﻿<!--
/* Javascript Document 
 .....................................................................................
 .. www.jingqu.cn V 3.1 Public Javascript						    	  		    ..
 ..	说明：忽略所有javascript 错误                                                   ..
 ..	设计：xyb www.ectrip.com Design Time: 2007.01.23 Edit Time: 2007.05.08          ..
......................................................................................*/
//隐藏错误
var mainTitle="畅游网";
var errTitle="畅游网温馨提示您：";

var errImgErr="<img src=\'/images/li_err.gif\' id='\li_err\' align=\'absmiddle\'  height=\'16\'/>";
var errImgOk="<img src=\'/images/li_ok.gif\' id='\li_ok\' align=\'absmiddle\' height=\'16\'/>";

/*function killErrors() {
  return true; 
}
window.onerror = killErrors;*/

//浏览器
var localUrl = function(mode) {
    var mode = mode || 'href';
	var l=window.location;
	var lPath=(l.pathname+l.search).toString();
	lPath=lPath.indexOf("/user/")!=-1?"/":lPath;
	switch(mode) {
	case 'href':
	case 'host':
	case 'hash':
		return eval("window.location."+mode);
		break;
	case 'root':
		return l.protocol+"//"+l.host+":"+l.port;
		break;
	case 'path':
		return {"uncode":encodeURI(lPath),"code":encodeURIComponent(lPath)};
		break;
	}
}

