// JavaScript Document

document.domain = "iecity.com" ;

function left(mainStr,lngLen) { 
	if (lngLen>0) {return mainStr.substring(0,lngLen)} 
	else{return null} 
} 

function right(mainStr,lngLen) { 
if (mainStr.length-lngLen>=0 && mainStr.length>=0 && mainStr.length-lngLen<=mainStr.length) { 
return mainStr.substring(mainStr.length-lngLen,mainStr.length)} 
else{return null} 
}

function closeDiv(id){
	document.getElementById(id).style.display = 'none'
}

function insertInput(s,id){
	document.getElementById(id).value = s ;	
}

function goFav(href,title){
	try{
		window.external.addFavorite(href, title);
	}catch (e){
		try
		{
			window.sidebar.addPanel(title, href , "");
		}catch (e)		{
			alert("加入收藏失败，请使用Ctrl+D进行添加");
		}
	}
}

function SetHome(obj,vrl){
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(vrl);
}

function SetWinHeight(obj)
{
	var win=obj;
	if (document.getElementById)
		{
		if (win && !window.opera)
		{
		if (win.contentDocument && win.contentDocument.body.offsetHeight) 
		
		win.height = win.contentDocument.body.offsetHeight; 
		else if(win.Document && win.Document.body.scrollHeight)
		win.height = win.Document.body.scrollHeight;
		}
	}
}

function goFor(href,title){
	url = location.href
	domain = href.substring(0,url.indexOf(".")) + ".iecity.com"
	window.open(domain+"/Tools/Forward.html?Title="+title+"&Url="+href)	
}

function doLogout(s){
	document.getElementById("SaveFrame").src = "http://www.iecity.com/bbs/logout.asp?gourl="+s
}

function formatdistance(d){
	if(d<1000){
		return d + "米"
	}else{
		d = d / 1000
		d = d.toFixed(2)
		return d + "公里"
	}
}

function IMicon(s,t){
	if(s!=""){
	switch (t) {
	   case "qq" :
			document.write( "<a target=blank href=tencent://message/?uin="+s+"&Site=城市生活网&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=1:"+s+":4 alt=点击这里用QQ和我联系  height=16 ></a>");
			return
	   case "msn" :
			document.write( "<a href=msnim:chat?contact="+s+"><img src=http://www.texindex.com.cn/images/msn.gif border=0 alt=点击这里用MSN和我联系 /></a>" );
			return
	   case "skype" :
			document.write("<a href=skype:"+s+"?call onclick=\"return skypeCheck();\"><img src=http://www.texindex.com.cn/images/skype.gif style=\"border: none;\" alt=点击这里用Skype和我联系 /></a>");
			return
	}
	}
}

function loading(id){
	$(id).innerHTML = "<img src='http://api.mapabc.com/flashmap/2.3.3/images/loading.gif'>"	
}

function DomainLink(cityEn,folder){
	url = location.href
	host = url.substring(7,url.indexOf("."))
	if(host=="www"){
			if(folder==""){
				return "http://www.iecity.com/" + cityEn + "/"	
			}else{
				return "http://www.iecity.com/" + cityEn + "/" + folder + "/"	
			}
	}else{
			if(folder==""){
				return "http://"+cityEn+".iecity.com/"	
			}else{
				return "http://"+cityEn+"."+folder+".iecity.com/"
			}
	}
}

function LifeLink(id){
	return "Detail" + ChrCode(id,4) + ".html"	
}

function BusLink(id){
	return "Detail" + ChrCode(id,2) + ".html"	
}

function radioValue(o){
	for(var i=0;i<o.length;i++){
		if(o[i].checked){
			return o[i].value	
		}	
	}
}

function $(){
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }
  return elements;
}

function DW(s){
	document.write(s);	
}

function changeItem(id,i,n,classname){
	for(x=1;x<=n;x++){
		if(x==i){
			document.getElementById(id+i).className = classname + "Focus"
			try{
			document.getElementById(id+"Body"+i).className = "DisplayShow"
			}catch(e){}
		}else{
			document.getElementById(id+x).className = classname + "Blur"
			try{
			document.getElementById(id+"Body"+x).className = "DisplayNone"
			}catch(e){}
		}
	}
}

var flag=false; 
function DrawImage(ImgD,MaxWidth,MaxHeight){ 
	var image=new Image(); 
	//var MaxWidth = 120
	//var MaxHeight = 120
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width/image.height>= MaxWidth/MaxHeight){ 
			if(image.width>MaxWidth){
				ImgD.width=MaxWidth; 
				ImgD.height=(image.height*MaxWidth)/image.width; 
			}else{ 
				ImgD.width=image.width;
				ImgD.height=image.height; 
			} 
			//ImgD.alt=image.width+"x"+image.height; 
		} 
		else{ 
			if(image.height>MaxHeight){
			ImgD.height=MaxHeight; 
			ImgD.width=(image.width*MaxHeight)/image.height; 
			}else{ 
			ImgD.width=image.width;
			ImgD.height=image.height; 
			} 
			//ImgD.alt=image.width+"x"+image.height; 
		} 
	}
}

