/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
						I N D E X
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*	function destroypage()
*   function OpenNewWindow(URL,windowH,windowW,mStatus)
*	function OpenNewImageWindow(URL,windowH,windowW,mStatus)
*	function OpenNotesWindow(tobject)
*	function OpenInLineWindow(cPicture,nWidth,nHeight,cMessage,nBorder)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

var NewWindow;
var NewImageWindow;



/*
*********************************************************
destroypage
*********************************************************
*/
function destroypage()
{
	if (NewWindow!=null)NewWindow.close();
}	




/*
*********************************************************
OpenNewImageWindow
*********************************************************
*/


function OpenNewImageWindow(URL)
	{
	var iTop,iLeft,available_width,available_height,windowH,windowW,sURL;
	windowH=400;
	windowW=600;

	sURL = "../popImage.aspx?processID=" + URL;
	
	 if(document.all) {
			available_width=window.screen.width;
			available_height=window.screen.height;
       } else {
			available_width=innerWidth;
			available_height=innerHeight;
       }
		
			
	
	iTop	= (parseFloat(available_height)/2)	- (parseFloat(windowH)/2);
	iLeft	= (parseFloat(available_width)/2)	- (parseFloat(windowW)/2);
	
	
		s = "width=" + windowW + ",height=" + windowH + ",top=" + iTop + ",left=" + iLeft + ",toolbar=no,status=yes,resizable=yes,scrollbars=yes"

	
	
	if (NewWindow!=null)NewWindow.close();
	
	NewWindow = window.open(sURL,"popFrameless", s);
	NewWindow.focus;
	}	

/*
*********************************************************
OpenNewImageWindow
*********************************************************
*/


function OpenNewImageWindow2(URL)
	{
	var iTop,iLeft,available_width,available_height,windowH,windowW,sURL;
	windowH=400;
	windowW=600;

	sURL = "../../popImage.aspx?processID=" + URL;
	
	 if(document.all) {
			available_width=window.screen.width;
			available_height=window.screen.height;
       } else {
			available_width=innerWidth;
			available_height=innerHeight;
       }
		
			
	
	iTop	= (parseFloat(available_height)/2)	- (parseFloat(windowH)/2);
	iLeft	= (parseFloat(available_width)/2)	- (parseFloat(windowW)/2);
	
	
		s = "width=" + windowW + ",height=" + windowH + ",top=" + iTop + ",left=" + iLeft + ",toolbar=no,status=yes,resizable=yes,scrollbars=yes"

	
	
	if (NewWindow!=null)NewWindow.close();
	
	NewWindow = window.open(sURL,"popFrameless", s);
	NewWindow.focus;
	}	


/*
*********************************************************
OpenNotesWindow
*********************************************************
*/


	
function OpenNotesWindow(tobject)
{
		var strFeatures;
		var strData;
		
		strFeatures = 'dialogWidth:500px;dialogHeight:350px;dialogTop:100px;';
		strFeatures = strFeatures + 'help:no;center:yes;border:thick;status:no;';
		strFeatures = strFeatures + 'scrollbars=no;toolbar=no;menubar=no;';

		strData = window.showModalDialog('frm_notes.asp',tobject.value, strFeatures);
		
		if (!isEmpty(strData))tobject.value = strData;
		
		
}			



function OpenImageWindow(sURL)
{
		var strFeatures;
		var strData;
		
		strFeatures = 'dialogWidth:650px;dialogHeight:650px;dialogTop:25px;';
		strFeatures = strFeatures + 'help:no;center:yes;border:thick;status:no;';
		strFeatures = strFeatures + 'resizable=yes;scroll=yes;toolbar=no;menubar=no;';

		strData = window.showModalDialog('popImage.aspx?processID=' + sURL,'', strFeatures);
		
			
}			



function OpenImageShop(nMoonType,nDocAdminType,nID)
{
		var sURL;

		sURL= "../docmanager/nxImageShop.aspx?moonburntype=" + nMoonType + "&doctype=" + nDocAdminType + "&processID=" + nID;
	
		OpenNewWindow(sURL,700,800,'mStatus');
		
			
}			



function OpenInLineWindow(sRoot,sTitle,cPicture,nWidth,nHeight)
	{
	var iTop,iLeft;
	var iPadding = 50;
	nHeight+=iPadding;
	nWidth+=iPadding;
	
	
	 if(document.all) {
			available_width=document.body.clientWidth;
            available_height=document.body.clientHeight;
       } else {
			available_width=innerWidth;
			available_height=innerHeight;
       }
	
	iTop	= (available_height/2)	- (nHeight/2);
	iLeft	= (available_width/2)	- (nWidth/2);
	
	if (NewWindow!=null)NewWindow.close();
	
	NewWindow=window.open("","NewOne","HEIGHT="+nHeight+",WIDTH="+nWidth+",scrollbars=no,resizable=no,top="+iTop+",left="+iLeft);
	NewWindow.document.write ("<HTML><HEAD><TITLE>" + sTitle);
	NewWindow.document.write ("</TITLE></HEAD>");
	NewWindow.document.write ("<BODY BGCOLOR=" + "'" + "LIGHTBLUE" + "'>");	
	NewWindow.document.write ("<P ALIGN=CENTER>");
	NewWindow.document.write ("<center><IMG SRC='" + sRoot + "images/close_window.gif' onClick='self.close()' ><BR><BR>");
	NewWindow.document.write ("<IMG SRC=");
	NewWindow.document.write (cPicture);
	NewWindow.document.write (">");
	NewWindow.document.write ("</P>");
	NewWindow.document.write ("</CENTER></BODY></HTML>");
	NewWindow.document.close();
	NewWindow.focus();
	return false;
	}

function OpenPDFWindow(PDFileName)
	{
	
	if (NewWindow!=null)NewWindow.close();
	
	NewWindow=window.open(PDFileName);
	NewWindow.focus();
	return false;
	}

function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5
eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
}

