﻿var isIE=/msie/.test(navigator.userAgent.toLowerCase());var show1,hide1;var isshowPri=false;function openLayer_city1(id,title,popname,showvalue,hidevalue){show1=showvalue;hide1=hidevalue;var popupDiv;if(document.getElementById(popname)!=null){document.getElementById(popname).style.display="";popupDiv=document.getElementById(popname)}else{popupDiv=document.createElement("div")}popupDiv.setAttribute("id",popname);popupDiv.style.width="150px";popupDiv.style.background="#fff";popupDiv.style.zIndex=99;popupDiv.style.position="absolute";var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();popupDiv.style.top=arrayPageScroll[1]+20+'px';popupDiv.style.left=(((arrayPageSize[0]-20-600-100)/2)+'px');var mybody=document.getElementById(id);insertAfter(popupDiv,mybody);var bodyBack_iframe;if(document.getElementById("bodybg_iframe")!=null){document.getElementById("bodybg_iframe").style.display="";bodyBack_iframe=document.getElementById("bodybg_iframe")}else{bodyBack_iframe=document.createElement("iframe");bodyBack_iframe.setAttribute("id","bodybg_iframe");bodyBack_iframe.style.width=document.body.clientWidth;bodyBack_iframe.style.height=(arrayPageSize[1]+35+'px');bodyBack_iframe.style.zIndex=98;bodyBack_iframe.style.position="absolute";bodyBack_iframe.style.top=0;bodyBack_iframe.style.left=0;bodyBack_iframe.style.filter="alpha(opacity=20)";bodyBack_iframe.style.opacity=0.2;bodyBack_iframe.style.frameborder=0;insertAfter(bodyBack_iframe,mybody)}var bodyBack;if(document.getElementById("bodybg")!=null){document.getElementById("bodybg").style.display="";bodyBack=document.getElementById("bodybg")}else{bodyBack=document.createElement("div");bodyBack.setAttribute("id","bodybg");bodyBack.style.width=document.body.clientWidth;bodyBack.style.height=(arrayPageSize[1]+35+'px');bodyBack.style.zIndex=98;bodyBack.style.position="absolute";bodyBack.style.top=0;bodyBack.style.left=0;bodyBack.style.filter="alpha(opacity=20)";bodyBack.style.opacity=0.2;bodyBack.style.background="#000";insertAfter(bodyBack,bodyBack_iframe)}popupDiv.innerHTML=addrHTML_city1(title,showvalue,hidevalue);init_check_city1(popname,showvalue,hidevalue);bind_baselay_event()}function addrHTML_city1(TITLE,showvalue,hidevalue){var CLOSE='<div class="winfr"><span ><img src="../FloatJs/image/winclose_t.gif" border="0" /></span></div>';var htmlDiv='';htmlDiv+='<div class="wino" id="m">';htmlDiv+='<div  class="wintit" onmousedown=mousedown(arguments[0])>';htmlDiv+='<div class="wintitxt">';htmlDiv+=TITLE;htmlDiv+='</div>';htmlDiv+='<div class="winfr"><span onclick=javascript:closeLayer(this.parentNode.parentNode.parentNode.parentNode);><img src="../FloatJs/image/winclose_t.gif" border="0" /></span></div>';htmlDiv+='</div>';htmlDiv+='<div class="wintip"><div class="wintipt">您当前选择的是：</div><div class="winfr"><input type="button" onclick="write_result_city1();closeLayer(this.parentNode.parentNode.parentNode.parentNode);" class="winbut" value="确 定"><input type="button" class="winbut" value="清 空" onclick=cleartips() ></div></div>';htmlDiv+='<div class="winsel">';htmlDiv+='<div id="tip" class="winselall"><span style="margin-left:10px;">您最多可以选择5个城市</span>';htmlDiv+='</div></div>';htmlDiv+='<div id="container" class="winarea"></div>';htmlDiv+='<div id="float_lay" class="winseco" style="display:none;"></div>';htmlDiv+='<div id="float_lay_2" class="winseco" style="display:none;"></div>';htmlDiv+='</div>';return htmlDiv}var containerID="container";var floatID="float_lay";var floatID_2="float_lay_2";function init_check_city1(popname,showvalue,hidevalue){_container=document.getElementById(containerID);_float=document.getElementById(floatID);_float.onmouseover=function(){this.style.display='block'};_float.onmouseout=function(){if(!isshowPri){this.style.display='none';_float_2.style.display='none'}};_selectCity=document.getElementById("tip");if(document.getElementById(hide1).value==""){_selectCity.innerHTML='<span style="margin-left:10px;">您最多可以选择5个城市</span>'}else{_selectCity.innerHTML="";var span=[],input=[];var hides=document.getElementById(hide1).value;var shows=document.getElementById(show1).value;var showsz=new Array();showsz=shows.split(",");var hidesz=new Array();hidesz=hides.split(",");var tipa=[];for(var i=0;i<hidesz.length;i++){if(showsz[i]!=null&&hidesz[i]!=null&&showsz[i]!=""){span[i]=document.createElement("div");tipa[i]=document.createElement("span");tipa[i].appendChild(document.createTextNode(showsz[i]));input[i]=document.createElement("input");input[i].type='checkbox';input[i].value=hidesz[i];input[i].id=hidesz[i];input[i].style.display='none';span[i].appendChild(input[i]);span[i].appendChild(tipa[i]);_selectCity.appendChild(span[i]);span[i].className='winselo';span[i].onclick=function(){var _input_m=_container.getElementsByTagName("input");for(var j=0;j<_input_m.length;j++)if(_input_m[j].value==this.children[0].value)_input_m[j].checked=false;_selectCity.removeChild(this)}}}}_mainCity=document.createElement("div");var div=[],h=[],input=[],span=[];var a=[],i=[];var haschildflag=false;_mainCity.id="main_city";for(var i=0;i<MainArray_city1.length;i++){span[i]=document.createElement("div");a[i]=document.createElement("span");a[i].appendChild(document.createTextNode(jb_city1[MainArray_city1[i]]));input[i]=document.createElement("input");input[i].type='checkbox';input[i].value=MainArray_city1[i];input[i].id=MainArray_city1[i];span[i].appendChild(input[i]);span[i].appendChild(a[i]);_container.appendChild(span[i]);haschildflag=cityhasnextdata(span[i].children[0].value);if(haschildflag){span[i].className='winareal'}else{span[i].className='winareal2'}span[i].onmouseover=function(){if(_float.className!='winseco'){_float.style.display='none'}if(_float.style.display=='none'){_float.style.left=this.offsetLeft+this.children[0].offsetWidth+this.children[1].offsetWidth;_float.style.top=this.offsetTop;if(cityhasnextdata(this.children[0].value)){_float.style.display='block';_float.className='winseco';createLay_city1(this.children[0].value,popname,showvalue,hidevalue)}}};span[i].onmouseout=function(){if(!isshowPri){_float.style.display='none'}}}check_in_select()}function createLay_city1(id,popname,showvalue,hidevalue){_float_2=document.getElementById(floatID_2);_float_2.onmouseover=function(){this.style.display='block';_float.style.display='block';isshowPri=true};_float_2.onmouseout=function(){this.style.display='none';_float.style.display='none';isshowPri=false};_float_2.style.display='none';var span=[],input=[],a=[];_float.innerHTML="";for(var i=1;i<1000;i++){var n="000"+i.toString();n=id+n.substring(n.length-3,n.length);if(jb_city1[n]!=null){span[i]=document.createElement("div");a[i]=document.createElement("span");a[i].appendChild(document.createTextNode(jb_city1[n]));input[i]=document.createElement("input");input[i].type='checkbox';input[i].value=n;input[i].id=n;span[i].appendChild(input[i]);span[i].appendChild(a[i]);_float.appendChild(span[i]);if(cityhasnextdata(span[i].children[0].value)){span[i].className="winsece"}else{span[i].className="winsecn"}span[i].onmouseover=function(evt){if(cityhasnextdata(this.children[0].value)){_float_2.style.left=this.parentElement.offsetLeft+this.offsetLeft-330;_float_2.style.top=this.parentElement.offsetTop+this.offsetTop-2;_float_2.style.display='block';_float_2.className='winseco';_float.style.display='block';createLay_city1_2(this.children[0].id,popname,showvalue,hidevalue)}};span[i].onmouseout=function(){}}}check_in_select();init_lay_event()}function createLay_city1_2(id,popname,showvalue,hidevalue){var span=[],input=[],a=[];_float_2.innerHTML="";for(var i=1;i<1000;i++){var n="000"+i.toString();n=id+n.substring(n.length-3,n.length);if(jb_city1[n]!=null){span[i]=document.createElement("div");a[i]=document.createElement("span");a[i].appendChild(document.createTextNode(jb_city1[n]));input[i]=document.createElement("input");input[i].type='checkbox';input[i].value=n;input[i].id=n;span[i].appendChild(input[i]);span[i].appendChild(a[i]);_float_2.appendChild(span[i]);span[i].className="winsecn";span[i].onmouseover=function(){};span[i].onmouseout=function(){}}}check_in_select_2();init_lay_event_2()}function write_result_city1(){document.getElementById(hide1).value="";document.getElementById(show1).value="";var _result=document.getElementById("tip");var _result_input=_result.getElementsByTagName("input");var _result_span=_result.getElementsByTagName("span");for(var i=0;i<_result_input.length;i++){document.getElementById(hide1).value+=_result_input[i].value+",";document.getElementById(show1).value+=_result_span[i].innerText+","}}function cleartips(){var _tipcontainer=document.getElementById("tip");var _result=_tipcontainer.getElementsByTagName("input");var main=_container.getElementsByTagName("input");var _f1=_float.getElementsByTagName("input");if(_float_2!=null)var _f2=_float_2.getElementsByTagName("input");for(var j=0;j<_result.length;j++){for(var i=0;i<main.length;i++){main[i].checked=false}for(var i=0;i<_f1.length;i++){_f1[i].checked=false}if(_f2!= null)for(var i=0;i<_f2.length;i++){_f2[i].checked=false}}_selectCity.innerHTML=''}function cityhasnextdata(value){var j=0;for(var i=1;i<1000;i++){var n="000"+i.toString();n=value+n.substring(n.length-3,n.length);if(jb_city1[n]!=null){if(++j>1)return true}}return false}