function startmarquee(lh,speed,delay,index){ 
	var t; 
	var p=false; 
	var o=document.getElementById("marqueebox"+index); 
	o.innerHTML+=o.innerHTML; 
	o.onmouseover=function(){p=true} 
	o.onmouseout=function(){p=false} 
	o.scrollTop = 0;
	function start(){ 
		t=setInterval(scrolling,speed); 
		if(!p) o.scrollTop += 2; 
	} 
	function scrolling(){ 
		if(o.scrollTop%lh!=0){ 
		o.scrollTop += 2; 
		if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0; 
		}else{ 
		clearInterval(t); 
		setTimeout(start,delay); 
		} 
	} 
	setTimeout(start,delay); 
}
//<div id="marqueebox0"></div>
//startmarquee(126,60,2000,0);
//startmarquee(一次滚动高度,速度,停留时间,图层标记); 

function copyToClipBoard(urlString){
	var clipBoardContent=urlString;
	window.clipboardData.setData("Text",clipBoardContent); 
	alert("复制成功");
}

function outputalert(id,s){
	document.write("<div id='a"+id+"' class='ClewBlur'>"+s+"</div><div id='s"+id+"' class='ClewFocus' style='display:none'></div>")	
}


function drawDateInput(n){
	var i;
	var oDate = new Date();
	if(n=="") return;
	var strHTML = "<select name=\""+n+"\" id=\""+n+"\" onChange=\"chkDate('"+n+"')\">\n";
	for(i=oDate.getYear()+3;i>1950;i--)
		strHTML += "<option value=\""+i+"\" "+(i==oDate.getYear()?"selected":"")+">"+i+"</option>\n";
	strHTML += "</select>年";
	strHTML += "<select name=\""+n+"\" id=\""+n+"\" onChange=\"chkDate('"+n+"')\">\n";
	for(i=1;i<13;i++)
		strHTML += "<option value=\""+i+"\" "+(i==oDate.getMonth()+1?"selected":"")+">"+i+"</option>\n";
	strHTML += "</select>月";
	strHTML += "<select name=\""+n+"\" id=\""+n+"\" onLoad=\"chkDate('"+n+"')\">\n";
	for(i=1;i<32;i++)
		strHTML += "<option value=\""+i+"\" "+(i==oDate.getDate()?"selected":"")+">"+i+"</option>\n";
	strHTML += "</select>日";
	strHTML += "<script language=javascript>chkDate('"+n+"')</script>";
	document.write(strHTML);
}

function chkDate(n){
	var oDateInput = document.all[n]
	if(!oDateInput) return;
	var nYear = parseInt(document.all[n][0].value);
	var nMonth = parseInt(document.all[n][1].value);
	var nDate = parseInt(document.all[n][2].value);
	var oDate2 = new Date(nYear,nMonth-1,1);
	var oDate1 = new Date(nYear,nMonth-1,1);
	oDate2.setMonth(oDate2.getMonth()+1);
	var iDayOfMonth = (oDate2-oDate1)/24/3600000;
	oDateInput[2].length=0;
	for(var i=1;i<iDayOfMonth+1;i++){
		oDateInput[2].length++;
		oDateInput[2].options[i-1].text=i;
		oDateInput[2].options[i-1].value=i;
		if(nDate==i) oDateInput[2].options[i-1].selected=true;
	}
}


/*
 * GB2312转UTF8
 * 例：
 * var xx=new GB2312UTF8();
 * var Utf8=xx.Gb2312ToUtf8("你aaa好aaaaa");
 * var Gb2312=xx.Utf8ToGb2312(Utf8);
 * alert(Gb2312);
 */

