if (top.location != self.location) top.location = self.location;

// Set up Screen Size and Co-Ordinate information
var screenheight = screen.availHeight - 10;
var screenwidth = screen.availWidth - 10;
var popupWidth = 600;
var popupHeight = 600;
var popupX = screenwidth - popupWidth;
var popupY = 10;

// for changing lanes pop up to go in middle of screen
var popx = screenwidth - 750;
popx = popx/2;
var popy = screenheight - popupHeight;
popy = popy/2;
	
// Main Competition PopUp
function PromoCompetitionPopUp(aspFile, productid,productRegion)
{	
	// Ensure No competitions on PlayUsa.com for now
	if(aspFile != null && aspFile != 'undefined' &&  productid != null && productid != 'undefined' )
	{
		var win = null;
		var servercopy = '';

		//win = window.open("http://competition.play.com/"+aspFile+"?s="+escape(servercopy), productid, "width="+popupWidth+",height="+popupHeight+",left="+popupX+",top=0,resizable=no,scrollbars=yes");
		win = window.open("http://localhost/PlayWeb/"+aspFile+"?s="+escape(servercopy), productid, "width="+popupWidth+",height="+popupHeight+",left="+popupX+",top=0,resizable=no,scrollbars=yes");
			
		if(productid != '')
		{
			productid.toLowerCase();
			if(productid.indexOf("promo_") == -1)
				document.location.href = "product.aspx?r="+ productRegion + "&title="+productid;
			else
			{
				// getrid of the promo
				productid=productid.replace("promo_", "");
				document.location.href = "promo.aspx?r="+ productRegion + "&id="+productid;
			}
		}
		win.focus();
	}
}

function dojump() 
{ 
	document.location.href = "Home.aspx?page=promo&id=316&r=R2";
}

function xmasjump()
{
	document.location.href = "Home.aspx?page=xmas";
}

function jansalejump()
{
	document.location.href = "Home.aspx?page=januarysale";
}

function PopUpLargeGadget(id,mainsite,pageArgs,localpur)
{
	alert("Please note that for security reasons this item will be shipped to your billing address.");	
	document.location.href=mainsite+pageArgs+localpur;
}

function showsearchtips (url)
{
	var win = window.open(url,"search","width=400,height=400,resizable=no,scrollbars=yes");
	win.focus();
}


function showMobilePhoneNetworks (url)
{
	var win = window.open(url,"","width=400,height=400,resizable=no,scrollbars=yes");
	win.focus();
}


function flagcorrections (url,id,region)
{
	var win = window.open
			  (url+"?mode=correct&pid="+id+"&r="+region,
			   "corrections",
			   "width=400,height=400,resizable=no,scrollbars=no");
	win.focus();
}


function siteseal()
{
	var win = window.open("https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.PLAYUSA.COM&lang=en", "win", "toolbar=0,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=560,height=480");
	win.focus();
}


function goquicklinks()
{
	var target = document.quicklinks.qldest[document.quicklinks.qldest.selectedIndex].value;			
	if( target != "0" )
		document.location.href=target;
}


function browseGenre()
{
	var target = document.frmBrowsegenre.browsegenre[document.frmBrowsegenre.browsegenre.selectedIndex].value;			
	if( target != "0" )
		document.location.href=target;
}


function hyperlaunchPromo(url, windowName, width, height)
{
		newWin = window.open(url,windowName,'width=' + width + ',height=' + height + ',alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=1,directories=0 ,fullscreen=0,hotkeys=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=50,screenY=50,left=50,top=50"');
}

function openATrailer(trailer, name, width, height) 
{
	var moviewin = window.open(trailer, name, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + width + ",height="+height);
	moviewin.focus();
}