
var popdiv="myPopWin";
$(document).ready(function(){
var nowTime=new Date();
$("body").append("<div id='markdiv' style='display:none; position:absolute; left:0px; top:0px; background-color:#000000;z-index:9999; filter:Alpha(opacity=50); -moz-opacity:0.3; opacity:0.3' ></div>");
$("body").append("<div id='"+popdiv+"' style='display:none; position:absolute; z-index:10000;'><iframe id='popif' scrolling='no' height='1' frameborder='0' width='1' src='' marginwidth='0' style='z-index:10001;'></iframe></div>");})
function UpdateHeight(h,w){
var IE=(!window.isOpera&&document.all&&navigator.userAgent.match(/msie/gi))?true:false;
if(!IE)h+=10;
$("#popif").height(h);
$("#popif").width(w);
PopOffset(popdiv);}
function ShowPop(url){
PopOffset(popdiv);
$("#popif").attr("src",url);
$("#markdiv").width($(document).width()).height($(document).height());
$("#markdiv").show();
$("#"+popdiv).show();}
function PopOffset(){
var windowobj=$(window);
var browserWidth=windowobj.width();
var browserHieght=windowobj.height();
var scrollLeft=windowobj.scrollLeft();
var scrollTop=windowobj.scrollTop();
var selfWidth=$("#"+popdiv).width();
var selfHeight=$("#"+popdiv).height();
var left=scrollLeft+(browserWidth-selfWidth)/2;
var top=scrollTop+(browserHieght-selfHeight)/2;
$("#"+popdiv).css("left",left);
$("#"+popdiv).css("top",top);}
function HidePop(){
$("#"+popdiv).hide();
$("#markdiv").hide();}
$(window).resize(function(){
PopOffset();})
$(window).scroll(function(){
PopOffset();})
