function header(mid,sid){
	document.write('	<div id="header">');
	document.write('		<h1><a href="http://www.remai.cn/shop/">热迈商城</a></h1>');
	//document.write('		<div id="mascot">吉祥物</div>');
	document.write('		<ul id="mainnav"');
	if(mid==0){
		document.write(' class="nav0"');
	}else if(mid==1){
		document.write(' class="nav2"');
	}else if(mid==2){
		document.write(' class="nav1"');
	}else if(mid==3){
		document.write(' class="nav3"');
	}else if(mid==4){
	    document.write(' class="nav4"');
	}
	document.write('>');
	document.write('			<li class="nav0"><a href="index.jsp">热迈首页</a></li>');
	document.write('			<li class="nav1"><a href="index.do">旅游线路</a></li>');
	document.write('			<li class="nav2"><a href="tickets_index.jsp">旅游票务</a></li>');
	document.write('			<li class="nav4"><a href="javascript:;" onclick="showLogin();">预定机票</a></li>');
	if(mid==3){
		document.write('			<li class="nav3 current"><a href="member_order.htm">会员中心</a></li>');
	}
	document.write('		</ul>');
	document.write('		<p id="topnav"><a href="javascript:;" onclick="showLogin();">登录</a> | <strong><a href="reg.do">注册</a></strong> | <a href="http://www.remai.cn/shop/scheduled_line.jsp" target="_blank">旅游预约服务</a> | <a href="help.jsp">帮助</a></p>');

	if(mid==0){
		document.write('		<div id="nav"><p class="home">热迈公告：<marquee  scrollamount="1" scrolldelay="1" width="200"><a href="http://www.remai.cn/shop/voucher_about.jsp" target="_blank">注册热迈旅游网会员即可获得15元迈圈大礼包一个！</a></marquee></p></div>');
	}

	if(mid==1){
		document.write('		<div id="nav"><p class="ticket"><a href="shop_ticket_list.do?ticket_type_id=3"');
		if(sid==3){
			document.write(' class="current"');
		}
		document.write('>温泉票</a> | <a href="shop_ticket_list.do?ticket_type_id=4"');
		if(sid==4){
			document.write(' class="current"');
		}
		document.write('>度假村吃住玩套票</a> | <a href="shop_ticket_list.do?ticket_type_id=5"');
		if(sid==5){
			document.write(' class="current"');
		}
		document.write('>景区景点门票</a> | ');
		document.write('<a href="shop_ticket_list.do?ticket_type_id=1"');
		if(sid==1){
			document.write(' class="current"');
		}
		document.write('>娱乐套票</a> | ');
		document.write('<a href="shop_ticket_list.do?ticket_type_id=2"');
		if(sid==2){
			document.write(' class="current"');
		}
		document.write('>滑雪票</a> | ');
		document.write('<a href="http://228.com.cn/indexbj.jsp?YongleLianmeng_id=remai" target="_blank"');
		if(sid==6){
		}
		document.write('>演出票</a></p></div>');
	}

	if(mid==2){
		document.write('		<div id="nav"><p class="travel"><a href="travel.do?travel_remark=list"');
		if(sid==2){
			document.write(' class="current"');
		}
		document.write('>北京游</a> | <a href="travel.do?travel_remark=list2"');
		if(sid==1){
			document.write(' class="current"');
		}
		document.write('>北京周边游</a> | <a href="travel.do?travel_remark=list3"');
		if(sid==5){
			document.write(' class="current"');
		}
		document.write('>国内长线游</a> | <a href="travel.do?travel_remark=list4"');
		if(sid==4){
			document.write(' class="current"');
		}
		document.write('>港澳台游</a> | <a href="travel.do?travel_remark=list5"');
		if(sid==3){
			document.write(' class="current"');
		}
		document.write('>出境游</a></p></div>');
	}

	if(mid==3){
		document.write('		<div id="nav"><p class="member"><a href="memberOrder.do"');
		if(sid==1){
			document.write(' class="current"');
		}
		document.write('">我的订单</a> | <a href="regselect.do"');
		if(sid==2){
			document.write(' class="current"');
		}
		document.write('>注册信息管理</a> | <a href="member_mypwd.do"');
		if(sid==3){
			document.write(' class="current"');
		}
		document.write('>密码管理</a></p></div>');
	}
	
	if(mid==4){
	   document.write('		<div id="nav"><p class="air">');
	   document.write('预定机票</p></div>');
	}

	document.write('	</div>');
}
/*

function footer(basspath){
	document.write('	<div id="footer">');
	document.write('		<ul id="footnav"><li class="nav1"><a href="'+basspath+'help_about.jsp">关于我们</a></li><li><a href="#">合作加盟</a></li><li><a href="'+basspath+'help_recruit.jsp">工作机会</a></li><li><a href="help_contact.jsp">联系我们</a></li></ul>');
	document.write('		<p id="copyright"><a href="http://www.315online.com.cn/member/315080092.html" target="_blank"><img src="img/net.gif" class="logo315" alt="网上交易保障" /> </a><br /></p>');
	document.write('	</div>');
}
*/

