<script type="text/javascript">
function ReceiveServerData(retVal)
{
var oFrag=document.createDocumentFragment();
if(retVal!=''&& retVal!=null){
var citys=retVal.split('|');
for(var i=0;i<citys.length;i++)
{
var ci=citys[i].split(';');
var vid=ci[1];
var chk = document.createElement("<input type=checkbox id='"+ci[0]+"'>");
if(document.getElementById('ctl00_ContentPlaceHolder1_txtContent').value.indexOf(ci[1])!=-1)
{
chk = document.createElement("<input type=checkbox id='"+ci[0]+"' checked>");
}else
{
chk = document.createElement("<input type=checkbox id='"+ci[0]+"'>");
}
chk.value = ci[1];
chk.title=ci[0];
chk.onclick = function()
{
showNewWin(this);
}
oFrag.appendChild(chk);
oFrag.appendChild(document.createTextNode(ci[1]));
}
}else
{
oFrag.appendChild(document.createTextNode("(*^_^*) 没有相关城市信息!"));
}
document.getElementById('div_checkBox').appendChild(oFrag);
}
function showNewWin(obj)
{
var selProvince=document.getElementById('ctl00_ContentPlaceHolder1_ddlProvince').options[document.getElementById('ctl00_ContentPlaceHolder1_ddlProvince').selectedIndex].value;
if(obj.checked)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtContent").value+=obj.value+";";
document.getElementById("ctl00_ContentPlaceHolder1_hdSelId").value+=selProvince+"|"+obj.title+";";
}else
{
var oldV=obj.value;
if(document.getElementById("ctl00_ContentPlaceHolder1_txtContent").value.indexOf(oldV+";")!=-1)
{
document.getElementById("ctl00_ContentPlaceHolder1_txtContent").value=document.getElementById("ctl00_ContentPlaceHolder1_txtContent").value.replace(obj.value+";","");
document.getElementById("ctl00_ContentPlaceHolder1_hdSelId").value=document.getElementById("ctl00_ContentPlaceHolder1_hdSelId").value.replace(selProvince+"|"+obj.title+";","");
}
}
}
</script>