// JavaScript Document
///PublicConst
var PublicWebName =  "橄榄游";//window.location.host
var PublicWebURL  =  "http://www.ganlanu.com";//window.location.host
var PublicPicURL  =   PublicWebURL+"/photocenter/hotelphoto/";//window.location.host
var PublicTel     =  "010-59237007";
var PublicTelC    =  "010-59237007";//400,800
var PublicFax     =  "010-59237007";
var PublicHotelImagePath ="/hotel/images/"
var PublicHotelPath ="/hotel/";
var suggestnum1=-1;
var suggeststr;

function  $$$(_sId) {return document.getElementById(_sId)}
function  $Tag(node){return document.getElementsByTagName(node);}
//******************************************//右键鼠标产生事件处理中心Start************************

document.onclick=function(){   
if(typeof(hideCalendar)=="function"){

          //日历
          hideCalendar();
                     
      }
if($$$("suggest")){
          //suggest城市搜索
          $$$("suggest").style.display='none';                     
      }

if(typeof(hideWriteDistrict)=="function"){

          //区域输出
          hideWriteDistrict();                     
      }
  }
//******************************************//右键鼠标产生事件处理中心End************************ 

//***************************.topsearchsuggest***************************
function ajax_keyword(){
			
			var xmlhttp1;
			try{
				xmlhttp1=new XMLHttpRequest();
				}
			catch(e){
				xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");
				}
			xmlhttp1.onreadystatechange=function(){
			if (xmlhttp1.readyState==4){
				if (xmlhttp1.status==200){
					var data=xmlhttp1.responseText;
					$$$("suggest").innerHTML=data;
					suggestnum1=-1;
					}
				}
			}
			
			xmlhttp1.open("post", "/hotel/ajaxsearchlable.aspx", true);
			xmlhttp1.setRequestHeader('Content-type','application/x-www-form-urlencoded');
			xmlhttp1.send("city="+escape($$$("searchcity").value)+"&keyword="+escape($$$("suggestkeyword").value)+"&Rnd="+CheckNum(10));
		}
		function keyupdeal(e){
			$$$("suggest").style.display='block';	
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc!=40 && keyc!=38){
				
				ajax_keyword();
				suggeststr=$$$("suggestkeyword").value;
			}
			}

		function set_style(num){
			for(var i=0;i<$Tag("li").length;i++){
				var li_node=$Tag("li")[i];
				li_node.className="";
			}
			if(suggestnum1>=0 && suggestnum1<$Tag("li").length){
				var i_node=$Tag("li")[suggestnum1];
				$Tag("li")[suggestnum1].className="select";
				}
			}
		function mo(nodevalue){
			suggestnum1=nodevalue;
			set_style(suggestnum1);
		}
		
		function goresult(nodevalue){
			window.location.href=nodevalue
		}		
		
		function form_submit(){
			if(suggestnum1>=0 && suggestnum1<$Tag("li").length){
				$Tag("input")[0].value=$Tag("li")[suggestnum1].childNodes[0].nodeValue;
				}
			document.search.submit();
		}
		function hide_suggest(){
			var nodes=document.body.childNodes
			for(var i=0;i<nodes.length;i++){
				if(nodes[i]!=$$$("suggestkeyword")){
					$$$("suggest").innerHTML="";
					}
				}
			}
			
function keydowndeal(e){
			var keyc;
			if(window.event){
				keyc=e.keyCode;
				}
			else if(e.which){
				keyc=e.which;
				}
			if(keyc==40 || keyc==38){
			if(keyc==40){
				if(suggestnum1<$Tag("li").length){
					suggestnum1++;
					if(suggestnum1>=$Tag("li").length){
						suggestnum1=-1;
					}
				}
				if(suggestnum1>=$Tag("li").length){
						suggestnum1=-1;
					}
			}
			if(keyc==38){
				if(suggestnum1>=0){
					suggestnum1--;
					if(suggestnum1<=-1){
						suggestnum1=$Tag("li").length;
					}
				}
				else{
					suggestnum1=$Tag("li").length-1;
				}
			}
			set_style(suggestnum1);
			if(suggestnum1>=0 && suggestnum1<$Tag("li").length){
				$$$("suggestkeyword").value=$Tag("li")[suggestnum1].childNodes[0].nodeValue;
				}
			else{
				$$$("suggestkeyword").value=suggeststr;
				}
			}
		}
//***************************.topsearchsuggest end	*********************************************
//*****************function*************************//
//Set COOKIE
function SetCookie(name,value,expires,path,domain,secure)
{
    var expDays = expires*24*60*60*1000;
    var expDate = new Date();
    expDate.setTime(expDate.getTime()+expDays);
    var expString = ((expires==null) ? "" : (";expires="+expDate.toGMTString()))
    var pathString = ((path==null) ? "" : (";path="+path))
    var domainString = ((domain==null) ? "" : (";domain="+domain))
    var secureString = ((secure==true) ? ";secure" : "" )
    document.cookie = name + "=" + escape(value) + expString + pathString + domainString + secureString;
} 
//Get CooLike
function GetCookie(name)
{
    var result = null;
    var myCookie = document.cookie + ";";
    var searchName = name + "=";
    var startOfCookie = myCookie.indexOf(searchName);
var endOfCookie;
if (startOfCookie != -1)
{
    startOfCookie += searchName.length;
    endOfCookie = myCookie.indexOf(";",startOfCookie);
    result = unescape(myCookie.substring(startOfCookie, endOfCookie));
}
return result;
} 


function doClick_down2(o){
	 o.className="xmenub_mb";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=2;i++){
	   id ="down2_"+i;
	   j = $$$(id);
	   e = $$$("d_con2_"+i);
	   if(id != o.id){
	   	 //j.className="xmenua_mb";
	   	 e.style.display = "none";
	   }else{
		e.style.display = "block";
	   }
	 }
	 }

function doClick_down(o){
	 o.className="r03b";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=5;i++){
	   id ="down"+i;
	   j = $$$(id);
	   e = $$$("d_con"+i);
	   if(id != o.id){
	   	 j.className="r03a";
	   	 e.style.display = "none";
	   }else{
		e.style.display = "block";
	   }
	 }
	 }
	 

//thisitemlist public this css 
//Del CooKIE：
function ClearCookie(name)
{
    var ThreeDays=3*24*60*60*1000;
    var expDate = new Date();
    expDate.setTime(expDate.getTime()-ThreeDays);
    document.cookie=name+"=;expires="+expDate.toGMTString();
}
function DecodeCookie(str) { 
　  var strArr; 
　  var strRtn=""; 
　  strArr=str.split("a"); 　
    for (var i=strArr.length-1;i>=0;i--) 
    {
    strRtn+=String.fromCharCode(eval(strArr[i]));
    }
    return strRtn; 
} 