function GB2312UTF8(){
  this.Dig2Dec=function(s){
      var retV = 0;
      if(s.length == 4){
          for(var i = 0; i < 4; i ++){
              retV += eval(s.charAt(i)) * Math.pow(2, 3 - i);
          }
          return retV;
      }
      return -1;
  } 
  this.Hex2Utf8=function(s){
     var retS = "";
     var tempS = "";
     var ss = "";
     if(s.length == 16){
         tempS = "1110" + s.substring(0, 4);
         tempS += "10" +  s.substring(4, 10); 
         tempS += "10" + s.substring(10,16); 
         var sss = "0123456789ABCDEF";
         for(var i = 0; i < 3; i ++){
            retS += "%";
            ss = tempS.substring(i * 8, (eval(i)+1)*8);
            retS += sss.charAt(this.Dig2Dec(ss.substring(0,4)));
            retS += sss.charAt(this.Dig2Dec(ss.substring(4,8)));
         }
         return retS;
     }
     return "";
  } 
  this.Dec2Dig=function(n1){
      var s = "";
      var n2 = 0;
      for(var i = 0; i < 4; i++){
         n2 = Math.pow(2,3 - i);
         if(n1 >= n2){
            s += '1';
            n1 = n1 - n2;
          }
         else
          s += '0';
      }
      return s;      
  }

  this.Str2Hex=function(s){
      var c = "";
      var n;
      var ss = "0123456789ABCDEF";
      var digS = "";
      for(var i = 0; i < s.length; i ++){
         c = s.charAt(i);
         n = ss.indexOf(c);
         digS += this.Dec2Dig(eval(n));
      }
      return digS;
  }
  this.Gb2312ToUtf8=function(s1){
    var s = escape(s1);
    var sa = s.split("%");
    var retV ="";
    if(sa[0] != ""){
      retV = sa[0];
    }
    for(var i = 1; i < sa.length; i ++){
      if(sa[i].substring(0,1) == "u"){
        retV += this.Hex2Utf8(this.Str2Hex(sa[i].substring(1,5)));
  if(sa[i].length){
    retV += sa[i].substring(5);
  }
      }
      else{
     retV += unescape("%" + sa[i]);
  if(sa[i].length){
    retV += sa[i].substring(5);
  }
   }
    }
    return retV;
  }
  this.Utf8ToGb2312=function(str1){
        var substr = "";
        var a = "";
        var b = "";
        var c = "";
        var i = -1;
        i = str1.indexOf("%");
        if(i==-1){
          return str1;
        }
        while(i!= -1){
    if(i<3){
                substr = substr + str1.substr(0,i-1);
                str1 = str1.substr(i+1,str1.length-i);
                a = str1.substr(0,2);
                str1 = str1.substr(2,str1.length - 2);
                if(parseInt("0x" + a) & 0x80 == 0){
                  substr = substr + String.fromCharCode(parseInt("0x" + a));
                }
                else if(parseInt("0x" + a) & 0xE0 == 0xC0){ //two byte
                        b = str1.substr(1,2);
                        str1 = str1.substr(3,str1.length - 3);
                        var widechar = (parseInt("0x" + a) & 0x1F) << 6;
                        widechar = widechar | (parseInt("0x" + b) & 0x3F);
                        substr = substr + String.fromCharCode(widechar);
                }
                else{
                        b = str1.substr(1,2);
                        str1 = str1.substr(3,str1.length - 3);
                        c = str1.substr(1,2);
                        str1 = str1.substr(3,str1.length - 3);
                        var widechar = (parseInt("0x" + a) & 0x0F) << 12;
                        widechar = widechar | ((parseInt("0x" + b) & 0x3F) << 6);
                        widechar = widechar | (parseInt("0x" + c) & 0x3F);
                        substr = substr + String.fromCharCode(widechar);
                }
     }
     else {
      substr = substr + str1.substring(0,i);
      str1= str1.substring(i);
     }
              i = str1.indexOf("%");
        }

        return substr+str1;
  }
}




function sAlert(str,msgw,msgh,titleName){
	//var msgw,msgh,bordercolor;

	//msgw=400;//提示窗口的宽度
	//msgh=100;//提示窗口的高度
	//titleheight=25 //提示窗口标题高度
	bordercolor="#6BC0E4";//提示窗口的边框颜色
	//titlecolor="#99CCFF";//提示窗口的标题颜色
	
	var sWidth,sHeight;
	sWidth=document.body.scrollWidth;
	sHeight=document.body.scrollHeight;//screen.height;
	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv');
	bgObj.style.position="absolute";
	bgObj.style.top="0";
	bgObj.style.background="#777";
	bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75)";
	bgObj.style.opacity="0.6";
	bgObj.style.left="0";
	bgObj.style.width=sWidth + "px";
	bgObj.style.height=sHeight + "px";
	bgObj.style.zIndex = "10000";
	document.body.appendChild(bgObj);
	
	var msgObj=document.createElement("div")
	msgObj.setAttribute("id","msgDiv");
	msgObj.setAttribute("align","center");
	msgObj.style.background	= "white";
	msgObj.style.border		="1px solid " + bordercolor;
	msgObj.style.position 	= "absolute";
	msgObj.style.left 		= "50%";
	msgObj.style.top 		= "50%";
	msgObj.style.font		= "12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
	msgObj.style.marginLeft = -msgw/2 + "px" ;
	msgObj.style.marginTop 	= -msgh/2 + document.body.scrollTop+"px";
	msgObj.style.width 		= msgw + "px";
	msgObj.style.height 	= msgh + "px";
	msgObj.style.textAlign 	= "center";
	msgObj.style.lineHeight = "25px";
	msgObj.style.zIndex 	= "10001";
	msgObj.style.padding	= "1px"
	
	var title=document.createElement("h4");
	title.setAttribute("id","msgTitle");
	title.setAttribute("align","left");
	title.style.margin		= "0px";
	title.style.padding		= "5px";
	title.style.backgroundImage	= "url(/Images/OuterBG1.jpg)";
	//title.style.backgroundColor	= bordercolor;
	title.style.filter		= "progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
	title.style.opacity		= "0.75";
	title.style.border		= "0px solid " + bordercolor;
	title.style.height		= "25px";
	title.style.font		= "12px Verdana, Geneva, Arial, Helvetica, sans-serif";
	title.style.color		= "white";
	title.style.cursor		= "pointer";
	title.innerHTML			= "<SPAN style='float:right;'>关闭</SPAN><SPAN style='font-weight:bold;'>"+titleName+"</SPAN>";
	title.onclick=function(){
		 document.body.removeChild(bgObj);
		 document.getElementById("msgDiv").removeChild(title);
		 document.body.removeChild(msgObj);
	}
	document.body.appendChild(msgObj);
	document.getElementById("msgDiv").appendChild(title);
	var txt=document.createElement("p");
	txt.style.margin="0px 0px 0px 0px"//"1em 0"
	txt.setAttribute("id","msgTxt");
	txt.innerHTML= '<iframe src=' +str +' name="msgdiv_v_if" width="100%" height="'+msgh+'" scrolling="No" frameborder="0" id="msgdiv_v_if"></iframe>';
	document.getElementById("msgDiv").appendChild(txt);
}

