function write_cookie(cookie_name,cookie_value){
	var cstr="";
	if (cookie_value==""){
		cookie_value="0";
	}

	cstr=cookie_name+"="+cookie_value+";path="+"/"+";expires=Fri,01-Jan-2010 00:00:01 GMT";
	document.cookie=cstr;
	return
}


function getcookieval(offset){
	var endstr=document.cookie.indexOf(";",offset);
	if (endstr==-1){
		endstr=document.cookie.length;
	}
	return unescape(document.cookie.substring(offset,endstr));
}


function getcookie(name){
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var I=0;
	while(I<clen){
		var j=I+alen;
		if (document.cookie.substring(I,j)==arg){
			return getcookieval(j);
		}
		I=document.cookie.indexOf("",I)+1;
		if (I==0) break;
	}
	return "";
}


function delete_cookie(name){
	if (getcookie(name)){
		document.cookie=name+"=0;path=/;expires=Thu,01-jan-70 00:00:01 GMT";
	}
}


function clear_status(){
	var status_str;
	status_str="";
	self.defaultStatus=status_str;
	return true;
}


 function delete_cookies(){
        delete_cookie("short_name");
        delete_cookie("loginOK");
        write_cookie("err_str","请您登录");
  }

function leave() {
   if(confirm("确实要离开吗？")){
        delete_cookies();
	//parent.iframe1.history.go(0);
  }
}

function changeBlue(){
  zz.style.color='#0000ff';
  setTimeout('changeRed()','500');
}

function changeRed(){
  zz.style.color='#FF0000';
  setTimeout('changeBlue()','500');
}

function userInfo(){
	loginOK = getcookie("loginOK");
	oper=getcookie("ident_code");
	short_name=getcookie("short_name");
	if (loginOK=="1"&&short_name!=""&&short_name!="0"){
		if (oper=="A0000661") {    
           ss =short_name+"，您好！";
        }
        else {            //other enterprises
		   ss =short_name+"您好，您目前是企业会员，无法进行订票操作。";
		}
    }    	
	else 
		ss= "您目前还没有登录，要使用该项服务，请您先<a href=/servlet/publiclogin>登录</a>。"
  document.write(ss);
}


function printNavi(){
	document.write("<table width='775' height='20' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr><td width=100%>&nbsp;</td> </tr></table>");
	document.write("<table width=100% border=0 cellspacing=0 cellpadding=0><tr>");
	document.write("<td width=5% height='59'>&nbsp;</td>");
	document.write("<td><a href='http://www.036.com.cn/'><img src='http://www.036.com.cn/images/idx_2.jpg' width='156' height='37' border=0></a></td>");
	document.write("<td valign=bottom>");
//	document.write("<img src='http://www.036.com.cn/images/idx_1.jpg' width='583' height='57'>");
//  抬头红条
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='583' height='57'><param name=movie value='/images/idx_1.swf'><param name=quality value=high><embed src='/images/idx_1.swf' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='583' height='57' ></embed></object>");

	document.write("</td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td height='39' colspan='3' align='right' valign='top' bgcolor='fefdd1'>");
	document.write("<table width='50' border='0' cellspacing='0' cellpadding='0'>");
	document.write("<tr>");
	document.write("<td><a href='http://www.036.com.cn/ticket/inforShow?function=CMemberIntro' class=listtitle><img src='http://www.036.com.cn/images/zz_06.jpg' width='76' height='30' border=0></a></td>");
    document.write("<td><a href='http://www.036.com.cn/ticket/mesgShow' class=listtitle><img src='http://www.036.com.cn/images/zz_09.jpg' width='78' height='30' border=0></a></td>");
//  090612订票业务暂停	document.write("<td><a href='http://www.036.com.cn/ticket/inforShow?function=TicketOnlineIntro' class=listtitle><img src='http://www.036.com.cn/images/zz_07.jpg' width='74' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/dpggao.htm' class=listtitle><img src='http://www.036.com.cn/images/zz_07.jpg' width='74' height='30' border=0></a></td>");
//	document.write("<td><a href='http://www.036.com.cn/servlets/countURL?url=http://plane.036.com.cn/plane/search.aspx' class=listtitle><img src='http://www.036.com.cn/images/zz_08.jpg' width='73' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/9588.htm' class=listtitle><img src='http://www.036.com.cn/images/zz_08.jpg' width='73' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/ticket/inforShow?function=ParcelIntro' class=listtitle><img src='http://www.036.com.cn/images/zz_10.jpg' width='73' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/ticket/inforShow?function=HelpIntro' class=listtitle><img src='http://www.036.com.cn/images/zz_16.jpg' width='75' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/ticket/Help_ListA?type=15' class=listtitle><img src='http://www.036.com.cn/images/zz_12.jpg' width='77' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/elonghotel.htm' class=listtitle><img src='http://www.036.com.cn/images/zz_14.jpg' width='73' height='30' border=0></a></td>");
	document.write("<td><a href='http://www.036.com.cn/ticket/inforShow?function=ContactUs' class=listtitle><img src='http://www.036.com.cn/images/zz_13.jpg' width='66' height='30' border=0></a></td>");
//	document.write("<td><img src='http://www.036.com.cn/images/zz_14.jpg' width='73' height='30'></td>");
	document.write("<td><a href='http://mail.036.com.cn/cgi-bin/mail?index=1' class=listtitle target='_blank'><img src='http://www.036.com.cn/images/zz_15.jpg' width='67' height='30' border=0></a></td>");
	document.write("</tr>");
	document.write("</table></td>");
	document.write("</tr>");
	document.write("</table>");


}