function CheckLoginText()
{
   if(GetCookie("UserID")!=null&&GetCookie("UserID").length!=0&&GetCookie("UserID")!="0")	
     {
     document.write("　 <a href='/User/Manage.aspx'><font color=green>欢迎您!"+DecodeCookie(GetCookie("UserID"))+"</font></a>")	 
     }
   else
     {
     document.write(" 　　　　　　　·<a href='/User/MyProfile.aspx?action=initlogin&nowurl="+escape(window.location)+"'>登录</a>  ")		 
     document.write("·<a href='/User/MyProfile.aspx?action=initreg&nowurl="+escape(window.location)+"'>注册</a>")	 	 
     }
}
//******************************************HotelPostCheckCenter-Start************************
function hotelearchCheck()
    {
	var ToDays	= ToDayShortDate();

	if ($$$('keyword'))
        {		
	$$$('city').value=$$$('keyword').value
	}
	if ($$$('city').value==""||$$$('city').value=="中文或拼音") {
		
		alert('请选择或填写酒店所在城市！');		
		if($$$('TextCity'))	{
		$$$('TextCity').focus();
		}
		else{
		if($$$('keyword')){
		$$$('keyword').focus();				
		}
		else{
		$$$('city').focus();
		}
		}
		return false;
		
	}
	if ($$$('HotelName')){
	if ($$$('HotelName').value=="中文或英文")
        {
		$$$('HotelName').value="";
	}
	}

	if ($$$('StartDate').value.length==0){
	    alert("请输入入住时间！");
		$$$('StartDate').focus();
		return false
	}	
	if(!isDateString($$$('StartDate').value)){
		alert("入住时间不符合格式规范或无效的日期！");
		$$$('StartDate').focus();
		return false
	}
	if (stringToDate($$$('StartDate').value,true)<stringToDate(ToDays,true)){
	    alert("入住时间不能早于"+$$$('StartDate').value+"！");
		$$$('StartDate').focus();
		return false
	}
	if (compareDate1(ToDays,parent.$$$('StartDate').value)){
		alert('本系统不支持晚于或等于'+$$$('StartDate').value+'号的网上预订,如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务。');
		return false}
	
	if ($$$('DepDate').value.length==0){
		alert("请输入离店时间！");
		$$$('DepDate').focus();
		return false
	}	
	if(!isDateString($$$('DepDate').value)){
		alert("离店时间不符合格式规范或无效的日期！");
		$$$('DepDate').focus();
		return false
	}
	if (stringToDate($$$('DepDate').value,true)<=stringToDate($$$('StartDate').value,true)){
		alert("离店时间不能早于或等于入住时间"+$$$('StartDate').value+"！");
		$$$('DepDate').focus();
		return false
	}

	if (compareDate($$$('StartDate').value,$$$('DepDate').value)){
		alert('本系统不支持大于25天以上的网上预订，如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务。');
		return false
	}
	SearchForm.action="/hotel/Search.aspx"
	SearchForm.submit();
	
	//return true;
}


function HotelDateCheck(PostStartDate,PostDepDate)
    {
	var ToDays	= ToDayShortDate();

	if ($$$(PostStartDate).value.length==0){
	    alert("请输入入住时间！");
		$$$(PostStartDate).focus();
		return false
	}	
	
	if(!isDateString($$$(PostStartDate).value)){
		alert("入住时间不符合格式规范或无效的日期！");
		$$$(PostStartDate).focus();
		return false
	}
	
	if (stringToDate($$$(PostStartDate).value,true)<stringToDate(ToDays,true)){
	    alert("入住时间不能早于"+$$$(PostStartDate).value+"！");
		$$$(PostStartDate).focus();
		return false
	}
	if (compareDate1(ToDays,$$$(PostStartDate).value)){
		alert('本系统不支持晚于或等于'+$$$(PostStartDate).value+'号的网上预订，如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务');
		return false}
	
	if ($$$(PostDepDate).value.length==0){
		alert("请输入离店时间！");
		$$$(PostDepDate).focus();
		return false
	}	
	if(!isDateString($$$(PostDepDate).value)){
		alert("离店时间不符合格式规范或无效的日期！");
		$$$(PostDepDate).focus();
		return false
	}
	if (stringToDate($$$(PostDepDate).value,true)<=stringToDate($$$(PostStartDate).value,true)){
		alert("离店时间不能早于或等于入住时间"+$$$(PostStartDate).value+"！");
		$$$(PostDepDate).focus();
		return false
	}

	if (compareDate($$$(PostStartDate).value,$$$(PostDepDate).value)){
		alert('本系统不支持大于25天以上的网上预订，如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务');
		return false
	}
	$$$('SearchForm').action="/hotel/hotelearchResult.aspx"
	return true;
}

function OrderHotelDateCheck(PostStartDate,PostDepDate)
    {
	var ToDays	= ToDayShortDate();

	
	if ($$$(PostStartDate).value.length==0){
	    alert("请输入入住时间！");
		$$$(PostDepDate).focus();
		return false
	}	
	if(!isDateString($$$(PostStartDate).value)){
		alert("入住时间不符合格式规范或无效的日期！");
		$$$(PostStartDate).focus();
		return false
	}
	if (stringToDate($$$(PostStartDate).value,true)<stringToDate(ToDays,true)){
	    alert("入住时间不能早于"+$$$(PostStartDate).value+"！");
		$$$(PostStartDate).focus();
		return false
	}
	if (compareDate1(ToDays,parent.$$$(PostStartDate).value)){
		alert('本系统不支持晚于或等于'+$$$(PostStartDate).value+'号的网上预订，如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务');
		return false}
	
	if ($$$(PostDepDate).value.length==0){
		alert("请输入离店时间！");
		$$$(PostDepDate).focus();
		return false
	}	
	if(!isDateString($$$(PostDepDate).value)){
		alert("离店时间不符合格式规范或无效的日期！");
		$$$(PostDepDate).focus();
		return false
	}
	if (stringToDate($$$(PostDepDate).value,true)<=stringToDate($$$(PostStartDate).value,true)){
		alert("离店时间不能早于或等于入住时间"+$$$(PostStartDate).value+"！");
		$$$(PostDepDate).focus();
		return false
	}

	if (compareDate($$$(PostStartDate).value,$$$(PostDepDate).value)){
		alert('本系统不支持大于25天以上的网上预订，如有需要请与'+PublicWebName+'预订部联系,'+PublicTel+'，我们会竭诚为您服务');
		return false
	}
	return true;
}
//******************************************HotelPostCheckCenter-end************************