String.prototype.trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, '');
}

function ChrCode(s,n){
	s = s.trim();
	var CC = "";
	var i ;
	var ss ;
	var str ;
	switch (n) {
	   case 0 :
			for(i=0;i<s.length;i++){
				str = s.substring(i,i+1)
				execScript("ChrCodeA = ASC('"+str+"')","vbscript");
				if(ChrCodeA<0){
					CC = CC +"b"+ -ChrCodeA
				}else{
					CC = CC +"a"+ ChrCodeA
				}
			}
			return CC
			
	   case 1 :
			s = s.replace("b","a-")
			ss = s.split("a")
			for(i=1;i<ss.length;i++){
				str = ss[i];
				execScript("ChrCodeA = Chr("+str+")","vbscript");
				CC = CC + ChrCodeA
			}
		   return CC
		   
		case 2 :
			for(i=0;i<s.length;i++){
				str = s.substring(i,i+1);
				execScript("ChrCodeB = Hex(ASC('"+str+"'))","vbscript");
				ChrCodeA = addzero(ChrCodeB,4);
				CC = CC + ChrCodeA;
			}
			return CC
			
		case 3 :
			for(i=0;i<s.length;i=i+4){
				str = s.substring(i,i+4);
				execScript("ChrCodeB = Chr(CLng('&H"+str+"'))","vbscript");
				CC = CC + ChrCodeB ;
			}
			return CC
			
		case 4 :
			for(i=0;i<s.length;i++){
			  CC += s.charCodeAt(i)
			}
			return CC
			
		case 5 :
			for(i=0;i<s.length;i=i+2){
			  CC += String.fromCharCode(s.substring(i,i+2))
			}
			return CC
			
	} 		
}


function addzero(fstring,xxx){
	var i;
	if(fstring.length<xxx){
		var aa = ""
		for(i=0;i<xxx-fstring.length;i++){
				aa = aa + "0" ;
		}
		aa = aa + fstring ;
		return aa
	}else{
		return fstring	
	}	
	
}




//====base64==================================================

var Base64keyStr = "ABCDEFGHIJKLMNOP" +
			"QRSTUVWXYZabcdef" +
			"ghijklmnopqrstuv" +
			"wxyz0123456789+/" +
			"=";

function encode64(input) {
	var output = "";
	var chr1, chr2, chr3 = "";
	var enc1, enc2, enc3, enc4 = "";
	var i = 0;

	do {
		chr1 = input.charCodeAt(i++);
		chr2 = input.charCodeAt(i++);
		chr3 = input.charCodeAt(i++);
		
		enc1 = chr1 >> 2;
		enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
		enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
		enc4 = chr3 & 63;
		
		if (isNaN(chr2)) {
			enc3 = enc4 = 64;
		} else if (isNaN(chr3)) {
			enc4 = 64;
		}
	
		output = output + 
		Base64keyStr.charAt(enc1) + 
		Base64keyStr.charAt(enc2) + 
		Base64keyStr.charAt(enc3) + 
		Base64keyStr.charAt(enc4);
		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";
	} while (i < input.length);
	
	output = output.replace("==","TrAvEl");
	output = output.replace("=","HoTeL");
	
	return output;
}

function decode64(input) {
	
	input = input.replace("TrAvEl","==");
	input = input.replace("HoTeL","=");
	
	var output = "";
	var chr1, chr2, chr3 = "";
	var enc1, enc2, enc3, enc4 = "";
	var i = 0;
	
	// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
	var base64test = /[^A-Za-z0-9\+\/\=]/g;
	if (base64test.exec(input)) {
	alert("There were invalid base64 characters in the input text.\n" +
	"Valid base64 characters are A-Z, a-z, 0-9, '+', '/', and '='\n" +
	"Expect errors in decoding.");
	}
	input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	
	do {
		enc1 = Base64keyStr.indexOf(input.charAt(i++));
		enc2 = Base64keyStr.indexOf(input.charAt(i++));
		enc3 = Base64keyStr.indexOf(input.charAt(i++));
		enc4 = Base64keyStr.indexOf(input.charAt(i++));
		
		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;
		
		output = output + String.fromCharCode(chr1);
		
		if (enc3 != 64) {
			output = output + String.fromCharCode(chr2);
		}
		if (enc4 != 64) {
			output = output + String.fromCharCode(chr3);
		}
		
		chr1 = chr2 = chr3 = "";
		enc1 = enc2 = enc3 = enc4 = "";
		
	} while (i < input.length);
	
	return output;
}

