function showDialog2(hide,dialog_id,topx){
	setHideScroll2(hide);
	var left = leftPosition2(); 
	var top = topPosition2();
	var cw = document.body.clientWidth; 
	var ch = document.body.clientHeight-topx;
	var bg = document.getElementById("bgDisable");
	bg.style.width = (parseInt(cw,10)+900);
	bg.style.height = (parseInt(ch,10)+1500);
	bg.style.display = hide;
	bg.style.opacity = 0.5;
	bg.style.filter = "alpha(opacity=50)";	
	var dialog = document.getElementById(""+dialog_id+"");	
	dialog.style.top = top+(ch - dialog.style.height.replace(/px/,""))/2;
	dialog.style.left = left+(cw - dialog.style.width.replace(/px/,""))/2;
	dialog.style.display = hide;
}

function init_showDialog(){
	var obj = document.createElement('div');
	obj.setAttribute('id', 'bgDisable');
	obj.style.display = 'none';		
	obj.style.position = 'absolute';
	obj.style.top = '0px';  obj.style.left = '0px'; 	
	obj.style.backgroundColor = 'gray';	
	obj.onclick = function(){ return false; }
	obj.ondblclick = function(){ return false; }
	obj.onmousedown = function(){ return false; }
	obj.onmousemove = function(){ return false; }
	obj.onmouseup = function(){ return false; }
	//obj.style.filter = "alpha(opacity=50)";
	document.body.appendChild(obj);	
}

function setHideScroll2(hide){
	if(hide == "block"){   document.body.scroll = "no"; document.body.style.overflow = "hidden";
	}else{  	document.body.scroll = "yes"; document.body.style.overflow = "";   }
}

function topPosition2(){
return typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

// calculate the position starting at the left of the window //
function leftPosition2() {
return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}