//******************************************HeadFile-NowTime-Start************************
function WriteNowTime()
{

	var day       ="";
	var month     ="";
	var ampm      ="";
	var ampmhour  ="";
	var myweekday ="";
	var year      ="";
	mydate        =new Date();
	
	myweekday = mydate.getDay();
	mymonth   = mydate.getMonth()+1;
	myday     = mydate.getDate();
	myyear    = mydate.getYear();
    year=(myyear > 200) ? myyear : 1900 + myyear;
	if(myweekday == 0)
	weekday=" 星期日 ";
	else if(myweekday == 1)
	weekday=" 星期一 ";
	else if(myweekday == 2)
	weekday=" 星期二 ";
	else if(myweekday == 3)
	weekday=" 星期三 ";
	else if(myweekday == 4)
	weekday=" 星期四 ";
	else if(myweekday == 5)
	weekday=" 星期五 ";
	else if(myweekday == 6)
	weekday=" 星期六 ";
	document.write(myyear+"年"+mymonth+"月"+myday+"日 "+weekday);
}
//******************************************HeadFile-NowTime-end************************

function CheckNum(NUM) 
{ 
	var i,j,strTemp; 
	strTemp="-.0123456789"; 
	if ( NUM.length== 0) 
	return 0 
	for (i=0;i<NUM.length;i++) 
	{ 
	j=strTemp.indexOf(NUM.charAt(i)); 
		if (j==-1) 
		{ 
		
		return false; 
		} 
	} 

	return true; 
} 

function SHotelPrice()
{

	var H=screen.availHeight
    var W=screen.availWidth
	var WinH=260
	var WinW=570
	window.open("/hotel/price.htm","","height="+WinH+",width="+WinW+",scrollbars=yes,toolbar=no,resizable=yes,location=no, status=no,top="+(H-WinH)/2+"px,left="+(W-WinW)/2+"px");
}

function HotelMap(PostHotelName)
{

		var H=screen.availHeight
        var W=screen.availWidth
		var WinH=300
		var WinW=630
		var city=$$$("city").value
		var HotelName=PostHotelName.replace(city,"")
		window.open("Map.htm?city="+city+"&HotelName="+HotelName,"","height="+WinH+",width="+WinW+",scrollbars=yes,toolbar=no,resizable=yes,location=no, status=no,top="+(H-WinH)/2+"px,left="+(W-WinW)/2+"px");
}	
function HotelEMap(HotelID)
{

		var H=screen.availHeight
        var W=screen.availWidth
		var WinH=500
		var WinW=750
		window.open("/hotel/EMap.asp?HotelID="+HotelID)
		//window.open("EMap.asp?HotelID="+HotelID,"","height="+WinH+",width="+WinW+",scrollbars=yes,toolbar=no,resizable=yes,location=no, status=no,top="+(H-WinH)/2+"px,left="+(W-WinW)/2+"px");
}

function MoreSearch(PostNum)
{
	if(PostNum==0)
	{
	$$$("MoreSearchBody").style.display=""
	}
}

function ListdItem(Listcount,Listnum,Listname,ListconName,Listcss1,Listcss2)
{


    for(var i=0;i<Listcount;i++)
    {
    eval("$$$('"+ListconName+i.toString()+"').style.display='none'")
    }	
	
    for(var i=0;i<Listcount;i++)
    {
    eval("$$$('"+Listname+i.toString()+"').className='"+Listcss1+"'")
    }
	
    eval("$$$('"+Listname+Listnum.toString()+"').className='"+Listcss2+"'")
    eval("$$$('"+ListconName+Listnum.toString()+"').style.display='block'") 
}

function LableSearch()
{
	var h_city=$$$("h_city")
	var h_lable=$$$("h_lable")
	if (h_city.value=='城市中文或拼音'||h_city.value=='')
	{
		alert('请输入酒店所在城市')
		h_city.focus()
		return false
		
	}
	if (h_lable.value=='地名/路名/标注性建筑'||h_lable.value=='')
	{
		alert('请输入您要搜索的位置')
		h_lable.focus()
		return false
		
	}	
	window.open("/hotel/searchmap.aspx?city="+escape(h_city.value)+"&lable="+escape(h_lable.value)+"")
}
document.write('<input type=hidden name=history id=history>')	
document.write('<div id="SetQueryString"  style="display:none;position:absolute;z-index:99;background-color:#ffffff;border:solid #ff6600 2px" ondblclick="this.style.display=\''+'none'+'\'" ></div>')
document.write('<div id="SetQueryString2" style="display:none;position:absolute;z-index:99;" ondblclick="this.style.display=\''+'none'+'\'" ></div>')
function AskMarkString(ListID)
{


	$$$("SetQueryString").innerHTML='<table><tr><td>（1）点评奖金：是指您通过'+PublicWebName+'预订酒店并且入住后，返回登陆'+PublicWebName+'，对您入住的酒店发表点评，经我们核实后，由我们网站返给您的现金奖励。</td></tr><tr><td>（2）点评奖金是由'+PublicWebName+'促销返还的，与酒店无关，所以您不能向酒店前台索要。</td></tr><tr><td>（3）每次的点评奖金暂存入您在'+PublicWebName+'的会员账户，当您账户金额达到200元时，即可申请提现。</td></tr><tr><td>（4）点评奖金制度于2009年5月1日开始施行，即于该日或该日以后提交的订单才可以参与该制度</td></tr></table>';	 
	$$$("SetQueryString").style.display=	'block'
	$$$("SetQueryString").style.top =GetIDLT(ListID,'top')+"px"
	$$$("SetQueryString").style.left=(GetIDLT(ListID,'left'))+"px"	
	
}
// JavaScript Document
//常用函数开始***********************************
 var request = {
 QueryString : function(val) {
 var uri = window.location.search;
 var re = new RegExp("" +val+ "\=([^\&\?]*)", "ig");
 return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
 },
 QueryStrings : function() {
 var uri = window.location.search;
 var re = /\w*\=([^\&\?]*)/ig;
 var retval=[];
 while ((arr = re.exec(uri)) != null)
 retval.push(arr[0]);
 return retval;
 },
 setQuery : function(val1, val2) {
 var a = this.QueryStrings();
 var retval = "";
 var seted = false;
 var re = new RegExp("^" +val1+ "\=([^\&\?]*)$", "ig");
 for(var i=0; i<a.length; i++) {
 if (re.test(a[i])) {
 seted = true;
 a[i] = val1 +"="+ val2;
 }
 }
 retval = a.join("&");
 return "?" +retval+ (seted ? "" : (retval ? "&" : "") +val1+ "=" +val2);
 }
}