var __keys__ = [[0, 2, 1, 2, 8, 9, 4, 1, 7, 2, 5, 3, 9], [0, 3, 2, 2, 9, 5, 8, 2, 6, 8, 4, 6, 3], [1, 5, 2, 7, 1, 4, 7, 2, 4, 1, 4, 3, 0], [0, 7, 8, 3, 4, 9, 0, 6, 7, 7, 4, 4, 2], [0, 2, 1, 8, 4, 9, 3, 2, 3, 1, 5, 7, 8], [0, 0, 9, 5, 4, 7, 3, 0, 8, 7, 5, 2, 8], [0, 1, 5, 1, 1, 8, 2, 7, 1, 9, 1, 3, 5], [0, 5, 2, 5, 6, 0, 3, 4, 6, 7, 1, 3, 5], [1, 3, 2, 1, 8, 1, 8, 3, 7, 9, 2, 7, 0], [1, 2, 7, 7, 4, 3, 1, 5, 5, 0, 6, 4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, 5, 4, 8, 0, 9, 7, 8, 0, 1, 8], [1, 7, 9, 9, 0, 4, 5, 7, 2, 9, 0, 1, 9], [0, 6, 6, 5, 6, 7, 0, 4, 0, 7, 8, 5, 1], [0, 6, 0, 6, 3, 1, 1, 5, 0, 9, 2, 2, 3], [1, 6, 3, 5, 6, 7, 1, 6, 6, 9, 7, 4, 9], [0, 9, 5, 9, 8, 2, 4, 3, 3, 2, 3, 5, 6], [0, 1, 6, 3, 8, 9, 9, 2, 8, 2, 5, 8, 6], [1, 4, 7, 6, 6, 5, 7, 3, 3, 3, 4, 1, 1], [1, 8, 2, 9, 0, 3, 8, 6, 8, 3, 3, 7, 3], [0, 2, 8, 4, 8, 5, 4, 8, 9, 5, 0, 5, 7]]; 
function getDecodeCoordinate(enLonLat) {
     //取编码坐标的后4位字符
     var last4cha = enLonLat.substring(enLonLat.length - 4, enLonLat.length);
     //将后4位字符转成对应的ASCII值
     var last4asc = [];
     for (var i = 0; i < last4cha.length; i++) {
      last4asc.push(last4cha.charCodeAt(i));
     }
     //取4个数值的后两位，组成一个新的8位数字，代表key所在的索引值
     var keyposition = 0;
     keyposition |= last4asc[0] & 3;
     keyposition |= (last4asc[1] & 3) << 2;
     keyposition |= (last4asc[2] & 3) << 4;
     keyposition |= (last4asc[3] & 3) << 6;
     //根据索引值取对应的key，key是一个长度为13的数组
     var keys = __keys__[keyposition];
     //取编码坐标的去掉最后4位的所有字符
     var lonlat = enLonLat.substring(0, enLonLat.length - 4);
     //将所有字符转成对应的ASCII值
     var lonlatasc = [];
     for (var i = 0; i < lonlat.length; i++) {
      lonlatasc.push(lonlat.charCodeAt(i));
     }
     //根据key的第一位。。。
     var key1 = keys[0];
     var fixed = 0;
     switch (key1) {
       case 0:
      fixed = 23;
      break;
       case 1:
      fixed = 53;
      break;
     }
     //将所有的asc值进行处理
     for (var i = 0; i < lonlatasc.length; i++) {
      lonlatasc[i] -= fixed;
      lonlatasc[i] -= keys[i + 1];
     }
     //将处理后的asc值转成对应的asc码
     var lonlatcha = [];
     for (var j = 0; j < lonlatasc.length; j++) {
      lonlatcha.push(String.fromCharCode(lonlatasc[j]));
     }
     var deLonLat = lonlatcha.join("");
     return deLonLat;
}

function getEncodeCoordinate(MrY) {
    var xGH = 256;
    var AaZ = __keys__;
    var AtF = 13;
    var Cwv = parseInt(Math.random() * xGH);
    var FEf = AaZ[Cwv];
    var wcW = "" + MrY;
    var UZO = new Array();
    for (var i = 0; i < wcW.length; i++) {
        UZO.push(wcW.charCodeAt(i));
    }
    var InJ = FEf[0];
    var KvR = 0;
    switch (InJ) {
      case 0:
        KvR = 23;
        break;
      case 1:
        KvR = 53;
        break;
    }
    nHl = UZO.length;
    var i = 0;
    var eag = "";
    for (i = 0; i < UZO.length && i < FEf.length - 2; i++) {
        UZO[i] += (parseInt(FEf[i + 1]) + parseInt(KvR));
        eag += String.fromCharCode(UZO[i]);
    }
    var mhc = new Array(4);
    for (var i = 0; i < mhc.length; i++) {
        mhc[i] = (Math.random() * 10);
        mhc[i] += 70;
        mhc[i] = mhc[i] >> 2;
        mhc[i] = mhc[i] << 2;
    }
    mhc[0] = mhc[0] | Cwv & 3;
    mhc[1] = mhc[1] | (Cwv & 12) >> 2;
    mhc[2] = mhc[2] | (Cwv & 48) >> 4;
    mhc[3] = mhc[3] | (Cwv & 192) >> 6;
    eag += String.fromCharCode(mhc[0], mhc[1], mhc[2], mhc[3]);
    return eag;
}