function footer(){
	document.write('	<div id="footer">');
	document.write('		<ul id="footnav"><li class="nav1"><a href="http://www.remai.cn/shop/help_about.jsp">关于我们</a></li><li><a href="http://www.remai.cn/shop/medium_about.jsp">媒体报道</a></li><li><a href="http://www.remai.cn/shop/voucher_about.jsp">关于迈圈</a></li><li><a href="http://www.remai.cn/shop/surrogate_about.jsp">代理加盟</a></li><li><a href="http://www.remai.cn/shop/help_recruit.jsp">工作机会</a></li><li><a href="http://www.remai.cn/shop/help_contact.jsp">联系我们</a></li></ul>');
	document.write('		<p id="copyright">北京联盟之旅旅行社有限公司  许可证编号L-BJ-GN00809<br />法人代表：刘柱  <a href="http://www.miibeian.gov.cn/">京ICP备07030847号</a><br />业务经营范围：国内旅游业务；会议服务；网络技术服务<br />旅游主管部门投诉电话：54157490  咨询：<a href="mailto:zixun@china-uta.com">zixun@china-uta.com</a></p>');
	document.write('		<p><a href="http://www.bj.cyberpolice.cn/index.htm" target="_blank"><img src="http://www.remai.cn/shop/img/netpolice.jpg" alt="" /></a>&nbsp;&nbsp;<a href ="http://www.315online.com.cn/member/315080092.html" target="_blank"><img src="http://www.remai.cn/shop/img/net.gif" alt="" /></a></p>');
	document.write('	</div>');
}

