function openWinIndex2(lnk,w,h,wn,m,s) {
	if (s) var scrbar=',scrollbars=yes';
	else srcbar='';
	if(typeof(am) == 'undefined') am='';
	var vin=window.open("/"+lnk+'&margin_window='+m+am,wn,'resizable=yes'+scrbar);
	vin.resizeTo(w, h);
	vin.resizable='yes';
	vin.globalDoc=window;
}
function showBckDebug(s) {
	var d=document.getElementById('bckdebug');
	d.style.display=s;
}
function g_SendSimple(url)	{
	 if (window.XMLHttpRequest) req = new XMLHttpRequest();
	 else if (window.ActiveXObject) 
        req = new ActiveXObject("Microsoft.XMLHTTP");
	
	if (req) {
			//alert(url);
          req.open("POST", 'rplc.php?'+url, true);
		if (window.XMLHttpRequest) req.send(null);
		else if (window.ActiveXObject) req.send();

	} else alert('Request not defined');
}

function IMP(im) { 
	var imgp=document.getElementById('imgp');
	imgp.innerHTML='<img src="/files/Image/'+im+'" alt="Click to Close" onLoad="shIMP();"/>';
	

}
function shIMP() {
	var imgp=document.getElementById('imgp');
	
	imgp.style.visibility = 'visible'; 
	imgp.style.display='block';
		
	 if (!document.all&&document.getElementById) {
		var ol = self.pageXOffset+(window.innerWidth/2-Number(imgp.offsetWidth)/2);  
		var ot = self.pageYOffset + (window.innerHeight/2-Number(imgp.offsetHeight)/2);	
	  } else {
		var ol = 0 - imgp.offsetWidth/2 + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth )/2 + ( ignoreMe = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft )   ;	
		var ot= 0 - imgp.offsetHeight/2 + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight )/2 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )   ;
	  }
  	if (ol<0) ol=0;
	if (ot<0) ot=0;
	imgp.style.left=ol+"px"
	imgp.style.top=ot+"px"
	
	imgp.style.zIndex=10000001;
}
function IMPClose() {
		var imgp=document.getElementById('imgp');
		imgp.style.visibility = 'visible'; 
		imgp.style.display='none';
}