function openExitWindow(sponsorURL)
{
	//Set the current URL value for the referrer value on the query string
	var currentPage;
	currentPage =  location.href; //get the current URL
	//alert(currentPage);
	var finalChar = currentPage.substring(currentPage.length - 1, currentPage.length);
	
	//Remove the hash on the end if the page is refreshed
	if(finalChar == '#')
	{
		currentPage = currentPage.substring(0, currentPage.length - 1); 
	}
	
	//Create the string required to navigate to the ExitPopup.aspx page 
	var popupPage = "ExitPopup.aspx?referrer=" + currentPage + sponsorURL;
		
	nwin=window.open(popupPage , 'MRR2005Pop','width=420,height=320,location=left,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no');
	nwin.focus()  
}
function openANZExitWindow(sponsorURL)
{
	//Set the current URL value for the referrer value on the query string
	var currentPage;
	currentPage =  location.href; //get the current URL
	
	var finalChar = currentPage.substring(currentPage.length - 1, currentPage.length);
	
	//Remove the hash on the end if the page is refreshed
	if(finalChar == '#')
	{
		currentPage = currentPage.substring(0, currentPage.length - 1); 
	}
	
	//Create the string required to navigate to the ExitPopup.aspx page 
	var popupPage = "ANZExitPopup.aspx?referrer=" + currentPage + sponsorURL;
		
	nwin=window.open(popupPage , 'MRR2005Pop','width=420,height=320,location=left,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no');
	nwin.focus()  
}
function openSponsorWindow(url)
{
	nwin=window.open(url);
	nwin.focus();
}
function PrevContestantBanner()
{
	if (currentImage == 0)
	{
		currentImage = imageCount - 1;
	}
	else
	{
		currentImage--;
	}
	document.forms[1].contestantBanner.src = eval("img"+ currentImage +".src");
}
function NextContestantBanner()
{
	if (currentImage == imageCount - 1)
	{
		currentImage = 0;
	}
	else
	{
		currentImage++;
	}
	document.forms[1].contestantBanner.src = eval("img"+ currentImage +".src");
}
function openNewWindow(url,width,height,menubar,toolbar)
{
	//Create the string required to navigate to the ExitPopup.aspx page 
	var popupPage = url;

	if(width == '')
	{
		var width=420;
	}
	else
	{
		var width=width;
	}

	if(height == '')
	{
		var height=320;
	}
	else
	{
		var height=height;
	}
		
		
	nwin=window.open(popupPage , 'MRR2005NewPopup','width=' + width + ',height=' + height + ',location=left,menubar=' +menubar+ ',resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=' +toolbar);
	nwin.focus()  
}

