function ShowCitys(swidth){
	document.body.style.height="100%";
	document.body.style.scroll="no";

	var bodyww=document.body.clientWidth;
	var bodyhh=document.body.clientHeight;
	var bodsww=screen.width;
	var bodshh=screen.height;
	if(bodyhh > bodshh) {var shieldHH=bodyhh;}else{var shieldHH=bodshh;}

	var shield = document.createElement("DIV");
    shield.id = "shield";
    shield.style.position = "absolute";
    shield.style.left = "0px";
    shield.style.top = "0px";
    shield.style.width = "100%";
    shield.style.height = shieldHH+"px";
    shield.style.background = "Gray";
    shield.style.textAlign = "center";
    shield.style.zIndex = "10000";
    shield['style']['filter'] = "alpha(opacity=50);";
    shield['style']['-moz-opacity'] = "0.50";
    shield['style']['opacity'] = "0.50";
    
    var alertFram = document.createElement("DIV");
    
    alertFram.id="alertFram";
    alertFram.style.position = "absolute";
        
    //负边界居中法,相对于shield层的底部时
    alertFram.style.width = ""+swidth+"px";
    alertFram.style.height = "100px";
    alertFram.style.background = "red";
    alertFram.style.textAlign = "left";
    alertFram.style.zIndex = "10002";
		
		var objhh=alertFram.clientHeight+8;
		var objww=alertFram.clientWidth+27;
    alertFram.style.top=(bodshh-objhh)/3+"px";
		alertFram.style.left=(bodsww-objww)/3+"px";
    
    strHtml="<div id=\"dialog\" style=\"z-index:200;padding:2px;margin:0;border:1px solid #CF4700;background:#FAB38E;width:"+swidth+"px;\">\n";
    strHtml+="<div style=\"background:#F47837 url(/images/dialog/TableTitleBG.gif) repeat-x;height:26px;line-height:26px;color: #ff0;text-align:right;cursor:move;\" id=\"stitle\" onmousedown=\"oMove(parentNode.parentNode);\"><a href=\"javascript:void(0);\" onclick=\"remove();\" style=\"margin-right:10px;color:#ff0;font-weight:bold;\">[关闭]</a></div>\n";
    strHtml+="<div style=\"background:#fff;padding:5px 10px;\" id=\"dialogBody\">\n";
    strHtml+="<div id=\"ScityBody\" style=\"border:1px solid #CCC;margin:5px 0;padding:4px;\"></div>\n";
    strHtml+="<div class=\"VNewsTab\" id=\"ScityTab\">\n";
    strHtml+="<ul>\n";
    strHtml+="<li><a href=\"javascript:void(0);\" onclick=\"showlist('ScityList','citylist.php?s=1');\">按省份选择</a></li>\n";
    strHtml+="<li><a href=\"javascript:void(0);\" onclick=\"showlist('ScityList','citylist.php?s=2');\">按字母选择</a></li>\n";
    strHtml+="</ul>\n";
    strHtml+="<div class=\"fclear\"></div>\n";
    strHtml+="</div>\n";
    strHtml+="<div id=\"ScityList\" style=\"border-top:1px solid #FED750;\"></div>\n";
    strHtml+="</div>\n";
    strHtml+="</div>\n";
   
    alertFram.innerHTML = strHtml;
    alertFram.focus();
    document.body.appendChild(alertFram);
    document.body.appendChild(shield);
    //showlist('ScityList','citylist.php?s=1');
    showlist('ScityBody','citybody.php');

    var c = 50;
    this.doAlpha = function(){
      if (c++ > 50){clearInterval(ad);return 0;}else{return 1;}
			shield['style']['filter'] = "alpha(opacity="+c+");";
      shield['style']['-moz-opacity'] = "0."+c;
			shield['style']['opacity'] = "0."+c;
    }
	this.remove=function(){
	  alertFram.innerHTML="";
		shield.style.filter = "";	
		shield.style.position = "";
		shield.style.left = "";
		shield.style.top = "";
		shield.style.width = "";
		shield.style.height ="";
		shield.style.background = "";
		shield.style.textAlign = "";
		shield.style.zIndex = "";
		shield.style.filter = "";
		shield.id = "";
		shield.style.display = "none";
		alertFram.style.position = "";
		alertFram.style.left = "";
		alertFram.style.top = "";
		alertFram.style.marginLeft = "";
		alertFram.style.marginTop = "";
		alertFram.style.width = "";
		alertFram.style.height = "";
		alertFram.style.background = "";
		alertFram.style.textAlign = "";
		alertFram.style.lineHeight = "";
		alertFram.style.zIndex = "";
		alertFram.id="";
		alertFram.style.display = "none";
		document.body.scroll="yes";
		document.body.onselectstart = function(){return true;};
	}
	var ad = setInterval("doAlpha()",10);
	alertFram.focus();
	document.body.onselectstart = function(){return false;};
}
function oMove(obj){
	var otop,oleft;
	if(!document.all)
	{
		oy = obj.pageY;
		ox = obj.pageX;
	}
	else
	{
		oy = event.y;
		ox = event.x;
	}
	otop = oy - obj.offsetTop;
	oleft = ox - obj.offsetLeft;
	
	obj.setCapture();
	obj.onmousemove = function()
	{
		if(!document.all){ 
			x = obj.pageX; 
			y = obj.pageY; 
		}
		else{ 
			x = event.x; 
			y = event.y; 
		}
		obj.style.left = x - oleft;
		obj.style.top = y - otop;
	}
	obj.onmouseup = function()
	{
		obj.onmousemove = null;
		obj.style.filter = null;
		obj.releaseCapture();
	}
}

function showlist(id,url){
	$.get(url,function(data){
		$('#'+id).html(data);
	});
}

