
function openHelp(theURL)
{
  //this function ignores features, allows them to be set here

	var newFeatures = "status=no,scrollbars=yes,resizable=yes,width=570,height=450";
	var helpWin = window.open(theURL, "Help", newFeatures);
	
	helpWin.focus()
}
function openInfEn(qs, inf)
{
	var page = "/popup/";
	var f = "status=no,scrollbars=yes,resizable=yes,width=770,height=670";


	if(inf)
	{
		page+="information.asp?"+qs;	
	}
	else
	{
		page+="enlargement.asp?"+qs;
	}
	if (isMac())
	{
		f = "toolbar=yes," + f;
	}

	MM_openBrWindow(page,"",f)
}
function isMac()
{
	if (navigator.appVersion.indexOf("Macintosh",1)>0)
	{
	   return true;
	}
 return false;
}

function MM_openBrWindow(theURL,winName,features) 
{ 
	//Some Mac browsers return the parse date as a negative number.  Strip it out
	var sDate = Date.parse(Date()).toString()
	sDate = sDate.slice(1)
	iWindowCount = "win"+sDate 
	var pWindow = window.open(theURL,iWindowCount, features );
    	pWindow.focus()
}

// aspx pages use this function to Close the popup and refresh the parent window
function RefreshParentClosePopup()
{	
	var random = Math.random();
	var href = window.top.opener.top.location.href;
	if(href.indexOf('?') != -1)
	{
		href += '&i=' + random
	}
	else
	{
		href += '?i=' + random
	}
	window.top.opener.top.location = href;
	window.close();
}

// This function is used by the Enlargement to refresh the parent window with new search results.
function SetParentLocation(url)
{
	window.top.opener.top.location = url;
	window.top.opener.focus();
}
// This function is used by the Login popup to transfer. 
function SetParentLocationClosePopup(url)
{
	window.top.opener.top.location = url;
	window.close();
}

function OpenNewLanguagePopup(langCode)
{
	var url = '/popup/newLanguage.aspx?lcd=' + langCode ;
	var attr = "status=no,scrollbars=no,resizable=no,width=390,height=257";
	var langPopup = window.open(url,"langPopup",attr);	
}

function OpenPromoPopup(url,width,height)
{
	var attr = 'status=no,scrollbars=no,resizable=no,width=' + width + ',height=' + height;
	var promoPopup = window.open(url,"promoPopup",attr); 
}

// Used to open the help popup.
function openHelp(url)
{
	var attr = "status=no,scrollbars=yes,resizable=yes,width=700,height=650";
	if (!url)
	url = "/help/default.aspx";
	var helpWin = window.open(url, "Help", attr);
	helpWin.focus();
}

//Used by View Options popup.
//When image of view is clicked the corresponding radio button needs to be checked.
//That is the purpose of this function.
function ImageRadioClick(radioId)
{
	var radioObject = document.getElementById(radioId);
	radioObject.checked = true;
}