function printHead(){
	loginOK = getcookie("loginOK");
	oper=getcookie("ident_code");
	short_name=getcookie("short_name");

	if (loginOK=="1"&&short_name!=""&&short_name!="0"){
		if (oper=="A0000661") {    //个人会员，greeting without link
           linkage="您好"+short_name+"!";
        }
        else {            //other enterprises
		   linkage="您好<a href='/admin/Operator_NewMenu' target='_blank' class=linkage>"+short_name+"</a>";
		}
	   document.write("<table width=775 border=0 cellspacing=0 cellpadding=0 class=ticketinfohead><tr>");
	   document.write("<td width=100 height=48  class=textStyle>");
	   document.write("<span class=textStyle>"+linkage+"</span></td>");
	   document.write("<td width=80%></td>");
	   document.write("<td><a href=/servlet/publiclogin onClick='leave();' class=listtitle>离开</a></td>");
	   document.write("</tr></table>");

	}    	
	else {
		linkage="您好!";
	   document.write("<table width=775 border=0 cellspacing=0 cellpadding=0 class=ticketinfohead><tr>");
	   document.write("<td width=100 height=29  class=textStyle>");
	   document.write("<span class=textStyle>"+linkage+"</span>");
	   document.write("</td>");
	   document.write("<form name=logform action=/servlets/logintest method=post onSubmit=\"window.status='正在登录……' \">"); 
	   document.write("<td width=675  class=textStyle>　用户名：<input name=username type=text class=inputStyle size=10>");
	   document.write("密码：<input name=passwd type=password class=inputStyle size=10>附加码：<input name=crccode type=text class=inputStyle size=10>附加码：<img src='http://www.036.com.cn/servlets/CRCImage' align=absbottom height=18 width=40> (输入左框)");
	   document.write("&nbsp;&nbsp;&nbsp;&nbsp;<a href=# onClick=logform.submit() class=listtitle>登录</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=/member/CMember_newReg target=_blank class=listtitle>注册</a>");　
	   document.write("<input type=hidden name=source_URL value=/servlet/publiclogin></td></form></tr></table>");
	}

}


function printBottomLine(){
	document.write("<br><table width=775 height=24 border=0 cellpadding=0 cellspacing=0><tr>");
	document.write("<td><div align=right><span class=vertangle>6</span><span class=dotline>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span></div></td>");
	document.write("</tr></table>");
	document.write("<br>");

}




function printBottom(){
	document.write("<table width=775 border=0 cellspacing=0 cellpadding=0>  <tr>");
	document.write("<td width=174 height=66><div align=right><img src='http://www.036.com.cn/images/version4/luhui_grey.gif' width=43 height=46></div></td>");
	document.write("<td width=50></td>");
	document.write("<td><div align=left><span class=nblack12><a href='http://www.036.com.cn/ticket/inforShow?function=AboutUs' class=black12>公司简介</a>&nbsp;|&nbsp;<a href='http://www.036.com.cn/ticket/inforShow?function=ContactUs' class=black12>联系我们</a>&nbsp;|&nbsp;<a href='http://www.036.com.cn/ticket/inforShow?function=HelpIntro' class=black12>帮助中心</a>&nbsp;|&nbsp;&nbsp;建议使用分辨率1024*768<br>");
	document.write("版权所有 首铁在线 Copyright @ 2006 C.R.Online Inc. All rights reserved<br>");
	document.write("电信与信息服务业务经营许可证号：京ICP证010079号<br>");
	document.write("</span></div></td><td width=174><a href=http://www.hd315.gov.cn/beian/view.asp?bianhao=0102000091300011 target=_blank><img height=47 src='http://www.036.com.cn/images/home/gongshang.gif' width=44 border=0></a></td>");
	document.write("</tr></table>");
}

