//All Below Called From First Window
////////////////////////////////////////////////////
////////////////////////////////////////////////////

function OpenSecondWindow(loc, w, h, s, r, l, t, exData)
{
	try{
		if(l == null) l=50; //Default 50 - Left
		if(t == null) t=50; //Default 50 - Top	
		if(w == null) w=725; //Default 725 - width
		if(h==null) h=525; //Default 525 - height
		if(s==null) s=''; else s='=false'; //Default, allows scrolling
		if(r==null) r='=false'; else r=''; //Default, doesnt allow resizing
		if(exData==null) exData = '';
		if(l > 0 && t > 0)
			window.open(loc,"_blank","height="+h+",width="+w+",resizable"+r+",scrollbars"+s+",menubar=false,status,left="+l+",top="+t); 
		else
			window.open(loc,"_blank","height="+h+",width="+w+",resizable"+r+",scrollbars"+s+",menubar=false,status"); 
		document.getElementById('PageBasePostID').value = exData;
	}catch(ex){}
}

function OpenToolWindow(loc)
{
	window.open( loc,"_blank","height=600,width=700,resizable,scrollbars=false,menubar=false,status=false"); 
}

//All Below Called From Second Window
////////////////////////////////////////////////////
////////////////////////////////////////////////////

function RefreshFirstWindow(SubmitReason)
{
	try{
		if(SubmitReason == null || SubmitReason == '')
			SubmitReason = '1'; 
		window.opener.document.getElementById('PageBasePostID').value = SubmitReason;
		window.opener.document.forms[0].submit();
	}catch(ex){} 
}

function CloseSecondWindowFromSecondWindow()
{
	try{
		window.close();
	}catch(ex){}
}

////////////////////////////////////////////////////
////////////////////////////////////////////////////



