

var PopBlockedMsg = " Warning: we attempted to open a link in a pop-up window, but you appear to be running a pop-up blocker. \n Please turn off any pop-up blockers you might be using to view this link.";


// ----------------- LAUNCHING POP UP WINDOWS FUNCTIONS --------------------------

// script modified to detect pop up blockers 14 nov


// Opens a window sized to specified width(w) and height(h) parameters

function OpenSizedWindow(stURL,w,h)
{
	var x = (screen.width - w)/2;
	var y = (screen.height - h)/2;
	
	if(x < 0)
		{
		x = 10;
		}
	
	if(y < 0)
		{
		y = 10;
		}
	
		arg = 'width='+w+',height='+h+',left=' + x + ',top=' + y + ',fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0';
		
		var popup = window.open(stURL,'', arg);

		// detect pop up blocker
		if (popup == null || typeof(popup) == "undefined") 
		{
			alert(PopBlockedMsg);
		}
		else
		{
			//popup.moveTo(x,y);	
			//popup.resizeTo(w, h);
			popup.focus();
		}
}


// opens regular window (standard features) sized almost to full screen size

function OpenRegularWindow(strURL)
{

	var winW = screen.width - 20;
	var winH = screen.height - 26;
	
	var xpos = (screen.width - winW)/2;
	var ypos = (screen.height - winH)/2;
	 
	
	if(xpos < 0)
		{
		xpos = 1;
		}
	
	if(ypos < 0)
		{
		ypos = 1;
		}
	
		arg = 'width='+winW+',height='+winH+',left=14,top=12,fullscreen=0,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1';
		
		var popup = window.open(strURL, '', arg);
	
		if (popup == null || typeof(popup) == "undefined") 
		{
			alert(PopBlockedMsg);
			
		}
		else
		{
			//popup.moveTo(xpos,ypos);	
			//popup.resizeTo(winW, winH);
			popup.focus();
		}

	
}



// opens almost screen sized popup window (no features)

function OpenLargeWindow(stURL)
{
	var winW = screen.width - 20;
	var winH = screen.height - 40;	//26;
	
	var x = (screen.width - winW)/2;
	var y = 5;	//(screen.height - winH)/2;
	
	var arg = 'width='+winW+',height='+winH+',left=0,top=0,fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0';
		
	var popup = window.open(stURL, '', arg);
	
	if (popup == null || typeof(popup) == "undefined") 
	{
		alert(PopBlockedMsg);
			
	}
	else
	{
		//popup.moveTo(x,y);	
		//popup.resizeTo(winW, winH);
		popup.focus();
	}
	
}