//弹出固定位置居中页面
function switchCity(){
var msgw,msgh,bordercolor;
msgw=556;//提示窗口的宽度
msgh=375;//提示窗口的高度
titleheight=25;//提示窗口标题高度
bordercolor="#9DBCEA";//"#336699";//提示窗口的边框颜色

var sWidth,sHeight;
sWidth=screen.width;// document.body.offsetWidth
sHeight=document.body.offsetHeight;
if (sHeight<screen.height)
{
sHeight=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=25";
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 ="25%";
msgObj.style.top ="30%";
msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
msgObj.style.width = msgw + "px";
msgObj.style.height =msgh + "px";
msgObj.style.textAlign = "center";
msgObj.style.lineHeight = (msgh-titleheight) + "px";
msgObj.style.zIndex = "10001";



var title=document.createElement("h4");
title.setAttribute("id","msgTitle");
title.setAttribute("align","right");
title.style.margin="0";
title.style.padding="8px";
//title.style.background=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="1px solid " + bordercolor;
//title.style.height="15px";
title.style.font="14px Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.color="#1C4E8D";//"white";
title.style.cursor="pointer";
var titleHtml="<h2 title='点击关闭窗口'><span style='float:right;'>关闭</span>请点击切换城市 </h2>"
title.innerHTML=titleHtml;
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="1em 0";
txt.setAttribute("id","msgTxt");

var url="http://www.ebying.com/client/city/switchCity.jsp";//192.168.1.168:8080/ebying
txt.innerHTML="<iframe id='DivShim' src='"+url+"' width='100%'  height='380px' scrolling='no' frameborder='0'/>";// style='position:absolute;'
document.getElementById("msgDiv").appendChild(txt);
parent.DivShim.location.reload();
//document.getElementById('DivShim').location.reload();
}


