//function windowPosition(){
	//var quickLink=document.getElementById("tmpdiv");
	//alert(document.documentElement.scrollTop);
	//alert(quickLink.style.top);
	//quickLink.style.top=document.body.scrollTop+100;
	//var cw=document.documentElement.clientWidth;
	//quickLink.style.left=document.documentElement.scrollLeft+document.documentElement.clientWidth-quickLink.offsetWidth-cw;
//}

function alertWin(title,url, w, h){ 
	var titleheight = "30px"; // 提示窗口標題高度 
	var bordercolor = "#eb208c"; // 提示窗口的邊框顏色 
    var titlecolor = "#eb208c"; // 提示窗口的標題顏色 
	var titlebgcolor ="#e0e6e8"; // 提示窗口的標題背景色
	var bgcolor = "#FFFFFF"; // 提示內容的背景色

	
	var iWidth = document.documentElement.clientWidth; 
	var iHeight = document.documentElement.clientHeight; 
	var sTop = document.documentElement.scrollTop+70; 
	//var sLeft = document.documentElement.scrollLeft; 
	if (document.getElementById){
		if (navigator.userAgent.indexOf("MSIE")>0)
		{
			iWidth = document.documentElement.offsetWidth; 
			iHeight = document.documentElement.offsetHeight;
			
		}else{
			iWidth = document.documentElement.scrollWidth; 
			iHeight = document.documentElement.scrollHeight;
		}
	}else{
		iWidth = document.documentElement.offsetWidth; 
		iHeight = document.documentElement.offsetHeight; 
	}
	var object = document.createElement("div");
    object.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=60);opacity:0.3;background-color:#666666;z-index:998;";
	object.style.width = document.body.clientWidth;
	if (document.getElementById){	
		object.style.height = document.documentElement.scrollHeight;
	}else{
	object.style.height = document.documentElement.offsetHeight;
	}
	object.style.position="absolute";
	object.style.left = 0+'px';
	object.style.top = 0+'px';
	object.style.zIndex = 998;
    object.style.display="inline";
	document.body.appendChild(object);

	var msgObj=document.createElement("div");
	msgObj.id = 'tmpdiv';
	msgObj.style.cssText = "position:absolute;font:11px '細明體';width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:999;";
	

	
	document.body.appendChild(msgObj);
	
	var table = document.createElement("table");
	msgObj.appendChild(table);
	table.style.cssText = "margin:0px;border:0px;padding:0px 0px;";
	table.cellSpacing = 0;
	if (title != null){
		var tr = table.insertRow(-1);
		tr.height="30px";
		var titleBar = tr.insertCell(-1);
		titleBar.style.cssText = "background: #FFFFFF url(img/thickbox-title.jpg) no-repeat left top;width:100%;height:"+titleheight+"px;text-align:left;padding:0px;margin:0px 0px;font:bold 13px '細明體';color:"+titlecolor+";border:0px solid " + bordercolor + ";cursor:move;background-color:" + titlebgcolor;
		titleBar.style.paddingLeft = "0px";
		titleBar.innerHTML = title;
		var moveX = 0;
		var moveY = 0;
		var moveTop = 0;
		var moveLeft = 0;
		var moveable = false;
		var docMouseMoveEvent = document.onmousemove;
		var docMouseUpEvent = document.onmouseup;
		titleBar.onmousedown = function() {
			var evt = getEvent();
			moveable = true; 
			moveX = evt.clientX;
			moveY = evt.clientY;
			moveTop = parseInt(msgObj.style.top,10);
			moveLeft = parseInt(msgObj.style.left,10);
			
			document.onmousemove = function() {
				if (moveable) {
					var evt = getEvent();
					var x = moveLeft + evt.clientX - moveX;
					var y = moveTop + evt.clientY - moveY;
					if ( x > 0 &&( x + w < iWidth) && y > 0 && (y + h < iHeight) ) {
						msgObj.style.left = x + "px";
						msgObj.style.top = y + "px";
					}
				}	
			};
			document.onmouseup = function () { 
				if (moveable) { 
					document.onmousemove = docMouseMoveEvent;
					document.onmouseup = docMouseUpEvent;
					moveable = false; 
					moveX = 0;
					moveY = 0;
					moveTop = 0;
					moveLeft = 0;
				} 
			};
		}
		
		var closeBtn = tr.insertCell(-1);
		closeBtn.style.cssText = "cursor:pointer; padding:0px 5px;background-color:" + titlebgcolor;
		closeBtn.innerHTML = "<img src='img/thickbox-title-xx.gif' border='0'/>";
		closeBtn.onclick = function(){ 
			//if(confirm('是否要關掉本視窗?')){
			   document.body.removeChild(object); 
			   document.body.removeChild(msgObj); 
			//}
		} 
	}
	var msgBox = table.insertRow(-1).insertCell(-1);
	msgBox.style.cssText = "font:10pt '細明體';";
	if (title != null){
		msgBox.colSpan  = 2;
	}
    msgBox.innerHTML='<iframe src="'+url+'" width="100%" height="445" frameborder="0" ></iframe>';
    // 獲得事件Event對象，用於兼容IE和FireFox
    function getEvent() {
	    return window.event || arguments.callee.caller.arguments[0];
    }
	msgObj.style.top=sTop+'px';
	msgObj.style.left=iWidth/2-msgObj.offsetWidth/2+'px';
} 


//window.onscroll=windowPosition;
//window.onresize=windowPosition;
