﻿// JScript File

function ShowMsgXY(MsgObj,PosObj,Offset)
{
    var Obj=document.getElementById(MsgObj);
    var Obj2=PosObj;
    //Obj.style.left=event.clientX 
    //Obj.style.top=event.clientY 
    
	var curleft = curtop = 0;
	if (PosObj.offsetParent) {
		curleft = PosObj.offsetLeft;
		curtop = PosObj.offsetTop;
		while (PosObj = PosObj.offsetParent) {
			curleft += PosObj.offsetLeft;
			curtop += PosObj.offsetTop;
		}
	}

	if (Offset=='left'){
		curtop += Obj2.offsetHeight;
	    curleft += (Obj2.offsetWidth-10);
	}else{
	
	}
	
    Obj.style.left=curleft;
    Obj.style.top=curtop;	 
    Obj.style.position="absolute";  
    Obj.style.display="block";
}

function ShowMsg(MsgObj,PosObj)
{
    var Obj2=document.getElementById(PosObj);
        
    var Obj=document.getElementById(MsgObj + '_MainDiv');
    Obj.style.display="block";  
    Obj.style.left=(Obj2.offsetWidth / 2) - (Obj.offsetWidth / 2) + "px";
    Obj.style.top=(document.documentElement.scrollTop + 150) + "px";  
    Obj.style.position="absolute";      
    
    var Obj=document.getElementById(MsgObj + '_MainIFrame');
    Obj.style.background="";
    Obj.style.display="block"; 
    Obj.style.left=(Obj2.offsetWidth / 2) - (Obj.offsetWidth / 2) + "px";
    Obj.style.top=(document.documentElement.scrollTop + 150) + "px";  
    Obj.style.position="absolute";   
    
    var Obj=document.getElementById(MsgObj + '_WaitGif');
    if (Obj != null) {
        Obj.innerHTML = '<img src="' + Obj.getAttribute('src') + '" />';
    }
    
    var boo=document.getElementById(MsgObj + '_BlackOut');
    if (boo != null) {
        boo.style.display="block";
        boo.style.width = Obj2.offsetWidth + "px"; 
        boo.style.height = Obj2.offsetHeight + "px";
        boo.style.top= Obj2.style.top;
        boo.style.position="absolute"; 
        //boo.style.left= "-" + Obj2.style.borderLeftWidth;  
        boo.style.left= "-" + Obj2.currentStyle.borderLeftWidth;  
    }  
}

function HideMsg(MsgObj)
{
    var Obj=document.getElementById(MsgObj + '_MainDiv');
    Obj.style.display="none";
    
    var Obj=document.getElementById(MsgObj + '_MainIFrame');
    Obj.style.display="none";    
}

function MonitorTimeout(MsgObj,PosObj,Time)
{
    setTimeout(function () { ShowMsg(MsgObj,PosObj);}, Time);
}
