var pageRoot = "";

function popWindow( url, width, height, windowName )
{
	//var taskbarHeight = 30;
    //get center coords
    var windowLeft = (screen.width - width) / 2;
    var windowTop = (screen.height - height) / 2;
	//windowTop -= taskbarHeight;
    
    window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + windowLeft + ',top=' + windowTop);
}
function popScrollingWindow(url, width, height, windowName)
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    return window.open(url, windowName, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}
function openWindow(url)
{
    var rand = "_blank";
    return window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}
function openWindow2(url, width, height)
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;

    var rand = "_blank";
    return window.open(url,rand,'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

function popWindowUpperLeft( url, width, height, windowName )
{
    return window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=20,top=20');
}

function downloadFile(theFile)
{
    popWindow(pageRoot + "download.html?theFile="+theFile, 300, 100, "downloadWindow");
}

var debugFlag=false;
function debug(string)
{
    if (debugFlag == true)
	{
		alert(string);
	}
}

function track(trackString)
{
    switch (trackString)
    {
    case "XXXXX":
        debug(trackString);
        break;
    default:
        debug(trackString);
        break;
    }
}



function popAIM(number)
{
    popWindow(pageRoot + "aim.html?icon="+number, 500, 600, "aim_icons");
}

function popWALLPAPER(number, size)
{
	openWindow(pageRoot + "wall_"+number+"_"+size+".html");
}

function popSticker()
{
	openWindow(pageRoot + "sticker.html", 500, 600, "stickers");
}
function popSignUp()
{
	popWindow(pageRoot + "signUp.html", 420, 480, "signupPop");
}


