// misc gs javascript functions used on many pages

function openDec(url, name, w, h) {
        popupWin = window.open(url, name, 'resizable=0,scrollbars=1,width=' + w + ',height=' + h + '');
    // focus window (only for Navigator >= 3.0)
    if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
    popupWin.focus();
}
function launchGSL(url, name, w, h) {
        popupWin = window.open(url, name, 'resizable=0,scrollbars=0,width=' + w + ',height=' + h + '');
    // focus window (only for Navigator >= 3.0)
    if ( (navigator.appName != "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1) == "3") )
    popupWin.focus();
}

function addgamepop(id,list) {
    popupWin = window.open('/user/add_game_pop.html?pid=' + id + '&list=' + list, 'trackpop', 'width=197,height=152,resizable=0,scrollbars=0');
}

var isIMG = document.images;
var Arrowon;
var Arrowoff;

if (isIMG) {
   Arrowon = new Image(7,7);
   Arrowon.src = "http://image.com.com/gamespot/shared/arrow_on.gif";
   Arrowoff = new Image(7,7);
   Arrowoff.src = "http://image.com.com/gamespot/shared/arrow_off.gif";
}
function Arrow(Arrowname) {
   if (isIMG) {
     document[Arrowname].src = (document[Arrowname].src.indexOf('arrow_on.gif') != -1) ? 'http://image.com.com/gamespot/shared/arrow_off.gif' : 'http://image.com.com/gamespot/shared/arrow_on.gif';

   }
}
function change(form){
    var page= document.form.site.options[document.form.site.selectedIndex].value;
    window.location.href = page;
}

var thisPageURL = window.location.href;
var popupRes = thisPageURL.match(/gscpopup/g);
if (popupRes == null) {
    window.name="mainWindow";
}

var url = document.referrer;
function newWindow(newContent) {
    winContent = window.open(newContent, 'nextWin', 'left=100,top=10,width=450,height=485,toolbar=no,scrollbars=no,resizable=no');
    if (document.referrer.length > 0) {
        window.location.href = document.referrer;
    }
}

function newWindow2(newContent) {
    winContent = window.open(newContent, 'nextWin', 'left=100,top=10,width=450,height=485,toolbar=no,scrollbars=no,resizable=no');
}

function mOvr(src,clrOver){
    if (!src.contains(event.fromElement)){
        src.style.cursor = 'hand';
        src.bgColor = clrOver;
    }
}

function mOut(src,clrIn){
    if (!src.contains(event.toElement)){
        src.style.cursor = 'default';
        src.bgColor = clrIn;
    }
}

function mClk(src){
    if(event.srcElement.tagName=='TD')
        src.children.tags('A')[0].click();
}

var hidetracking = 0;



function mobilewizardpop(isnew, pid) {
    URL = "/finder/mobile_wizard.html?";
    if (isnew) {
        URL = URL + "new=1&";
    }
    if (pid) {
        URL = URL + "pid=" + pid + "&";
    }
    URL = URL.substring(0, URL.length-1);
    day = new Date();
    oldid = day.getTime();
    id = "mobile_wizard";
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=758,height=400');");
}

function mobilewizardpop_gsc(isnew, pid) {
    URL = "/finder/mobile_wizard.html?";
    if (isnew) {
        URL = URL + "new=1&";
    }
    if (pid) {
        URL = URL + "pid=" + pid + "&";
    }
    URL = URL.substring(0, URL.length-1);
    day = new Date();
    oldid = day.getTime();
    id = "mobile_wizard";
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400');");
}

function screenPopUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=1');");
	eval("page" + id + ".resizeTo(10,10);");
	eval("page" + id + ".moveTo(20,20);");
}

function myVoid() { }

