//------------------------------------------------------------------
// Purpose: Opens up a new browser window in the center of the screen 
//			regardless of the Screens resolution.
// Input:	intPopUpHeight = the height of the new window; 
//			intPopUpWidth = the width of the new window; 
//			strURL = the URL that should be displayed in the new window
//			strWindowName = the name of the new window (cannot have spaces or special characters)
// Output:	true
//------------------------------------------------------------------
function CenterNewWindow( intPopUpHeight, intPopUpWidth, strURL, strWindowName, winFocus)
{
	var intPopUpXpos, intPopUpYpos;
	var chkParams = true;

	if (strURL == null || strURL.length == 0){
		chkParams = false;
	}
	if (strWindowName == null || strWindowName.length == 0){
		strWindowName = 'newWindow';
	}
	if (intPopUpHeight == null){
		intPopUpHeight = '560';
	}
	if (intPopUpWidth == null){
		intPopUpWidth = '720';	
	}

	intPopUpXpos = ((screen.width/2) - (intPopUpWidth/2)) ;
	intPopUpYpos = ((screen.height/2) - (intPopUpHeight/2)) - 30;

	if (typeof myWindow !='undefined'){
		if (!myWindow.closed) myWindow.close()
	}
	
	if(chkParams){
		myWindow = window.open( strURL,strWindowName,"top=" + intPopUpYpos + ",left=" + intPopUpXpos + ",toolbar=no,location=no,personalbar=no,scrollbars=auto,resize=no,alwaysRaised=yes,directories=no,status=no,menubar=no");
		myWindow.resizeTo(intPopUpWidth, intPopUpHeight);

		if(winFocus == 'showFocus')
		{
			myWindow.focus();
		}
	}
}
//------------------------------------------------------------------
// Purpose: This function is used for the media search drop down. 
//			Do not disable the TimeFrame dropdown if the user selects
//			"All Media" OR "Press Release" from the search drop down.
//------------------------------------------------------------------
function disableMediaTimeFrameDropDown()
{
	var ddownVal=document.frmSearch.ListOption.options[document.frmSearch.ListOption.selectedIndex].value;
	var ddDisable = true;
	
	var enableItems=new Array(1);
	
	enableItems[0]='MediaBO';
	enableItems[1]='press';
	
	for(i=0;i<enableItems.length;i++)
	{
		if(ddownVal==enableItems[i])
		{
			ddDisable = false;
		}	
	}
	if(ddDisable)
	{
		document.frmSearch.TimeFrame.disabled=true;
	}
	else
	{
		document.frmSearch.TimeFrame.disabled=false;
	}
}

function ShowPrintPreview(strURLIn)
{
	var strURL = "http://" + window.document.location.host + strURLIn;
	window.open(strURL, '_blank', 'width=780,height=600,menubar=no,resizable=yes,toolbar=no,scrollbars=yes');
}