function disp_login_board(){
	greetings.innerHTML=str_login_board();
};


function  print_login_board(){
	var loginOK = getcookie("loginOK");
	var oper=getcookie("ident_code");
	var short_name=getcookie("short_name");
	
	if (loginOK=="1"&&short_name!=""&&short_name!="0"){
	if (oper=="A0000661") {    //个人会员，open personalservice
		linkage= "<a href=/member/CMember_newInfo class=listtitle target=_blank>我的会员资料</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" 
				+"<a href=/ticket/mesgShow4 class=listtitle target=_blank>全国车次查询</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
				//+"<a href=/ticket/inforShow?function=TicketOnlineIntro class=listtitle target=_blank>火&nbsp;车&nbsp;票&nbsp;预&nbsp;订</a><br>"
				+"<a href=/ticket/Sale_OrderQuery class=listtitle target=_blank>查看我的订单</a>";
   }
   else {            //other enterprises
		linkage="<a href='/admin/Operator_NewMenu' target='_blank' class=board_intro>进入管理系统</a>";
   }

   ss=""
		+"<table width=100% height=29 border=0 cellspacing=0 cellpadding=0 class=grayinfohead>"
        +"<tr><td align=left><span class=nblack14>&nbsp;&nbsp;&nbsp;您好&nbsp;&nbsp;&nbsp;&nbsp;"+short_name+"</span></td>"
        +"<td >"+linkage+"</td>"
        +"<td><a href='#' onClick='leave();disp_login_board();' class=listtitle>离开</a></td>"
        +"</tr></table>";
  }
  else
     ss= str_login_board();
  return ss;
};

function str_login_board(){
 var ss =""
 +"<table width=100% height=29 border=0 cellspacing=0 cellpadding=0 class=grayinfohead>"
+"  <tr>"
+"    <td class=ngray12>用户名：<input name=username type=text class=inputStyle size=10></td>"
+"    <td class=ngray12>密&nbsp;&nbsp;码&nbsp;&nbsp;：<input name=passwd type=password class=inputStyle size=10></td>"
+"    <td class=ngray12>附加码：<input name=crccode type=text class=inputStyle size=10></td>"
+"    <td class=ngray12>附加码：<img src=/servlets/CRCImage align=absbottom height=18 width=40></td>"
+"    <td class=ngray12><a href=# onClick=logform.submit() class=listtitle>登录</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=/member/CMember_newReg target=_blank class=listtitle>注册</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onClick='leave();disp_login_board();' class=listtitle>离开</a>"
+"        <input type=hidden name=source_URL value=/servlet/publiclogin></td>"
+"    <td class=ngray12><a href=/member/CMember_newFindUser target=_blank class=listtitle>找回用户名</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=/member/CMember_newFindpwd target=_blank class=listtitle>找回密码</a></td>"
+"  </tr>"
+"</table>"
	;
        return ss;
}


//广告效果
var ADM_DIV="ADAREA",ADM_LOADED=false,ADM_O1,ADM_O2,AD,ADM_Ver="1.0",ADM_S=new Array(),ADM_RESIZE=new Array(),ADM_F="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";var ADM_CE=document.all?1:(document.getElementById?0:-1);document.write("<div id='"+ADM_DIV+"'></div>");function InitSchedule(){ADM_S.sort(ADM_sort);for(iAI=0;iAI<ADM_S.length;iAI++)ADM_S[iAI].i=iAI;}function ADM_sort(a,b){return(a.p>b.p)?1:((a.p==b.p)?0:-1);}

function ADM_Start(o){if(eval("typeof("+o.t+"_main)")=="function") eval(o.t+"_main(o)");}

function DoSchedule(){var p=-1;for(dAI=0;dAI<ADM_S.length;dAI++){switch(ADM_S[dAI].s){case 0:if(p==-1)p=ADM_S[dAI].p;if(p==ADM_S[dAI].p){ADM_S[dAI].s=1;ADM_Start(ADM_S[dAI]);break;}case 1:setTimeout("DoSchedule()",300);return;default :}}}if(ADM_CE>-1){window.onload=function ADM_PUSH(){if(!ADM_LOADED){ADM_LOADED=true;InitSchedule();DoSchedule();}}
window.onresize=function(){for(oAI=0;oAI<ADM_RESIZE.length;oAI++)eval(ADM_RESIZE[oAI]);}}function WriteAd(id,s){var o0=document.getElementById(id);if(o0==null){o0=document.createElement("div");o0.id=id;if(ADM_CE==1)document.getElementById(ADM_DIV).insertAdjacentElement("beforeBegin",o0);else document.getElementById(ADM_DIV).insertBefore(o0,null);}o0.innerHTML=s;}