function ListArea(PostNum)
{
	
	if (PostNum==1)
	{
		
	
	$$$("d_xzengMid").style.display = "none";
	$$$("d_xzengMid2").style.display = "block"
	$$$("Area0").className = "d-xzOn"	
	$$$("Area1").className = ""
	}
	else
	{
	
	$$$("d_xzengMid").style.display = "block";
	$$$("d_xzengMid2").style.display = "none"
	$$$("Area0").className = ""	
	$$$("Area1").className = "d-xzOn"
	}
}


function ListArea2(PostNum)
{
	
	if (PostNum==1)
	{
		
	
	$$$("hoteldistrictMid").style.display = "none";
	$$$("hoteldistrictMid2").style.display = "block"
	$$$("Area0").className = "AreaNavNS"	
	$$$("Area1").className = "AreaNavYS"
	}
	else
	{
	
	$$$("hoteldistrictMid").style.display = "block";
	$$$("hoteldistrictMid2").style.display = "none"
	$$$("Area0").className = "AreaNavYS"	
	$$$("Area1").className = "AreaNavNS"
	}
}


       function fnOnKeyPress() 
       { 
           var obj = window.event.srcElement; 
           if  (obj.value.length > obj.maxLength) 
               event.returnValue = false;           
       } 
        
       function fnOnPaste() 
       { 
           var obj = window.event.srcElement; 
           var maxLen = obj.maxLength; 
           var curLen = obj.value.length; 
           if (curLen >= maxLen) 
           { 
               event.returnValue = false; 
               return; 
           } 
           var newText = window.clipboardData.getData("text"); 
           if (newText.length + curLen <=maxLen ) 
           { 
               event.returnValue = true; 
               return; 
           } 
           event.returnValue = false; 
           if (obj.enableTruncate ) 
           { 
               obj.value = obj.value + newText.substring(0,maxLen-curLen); 
           } 
       } 
        
       function fnSetMaxLength(objName, maxLen, enableTruncate) 
       { 
           var obj = document.all(objName); 
           obj.maxLength = maxLen; 
           obj.enableTruncate = enableTruncate; 
           obj.onkeypress = fnOnKeyPress; 
           obj.onpaste = fnOnPaste; 
       } 
	   
	  function GetIDLT(PostID,RetrunType)
	 {
		var PostID=$$$(PostID);
		if(!PostID){alert("控制对象不存在！");return;}
		var eT=0,eL=0,p=PostID;
		var sT=document.body.scrollTop,sL=document.body.scrollLeft;
		var eH=PostID.height,eW=PostID.width;	
		var bH=document.body.clientHeight
		var bW=document.body.clientWidth
		//alert(p.offsetLeft)
		while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
		{
		if(RetrunType=="top"){
		return eT}
	
		if(RetrunType=="left"){
		return eL}
		}
	
	}	
	function getElementPos(elementId){
    var ua = navigator.userAgent.toLowerCase();
    var isOpera = (ua.indexOf('opera') != -1);
    var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof
    var el = document.getElementById(elementId);
	alert(el.value)
    if (el.parentNode === null || el.style.display == 'none') {
        return false;
    }
    var parent = null;
    var pos = [];
    var box;
    if (el.getBoundingClientRect) //IE
    {
        box = el.getBoundingClientRect();
        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
        return {
            x: box.left + scrollLeft,
            y: box.top + scrollTop
        };
    }
    else 
        if (document.getBoxObjectFor) // gecko    
        {
            box = document.getBoxObjectFor(el);
            var borderLeft = (el.style.borderLeftWidth) ? parseInt(el.style.borderLeftWidth) : 0;
            var borderTop = (el.style.borderTopWidth) ? parseInt(el.style.borderTopWidth) : 0;
            pos = [box.x - borderLeft, box.y - borderTop];
        }
        else // safari & opera    
        {
            pos = [el.offsetLeft, el.offsetTop];
            parent = el.offsetParent;
            if (parent != el) {
                while (parent) {
                    pos[0] += parent.offsetLeft;
                    pos[1] += parent.offsetTop;
                    parent = parent.offsetParent;
                }
            }
            if (ua.indexOf('opera') != -1 || (ua.indexOf('safari') != -1 && el.style.position == 'absolute')) {
                pos[0] -= document.body.offsetLeft;
                pos[1] -= document.body.offsetTop;
            }
        }
    if (el.parentNode) {
        parent = el.parentNode;
    }
    else {
        parent = null;
    }
    while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors
        pos[0] -= parent.scrollLeft;
        pos[1] -= parent.scrollTop;
        if (parent.parentNode) {
            parent = parent.parentNode;
        }
        else {
            parent = null;
        }
    }
    return {
        x: pos[0],
        y: pos[1]
    };
}	

function ReplaceAll(str, sptr, sptr1)
{
while (str.indexOf(sptr) >= 0)
{
   str = str.replace(sptr, sptr1);
}
return str;
}


function fnSetMaxLength(objName, maxLen, enableTruncate) 
       { 
           var obj = document.all(objName); 
           obj.maxLength = maxLen; 
           obj.enableTruncate = enableTruncate; 
           obj.onkeypress = fnOnKeyPress; 
           obj.onpaste = fnOnPaste; 
       } 
	   