function jumps(){
	document.write('<div id="j_cover" style="display:none;"></div>');
	document.write('<div id="j_viewcost" style="display:none;"><a class="close" href="javascript:;" title="关闭">关闭</a>');
	document.write('	<table cellspacing="1">');
	document.write('		<tr><th>成熟度</th><td><input type="text" name="mature_percent" readonly="true" id="mature" size="1"/></td></tr>');
	document.write('		<tr><th>价格优势</th><td><input type="text" name="price_percent" readonly="true" id="price" size="1"/></td></tr>');
	document.write('		<tr><th>有无购物</th><td><input type="text" name="shopping_percent" readonly="true" id="shopping" value="" size="1" /></td></tr>');
	document.write('		<tr><th>投诉率</th><td><input type="text" name="complaint_percent" readonly="true" id="complaint" size="1"/></td></tr>');
	document.write('	</table>');
	document.write('	<p><a href="help_comment.jsp">评价标准</a></p>');
	document.write('</div>');
	document.write('<div id="j_login" class="jump" style="display:none;width:400px;margin:-100px -200px;">');
	document.write('	<h3>用户登录</h3>');
	document.write('	<div class="main"><form name="LoginForm" method="post" onSubmit=""><a class="close" href="javascript:loginclose();" title="关闭">关闭</a>');

	document.write('		<table>');
	document.write('            <tr><td></td><td><label id ="showinfo" name="showinfo" style="color: #FF0000"></label></td></tr>');
	document.write('			<tr><th>手机或邮箱：</th><td class="element"><input type="text" class="input" name="servlet_login_name" id="servlet_login_name" maxlength="50" /></td><td></td>');
	document.write('			<tr><th>密　码：</th><td class="element"><input type="password" class="input" name="servlet_login_pwd" id="servlet_login_pwd" maxlength="20" /></td><td></td>');
	document.write('			<tr><th>验证码：</th><td class="element"><input type="text" class="input" style="width:40px;" name="servlet_code" id="servlet_code" maxlength="4" /> <img name="img1" id="img1" src="code.html" >&nbsp; <a href="javascript:reloadImage();">刷新</a></td><td></td>');
	document.write('		</table>');
	//document.write("		<p class=\"btns\"><input type=\"button\" name=\"loginbutton\" value=\"登 陆\"   onclick=\"checkLogin(document.getElementById('servlet_login_name').value,document.getElementById('servlet_login_pwd').value,document.getElementById('servlet_code').value);\" /> <input type=\"button\"   onclick=\"showLogin('buy')\" value=\"直接购买\" /></p>");
		document.write('		<p class="btns"><input type="button" class="btn1" value="登 录" /><input type="button" class="btn4" value="直接购买" /></p>');
	document.write('		<p class="links"><a href="reg.do">新用户注册</a>　|　<a href="forget.do">忘记密码</a></p>');
	document.write('	</form></div>');
	document.write('</div>');
	
	document.write('<div id="j_commend" class="jump"  style="display:none;width:400px;margin:-100px -200px;">');
	document.write('	<h3>推荐给朋友</h3>');
	document.write('	<div class="main"><form action="">');
	document.write('		<table>');
	document.write('			<tr><th>朋友的邮箱：</th><td class="element"><input type="text" class="input" /></td><td class="tips" id="jl_tip_uname"><p class="false">请输入手机或邮箱！</p></td>');
	document.write('			<tr><th>朋友的手机：</th><td class="element"><input type="text" class="input" /></td><td class="tips" id="jl_tip_uname"><p class="false">请输入手机或邮箱！</p></td>');
	document.write('		</table>');
	document.write('		<p class="btns"><input type="button" class="btn1" value="确 认" /><input type="button" class="btn2" value="取 消" /></p>');
	document.write('	</form></div>');
	document.write('</div>');
	document.write('<div id="calendar" class="calendar" style="display:none;">');
	document.write('	<table>');
	document.write('		<caption><a href="#">&lt;</a>　　2008年12月　　<a href="#">&gt;</a></caption>');
	document.write('		<tr>');
	document.write('				<th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th class="alert">六</th><th class="alert">日</th>');
	document.write('		</tr><tr>');
	document.write('			<td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td>');
	document.write('		</tr><tr>');
	document.write('			<td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td>');
	document.write('		</tr><tr>');
	document.write('			<td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td>');
	document.write('		</tr><tr>');
	document.write('			<td>22</td><td>23</td><td>24</td><td>25</td><td>26</td><td>27</td><td>28</td>');
	document.write('		</tr><tr>');
	document.write('			<td>29</td><td>30</td><td>31</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>');
	document.write('		</tr>');
	document.write('	</table>');
	document.write('</div>');
}

function getOffset(tgt,xy){
	var obj = tgt;
	xx=0;
	yy=0;
	while(obj.tagName != "BODY"){
		xx += obj.offsetLeft;
		yy += obj.offsetTop;
		obj = obj.offsetParent;
	}
	if(xy=="x"){
		return xx;
	}else if(xy=="y"){
		return yy;
	}
}
function viewCost(tgt,a,b,c,d){
    
   document.getElementById("complaint").value=d;
   document.getElementById("price").value=b;
   document.getElementById("shopping").value=a;
   document.getElementById("mature").value=c;
							
	_jv=document.getElementById("j_viewcost");
	_jv.style.display="";
	_jv.style.top=getOffset(tgt,"y")-8+"px";
	_jv.style.left=getOffset(tgt,"x")+77+"px";
	_jv.getElementsByTagName("a")[0].onclick=function(){
		_jv.style.display="none";
	}
}

function getTagClass(tgt,tname,cls){
	var tags=[];
	var get_tags=tgt.getElementsByTagName(tname);
	for(var i=0;i<get_tags.length;i++){
		if(get_tags[i].className==cls){
			tags.push(get_tags[i]);
		}
	}
	return tags;
}