function AddSchedule(oo){if(oo!=null && oo instanceof ADM)ADM_S[ADM_S.length]=oo;}

function ADM(t,p){this.t=t;this.p=p;this.s=0;this.i=0;this.style="position:absolute;";}

function ADM_Check(o){return o.CookieHour && ADM_CheckCookie(o.t+o.p+location.host.substring(0,location.host.indexOf(".")),o);}

function ADM_CheckCookie(E,o){var Now=new Date();var s=String(Now.getYear())+String(Now.getMonth()+1)+String(Now.getDate());if(ADM_GetCookie(E)==s)return true;else{Now.setTime(Now.getTime()+(parseFloat(typeof(o.CookieHour)=="undefined"?24:parseFloat(o.CookieHour))*60*60*1000));ADM_SetCookie(E,s,Now);return false;}}

function ADM_GetCookie(n){var args=n+"=";var aLength=args.length,cLength=document.cookie.length,AAi=0;while(AAi<cLength){var AAj=AAi+aLength;if(document.cookie.substring(AAi, AAj)==args)return ADM_GetCookieVal(AAj);AAi=document.cookie.indexOf(" ", AAi)+1;if(AAi==0)break;}return null;}

function ADM_GetCookieVal(offset){var endstr=document.cookie.indexOf(";", offset);if(endstr==-1)endstr=document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}

function ADM_SetCookie(name, value){var argv=ADM_SetCookie.arguments;var argc=ADM_SetCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");}

function ADM_Media(a,w,h,o,id,href){var s="";if(a.indexOf(".swf")!=-1){if(ADM_CE==1){s="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='"+ADM_F +"' id='"+((id==null)?o.t:id)+"' width='"+w+"' height='"+h+"' ";if(o.style)s+=" style='"+o.style+"'";if(o.extfunc)s+=" "+o.extfunc+" ";s+=" ><param name='movie' value='"+a+"'>";if(o.play)s+="<param name='play' value='"+o.play+"'>";if(o.wmode&&o.wmode!="")s+="<param name='wmode' value='"+o.wmode+"'>";if(typeof(o.loop)!="undefined")s+="<param name='loop' value='"+o.loop+"'>";s+="<param name='quality' value='autohigh'></object>";}else{s="<embed ";if(o.style)s+=" style='"+o.style+"'";if(o.extfunc)s+=" "+o.extfunc+" ";s+=" src='"+a+"'"+" quality='autohigh' id='"+((id==null)?o.t:id)+"' name='"+((id==null)?o.t:id)+"' width='"+w+"' height='"+h+"' ";if(o.wmode&&o.wmode!="")s+=" wmode='"+o.wmode+"' ";if(typeof(o.loop)!="undefined")s+=" loop='"+o.loop+"' ";s+="type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed>";}}else if(a.indexOf(".gif")!=-1||a.indexOf(".jpg")!=-1){s="<a href='"+((href==null)?o.href:href)+"' target='_blank'><img ";if(o.style)s+=" style='"+o.style+"'";if(o.extfunc)s+=" "+o.extfunc+" ";s+=" id='"+((id==null)?o.t:id)+"' src='"+a+"' border='0' width='"+w+"' height='"+h+"'></a>";}return s;}

function ADM_Close(o,n){ADM_S[o].s=2;var OBJ=document.getElementById(n);if(OBJ)OBJ.style.display="none";}

function FULL_main(o){if(ADM_Check(o)){o.s=2;return;}var IS_Find=false;if(o.StartTime.length==o.EndTime.length && o.EndTime.length==o.src.length && o.src.length==o.href.length){for(FAi=0;FAi<o.src.length;FAi++){var ST=new Date(o.StartTime[FAi]);var ET=new Date(o.EndTime[FAi]);var NT=new Date();if((ST<=ET)&&(NT<ET)&&(NT>=ST)){var OBJ=document.getElementById("fullscreenad");if(OBJ!=null){self.scroll(0,0);OBJ.style.display="block";o.style="";OBJ.innerHTML=ADM_Media(o.src[FAi],875,255,o,"",o.href[FAi]);IS_Find=true;setTimeout("ADM_Close("+o.i+",'fullscreenad')",isNaN(parseInt(o.timeout))?5000:parseInt(o.timeout));return;}else{o.s=2;return;}}}if(!IS_Find)ADM_Close(o.i,"fullscreenad");}}