function GetIDLT(PostID,RetrunType)
	 {
		var PostID=document.getElementById(PostID);
		if(!PostID){alert("控制对象不存在！");return;}
		var eT=0,eL=0,p=PostID;
		var sT=document.body.scrollTop,sL=document.body.scrollLeft;
		var eH=PostID.height,eW=PostID.width;	
		var bH=document.body.clientHeight
		var bW=document.body.clientWidth
		//alert(p.offsetLeft)
		while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
		{
		if(RetrunType=="top"){
		return eT}
	
		if(RetrunType=="left"){
		return eL}
		}
	
}
function get_offset(objid,rtype){
	var left = 0;
	var top  = 0;
    var offsetparent = document.getElementById(objid);
    while(offsetparent != null && offsetparent.nodeName != "BODY"){
         left += offsetparent.offsetLeft;
         top += offsetparent.offsetTop;
         offsetparent=offsetparent.parentNode;
    }
		if(rtype=="top"){
		return top}
	
		if(rtype=="left"){
		return left}	
}


	function getElementPos(elementId){
    var ua = navigator.userAgent.toLowerCase();
    var isOpera = (ua.indexOf('opera') != -1);
    var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof
    var el = document.getElementById(elementId);
	alert(el.value)
    if (el.parentNode === null || el.style.display == 'none') {
        return false;
    }
    var parent = null;
    var pos = [];
    var box;
    if (el.getBoundingClientRect) //IE
    {
        box = el.getBoundingClientRect();
        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
        return {
            x: box.left + scrollLeft,
            y: box.top + scrollTop
        };
    }
    else 
        if (document.getBoxObjectFor) // gecko    
        {
            box = document.getBoxObjectFor(el);
            var borderLeft = (el.style.borderLeftWidth) ? parseInt(el.style.borderLeftWidth) : 0;
            var borderTop = (el.style.borderTopWidth) ? parseInt(el.style.borderTopWidth) : 0;
            pos = [box.x - borderLeft, box.y - borderTop];
        }
        else // safari & opera    
        {
            pos = [el.offsetLeft, el.offsetTop];
            parent = el.offsetParent;
            if (parent != el) {
                while (parent) {
                    pos[0] += parent.offsetLeft;
                    pos[1] += parent.offsetTop;
                    parent = parent.offsetParent;
                }
            }
            if (ua.indexOf('opera') != -1 || (ua.indexOf('safari') != -1 && el.style.position == 'absolute')) {
                pos[0] -= document.body.offsetLeft;
                pos[1] -= document.body.offsetTop;
            }
        }
    if (el.parentNode) {
        parent = el.parentNode;
    }
    else {
        parent = null;
    }
    while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors
        pos[0] -= parent.scrollLeft;
        pos[1] -= parent.scrollTop;
        if (parent.parentNode) {
            parent = parent.parentNode;
        }
        else {
            parent = null;
        }
    }
    return {
        x: pos[0],
        y: pos[1]
    };
}	

function ReplaceAll(str, sptr, sptr1)
{
while (str.indexOf(sptr) >= 0)
{
   str = str.replace(sptr, sptr1);
}
return str;
}

//常用函数结束***********************************
//常用函数结束***********************************



//***********************************日期函数部份***********************************
// JavaScript Document
function addDate(type,NumDay,dtDate){
   var datestring=dtDate.split("-").join("/")

   var date = new Date(datestring)
   type = parseInt(type) //类型 
   lIntval = parseInt(NumDay)//间隔
  switch(type){
  case 6 ://年
  date.setYear(date.getFullYear() + lIntval)
  break;
  case 7 ://季度
  date.setMonth(date.getMonth() + (lIntval * 3) )
  break;
  case 5 ://月
  date.setMonth(date.getMonth() + lIntval)
  break;
  case 4 ://天
  date.setDate(date.getDate() + lIntval)
  break
  case 3 ://时
  date.setHours(date.getHours() + lIntval)
  break
  case 2 ://分
  date.setMinutes(date.getMinutes() + lIntval)
  break
  case 1 ://秒
  date.setSeconds(date.getSeconds() + lIntval)
  break;
  default:
    
  } 

 return date.getFullYear() +'-' +  (date.getMonth()+1) + '-' +date.getDate()
  } 
  
  
 function dateDiff(SDate,EDate)
 {
	    var interval='D' 
        var objInterval = {'D' : 1000 * 60 * 60 * 24, 'H' : 1000 * 60 * 60, 'M' : 1000 * 60, 'S' : 1000, 'T' : 1};
        interval = interval.toUpperCase();
        var dt1 = Date.parse(SDate.replace(/-/g, '/'));
        var dt2 = Date.parse(EDate.replace(/-/g, '/'));
        try
        {
            return Math.round((dt2 - dt1) / eval('(objInterval.' + interval + ')'));
        }
        catch (e)
        {
            return e.message;
        }

  }



  function ReturnDateString(StartDate,DepDate,OrderDay)
  {

  var TempValue=""
  for(var i=0;i<OrderDay;i++)
  {
  TempValue+=addDate(4,i,StartDate)
  i<OrderDay-1?TempValue+=",":false    
  } 

  return TempValue
  } 

  function ReturnFormatDate(PostDate,typeNum)
  {

  var returnDate
  var datestring=PostDate.split("-").join("/")
  var date = new Date(datestring)	  
  switch(typeNum){
  case 1 :
  returnDate=(date.getMonth()+1) + '月' +date.getDate()+"日"
  break;
  case 2 :
  returnDate=(date.getFullYear()) + '年'+(date.getMonth()+1) + '月' +date.getDate()+"日"
  break;
  default:
    
  } 

  return returnDate


  }

  function ReturnWeekDay(PostDate)
  {

  var enabled = 0;
  var day="";  
  var date;
  var arys= new Array();
  var str = PostDate
 
  arys =str.split('-');
	  
  var  Thisdate = new Date(arys[0],arys[1]-1,arys[2]);

  if(Thisdate.getDay()==0)    {  day = "周日"}

  if(Thisdate.getDay()==1)    {  day = "周一"}

  if(Thisdate.getDay()==2)    {  day = "周二"}

  if(Thisdate.getDay()==3)    {  day = "周三"}

  if(Thisdate.getDay()==4)    {  day = "周四"}

  if(Thisdate.getDay()==5)    {  day = "周五"}

  if(Thisdate.getDay()==6)    {  day = "周六"}


  //date = "<font class f7 color='#000000'> " + (today.getYear())  + "年" + (today.getMonth() + 1 ) + "月" + today.getDate() + "日  " + day + "</font>";
  return day
 // document.write(date.fontsize(2)+"");

  }
  


function isDateString(sDate)
{	var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
	var iaDate = new Array(3)
	var year, month, day

	if (arguments.length != 1) return false
	iaDate = sDate.toString().split("-")
	if (iaDate.length != 3) return false
	if (iaDate[1].length > 2 || iaDate[2].length > 2) return false
	if (isNaN(iaDate[0])||isNaN(iaDate[1])||isNaN(iaDate[2])) return false

	year = parseFloat(iaDate[0])
	month = parseFloat(iaDate[1])
	day=parseFloat(iaDate[2])

	if (year < 1900 || year > 2100) return false
	if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
	if (month < 1 || month > 12) return false
	if (day < 1 || day > iaMonthDays[month - 1]) return false
	return true
}

function stringToDate(sDate, bIgnore)
{	var bValidDate, year, month, day
	var iaDate = new Array(3)
	
	if (bIgnore) bValidDate = true
	else bValidDate = isDateString(sDate)
	
	if (bValidDate)
	{  iaDate = sDate.toString().split("-")
		year = parseFloat(iaDate[0])
		month = parseFloat(iaDate[1]) - 1
		day=parseFloat(iaDate[2])
		return (new Date(year,month,day))
	}
	else return (new Date(1900,1,1))
}

    
function toShortDate(sDate){  
  var   str   =   sDate.getFullYear() +'-' +  (sDate.getMonth()+1) + '-' +sDate.getDate();   
  return str;  
  }