function showLogin(id,path){
	_jl=document.getElementById("j_login");
	_jc=document.getElementById("j_cover");
	_jl.style.display="";
	_jc.style.display="";
	hideSelect();
	
	getTagClass(_jl,"a","close")[0].onclick=function(){
		_jl.style.display="none";
		_jc.style.display="none";
	}
	if(id=="buy"){ // 购买  显示协议 页面 点击 我同意 出来的登陆效果
	     //登陆 按钮
		getTagClass(_jl,"input","btn1")[0].onclick=function(){ 
		     checkLogin(document.getElementById('servlet_login_name').value,document.getElementById('servlet_login_pwd').value,document.getElementById('servlet_code').value);
			//location.href="buy_step1.htm";
		}
		//直接购买 按钮
		getTagClass(_jl,"input","btn4")[0].onclick=function(){
			location.href=path;
		}
	}else{ //其他页面 点击登陆显示得登陆效果
         //登陆 按钮
		getTagClass(_jl,"input","btn1")[0].onclick=function(){
		    checkLogin(document.getElementById('servlet_login_name').value,document.getElementById('servlet_login_pwd').value,document.getElementById('servlet_code').value);
		//	location.href="member_order.htm";
		}
		//隐藏 直接购买 的 按钮
		getTagClass(_jl,"input","btn4")[0].style.display="none";
	}
}
function showLoginError(){
    _jl=document.getElementById("j_login_error");
	_jc=document.getElementById("j_cover");
	_jl.style.display="";
	_jc.style.display="";
	getTagClass(_jl,"a","close")[0].onclick=function(){
		_jl.style.display="none";
		_jc.style.display="none";
	}

}

function showCodeError(){
    _jl=document.getElementById("j_code_error");
	_jc=document.getElementById("j_cover");
	_jl.style.display="";
	_jc.style.display="";
	getTagClass(_jl,"a","close")[0].onclick=function(){
		_jl.style.display="none";
		_jc.style.display="none";
	}

}
function commendFriend(){
	_jd=document.getElementById("j_commend");
	_jc=document.getElementById("j_cover");
	_jd.style.display="";
	_jc.style.display="";
	getTagClass(_jd,"input","btn1")[0].onclick=function(){
		_jd.style.display="none";
		_jc.style.display="none";
	}
	getTagClass(_jd,"input","btn2")[0].onclick=function(){
		_jd.style.display="none";
		_jc.style.display="none";
	}
}

function loginclose(){

_jd=document.getElementById("j_commend");
	_jc=document.getElementById("j_cover");
	_jd.style.display="none";
		_jc.style.display="none";
		showSelect();
}
function showCalendar(tgt){
	var cld=document.getElementById("calendar");
	cld.style.display="";
	cld.style.left=getOffset(tgt,"x")+"px";
	cld.style.top=getOffset(tgt,"y")-6+"px";
	cld.onclick=function(){
		cld.style.display="none";
	}
}
function getRightMessage(width){
	document.write('<div class="frame"><iframe frameborder="0" src="http://www.remai.cn/shop/html/travelnews/message.html" width="'+width+'" height="210" scrolling="no"></iframe></div>');
	document.write('		<br/>');
}
function getIndexMessage(index,width){
	if(Number(index) ==1){
	document.write('<div class="frame"><iframe frameborder="0" src="http://www.remai.cn/shop/html/travelnews/message.html" width="'+width+'" height="210" scrolling="no"></iframe></div><br/>');
	}else if(Number(index) ==2){ 
	document.write('<div class="frame"><iframe frameborder="0" src="http://www.remai.cn/shop/html/team_commend/message.html" width="'+width+'" height="210" scrolling="no"></iframe></div><br/>');
	}else if(Number(index) ==3){
	document.write('<div class="frame"><iframe frameborder="0" src="http://www.remai.cn/shop/html/free_travel/message.html" width="'+width+'" height="210" scrolling="no"></iframe></div><br/>');
	}else if(Number(index) ==4){
	document.write('<div class="frame"><iframe frameborder="0" src="http://www.remai.cn/shop/html/china_travel/message.html" width="'+width+'" height="210" scrolling="no"></iframe></div><br/>');
	}
}
function reloadImage() 
{ 
 url="code.html?r="+Math.random();
document.getElementById('img1').src=url;
} 

function orderby(path){
   var number=document.getElementById("number").value;
   var pagenumber=document.getElementById("pageNumber").value;
   
   if((number==0)||(number%2==0)){
      number=parseInt(number)+parseInt(1);
      location.href=path+"?orderby=asc&pageNumber="+pagenumber+"&number="+number;
      return true;
   }
   
   if(number%2!=0){
      number=parseInt(number)+parseInt(1);
      location.href=path+"?orderby=desc&pageNumber="+pagenumber+"&number="+number;
      return true;
   }

}

