//ajax
function showPopWithUrl(tit,url,w,h){
		var sWidth,sHeight;
		sWidth=document.body.clientWidth;
		sHeight=document.body.scrollHeight;
		if(sHeight<window.screen.height){sHeight=window.screen.height;}
		var bgObj=document.createElement("div");
		bgObj.setAttribute('id','bgDiv');
		bgObj.style.position="absolute";
		bgObj.style.top="0";
		bgObj.style.background="#000000";
		bgObj.style.filter="Alpha(Opacity=30);";
		bgObj.style.left="0";
		bgObj.style.width=sWidth + "px";
		bgObj.style.height=sHeight + "px";
		bgObj.style.zIndex = "10000";
    document.body.appendChild(bgObj);

    massage_box.style.left = (document.body.clientWidth - w) / 2;
    massage_box.style.top = (screen.height - h) / 2-80;
    massage_box.style.screenx = (document.body.clientWidth - w) / 2;
    massage_box.style.screeny = (screen.height - h) / 2-80;
    massage_box.style.width = w+"px";
    massage_box.style.height = h+"px";
    pop_title.innerHTML=tit;
    massage_box.style.display=''
    var popiframe='<iframe src="'+url+'" width="'+(w-11)+'px"  height="'+(h-36)+'px" frameborder=0 scrolling=no></iframe>';
    pop_iframe.innerHTML=popiframe;
}

function showPopWithInfo(tit,info,w,h){

		var msgBox = document.getElementById("massage_box");
		var popFrame = document.getElementById("pop_iframe");

		var sWidth,sHeight;
		sWidth=document.body.clientWidth;
		sHeight=document.body.scrollHeight;
		if(sHeight<window.screen.height){sHeight=window.screen.height;}
		var bgObj=document.createElement("div");
		bgObj.setAttribute('id','bgDiv');
		bgObj.style.position="absolute";
		bgObj.style.top="0";
		bgObj.style.background="#000000";
		bgObj.style.filter="Alpha(Opacity=30);";
		bgObj.style.left="0";
		bgObj.style.width=sWidth + "px";
		bgObj.style.height=sHeight + "px";
		bgObj.style.zIndex = "10000";

    document.body.appendChild(bgObj);

    msgBox.style.left = (document.body.clientWidth - w) / 2;
    msgBox.style.top = (screen.height - h) / 2-80;
    msgBox.style.screenx = (document.body.clientWidth - w) / 2;
    msgBox.style.screeny = (screen.height - h) / 2-80;
    msgBox.style.width = w+"px";
    msgBox.style.height = h+"px";
    //pop_title.innerHTML=tit;
    msgBox.style.display=''
//    var popiframe='<iframe src="'+url+'" width="'+(w-11)+'px"  height="'+(h-36)+'px" frameborder=0 scrolling=no></iframe>';
    popFrame.innerHTML= "<div style=\"padding:20px 30px;width:100%\"><div style=\"width:20%;height:100%;float:left;padding-top:5px\"><img src=\"/common/images/untitled.bmp\"></div><div style=\"WORD-BREAK:break-all;height:100%;float:left;\">" + info + "</div></div>";
}

function closeWithIframe(){
		var msgBox = document.getElementById("massage_box");
    msgBox.style.display="none";
    document.body.removeChild(document.getElementById("bgDiv"));
}
document.write('<div id="massage_box" style="position:absolute; FILTER: progid:DXImageTransform.Microsoft.DropShadow();z-index:10001;display:none">');
document.write('<div style="border-width:1 1 3 1; width:100%; height:100%; background:#fff; color:#666666; font-size:12px; line-height:150%">');
document.write('<div onmousedown=MDown("massage_box") style="background:#666666; height:20px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;color:#fff;cursor:move;padding:0 0 4px 0">');
document.write('<div style="display:inline; width:200px; position:absolute;padding:3px 0 0 5px" id=pop_title></div>');
document.write('<span onClick="closeWithIframe()" style="float:right; display:inline; cursor:pointer;padding:3px 5px 0 0;font-size:12px">關閉</span>');
document.write('</div>');
document.write('<div style="padding:5px" id="pop_iframe"></div>');
document.write('</div>');
document.write('</div>');
//ajax

//ajax
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove

function MDown(t_name){
var obj = document.getElementById(t_name) ;
Obj=obj.id;
	if (document.all){	
		document.all(Obj).setCapture();
		pX=event.x-document.all(Obj).style.pixelLeft;
		pY=event.y-document.all(Obj).style.pixelTop;
	}	
}

function MMove(){
if(Obj!=''){
	   if (document.all){	 
			  document.all(Obj).style.left=event.x-pX;
			  document.all(Obj).style.top=event.y-pY;
			}			  
  }
}

function MUp(){
if(Obj!=''){
	if (document.all){	 
  	document.all(Obj).releaseCapture();
	}  	
  Obj='';
  }
}