//===============================================================


function updateInfo(content){
	strA = "content=" + escape(content) ;
	var http = new ActiveXObject("Microsoft.XMLHTTP");
	http.open("POST","/script/infoupdate.asp" ,false);
	http.setRequestHeader("Content-Length",strA.length); 
	http.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
	http.send(strA);
}


function updateDigiInfo(pguid,name,citycode,city,address,tel,type,gridcode,url,timestamp,z,srctype,y,x){
	arg = "pguid="+pguid+"&name="+name+"&citycode="+citycode+"&city="+city+"&address="+address+"&tel="+tel+"&type="+type+"&gridcode="+gridcode+"&url="+url+"&timestamp="+timestamp+"&match="+z+"&srctype="+srctype+"&y="+y+"&x="+x
	var http = new ActiveXObject("Microsoft.XMLHTTP");
	http.open("GET","/script/lifeupdate.asp?" + arg ,false);
	http.send();
}

function updateDigiBus(line_id,name,key_name,company,front_name,terminal_name,start_time,end_time,basic_price,length,city){
	arg = "line_id="+line_id+"&name="+name+"&key_name="+key_name+"&company="+company+"&front_name="+front_name+"&terminal_name="+terminal_name+"&start_time="+start_time+"&end_time="+end_time+"&basic_price="+basic_price+"&length="+length+"&city="+city
	var http = new ActiveXObject("Microsoft.XMLHTTP");
	http.open("GET","/script/busupdate.asp?" + arg ,false);
	http.send();
}

function updateDigiLog(t1,t2,city,kind){
	arg = "t1="+t1+"&t2="+t2+"&city="+city+"&kind="+kind
	var http = new ActiveXObject("Microsoft.XMLHTTP");
	http.open("GET","/script/logupdate.asp?" + arg ,false);
	http.send();
}

function lifeSearch(citycode,keyword,dataType,center,centerX,centerY,page,perpage){
	var range 			= 50
	var mls 			= new MLocalSearch();
	var mlsp			= new MLocalSearchOptions();
	mlsp.recordsPerPage = perpage ;
	mlsp.range = range * 1000 ;
	mlsp.naviFlag = 1
	mlsp.pageNum = page
	
	if(dataType!=""){
	mlsp.dataType = dataType
	}

	mls.setCallbackFunction(myfunclifeSearch);

	var Ucitycode = city.ctn2c(citycode);
	
	if(centerX!="" && centerY!=""){
		var centerXY = new MLngLat(centerX,centerY)
		mls.poiSearchByCenterXY(centerXY,keyword,Ucitycode,mlsp)
	}else if(center!=""){
		mls.poiSearchByCenterKeywords(center,keyword,Ucitycode,mlsp)
	}else{
		mls.poiSearchByKeywords(keyword,Ucitycode,mlsp);
	}
	
}

function myfunclifeSearch(data){//查询方法的回调函数
	var content = ""
	for (var i = 0; i < data.poilist.length; i++) {
		var  pguid		= data.poilist[i].pguid
		var  name		= data.poilist[i].name
		var  citycode1	= data.poilist[i].citycode
		var  city1		= city.ctc2n( data.poilist[i].citycode )
		var  address	= data.poilist[i].address
		var  tel		= data.poilist[i].tel
		var  type		= data.poilist[i].type
		var  gridcode	= data.poilist[i].gridcode
		var  url		= data.poilist[i].url
		var  timestamp	= data.poilist[i].timestamp
		var  z			= data.poilist[i].match
		var  srctype	= data.poilist[i].srctype
		var  y			= getDecodeCoordinate(data.poilist[i].y)
		var  x	  		= getDecodeCoordinate(data.poilist[i].x)
		//updateDigiInfo(pguid,name,citycode1,city1,address,tel,type,gridcode,url,timestamp,z,srctype,y,x)
		content += pguid+"|"+name+"|"+citycode1+"|"+city1+"|"+address+"|"+tel+"|"+type+"|"+gridcode+"|"+url+"|"+timestamp+"|"+z+"|"+srctype+"|"+y+"|"+x + "\n"
	}
	
	//alert(content)
	
	updateInfo(content)
}

function ClearRepeat(s,s1){
	var ss = s.split(",")
	if(ss[0] == ss[1]){
		return ss[0]
	}else{
		return ss[0] + s1 + ss[1]
	}
}

