if (top.location != self.location) top.location = self.location;
	
// Main Competition PopUp
function PromoCompetitionPopUp(aspFile,pagelink,productRegion,width,height,x,y)
{
	// Set up Screen Size and Co-Ordinate information
	var screenheight = screen.availHeight - 10;
	var screenwidth = screen.availWidth - 10;
	var popupWidth = width;
	var popupHeight = height;

	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;
	
	// Ensure No competitions on PlayUsa.com for now
	if(aspFile != null && aspFile != 'undefined' &&  pagelink != null && pagelink != 'undefined' )
	{
		var win = null;
		var servercopy = '';

		win = window.open(aspFile, "comp", "width="+popupWidth+",height="+popupHeight+",left="+popupX+",top=0,resizable=no,scrollbars=yes");
			
		document.location.href = pagelink;
		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.PLAY.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();
}

function hyperlaunchMGM(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=1,scrollbars=1,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=50,screenY=50,left=50,top=50"');
}

function clickToEnlarge(thumbImageID,thumbOtherImageID,largeImageID)
{
	    var thumbOtherImgobj = document.getElementById(thumbOtherImageID);
            var thumbImgobj = document.getElementById(thumbImageID);
            var largeImgObj = document.getElementById(largeImageID);
            var divObj = document.getElementById('frontthumb');
            if(thumbImgobj!=null && largeImgObj!=null)
            {
               divObj.style.border = ''; 
               thumbImgobj.style.border = '2px solid #ccc';
               largeImgObj.src = thumbImgobj.src.substring(0,thumbImgobj.src.lastIndexOf(".")-1)+".jpg";
               if(thumbOtherImgobj!=null)
                   thumbOtherImgobj.style.border = '';
			}
  
}

function HideContent(d) 
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = 'none';
}

function AppendToClassName(element,className) {    
    var current = element.className;
    if (current) {
        if (current.charAt(current.length - 1) != ' ') {
            current += ' ';
        }
        current += className;
    }
    else {
        current = className;
    }
    element.className = current;
}

function RemoveClassName(element,className) {    
    var current = element.className;
    if (current) {
        if (current.substring(current.length - className.length - 1, current.length) == ' ' + className) {
            element.className = current.substring(0, current.length - className.length - 1);
            return;
        }
        if (current == className) {
            element.className = "";
            return;
        }
        var index = current.indexOf(' ' + className + ' ');
        if (index != -1) {
            element.className = current.substring(0, index) + current.substring(index + className.length + 2, current.length);
            return;
        }
        if (current.substring(0, className.length) == className + ' ') {
            element.className = current.substring(className.length + 1, current.length);
        }
    }
}

function addEvent(obj,evtType,fn)
{
    if (obj.addEventListener){
        obj.addEventListener(evtType,fn,false);
        return true;
    }
    else if (obj.attachEvent){                                          
        return obj.attachEvent("on"+evtType,fn);
    }
    else{
        return false;
    }
}