function showHideProdInfo(){
	var p_info=document.getElementById("prodInfo");
	var e_info=document.getElementById("emptyInfo");
	var i_info=document.getElementById("icoInfo");
	if(p_info.style.display==""){
		p_info.style.display="none";
		e_info.style.display="";
		i_info.setAttribute("src","img/ico_+.gif");
	}else{
		p_info.style.display="";
		e_info.style.display="none";
		i_info.setAttribute("src","img/ico_-.gif");
	}
}

function index_orderby(i){
   return "showtab_101.js";
}

function checkDel(){
   if (!confirm("确定删除吗?")) return false;
}
function chooseType(type,path)
{
	if(Number(type)==2){
		document.getElementById("purl").value=path+"shop_ticket_list_index_search.do";
		document.getElementById("point").value=2;
	}else if(Number(type)==1)
	{
		document.getElementById("purl").value=path+"searchView.do";
		document.getElementById("point").value=1;
	}
}
function seacherIndex()
{	
		subfm=document.indexfm;
		if(document.getElementById("point").value==2)
		{
			subfm.action=document.getElementById("purl").value+"?ticket_name="+document.getElementById("key").value;
			subfm.method="get";
		}else{	
			subfm.target="_blank";
			subfm.action=document.getElementById("purl").value;
		}
		
}
function initkey()
{
if(document.getElementById("key").value=="请输入目的地"){
				document.getElementById("key").value="";
}
	if(document.getElementById("point").value==2){
		document.getElementById("ticket_name").value=document.getElementById("key").value;
	}else{document.getElementById("mainAddress").value=document.getElementById("key").value;
	}	
}

function flash(){
	if(document.getElementById('m_mainad')){
		ad_id=Math.floor(Math.random()*10);
		adNav();
		adMain();
		adIntervals=new Array();
		adChange();
		goAD();
	}
}
function adNav(){
	var adnavs=document.getElementById("m_mainad").getElementsByTagName("li");
	for(var i=0;i<adnavs.length;i++){
		adnavs[i].i=i;
		adnavs[i].onclick=function(){
			clearAD();
			document.getElementById("m_mainad").className="ad"+this.i;
			ad_id=this.i+1;
			if(ad_id==adnavs.length) ad_id=0;
			goAD();
		}
	}
}
function adMain(){
	var addivs=document.getElementById("m_mainad").getElementsByTagName("div");
	for(var i=0;i<addivs.length;i++){
		addivs[i].i=i;
		addivs[i].onmouseover=function(){
			clearAD();
		}
		addivs[i].onmouseout=function(){
			goAD();
		}
	}
}
function clearAD(){
	for (var j in adIntervals){
		clearInterval(adIntervals[j]);
		adIntervals.pop();
	}
}
function goAD(){
	change_ad=setInterval(adChange,3000);
	adIntervals.push(change_ad);
}
function adChange(){
	var adnavs=document.getElementById("m_mainad").getElementsByTagName("li");
	document.getElementById("m_mainad").className="ad"+ad_id;
	ad_id++;
	if(ad_id==adnavs.length) ad_id=0;
}
//宽屏应用背景
function doPageBg(){
	if(!document.getElementById("pagebg")) return false;
	document.getElementById("pagebg").style.backgroundImage="url(http://www.remai.cn/shop/img/bg.jpg)";
}

//自动加载
function bodyonload(){
	if(document.getElementById('m_mainad')){
		ad_id=Math.floor(Math.random()*10);
		adNav();
		adMain();
		adIntervals=new Array();
		adChange();
		goAD();
	}
	
	if(document.body.clientWidth>1200){
		doPageBg();
	}
}
function aboutmessage(a){
                    document.write('<h3>热迈商城</h3>');
					document.write('<ul');
					document.write('<li></li>');
						document.write('<li><a href="'+a+'help_about.jsp">关于我们</a></li>');
						document.write('<li><a href="'+a+'medium_about.jsp">媒体报道</a></li>');
						document.write('<li><a href="'+a+'voucher_about.jsp">关于迈圈</a></li>');
						document.write('<li><a href="'+a+'surrogate_about.jsp">代理加盟</a></li>');
						document.write('<li><a href="'+a+'help_recruit.jsp">工作机会</a></li>');
						document.write('<li><a href="'+a+'help_contact.jsp">联系我们</a></li>');
					document.write('</ul>');

}