function showWeather(weatherInfo){
	if(typeof(weatherInfo)=="string"){
		aWeather = weatherInfo.split("|")
		var sWeather = ""
		var myDate = new Date();
		if(myDate.getHours()>17 || myDate.getHours()<1){
			WP = aWeather[1].split(",")[1]
		}else{
			WP = aWeather[1].split(",")[0]
		}
		sWeather += "<ul id='weather'><li class='weather0'>"
		sWeather += "<img src='/Images/Weather/50/"+WP+".png'> "
		sWeather += "</li>"
		sWeather += "<li class='weather1'>"+ClearRepeat(aWeather[2],"转")+"</li>"
		sWeather += "<li class='weather2'><font color=#990000>"+aWeather[3].split(",")[0]+"℃</font> - <font color=#000066>"+aWeather[3].split(",")[1]+"℃</font></li>"
		sWeather += "<li class='weather3'>"+ClearRepeat(aWeather[4],"转")+"</li>"
		sWeather += "</ul>"
		return sWeather
	}else{
		return ""	
	}
}

//日历
var date_start,date_end,g_object
var today = new Date();
var separator="-";
var inover=false;

//mode :时间变换的类型0-年 1-月 2-直接选择月
function change_date(temp,mode)
{
 var t_month,t_year
    if (mode){
        if(mode==1)
        t_month=parseInt(cele_date_month.value,10)+parseInt(temp,10);
        else
        t_month=parseInt(temp)
        if (t_month<cele_date_month.options(0).text) {
            cele_date_month.value=cele_date_month.options(cele_date_month.length-1).text;
            change_date(parseInt(cele_date_year.value,10)-1,0);
            }
        else{
            if (t_month>cele_date_month.options(cele_date_month.length-1).text){
                cele_date_month.value=cele_date_month.options(0).text;
                change_date(parseInt(cele_date_year.value,10)+1,0);
                }            
            else
                {cele_date_month.value=t_month;
                 set_cele_date(cele_date_year.value,cele_date_month.value);                
                }
        }
    }  
    else{
        t_year=parseInt(temp,10);
        
        if (t_year<cele_date_year.options(0).text) {
            cele_date_year.value=cele_date_year.options(0).text;
            set_cele_date(cele_date_year.value,1);                
            }
        else{
            if (parseInt(t_year,10)>parseInt(cele_date_year.options(cele_date_year.length-1).text,10)){
                cele_date_year.value=cele_date_year.options(cele_date_year.length-1).text;
                set_cele_date(cele_date_year.value,12);                
                }            
            else
                {cele_date_year.value=t_year;
                 set_cele_date(cele_date_year.value,cele_date_month.value);                
                }
        }
    }
    /*********2002-02-01 MODIFY BY WING **************/
    window.cele_date.focus();
    /****************MODIFY END***********************/
}

//初始化日历
function init(d_start,d_end)
{
     var temp_str;
     var i=0
     var j=0
     date_start=new Date(1980,7,1)
     date_end=new Date(2004,8,1)
     document.writeln("<div name=\"cele_date\" id=\"cele_date\"  style=\"display:none\"    style=\"LEFT: 69px; POSITION: absolute; TOP: 159px;Z-INDEX:99\" onClick=\"event.cancelBubble=true;\" onBlur=\"hilayer()\" onMouseout=\"lostlayerfocus()\">-</div>");
     window.cele_date.innerHTML="";
     temp_str="<table border=\"1\" bgcolor=\"#DDDDDD\" bordercolor=\"white\"><tr><td colspan=7 onmouseover=\"overcolor(this)\">";
     temp_str+="<input type=\"Button\" value=\"<<\" onclick=\"change_date(-1,1)\" onmouseover=\"getlayerfocus()\" style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">-";

     temp_str+=""
     temp_str+="<select name=\"cele_date_year\" id=\"cele_date_year\" language=\"javascript\" onchange=\"change_date(this.value,0)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">"

     for (i=1900;i<=2020;i++)
     {
      temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>";
     }
     temp_str+="</select>-";
     temp_str+=""
     temp_str+="<select name=\"cele_date_month\" id=\"cele_date_month\" language=\"javascript\" onchange=\"change_date(this.value,2)\" onmouseover=\"getlayerfocus()\" onblur=\"getlayerfocus()\" style=\"font-size: 9pt; border: 1px #666666 outset; background-color: #F4F8FB\">"

     for (i=1;i<=12;i++)
     {
      temp_str+="<OPTION value=\""+i.toString()+"\">"+i.toString()+"</OPTION>";
     }
     temp_str+="</select>-";
     temp_str+=""
     temp_str+="<input type=\"Button\" value=\">>\" onclick=\"change_date(1,1)\" onmouseover=\"getlayerfocus()\"  style=\"color: #000099; background-color: #BFBFBF; cursor: hand\">";

     temp_str+="</td></tr><tr><td onmouseover=\"overcolor(this)\">"
     temp_str+="<font color=red>日</font></td><td>";temp_str+="一</td><td>"; temp_str+="二</td><td>"; temp_str+="三</td><td>"
     temp_str+="四</td><td>";temp_str+="五</td><td>"; temp_str+="六</td></tr>";
     for (i=1 ;i<=6 ;i++)
     {
     temp_str+="<tr>";
        for(j=1;j<=7;j++){
            temp_str+="<td name=\"c"+i+"_"+j+"\"id=\"c"+i+"_"+j+"\" style=\"CURSOR: hand\" style=\"COLOR:#000000\" language=\"javascript\" onmouseover=\"overcolor(this)\" onmouseout=\"outcolor(this)\" onclick=\"td_click(this)\">?</td>"
            }
     temp_str+="</tr>"        
     }
     temp_str+="</td></tr></table>";
     window.cele_date.innerHTML=temp_str;
}
function set_cele_date(year,month)
{
   var i,j,p,k
   var nd=new Date(year,month-1,1);
   event.cancelBubble=true;
   cele_date_year.value=year;
   cele_date_month.value=month;   
   k=nd.getDay()-1
   var temp;
   for (i=1;i<=6;i++)
      for(j=1;j<=7;j++)
      {
      eval("c"+i+"_"+j+".innerHTML=\"\"");
      eval("c"+i+"_"+j+".bgColor=\"#DDDDDD\"");
      eval("c"+i+"_"+j+".style.cursor=\"hand\"");
      }
   while(month-1==nd.getMonth())
    { j=(nd.getDay() +1);
      p=parseInt((nd.getDate()+k) / 7)+1;
      eval("c"+p+"_"+j+".innerHTML="+"\""+nd.getDate()+"\"");
      if ((nd.getDate()==today.getDate())&&(cele_date_month.value==today.getMonth()+1)&&(cele_date_year.value==today.getYear())){
        eval("c"+p+"_"+j+".bgColor=\"#EFFB64\"");
      }
      if (nd>date_end || nd<date_start)
      {
      eval("c"+p+"_"+j+".bgColor=\"#FF9999\"");
      eval("c"+p+"_"+j+".style.cursor=\"text\"");
      }
      nd=new Date(nd.valueOf() + 86400000)
    }
}