function setHomepage(){
if (document.all){
	document.body.style.behavior='url(#default#homepage)';
	document.body.setHomePage('http://www.jingqu.cn');
 
}else if (window.sidebar){
	if(window.netscape){
		try{
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    		prefs.setCharPref('browser.startup.homepage','http://www.jingqu.cn');
		}catch (e){
			alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );
		}
    }
    
}
} 

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openNew(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function getDiv(divid){
	return document.getElementById(divid); 
}

function randomNumber(limit){
  return Math.floor(Math.random()*limit+1);
}

function bookmark(url,title){ 
var title=title||document.title;
var url=url||document.location.href;

if(url=="http://www.jingqu.cn")
title="畅游网－旅游目的地资源网络营销平台";

if (window.sidebar) window.sidebar.addPanel(title, url,""); 
else if( window.opera && window.print ){ 
var mbm = document.createElement('a'); 
mbm.setAttribute('rel','sidebar'); 
mbm.setAttribute('href',url); 
mbm.setAttribute('title',title); 
mbm.click();} 
else if( document.all ) window.external.AddFavorite( url, title); 
}

function writeCookie(name, value, hours){
  var expire = "";
  if(hours != null){
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
function readCookie(name){
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0){ 
    offset = document.cookie.indexOf(search);
    if (offset != -1){ 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

//显示 隐含 

function openwin(url,wid,hei,reloadA)
{
  var str;
  if(url==null)
     {
      alert('您的URL不能为空!');
      return;
     }
  
  if(wid==null || wid=='')
     wid=450;
  if(hei==null || hei=='')
     hei=360;
 
  str=window.showModalDialog('/system/openwin.html',url,'dialogWidth:'+wid+'px;dialogHeight:'+hei+'px;status:no;scrollbars=no;help:0;center:1');
  if(reloadA==true&&str!="login"&&str!="no"&&eval("typeof("+str+")")!='undefined'){
	 location.reload();
  }
  if(str=="login")
     top.window.location.replace("/user/UserLogin.jsp?url="+localUrl('path').code);
  return str;           
}

function openwin1(url,wid,hei,reloadA)
{
  var str;
 // alert(url);
  if(url==null)
     {
      alert("您的URL不能为空!");
 
      return;
     }
  
  if(wid==null||wid=='')
     wid=470;
  if(hei==null||hei=='')
     hei=360;
 
  str=window.showModalDialog(url,window,'dialogWidth:'+wid+'px;dialogHeight:'+hei+'px;status:no;scrollbars=no;scroll=no;help:0;center:1');
  
  if(reloadA==true)
     window.location.reload();   

  return str;           
}
//刷新 showModalDialog 
function F5_reload(){
var url=self.location.toString();
if (event.keyCode==116)	
window.self.location=url;
}

//刷新 showModalDialog 
function F5_reload_01(){
//var url=self.location;
//alert("刷新窗口！");
//window.location=url; 
if (event.keyCode==116)
reload();
}

function bbimg(o){
 var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
 return false;
}
//轮滚变化大小 调用方法： <IMG   src="#"onmousewheel='return bbimg(this)'>

//图片自动缩小的js代码,用以防止图片撑破页面 调用方法： <img src="图片" border=0 width="180" height="110" onload="javascript:DrawImage(this);">width="180" height="110"  注意这里最好限定,如果不限定加载图时会成原大,然后再缩小,这个过程如果图大了很难看的.这里是宽度和高度,在前面的JS里改,这里也作相应的改.
var flag=false; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
   if(image.width>420){
    ImgD.width=420; 
    ImgD.height=420*((image.height)/image.width); 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
}
}


//字体变化
function fontZoom(divid,size)
{
 //document.getElementById(divid).style.font-size=size+'px';
 //document.getElementById(divid).style.fontSize=size+'px';
 document.getElementById(divid).className="s_"+size;
 //alert(document.getElementById(divid).className);
 //alert( document.getElementById(divid).getElementsByTagName("div").length);
}

//Dreamweaver 显示 隐含 层

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//隐含 select start 肖一兵 添加 
function showDiv(sDivID, bState) {
	var oDiv = document.getElementById(sDivID);
	/*@cc_on
	@if (@_jscript_version >= 5) 
    try {
		var oIframe = document.getElementById('HelpFrame');
		oIframe.scrolling = 'no';
		oIframe.frameborder = 0;
		oIframe.style.top = 0;
        oIframe.style.left = 0;
		oIframe.style.left.width=180;
	}
	catch (e) {
		var oIframe = document.createElement('iframe');
		var oParent = oDiv.parentNode;
		oIframe.id = 'HelpFrame';
		oParent.appendChild(oIframe);
		oIframe.scrolling = 'no';
		oIframe.frameborder = 0;
		oIframe.style.top = 0;
        oIframe.style.left = 0;
		oIframe.style.left.width=170;
	}
    oIframe.frameborder = 0;
    oIframe.style.position = 'absolute';
	oIframe.scrolling = 'no';
    oIframe.style.top = 0;
    oIframe.style.left = 0;
    oIframe.style.display = 'none';
	oIframe.style.left.width=170;
	@end @*/
    if (bState) {
        oDiv.style.display = 'block';
        /*@cc_on
        @if (@_jscript_version >= 5)
        oIframe.style.top = oDiv.style.top;
        oIframe.style.left = oDiv.style.left;
        oIframe.style.zIndex = oDiv.style.zIndex - 1;
        oIframe.style.width = parseInt(oDiv.offsetWidth);
        oIframe.style.height = parseInt(oDiv.offsetHeight);
        oIframe.style.display = 'block';
        @end @*/
    }
    else {
        /*@cc_on
        @if (@_jscript_version >= 5)
        oIframe.style.display = 'none';
        @end @*/
        oDiv.style.display = 'none';
    }
}
//隐含 select end 肖一兵 添加 


//

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

//预加载图片
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//Delete Domain
function DeleteDomain(str){
	str=str.toString();
	if (str.split("http://").length>1){
		str=str.split("http://")[1];
		str=str.split(str.split("/")[0])[1];
	}else{
		str="/";
	}
return str;
}

//User Start

function DeleteSpaces(str)   
{
	var count = 0;
	for (var i = 0; i < str.length; i++) 
	{	
		if (str.charAt(i) == " ") 
		{		
			count++;
		}
		else
		{	
			break;
		}
	}
	str = str.substring(count, str.length);
	count = 0;	
	for (var i = str.length; i >=0; i--) 
	{	
		if (str.charAt(i - 1) == " ") 
		{		
			count++;
		}
		else
		{	
			break;
		}
	}	
	str = str.substring(0, str.length - count);
	return str;
}

function checkClass(name,divName,MsgClass,MsgImg,Msg){
	//alert(MsgImg);
	if (name!=""){
		if (MsgClass=="MsgErr"){
		jQuery("#"+name)[0].focus();
		jQuery("#"+name)[0].select();
		}
	}
	if (divName!=""){
		jQuery("#"+divName).addClass(MsgClass);
		jQuery("#"+divName).html(MsgImg+Msg);
	}
	if (MsgClass=="MsgOk"){
		return true;		
	}else{
		return false;	
	}
}


function createRequest(){
        if(typeof XMLHttpRequest!="undefined")        {
                return new XMLHttpRequest();
        }else if(typeof ActiveXObject!="undefined"){
                var xmlHttp_ver  = false;
                var xmlHttp_vers = ["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp","Microsoft.XmlHttp"];
                if(!xmlHttp_ver){
                        for(var i=0;i<xmlHttp_vers.length;i++){
                                try{
                                        new ActiveXObject(xmlHttp_vers[i]);
                                        xmlHttp_ver = xmlHttp_vers[i];
                                        break;
                                }catch(oError){;}
                        }
                }
                if(xmlHttp_ver){
                        return new ActiveXObject(xmlHttp_ver);
                }else{
                        throw new Error("Could not create XML HTTP Request.");
                }
        }else{
                throw new Error("Your browser doesn't support an XML HTTP Request.");
        }
}

/*function execScript(){
	if(XmlHttp.readyState == 4) {
		if(XmlHttp.status == 200) {
			eval(XmlHttp.responsetext); 			
		}
	}
}*/

function isValidUsid(s)
{
		noUsid=new Array("admin","blog","travel","trip","ectrip","hotel","ticket","cms","bbs","help","price","line","custom","manage","system","root","daoyou","user","article","ask","order","ciceroni","air","train","bus","home");
		for (i=0; i<noUsid.length;i=i+1){
		if (s==noUsid[i])
			return false;			
			}
		return true;
} 



function closewindow() {
   window.close();
	}
function gotoT(LocationUrl) {
   window.location=LocationUrl; 
	}
	
function gotoP(LocationUrl,type) {
   if(typeof type=="undefined")
   top.window.location.replace(LocationUrl);
   else
   self.window.location.replace(LocationUrl);
}
function gotoN(LocationUrl) {
  MM_openBrWindow(LocationUrl,'windows_'+randomNumber(10000),'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'); 
	}
function goback(){
   window.history.back(); 
 }
	



//新窗口方式
function externalLinks()
{
	var objAnchors = document.getElementsByTagName('a');
	var objImages;
	for (var iCounter=0; iCounter<objAnchors.length; iCounter++)
	{
		//objImages = objAnchors[iCounter].getElementsByTagName('img');objImages.length == 0
		anchor = objAnchors[iCounter]; 
		if (objAnchors[iCounter].href.indexOf('http://www.jingqu.cn/') == -1 && objAnchors[iCounter].href.indexOf('http://jingqu.cn/') == -1 && objAnchors[iCounter].href.indexOf('javascript:;') == -1 && objAnchors[iCounter].href.indexOf('#') == -1 && objAnchors[iCounter].href.indexOf('http://my.opera.com/forestgan/') == -1&&anchor.getAttribute("rel") == "external")
		anchor.target = "_blank"; 
	}
}

//form 快捷键提交
function formClearTitle(id){
for (i=0; i<id.split(",").length;i++)
if (getDiv(id.split(",")[i]))
getDiv(id.split(",")[i]).setAttribute("title","");
}

function formShortscut()
{	
	var objForm =document.forms;
	var objId;
	var tMsg="温馨提示：可以使用快捷键“Alt+T”快速提交";
	if(typeof(objForm[0])!='undefined'){
	for (var i=0; i<objForm[0].elements.length; i++){
	if (objForm[0].elements[i].getAttribute("type")!="hidden"&&(objForm[0].elements[i].nodeName=="INPUT"||objForm[0].elements[i].nodeName=="TEXTAREA")){
	try{
	objForm[0].elements[i].focus();//默认第一个表单元素
	break;
	}catch(e){}
	
	}else{
	continue;
	}
	}
	if (objForm){	
		if (objForm.length==1){
			if (objForm[0].id) {
			getDiv(objForm[0].id).setAttribute("title",tMsg);
			setTimeout(function(){getDiv(objForm[0].id).setAttribute("title","");},5000);//1分钟后清空
			}else{
			objForm[0].setAttribute("id","ectripForm_"+randomNumber(100000));
			getDiv(objForm[0].id).setAttribute("title",tMsg);
			setTimeout(function(){getDiv(objForm[0].id).setAttribute("title","");},5000);//1分钟后清空
			}
		}else{
			var iCounterId="";
			for (var iCounter=0; iCounter<objForm.length; iCounter++)
			{			
			if (getDiv(objForm[iCounter].id)!=null) {
			getDiv(objForm[iCounter].id).setAttribute("title",tMsg);			
			iCounterId+=objForm[iCounter].id+",";
			}else{
			objForm[iCounter].setAttribute("id","ectripForm_"+randomNumber(100000));
			getDiv(objForm[iCounter].id).setAttribute("title",tMsg);
			iCounterId+=objForm[iCounter].id+",";
			}
			setTimeout(function(){formClearTitle(iCounterId)},5000);//1分钟后清空
			}
		}
	}
}
}
//禁止右键
/*if (window.Event) 
  document.captureEvents(Event.MOUSEUP); 
function nocontextmenu() 
{
 event.cancelBubble = true
 event.returnValue = false;
 return false;
}*/

function disableRightClick(e)
{
  var message = "Right click disabled";
  //hideErrId();//隐藏ErrId
 // externalLinks();//链接新窗口
/*  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    return true;
  } */
//document.oncontextmenu = nocontextmenu;  // for IE5+
//document.onmousedown =nocontextmenu ; // for all others
}

//是否允许复制成功**
function StartOk(){
//document.onselectstart=new Function("event.returnValue=false");
document.onselectstart=new Function("event.returnValue=true");
}

//添加提交信息
function _subSub(id,info,classType,jQNo){

if(typeof jQNo != "undefined")
if (jQNo ==1)


if (jQuery("#main_errors")&&id!="#main_errors")
jQuery("#main_errors").hide();
//if (id!="main_errors"){
if(typeof classType == "undefined")
jQuery(id).addClass("submitInfo");

if(typeof classType != "undefined")//不添加样式
if(classType != 0)//不添加样式
jQuery(id).addClass(classType);


jQuery(id).show();
//jQuery(id).css("color","#669900");
//}

if(typeof info == "undefined")
info="数据提交中";
else if(info==""||info==null)
info="数据提交中";
else if(info=="loading")
info="加载中";

jQuery(id).html("<img src=\"/images/loading.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" />&nbsp;&nbsp;"+info+"......");


setTimeout(function(){
	if (jQuery(id).html().indexOf("数据提交中")!=-1||jQuery(id).html().indexOf(info)!=-1){
	jQuery(id).html("<img src=\"/images/li_err.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" />&nbsp;&nbsp;<span class=\"red\">非常抱歉，服务器连接超时，请重新刷新页面！<a href=\"#\" onclick=\"gotoP(window.location.toString(),1);return false;\">[立即刷新]</a>");	
	jQuery("form").submit(function(){return false;});
	return false;
	}
},30000);

}

function _loadSub(id){
if (jQuery("#main_errors")&&id!="#main_errors")
jQuery("#main_errors").hide();
jQuery(id).addClass("submitInfo");
jQuery(id).show();
jQuery(id).html("<img src=\"/images/loading.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" />&nbsp;&nbsp;数据加载中......");	

setTimeout(function(){
	if (jQuery(id).html().indexOf("数据加载中")!=-1){
	jQuery(id).html("<img src=\"/images/li_err.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" />&nbsp;&nbsp;<span class=\"red\">非常抱歉，服务器连接超时，请重新刷新页面！<a href=\"#\" onclick=\"gotoP(window.location.toString(),1);return false;\">[立即刷新]</a>");	
	jQuery("form").submit(function(){return false;});
	return false;
	}
},30000);

}


//添加错误信息
function addErr(info,ErrId){
var str="";
var ErrIdD="main_errors";

if (info.indexOf(",")!=-1){
for (var i=0; i<info.split(",").length; i++)
if(info.split(",")[i]!="")
str+="<li>"+info.split(",")[i]+"</li>";
}else{
str="<li>"+info+"</li>";
}

if(typeof ErrId!= "undefined"){
ErrIdD=ErrId;
}

if (getDiv(ErrIdD)&&str!=""){

	if(typeof $!= "undefined"){
		jQuery("#"+ErrIdD).html("<div class=\"main_errors_title\">"+errTitle+"</div><ul>"+str+"</ul>");	
		if (getDiv(ErrIdD).style.display!="block"){
			jQuery("#"+ErrIdD).slideDown("fast");
		}else{
			getDiv(ErrIdD).style.display="block";
		}
	}else{
		getDiv(ErrIdD).innerHTML="<div class=\"main_errors_title\">"+errTitle+"</div><ul>"+str+"</ul>";
		getDiv(ErrIdD).style.display="block";
	}
}

}

//错误信息判断
function hideErrId() {
	var main_errors=jQuery("#main_errors");
	if( main_errors.length==0||main_errors.length>1)
	main_errors=jQuery("div[@className^='main_errors']");
	
	if (main_errors.length>0){
			
		for (i=0; i<main_errors.length; i++){
			if (main_errors.eq(i).find("li").length==0){
				main_errors.eq(i).hide();//MM_showHideLayers(strtype,'','hide');//hide("main_errors");
			}else{
				main_errors.eq(i).slideDown("fast");
				main_errors.eq(i).html(main_errors.eq(i).html().replace("系统提示:",errTitle));
			}
		}
	}
	
}



//分页判断
function hidePageId() 
{
	var publicPage=jQuery("#publicPage");
	publicPage.length==0?publicPage=jQuery(".publicPage"):publicPage=publicPage;
	publicPage.each(function(i){
		var thisEq=publicPage.eq(i);
		if(thisEq.find("a").length>0)
		thisEq.show();
	});
}

//论坛搜索检验
function  bbs_search(){
with(document.SearchForm){
	if (searchvalue.value==""||searchvalue.value.length==0){
		alert("请输入关键字！");
		searchvalue.focus();
		return false;
	}
  }
}

//获取当前时间yyyy-mm-dd
function nowDate() 
{ 
if(dateRange==undefined){
	dateRange={sid:'order_start_date',eid:'order_end_date',sDay:0,eDay:null,rangeDay:30,sHour:24}
}
var today = new Date(); 
var day = today.getDate(); 
var month = today.getMonth() + 1; 
var year = today.getYear();
var nowHour=today.getHours();
var sHour=dateRange.sHour||24;

if(year<1000)
year=year+1900;


if(nowHour>=sHour)day=day+1;


month=(month+"").length == 1 ?"0"+month :month;
day=(day+"").length == 1 ? "0"+day :day;	
var date = year + "-" + month + "-" + day; 
return date;
}

//获取地址栏参数 值
function getParmValue(name){
 var str=window.location.search;
 if (str.indexOf(name)!=-1){
  var pos_start=str.indexOf(name)+name.length+1;
 var pos_end=str.indexOf("&",pos_start);
 if (pos_end==-1){
	 return str.substring(pos_start);
	 }
	 else{
	  return str.substring(pos_start,pos_end)
	  }
	}
	else{
 	return "";
	 }
}


function getdate(XDate,dayNum){
/*
使用：For ectrip
作者：ectrip xyb
时间：2008-04-18 16:09
功能：日期加减后的日期
XDATE:原始日期;
dayNum 加减天数

*/

var todaydate=new Date();
var XDate=XDate|| todaydate;
var CST=0;



if(XDate.indexOf("CST")!=-1){
	todaydate=Date.parse(XDate);
	CST=1;
}else{
	if(XDate.indexOf("-")!=-1){
	
	var dayArr=XDate.split("-");	
	todaydate.setUTCFullYear(parseInt(dayArr[0]));
	todaydate.setUTCMonth(parseFloat(dayArr[1])-1);
	todaydate.setUTCDate(parseFloat(dayArr[2]));
	}
}


todaydate = new Date(todaydate.toUTCString());


if(CST==1)
todaydate.setUTCHours(todaydate.getUTCHours()-14);

todaydate.setUTCDate(todaydate.getUTCDate()+dayNum);

var year,month,day,toyear;
toyear=todaydate.getUTCFullYear();

if(toyear<1000)
toyear=toyear+1900;

year=toyear.toString();

month=(todaydate.getUTCMonth()+1).toString();
month.length == 1 ? month = "0"+month : month = month;
day=todaydate.getUTCDate().toString();
day.length == 1 ? day = "0"+day : day = day;					
todaydate=year+"-"+month+"-"+day;

return todaydate;
}

function getdate1(dayNum,lastTime){
/*
使用：For ectrip
作者：ectrip xyb
时间：2007-04-02 16:09
功能：预订日期
dayNum 今天之后的天数相隔
lastTime 每天最迟时间(小时),如果当前时间大于lastTime,则天数加1
*/
var date=new Date();
var year,month,day,hour;

lastTime=parseInt(lastTime);
if (date.getHours()>=lastTime)
date.setDate(date.getDate()+1);

dayNum=parseInt(dayNum);
if (dayNum==0||dayNum==null)
dayNum=0;
date.setDate(date.getDate()+dayNum);

year=date.getFullYear().toString();
month=(date.getMonth()+1).toString();
month.length == 1 ? month = "0"+month : month = month;
day=date.getDate().toString();
day.length == 1 ? day = "0"+day : day = day;					
date=year+"-"+month+"-"+day;
return date;
}


//电话号码和email调用：
//var telinfo="服务热线：||tel||1||1&24小时值班电话：<br/>||24tel||0||0";
//参数说明:名称||类别||是否加粗(1为加粗)||颜色选择(1为red，2为yellow，0为默认颜色)
function  tel_all(telinfo){
subtel= new Array("0755-26470660<span style='font-weight:normal'></span>","0755-26470691","0755-26470692","0755-26470692","0755-26470692","","001","002","ectrip01@hotamil.com","ectrip02@hotmail.com","ectrip03@hotmail.com","chinaEctrip@163.com");
subtype= new Array("tel","ordertel","hottel","24tel","fax","mobi","QQ1","QQ2","MSN1","MSN2","MSN3","email");

//电话,24小时值班电话,预订热线,服务热线传真,应急电话,QQ1,QQ2,msn1,msn2,msn3,email
//Type: tel,ordertel,hottel,24tel,fax,mobi,QQ1,QQ2,msn1,msn2,msn3,email
var tel_content;
tel_content="";


for (var q=0; q<=telinfo.split("&").length-1; q++){
	for (var i=0; i<=subtype.length-1; i++){
		
		if (telinfo.split("&")[q].split("||")[1]==subtype[i]){
			if (telinfo.split("&")[q].split("||")[2]=="1"){
				if (telinfo.split("&")[q].split("||")[3]=="1"){
					tel_content+=telinfo.split("&")[q].split("||")[0]+"<span class='red'><strong>"+subtel[i]+"</strong></span>";	
				}else if(telinfo.split("&")[q].split("||")[3]=="2"){
					tel_content+=telinfo.split("&")[q].split("||")[0]+"<span class='yellow'><strong>"+subtel[i]+"</strong></span>";
				}else{
					tel_content+=telinfo.split("&")[q].split("||")[0]+"<strong>"+subtel[i]+"</strong>";
				}
			}else{
				if (telinfo.split("&")[q].split("||")[3]=="1"){
					tel_content+=telinfo.split("&")[q].split("||")[0]+"<span class='red'>"+subtel[i]+"</span>";	
				}else if(telinfo.split("&")[q].split("||")[3]=="2"){
					tel_content+=telinfo.split("&")[q].split("||")[0]+"<span class='yellow'>"+subtel[i]+"</span>";
				}else{
					tel_content+=telinfo.split("&")[q].split("||")[0]+subtel[i];
				}
			}	
			
		break;	
		}else{
			tel_content+="";
			continue;
		}
		
	}
}
var replaceStr="⊙";
re = /\@/g;
tel_content=tel_content.replace(re,replaceStr);

if (tel_content.indexOf(replaceStr)!=-1)
tel_content="<span title=\"温馨提示：发邮件时请把“"+replaceStr+"”改成“@”\">"+tel_content+"</span>";
document.write(tel_content);
}


function setInputCheck(checkInfo,tForm){
var $=jQuery; 
var subtype= new Array("id","dataType","msg","min","max","Require","to","operator");//operator 如：GreaterThanEqual，需要和to一起使用
//var info="usid,Username,请正确输入用户名,2,16,,,||password,Password,请正确输密码,8,16,,,||random,Code,请正确输入验证码,,,,,";
var info="";
var tForm=tForm||"";


if(eval("typeof("+"checkInfo"+")")!='undefined'){
info=checkInfo.toString();
if (info!=null&&info!=""){
	


var inputFirstN=info.split("||")[0].split(",")[0];
var inputFirst=jQuery("*[name="+inputFirstN+"]").eq(0);

inputFirst=inputFirst.length==0?jQuery("#"+inputFirstN).eq(0):inputFirst;	

tForm=tForm=="undefined"?jQuery("#"+tForm):inputFirst.parents("form").eq(0);


for (var q=0; q<=info.split("||").length-1; q++){
	var thisQname=info.split("||")[q].split(",")[0];
	
	var inputObj=tForm.find("*[name="+thisQname+"]").eq(0);

	if(inputObj.length==0){
		inputObj=jQuery("#"+thisQname).eq(0);
	}

	if (inputObj.length>0){
		for (var i=0; i<=info.split("||")[q].split(",").length-1; i++){
			
			var dataType=info.split("||")[q].split(",")[1];
			
				if (info.split("||")[q].split(",")[i]!=""&&i>0){
					try{
					inputObj[0].setAttribute(subtype[i],info.split("||")[q].split(",")[i]);
					if (info.split("||")[q].split(",")[1]=="Filter"){
					inputObj[0].setAttribute("accept",info.split("||")[q].split(",")[7]);
					}
					if (info.split("||")[q].split(",")[6]==""&&info.split("||")[q].split(",")[7]!=""){
					inputObj[0].setAttribute("format",info.split("||")[q].split(",")[7]);
					}
					}catch(e){}
				}
		}		
	}
}

}

}
}


function chonfocus(id){
	document.getElementById(id).focus();
}

//加载区域
MM_preloadImages( '/images/user/tubiao_host-2.gif', '/images/user/tubiao_guide-2.gif', '/images/user/tubiao_tour_car-2.gif', '/images/user/tubiao_scenic-2.gif', '/images/user/tubiao_travel_bureau-2.gif', '/images/user/tubiao_hotel-2.gif', '/images/user/tubiao_restaurant-2.gif' );


//v1.7
// Flash Player Version Detection
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var e;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(e){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(e){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(e){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(e){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(e){a=-1}}return a}function GetSwfVer(){var a=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var b=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var c=navigator.plugins["Shockwave Flash"+b].description;var d=c.split(" ");var e=d[2].split(".");var f=e[0];var g=e[1];var h=d[3];if(h==""){h=d[4]}if(h[0]=="d"){h=h.substring(1)}else if(h[0]=="r"){h=h.substring(1);if(h.indexOf("d")>0){h=h.substring(0,h.indexOf("d"))}}var a=f+"."+g+"."+h}}else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)a=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)a=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)a=2;else if(isIE&&isWin&&!isOpera){a=ControlVersion()}return a}function DetectFlashVer(a,b,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var d=versionArray[0];var e=versionArray[1];var f=versionArray[2];if(d>parseFloat(a)){return true}else if(d==parseFloat(a)){if(e>parseFloat(b))return true;else if(e==parseFloat(b)){if(f>=parseFloat(c))return true}}return false}}function AC_AddExtension(a,b){if(a.indexOf('?')!=-1)return a.replace(/\?/,b+'?');else return a+b}function AC_Generateobj(a,b,c){var d='';if(isIE&&isWin&&!isOpera){d+='<object ';for(var i in a){d+=i+'="'+a[i]+'" '}d+='>';for(var i in b){d+='<param name="'+i+'" value="'+b[i]+'" /> '}d+='</object>'}else{d+='<embed ';for(var i in c){d+=i+'="'+c[i]+'" '}d+='> </embed>'}document.write(d)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(a,b,c,d,e){var f=new Object();f.embedAttrs=new Object();f.params=new Object();f.objAttrs=new Object();for(var i=0;i<a.length;i=i+2){var g=a[i].toLowerCase();switch(g){case"classid":break;case"pluginspage":f.embedAttrs[a[i]]=a[i+1];break;case"src":case"movie":a[i+1]=AC_AddExtension(a[i+1],b);f.embedAttrs["src"]=a[i+1];f.params[c]=a[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case "codebase":f.objAttrs[a[i]] ="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,19,0";break;case"id":f.objAttrs[a[i]]=a[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":f.embedAttrs[a[i]]=f.objAttrs[a[i]]=a[i+1];break;default:f.embedAttrs[a[i]]=f.params[a[i]]=a[i+1]}}f.objAttrs["classid"]=d;if(e)f.embedAttrs["type"]=e;return f}


function _sFocus(imgStr,w,h,h_t,id,type){
					
	//if (navigator.appName == "Netscape"){
	//document.write('<a href="'+imgLink1+'"><img src="'+imgUrl1+'" width=200 height=152 border=0 class=img01 ><br> '+imgtext1+'</a> ')
	//}else{
	var focus_width=w;
	var focus_height=h;
	var text_height=h_t;
	var swf_height = focus_height+text_height;
	var imgArr=imgStr;
	var imgArrL=imgStr.length;
	//	var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
	//	var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
	//	var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
	var pics="";
	var links="";
	var texts="";
	/*var setPic=function(str){
		var rStr=str;
		if(typeof type!="undefined"){
			if (type=="m")
			rStr=str.replace("/upfiles/s","/upfiles/m")
		}
		return rStr;
	}*/
	for (var i=0;i<imgArrL;i=i+3){	
	  if (i==0){
		texts+=imgArr[i];
		pics+=imgArr[i+1];		
		links+=imgArr[i+2];		
	  }else{
		texts+="|"+imgArr[i];
		pics+="|"+imgArr[i+1];
		links+="|"+imgArr[i+2];
	  } 
	}
	if (pics!==""){
	
	AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','name',id,'width',focus_width,'height',swf_height,'align','middle','id',id,'FlashVars','pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height,'src','/media/focus','menu','false','quality','high','scale','noscale','wmode','transparent','bgcolor','#ffffff','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','/media/focus' );

	}
	//}
}
//校验搜索关键字 
function isSearch(s) 
{ 
var patrn=/^[^`~!@#$%^&*()+=|\\\][\]\{\}:;'\,.<>/?]{1}[^`~!@$%^&()+=|\\\][\]\{\}:;'\,.<>?]{0,19}$/; 
if (!patrn.exec(s)) return false 
return true 
} 
function isIP(s) //by zergling 
{ 
var patrn=/^[0-9.]{1,20}$/; 
if (!patrn.exec(s)) return false 
return true 
}
//-->

function getPlayer(url,w,h,s,e,m,mode){
							var urlType=url.split(".")[1].toLowerCase();
							var urlName="viedo_"+url.split(".")[0].toLowerCase();
							
							var videoStr="";
							var msgStr="";
							msgStr="格式："+urlType;
							
							if(urlType!=""){
								switch(urlType){
									//mid,mp3,wma,wav,mpeg,mpg,wmv,avi,rm,rmvb,swf
									case "mid":
									case "mp3":
									case "wma":
									case "wav":
									case "asx":
									videoStr= '<EMBED src="'+url+'" id="'+urlName+'" name="'+urlName+'" type=audio/mpeg AUTOSTART="1" loop="0" width="'+w+'" height="68" showstatusbar="true" showcontrols="true" showaudiocontrols="true" ></EMBED>';
									break;
																									
									case "mpeg":
									case "mpg":
									case "wmv":
									videoStr= '<object  id="'+urlName+'" name="'+urlName+'" width="'+w+'" height="'+h+'" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param NAME="AutoStart" VALUE="-1"><param NAME="Balance" VALUE="0"><param name="enabled" value="'+e+'"><param NAME="EnableContextMenu" VALUE="'+m+'"><param NAME="url" VALUE="'+url+'"><param NAME="PlayCount" VALUE="1"><param name="rate" value="1"><param name="currentPosition" value="0"><param name="currentMarker" value="0"><param name="defaultFrame" value=""><param name="invokeURLs" value="0"><param name="baseURL" value=""><param name="stretchToFit" value="-1"><param name="volume" value="50"><param name="mute" value="0"><param name="uiMode" value="'+mode+'"><param name="windowlessVideo" value="0"><param name="fullScreen" value="0"><param name="enableErrorDialogs" value="-1"></object>';	
									break;
									
									case "avi" :
									videoStr= '<object  id="'+urlName+'" name="'+urlName+'" width="'+w+'" height="'+h+'" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"><param name="ShowDisplay" value="0"><param name="ShowControls" value="1"><param name="AutoStart" value="1"><param name="AutoRewind" value="0"><param name="PlayCount" value="1"><param name="Appearance value="0 value="""><param name="BorderStyle value="0 value="""><param name="MovieWindowHeight" value="'+h+'"><param name="MovieWindowWidth" value="'+w+'"><param name="FileName" value="'+url+'"><embed  width="'+w+'" height="'+h+'" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="'+h+'" moviewindowwidth="'+w+'" filename="'+url+'" src="'+url+'"></embed></object>';
									break;
									
									case "rm":
									case "rmvb":
									videoStr+='<object  id="rmVideo" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+w+'" height="'+h+'">';
									videoStr+='<param name="_ExtentX" value="3016" />';
									videoStr+='<param name="_ExtentY" value="2646" />';
									videoStr+='<param name="AUTOSTART" value="-1" />';
									videoStr+='<param name="SHUFFLE" value="0" />';
									videoStr+='<param name="PREFETCH" value="0" />';
									videoStr+='<param name="NOLABELS" value="-1" />';
									videoStr+='<param name="SRC" value="'+url+'"; />';
									videoStr+='<param name="CONTROLS" value="Imagewindow" />';
									videoStr+='<param name="CONSOLE" value="clip1" />';
									videoStr+='<param name="LOOP" value="0" />';
									videoStr+='<param name="NUMLOOP" value="0" />';
									videoStr+='<param name="CENTER" value="0" />';
									videoStr+='<param name="MAINTAINASPECT" value="0" />';
									videoStr+='<param name="BACKGROUNDCOLOR" value="#000000" />';
									videoStr+='</object>';
									videoStr+='<div class="clear"></div><object  id="rmVideo2" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"  width="'+w+'" height=30>';
									videoStr+='<param name="_ExtentX" value="11298" />';
									videoStr+='<param name="_ExtentY" value="794" />';
									videoStr+='<param name="AUTOSTART" value="-1" />';
									videoStr+='<param name="SHUFFLE" value="0" />';
									videoStr+='<param name="PREFETCH" value="0" />';
									videoStr+='<param name="NOLABELS" value="-1" />';
									videoStr+='<param name="SRC" value="'+url+'" />';
									videoStr+='<param name="CONTROLS" value="ControlPanel" />';
									videoStr+='<param name="CONSOLE" value="clip1" />';
									videoStr+='<param name="LOOP" value="0" />';
									videoStr+='<param name="NUMLOOP" value="0" />';
									videoStr+='<param name="CENTER" value="0" />';
									videoStr+='<param name="maintainaspect" value="0" />';
									videoStr+='<param name="BACKGROUNDCOLOR" value="#000000" />';
									videoStr+='</object>';

									break;	
															
									case "swf":
									videoStr= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'"  id="'+urlName+'" name="'+urlName+'" height="'+h+'"> <param name="movie" value="'+url+'"> <param name="quality" value="high"> <embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"’ target="_blank" >http://www.macromedia.com/go/getflashplayer"; type="application/x-shockwave-flash"  width="'+w+'" height="'+h+'"> </embed> </object> ';
									break;
									
									default:
									videoStr= '<EMBED src="'+url+'"  id="'+urlName+'" name="'+urlName+'" type=audio/mpeg AUTOSTART="1" loop="0" showstatusbar="true" showcontrols="true" showaudiocontrols="true" ></EMBED>';
									break;
								}
								
							}
							return videoStr;
							//$("#video_msg").html(msgStr);
							//$("#playerShow").html(videoStr);
							//getPlayer("/video/z.rm","420","300","0","-1","-1","mini");
							}
							