function ToDayShortDate()
{
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
var TempString;
mydate=new Date();
myweekday=mydate.getDay();
mymonth=mydate.getMonth()+1;
myday= mydate.getDate();
myyear= mydate.getFullYear();
year=(myyear > 200) ? myyear : 1900 + myyear;
TempString=myyear+"-"+mymonth+"-"+myday;
return TempString;
}

function compareDate(strDate1,strDate2) {
	if (dateDiff(strDate1,strDate2)>=25)
	{

		return true;
	}
	else
	{
		return false;
	}
	}
function compareDate1(strDate1,strDate2) {
	if (dateDiff(strDate1,strDate2)>=60)
	{
		return true;
	}
	else
	{
		return false;
	}
}
//***********************************日期函数部份结束***********************************






//***********************************城市选择函数部份***********************************
//this city function 
//省份ID,城市ID,商业区ID,行政区ID,第二商业区ID,指定省份值,指定城市值,指定行政区,指定商业区,指定第二商业区
//全局函数 showprovince()
//行政区与商业区单独使用函数 Districts(行政区ID,商业区ID,指定城市值,指定行政区,指定商业区)
//第二商业区单独使用函数     OtherDistrict(第二商业区指定ID,指定城市值,指定第二商业区值)

function showprovince(ProvinceID,CityID,District1ID,District2ID,District3ID,SelectedProvince,SelectedCity,SelectedDistrict1,SelectedDistrict2,SelectedDistrict3)
{
	
document.getElementById(ProvinceID).options.length=ProvinceValue.length//设置省份列表框长度ProvinceText==ProvinceValue

for(var i=0;i<ProvinceValue.length;i++)
{

document.getElementById(ProvinceID).options[i]=new  Option(ProvinceText[i],ProvinceValue[i]);//赋值
}
document.getElementById(ProvinceID).options[1].selected=true;

if(SelectedProvince!=null)//选中已有省份
{
for(var  i=0;i<document.getElementById(ProvinceID).options.length;i++)
{
						if ((document.getElementById(ProvinceID).options[i].value.indexOf(SelectedProvince))!=-1)
							{
							 //alert(CityNamevalue+OptionName.options[i].text)
							 document.getElementById(ProvinceID)[i].selected=true
							 //  change(省份，酒店ID,设置区域开关证明有选中城市值(，城市,行政区，商业区,当这么参数为NULL时不被初行))
 							 change(ProvinceID,CityID,District1ID,District2ID,District3ID,SelectedProvince,SelectedCity,SelectedDistrict1,SelectedDistrict2,SelectedDistrict3);
							 break
							}
					}
}
else
	{
	change(ProvinceID,CityID,District1ID,District2ID,District3ID,document.getElementById(ProvinceID).options[1].value,null,null,null,null);//没有要选中的省份中和城市，默认选项中值以1开头
	}
			
			
}

function change(ProvinceID,CityID,District1ID,District2ID,District3ID,SelectedProvince,SelectedCity,SelectedDistrict1,SelectedDistrict2,SelectedDistrict3)
{
	
//*******省份Selected设置********	
				for(var  z=0;z<document.getElementById(ProvinceID).length;z++)
				{

				if ((document.getElementById(ProvinceID)[z].value.indexOf(SelectedProvince))!=-1)
					
				{

				document.getElementById(ProvinceID)[z].selected=true

				break
				}
				}
//*******省份Selected设置结束********


	document.getElementById(CityID).options.length=ProvinceText[SelectedProvince].length//设置城市列表框长度
	for(var x=0;x<ProvinceText[SelectedProvince].length;x++)
	{
	document.getElementById(CityID).options[x]=new  Option(ProvinceText[SelectedProvince][x],ProvinceValue[SelectedProvince][x]);//赋值
	}

	if(SelectedCity!=null)//有指定/选中城市
			{ 
			//alert(SelectedCity)
				for(var  i=0;i<document.getElementById(CityID).options.length;i++)
				{
						//alert(document.getElementById(CityID).options[i].value)
					if ((document.getElementById(CityID).options[i].value.indexOf(SelectedCity))!=-1)
					
				{
								 //alert(CityNamevalue+OptionName.options[i].text)
						 document.getElementById(CityID)[i].selected=true
							    // change(SelectedProvince,PCityID,1,SelectedCity,SelectedDistrict1,SelectedDistrict2);
					break
				}
				}
			}
	 else
	 {
	 document.getElementById(CityID)[0].selected=true //没有指定/选择城市时使用首选值
	 }	 
	 //启用商业区域与行政区域
	 if(District1ID!=null)
	 {
	  Districts(District1ID,District2ID,document.getElementById(CityID).value,SelectedDistrict1,SelectedDistrict2)
	 }
	 //启用第二商业区域
	 if(District3ID!=null)
	 {
	   OtherDistrict(District3ID,document.getElementById(CityID).value,SelectedDistrict3)
	 }	 
}
//用户直接输入城市信息
function TextCityWrite(District1ID,District2ID,WriteCity,CityID)
{
			document.getElementById(CityID).options.length=1
			document.getElementById(CityID).options[0]=new Option(WriteCity,WriteCity);
			document.getElementById(CityID).options[0].selected=true;
			Districts(District1ID,District2ID,WriteCity,null,null)//查找用户输入城市区域
	
}
//用户直接输入城市信息


