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 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=530,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 browseGenre()
{
	var target = document.frmBrowsegenre.browsegenre[document.frmBrowsegenre.browsegenre.selectedIndex].value;			
	if( target != "0" )
		document.location.href=target;
}


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;
    }
}

// Reloaded JavaScript
// [a] Escape frames
// [b] Flash detection
// [c] Writing flash object or alternate GIF (no link)
// [d] Writing flash object or alternate GIF (promo banner with link)
// [e] Competition banner
// [f] Competition popup
// [g] Siteseal banner
// [h] Siteseal popup
// [i] Standard popups

// [a]
// Escape frames
if (top.location != self.location) top.location = self.location;


// [b]
// Flast detection
// moock fpi [f.lash p.layer i.nspector] | version: 1.3.7 | Original code written by Colin Moock (this is an adapted version)
flash2Installed = false;    // true if flash 2 is installed
flash3Installed = false;    // true if flash 3 is installed
flash4Installed = false;    // true if flash 4 is installed
flash5Installed = false;    // true if flash 5 is installed
flash6Installed = false;    // true if flash 6 is installed
flash7Installed = false;    // true if flash 7 is installed
flash8Installed = false;    // true if flash 8 is installed
flash9Installed = false;    // true if flash 9 is installed
requiredVersion = 5;        // version the user needs to view site (max 9, min 2)
maxVersion = 9;             // highest version we can actually detect
actualVersion = 0;          // version the user really has
hasRightVersion = false;    // true if it's safe to embed the flash movie

isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
if (isIE && isWin) {
    document.write('<scr' + 'ipt language="vbscript"\> \n');
    document.write('on error resume next \n');
    document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
    document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
    document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
    document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
    document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
    document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
    document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
    document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
    document.write('<\/scr' + 'ipt\> \n');
}

if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
        isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
        flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
        flashVersion = parseInt(flashDescription.substring(16));
        flash2Installed = flashVersion == 2;
        flash3Installed = flashVersion == 3;
        flash4Installed = flashVersion == 4;
        flash5Installed = flashVersion == 5;
        flash6Installed = flashVersion == 6;
        flash7Installed = flashVersion == 7;
        flash8Installed = flashVersion == 8;
        flash9Installed = flashVersion >= 9;
    }
}
for (i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
}
if (actualVersion >= requiredVersion) {
    hasRightVersion = true;
}

// [c]
// Write Flash object (no link)
function writeFlash(flashFile, altFile, altText, height, width) {
    if (hasRightVersion) {
        flashContent = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
    + 'height="' + height + '" width="' + width + '" '
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="' + flashFile + '">'
    + '<param name="play" value="true">'
    + '<param name="loop" value="false">'
    + '<param name="quality" value="high">'
    + '<param name="menu" value="false">'
    + '<embed src="' + flashFile + '"'
    + 'height="' + height + '" width="' + width + '" '
    + 'alt="' + altText + '" '
    + 'play="true" loop="false" quality="high" menu="false" '
    + 'type="application/x-shockwave-flash"'
    + 'pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
    + '<\/embed>'
    + '<\/object>';
        document.write(flashContent);
    } else {
        altContent = '<div><img src="' + altFile + '" height="' + height + '" width="' + width + '" alt="' + altText + '" ></div>';
        document.write(altContent);
    }
}

// [e]
// Competition banner
function competitionBanner(competitionFile, productID, productRegion, imgFile, imgWidth, imgHeight, altText) {
    bannerLink = '<div><a href="javascript:competitionPopUp(\'' + competitionFile + '\',\'' + productID + '\',\'' + productRegion + '\');"'
  + 'title="' + altText + '">'
  + '<img src="http://www.play.com/newimages/' + imgFile + '"'
  + 'width="' + imgWidth + '" height="' + imgHeight + '" alt="' + altText + '" \/><\/a></div>';
    document.write(bannerLink);
}

// [f]
// Competition popup
function competitionPopUp(competitionFile, productID, productRegion) {
    // Create popup
    popupURL = "http://competition.play.com/" + competitionFile
    popupName = productID;
    popupFeatures = "width=610,height=550,left=" + (screen.availWidth - 620) + ",top=0,resizable=no,scrollbars=yes"
    popup = window.open(popupURL, popupName, popupFeatures);
    // Place content into original browser window
    if (productID != '') {
        productID.toLowerCase();
        if (productID.indexOf("promo_") == -1) {
            if (productID.indexOf("link_") == -1) {
                document.location.href = "http://www.play.com/play247.asp?page=title&r=" + productRegion + "&title=" + productID;
            } else {
                productID = productID.replace("link_", "");
                document.location.href = "http://www.play.com/play247.asp?page=" + productID;
            }
        } else {
            productID = productID.replace("promo_", "");
            document.location.href = "http://www.play.com/play247.asp?page=promo&r=" + productRegion + "&id=" + productID;
        }
    }
    // Bring popup to front
    popup.focus();
}

// submits a webform to the url provided
function FormPost(actionUrl) {
    theForm.action = actionUrl;
    theForm.__VIEWSTATE.value = '';
}
