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

/*
exitLinkArray = new Array();
exitLinkArray[0] = escape("Exit_muppets+oz_sell+movies_abc_order+dvd");
exitLinkArray[1] = escape("Exit_muppets+oz_sell+movies_abc_order+soundtrack");
exitLinkArray[2] = escape("Exit_muppets+oz_multimedia_abc_trailer+e23845");
*/


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 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 popScrollingWindow2(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=1,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

function popTrailer(size) {
	if(size = "s"){
		popWindow("trailer_sm.html", 500, 400, "trailer");
	} else if (size == "m"){
		popWindow("trailer_md.html", 500, 400, "trailer");
	} else if (size == "l"){
		popWindow("trailer_lg.html", 500, 400, "trailer");
	};
    return;
}

function popWallpaper(number, size)
{
	openWindow(siteRoot + "wallpaper/wallpaper.html?image=akeelah_wall_"+number+"_"+size+".jpg");
}

function pop_pr(){
	var url="starbucks_lionsgate.pdf";
	var rand = "_bee";
	window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
	return;
}
function pop_forum(){
	var url="http://forums.lgf.com/forumdisplay.php?f=85";
	var rand = "_bee";
	window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
	return;
}

function pop_trailer(){
	var url="http://movies.yahoo.com/feature/akeelahandthebee.html;_ylt=Aqh6EF6poY5hpHD.Wbqe0FxfVXcA";
	var rand = "_bee";
	window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
	return;
}

function popRegister(){
	var url="./get_updates.html";
	var windowName = "_bee";
	var width = "400";
	var height = "500";
	
	popWindow( url, width, height, windowName );
	return;
}



/*
function downloadFile(theFile){
    popWindow(localRoot + "download.html?theFile="+theFile, 400, 200, "downloadWindow");
}
var debugFlag=false;

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");
}

function popIcons(){
	
	javascript:installIcon('serenity_river')
    //popWindow(localRoot + "aim/aim.html", 550, 560, "aim_icons");
}
*/
function popAIM(num){
	//var pagePath = "" + window.location;
    //var pageRoot = pagePath.substring(0,pagePath.lastIndexOf("/")+1);
		if(num == "1"){
		file = "AIM_ih_Renata.gif";
	}else if(num == "2"){
		file = "AIM_ih_Vic.gif";
	}else if(num == "3"){
		file = "AIM_ih_Charlie.gif";
	}else if(num == "4"){
		file = "AIM_ih_General.gif";
	}
    popWindow(localRoot + 'aim/aim.html', 439, 490, "aim");
}
/*
function popWallpaper(number, size){

	number = "0" + number;
	
	var dimensions = "";
	var size = "small";
	switch (size)
	{
	case "small":
		dimensions = "1024x768";
		break;
	case "medium":
		dimensions = "1280x960";
		break;
	case "large":
		dimensions = "1600x1200";
		break;
	default:
		dimensions = size;
		break;
	}
	openWindow(localRoot + "wallpaper/wallpaper.html?wallpaper=IH_"+number+"_"+dimensions+".jpg");
}

//----------------------------------------------------
function popSite() {
	var url = "main.html";
	popWindow(localRoot +  url, 1018, 714, "site" );
	//window.location.href="aim:BuddyIcon?src="+pageRoot+"images/"+icon+".gif";
}
//----------------------------------------------------
function installIcon(icon)
{
    var pagePath = "" + window.location;
    var pageRoot = pagePath.substring(0,pagePath.lastIndexOf("/")+1);

    //alert("aim:BuddyIcon?src="+pageRoot+"images/"+icon+".gif");
    window.location.href="aim:BuddyIcon?src="+pageRoot+"images/"+icon+".gif";
}
*/