// JavaScript Document
function Districts(District1ID,District2ID,CityValue,SelectedDistrict1,SelectedDistrict2)
{
var DistrictSelect =document.getElementById(District1ID)//行政区
var DistrictSelect2=document.getElementById(District2ID)//商业区
var S1Text=DistrictSelect.options[0].text
var S2Text=DistrictSelect2.options[0].text
 //设置行政区初始
	for(var  i=0;i<DistrictSelect.options.length;i++)
	{
		 DistrictSelect.removeChild(DistrictSelect.options[i])
		 
		 //CityNumbers.value=OptionName.options[i].value
		
		 //break
	}
	DistrictSelect.options.length=1
	DistrictSelect.options[0]=new Option(S1Text,'')//商业区
 //设置行政区初始结束	
 
  //设置商业区初始
	for(var  i=0;i<DistrictSelect2.options.length;i++)
	{
		 DistrictSelect2.removeChild(DistrictSelect2.options[i])
		 
		 //CityNumbers.value=OptionName.options[i].value
		
		 //break
	}
	DistrictSelect2.options.length=1
	DistrictSelect2.options[0]=new Option(S2Text,"")//商业区
  
  //设置行政区初始结束
    var Check=0//设置开关当有选项中值时不再循环  	
	for(var s=0;s<D1City.length;s++)//循环需要商业区的城市
		{
			if(D1City[s]==CityValue)//当找到商业城市值时
				{
					for (var i=0;i<District[CityValue].length;i++)
					  {
						   if (i==0)
						   {
							DistrictSelect.options[i]=new Option(S1Text.replace("行政区","不限"),'')//商业区   
						   }
					   else
						   {
							DistrictSelect.options[i]=new Option(District[CityValue][i][1],District[CityValue][i][1])//添加行政区下拉列值
							}
							if(SelectedDistrict1!=null&&Check==0)//判断是否有指定行政区值，有则需要设置为selected
							{
								if((District[CityValue][i][1].indexOf(SelectedDistrict1))!=-1)
							    {
								 DistrictSelect.options[i].selected=true
								 Check=1
							    }
							}
					  }
				break	  
				}
		}
    var Check2=0//设置开关当有选项中值时不再循环
	for(s=0;s<D2City.length;s++)
		{  
			if(D2City[s]==CityValue)
				{
					for (var i=0;i<District2[CityValue].length;i++)
					{
					   if (i==0)
					   {
						DistrictSelect2.options[i]=new Option(S2Text.replace("商业区","不限"),'')//商业区   
					   }
					   else
					   {
					    DistrictSelect2.options[i]=new Option(District2[CityValue][i][1],District2[CityValue][i][1])//商业区
					   }
					   if(SelectedDistrict2!=null&&Check2==0)//判断是否有指定商业区值，有则需要设置为selected
							{
							 if((District2[CityValue][i][1].indexOf(SelectedDistrict2))!=-1)
							    {
								 DistrictSelect2.options[i].selected=true
								 Check2=1//关闭开关
								}
							}					  
					  }

				break	  
				}
				
		}
}		

//第二商业区
function OtherDistrict(DistrictSelect3ID,CityValue,SelectedDistrict)
{
    var DistrictSelect3=document.getElementById(DistrictSelect3ID)
 //alert (DistrictSelect3.value)
 //设置行政区初始
	for(var  i=0;i<DistrictSelect3.options.length;i++)
	{
		DistrictSelect3.removeChild(DistrictSelect3.options[i])
		 
		 //CityNumbers.value=OptionName.options[i].value
		
		 //break
	}
	DistrictSelect3.options.length=1
	DistrictSelect3.options[0]=new Option("-----不限-----",'')//初始值为空
 //设置行政区初始结束	
 
  //设置商业区初始
	for(var  i=0;i<DistrictSelect3.options.length;i++)
	{
	DistrictSelect3.removeChild(DistrictSelect3.options[i])
		 
		 //CityNumbers.value=OptionName.options[i].value
		
		 //break
	}
	DistrictSelect3.options.length=1
	DistrictSelect3.options[0]=new Option("-----不限-----","")//商业区
  
  //设置行政区初始结束
    var Check3=0//设置开关当有选项中值时不再循环  	
	for(var s=0;s<D3City.length;s++)//循环需要商业区的城市
		{
		if(D3City[s]==CityValue)//当找到商业城市值时
			{
			for (var i=0;i<District3[CityValue].length;i++)
				{
				if (i==0)
				{
				DistrictSelect3.options[i]=new Option('-----不限-----','')//商业区   
				}
				else
				{
				DistrictSelect3.options[i]=new Option(District3[CityValue][i][1],District3[CityValue][i][1])//添加行政区下拉列值
				
							if(SelectedDistrict!=null&SelectedDistrict!=''&Check3==0)//判断是否有指定行政区值，有则需要设置为selected
						    {
								if((District3[CityValue][i][1].indexOf(SelectedDistrict))!=-1)
								  {
								 DistrictSelect3.options[i].selected=true
								 Check=1
								  }
				            }
				}
				  
				}
		break	
		}
		}

}	



function showDistrict(sImg,Scid,Noimg)
{
	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)//FF下列表框会自动增宽,将不应用自定义增长框架
	{ 
	//return
	} 
    //document.getElementById('DistrictSelect2').onBlur
	var oImg=document.getElementById(sImg);
	var oCid=document.getElementById(Scid);
	if(!oImg){alert("控制对象不存在！");return;}
	if(!oCid){alert("控制对象不存在！");return;}	
	var eT=0,eL=0,p=oImg;
	var sT=document.body.scrollTop,sL=document.body.scrollLeft;
	var eH=oImg.height,eW=oImg.width;	
	var bH=document.body.clientHeight
	var bW=document.body.clientWidth
    //alert(p.offsetLeft)
	while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
	{
	if(!Noimg)
	oCid.style.top=eT

	else
	{
	oCid.style.top=eT
	}
	}

	oCid.style.left=eL+88;


	if(Number(eL)>800)
	{

	//oCid.style.left=eL-(oCid.style.width).replace("px","");
	}
	oCid.style.display="block";

}
	//document.write('<iframe id="SetDistrict" src="/hotels/district.html"  name="SetDistrict"  frameborder="0" style="display:none;position:absolute;z-index:108;width:98px;" ondblclick="this.style.display=\''+'none'+'\'" ></iframe>')

