var localRoot = "";
var siteRoot = "";

function track(page, link){
	hitbox.Set_hbPageView(page, link);
};


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, win){
    return window.open(url,win,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}

function popWindow( url, width, height, windowName ) {
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var win = window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}
function popLink( url, width, height, windowName ) {
	popWindow( url, width, height, windowName );
}

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 popWallpaper(country, filename){
	openWindow2(siteRoot + country + "/wallpaper.html?image=../"+filename, "wllpapers");
}

function popAIM(country, filename){
	popWindow(siteRoot + country + '/aim.html?image=../'+filename, 413, 490, "aim");
}

function popSignatures(country, filename){
	popWindow(siteRoot + country + '/signatures.html?image=../'+filename, 300, 350, "signatures");
}

function popAdsPrint(country, filename, format){
	openWindow(siteRoot + country + "/ads2.html?image=../"+filename+"&format="+format);
}

function popDownload(country, filename){
	popWindow(siteRoot + filename, 200, 200, "_self");
}

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

function flashDebug(string){
	//to make sure nothing breaks
}

function popClip(clip, player, size){
    player = player.toUpperCase();
    size = size.toLowerCase();
    popWindow(localRoot + 'clips/clips.html?movie='+clip+'&size='+player+size, 648, 488, "trailer");
}