//s_object：点击的对象；d_start-d_end有效的时间区段；需要存放值的控件；
function show_cele_date(eP,d_start,d_end,t_object)
{
window.cele_date.style.display="";
window.cele_date.style.zIndex=99
var s,cur_d
var eT = eP.offsetTop;  
var eH = eP.offsetHeight+eT;  
var dH = window.cele_date.style.pixelHeight;  
var sT = document.body.scrollTop; 
var sL = document.body.scrollLeft; 
event.cancelBubble=true;
window.cele_date.style.posLeft = event.clientX-event.offsetX+sL-5;  
window.cele_date.style.posTop = event.clientY-event.offsetY+eH+sT-5;
if (window.cele_date.style.posLeft+window.cele_date.clientWidth>document.body.clientWidth) window.cele_date.style.posLeft+=eP.offsetWidth-window.cele_date.clientWidth;
if (d_start!=""){
    if (d_start=="today"){
        date_start=new Date(today.getYear(),today.getMonth(),today.getDate());
    }else{
        s=d_start.split(separator);
        date_start=new Date(s[0],s[1]-1,s[2]);
    }
}else{
    date_start=new Date(1900,1,1);
}

if (d_end!=""){
    s=d_end.split(separator);
    date_end=new Date(s[0],s[1]-1,s[2]);
}else{
    date_end=new Date(3000,1,1);
}

g_object=t_object

cur_d=new Date()
set_cele_date(cur_d.getYear(),cur_d.getMonth()+1);
window.cele_date.style.display="block";

window.cele_date.focus();

}

function td_click(t_object)
{
var t_d
if (parseInt(t_object.innerHTML,10)>=1 && parseInt(t_object.innerHTML,10)<=31 ) 
{ t_d=new Date(cele_date_year.value,cele_date_month.value-1,t_object.innerHTML)
if (t_d<=date_end && t_d>=date_start)
{
var year = cele_date_year.value;
var month = cele_date_month.value;
var day = t_object.innerHTML;
var d = new Date();
if (parseInt(month)<10) month = "0" + month;
if (parseInt(day)<10) day = "0" + day;

//可以修改这里改变输出样式：
//g_object.value=year+"年"+month+"月"+day+"日";
g_object.value=year+separator+month+separator+day;
window.cele_date.style.display="none";};
}

}
function h_cele_date()
{
window.cele_date.style.display="none";
}

function overcolor(obj)
{
  if (obj.style.cursor=="hand") obj.style.color = "#FF0000";

  inover=true;
  window.cele_date.focus();

}

function outcolor(obj)
{
 obj.style.color = "#000000";
 inover=false;

}

function getNow(o){
    var Stamp=new Date();
    var year = Stamp.getYear();
    var month = Stamp.getMonth()+1;
    var day = Stamp.getDate();
    if(month<10){
 month="0"+month;
    }
    if(day<10){
 day="0"+day;
    }
    o.value=year+separator+month+separator+day;
}

function hilayer()
{
 if (inover==false)
 {
  var lay=document.all.cele_date;
  lay.style.display="none";
 }
}
function getlayerfocus()
{
 inover=true;
}
function lostlayerfocus()
{
 inover=false;
}
init();
//日历结束