function WriteDistrict()
{
		var   City=document.getElementById('city').value
		var   C=-1
		var   TableWidth=0
		var   TableWidthStr=""	
		var   TdBgColor=""
		var   SetDistrictHtml=""
		if (!document.getElementById('SetDistrict')){
		document.write('  <div id="SetDistrict" style="display:none;position:absolute;z-index:99;background-color:#ffffff;border:solid #ccc 1px" ondblclick="this.style.display=\''+'none'+'\'" ></div>')
		}

	  
	  SetDistrictHtml+=('  <table  width="100%"  border="0" cellpadding="0" >')
	  SetDistrictHtml+=('  <tr>')
	  SetDistrictHtml+=('  <td  align="left" valign="top" bgcolor="#ffffff" style="word-break:break-all">')
	  SetDistrictHtml+=('  <table width="100%"  border="0" cellpadding="0" cellspacing="0">')
      SetDistrictHtml+=('  <tr><td  height=20  style="word-break:break-all;background-color:#67a1e2;padding-left:10px;" colspan=6><A href="javascript:SetInput(\''+''+'\',3)"><font  style="font-size:12px;color:#fff">选择酒店所在地理位置</font></A></td></tr>')	  	  
      SetDistrictHtml+=('  <tr><td  height=20  style="word-break:break-all;border-bottom:dashed #999 1px;padding-left:10px" colspan=4 align="left"><font style="font-size:12px;color:#999">商业区</font></td></tr>')	  	  		
    



	  if(District2[City])
	  {
	  //alert(District2[City].length)

	  if(District2[City].length>1){
	  for(var s=1;s<District2[City].length;s++)
	  {
	  //取余
	  C=C+1
	  Mod=eval(C%3)
	  TdBgColor=""
      if (C!=0&&(Mod==0))
	  {

	  
	  
      SetDistrictHtml+=('  </tr><tr>')	
	  
	  //TdBgColor="#E7F3FE"
	  }

	  s>0?SetDistrictHtml+=(' <td height=20 style="word-break:break-all;padding:5px;background-color:'+TdBgColor+';"><A href="javascript:SetInput(\''+District2[City][s][1]+'\',1)" class=black>'+District2[City][s][1]+'</a></td>'):true
	        
	  if((District2[City][s][1].length)>TableWidth)
	  {
	  TableWidth=District2[City][s][1].length
  
	  }	  
	  }
	  }
	  }
	  //alert(TableWidth)
	  var SetDistrictWidth=Number(TableWidth*8*5)

	  if(SetDistrictWidth<400)
	  {
	  SetDistrictWidth=400
	  } 
      SetDistrictHtml+=('</table></td>')
      SetDistrictHtml+=('</tr>')
	  SetDistrictHtml+=('</table>')

	  C=-1
	  SetDistrictHtml+=('  <table  width="100%"  border="0" cellpadding="0"  >')
	  SetDistrictHtml+=('  <tr>')
	  SetDistrictHtml+=('  <td  align="left" valign="top" bgcolor="#ffffff" style="word-break:break-all">')
	  SetDistrictHtml+=('  <table width="100%"  border="0" cellpadding="0" cellspacing="0">')

      SetDistrictHtml+=('  <tr><td  height=20  style="word-break:break-all;border-bottom:dashed #999 1px;padding-left:10px" colspan=6 align="left"><font style="font-size:12px;color:#999">行政区</font></td></tr>')	  		
        //document.write('  <tr>')	

	  if(District[City])
	  {
	  //alert(District2[City].length)

	  if(District[City].length>1){
	  for(var s=1;s<District[City].length;s++)
	  {
	  //取余
	  C=C+1
	  Mod=eval(C%6)
	  TdBgColor=""
      if (C!=0&&(Mod==0))
	  {

      SetDistrictHtml+=('  </tr><tr>')			  
	  //TdBgColor="#E7F3FE"
	  }

	  s>0?SetDistrictHtml+=(' <td height=20 style="word-break:break-all;padding:5px;background-color:'+TdBgColor+'"><A href="javascript:SetInput(\''+District[City][s][1]+'\',0)"  >'+District[City][s][1]+'</a></td>'):true
	        
	  if((District[City][s][1].length)>TableWidth)
	  {
	  TableWidth=District[City][s][1].length
  
	  }	  
	  }
	  }
	  }
	  SetDistrictHtml+=('  </tr><tr>')
      SetDistrictHtml+=('</table></td>')
      SetDistrictHtml+=('</tr>')
	  SetDistrictHtml+=('</table>')
	  	  
	 
	  
	  document.getElementById('SetDistrict').innerHTML=SetDistrictHtml
	  document.getElementById('SetDistrict').style.width=SetDistrictWidth
	  document.getElementById('DistrictInput').focus();
	

}





	  function hideWriteDistrict()
	  {
	  if (!(document.activeElement.name)&&document.activeElement.name!='DistrictInput'&&document.getElementById('DistrictInput')){
	  document.getElementById('SetDistrict').style.display='none'
	  }
	  }

	  function Set(PostValue)
	  {
	  var   City=document.getElementById('City').value
	  Districts('DistrictSelect','DistrictSelect2',City,null,PostValue)
	  document.getElementById('DistrictSelect2').disabled=false
	  document.getElementById('SetDistrict').style.display='none'
	  }
	  
	  function SetInput(PostValue,PostNum)
	  {
	  var   City=document.getElementById('city').value
	  if (PostValue!="")
	  {
		  if (PostNum==0)
			  {
			  document.getElementById('DistrictInput').value=PostValue
			 // Districts('DistrictSelect','DistrictSelect2',City,PostValue,null)
			  document.getElementById('District1').value=PostValue
			  document.getElementById('District2').value=''			  
			  document.getElementById('SetDistrict').style.display='none'
			  }
		  else
			  {
			  document.getElementById('DistrictInput').value=PostValue
			 // Districts('DistrictSelect','DistrictSelect2',City,null,PostValue)
			 // document.getElementById('DistrictSelect').disabled=false
			  document.getElementById('District1').value=''				 
			  document.getElementById('District2').value=PostValue			 
			  document.getElementById('SetDistrict').style.display='none'		  
			  }
	  }
	  else
	  {
			  document.getElementById('District1').value=''				 
			  document.getElementById('District2').value=''			  
			  document.getElementById('DistrictInput').value='';
  			  document.getElementById('SetDistrict').style.display='none'		
	  }	  
	  }
//***********************************城市选择函数部份结束***********************************	



//**************GoogleAD-Start*****************
function gad1()
{
document.writeln("<script type=\"text\/javascript\"><!--");
document.writeln("google_ad_client = \"ca-pub-7145019854184992\";");
document.writeln("\/* tonbanner *\/");
document.writeln("google_ad_slot = \"5400816428\";");
document.writeln("google_ad_width = 468;");
document.writeln("google_ad_height = 60;");
document.writeln("\/\/-->");
document.writeln("<\/script>");
document.writeln("<script type=\"text\/javascript\"");
document.writeln("src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">");
document.writeln("<\/script>");
}

function gad2()
{
document.writeln("<script type=\"text/javascript\"><!--");
document.writeln("google_ad_client = \"ca-pub-7145019854184992\";");
document.writeln("/* 酒店联系位置 */");
document.writeln("google_ad_slot = \"9248983481\";");
document.writeln("google_ad_width = 120;");
document.writeln("google_ad_height = 90;");
document.writeln("//-->");
document.writeln("</script>");
document.writeln("<script type=\"text/javascript\"");
document.writeln("src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">");
document.writeln("</script>");
}

function gad3()
{
document.writeln("<script type=\"text/javascript\"><!--");
document.writeln("google_ad_client = \"ca-pub-7145019854184992\";");
document.writeln("/* 468 */");
document.writeln("google_ad_slot = \"8087824731\";");
document.writeln("google_ad_width = 468;");
document.writeln("google_ad_height = 15;");
document.writeln("//-->");
document.writeln("</script>");
document.writeln("<script type=\"text/javascript\"");
document.writeln("src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">");
document.writeln("</script>");
}

//**************GoogleAD-End*******************  

