var siteRoot = "";

function popVideo(cid, width, height, ftype, file){
	var url= siteRoot + cid+"/video.html?msizeW="+width+"&msizeH="+height+"&country="+cid+"&type="+ftype+"&movie="+file;
	popWindow(url, '565',  '346', 'video');
}

function popWindow( 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=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

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");
}


var debugFlag=false;
function debug(string){
	if (debugFlag == true){
		alert(string);
	}
}

function track(trackString){
	debug(trackString);
	switch (trackString){
	case "XXXXX":
		break;
	default:
		hitbox.Set_hbPageView(trackString,"/Narnia");
		break;
	}
}

function popAIMIcon(icon, cid){
	popWindow(siteRoot + cid + "/aim.html?icon="+icon, 400, 300, "aim_icons");
}

function popWallpaper(wallpaper, cid){
	openWindow(siteRoot + cid + "/wallpaper.html?image="+wallpaper);
}



