var pageRoot = "";

function popWindow( url, width, height, windowName )
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    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 popScrollingWindow(url, width, height, windowName)
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    win=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";
    win=window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}


function popStageToScreen()
{
	popWindow("stagetoscreen/index.html",840, 550, "stagetoscreen");
}

function popOnLocation()
{
	popWindow("onlocation/index.html",840, 600, "onlocation");
}

function popLoveHurts()
{
	popWindow("lovehurts/index.html",840, 550, "lovehurts");
}

function popFanQuiz()
{
	popWindow("fanquiz/index.html",840, 550, "fanquiz");
}

function popPartners()
{
	popWindow("partners/index.html",450, 580, "partners");
}


function popProductionNotes()
{
	popWindow("production_notes/index.html", 750, 500, "ProductionNotes");
}

function popSing()
{
	popWindow("sing_along/index.html", 750, 500, "MammaMia");
}



function showWallpaper(number)
{
	popWindow(pageRoot + "./content/wallpapers/wallpaper.html?wid="+number+"&size=1024", 544, 589, "wallpapers");
}

function popIcons()
{
	popWindow("downloads/im_icons/popup.html", 497, 550, "mmIcons");
}

function popPromotions(){
	popWindow("promotions/index.html", 560, 888, "mmPromo");
}

function popEcard()
{
	popWindow("http://ecard.mammamiamovie.com/generator.html", 500, 500, "ecard");
}
function popQuiz()
{
	popWindow("./quiz.html", 500, 500, "quiz");
}

function popFacebook(){
	openWindow("http://www.facebook.com/apps/application.php?id=18715063551");
}

function popFeaturettePopup(){
	popWindow("http://widgets.clearspring.com/c/widget.bs?wid=483f0274e955e784", 332,315, "popup_featurette");
}

function popExclusiveClip(){
	popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48642dfb851d1b93", 332,270, "exclusiveclip");
}


function popSpotsPopup(num){
	if(num == 0) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48740e284872a49c", 332,315, "popup_clip");
	}else if(num == 1) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48740e4c9d2555d2", 332,315, "popup_clip");
	}else if(num == 2) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48740dd6af44f39f", 332,315, "popup_clip");
	}else if(num == 3) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=4849d0622137f4a7", 332,315, "popup_clip");
	}else if(num == 4) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48642d8022b3142b", 332,315, "popup_clip");
	}else if(num == 5) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48642db6c9a4f6cd", 332,315, "popup_clip");
	}else if(num == 6) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=48642dda1a8bca54", 332,315, "popup_clip");
	}
}





function popWallpaper(number, size)
{
	if(size==1) {
		var size_num="800x600";
	}else if(size==2) {
		var size_num="1024x768";
	}else {
		size_num="1280x1024";
	}
	openWindow(pageRoot + "wallpaper/wallpaper.html?wallpaper="+number+"_"+size_num+".jpg");
}

function checkSize(fix)

{

   myHeight = 5;

   minHeight = 856;

   if( typeof( window.innerWidth ) == 'number' )

   {

      //Non-IE

      myHeight = window.innerHeight;

   } 

   else if( document.documentElement && ( document.documentElement.clientHeight ) ) 

   {

      //IE 6+ in 'standards compliant mode'

      myHeight = document.documentElement.clientHeight;

   } 

   else if( document.body && ( document.body.clientHeight ) ) 

   {

      //IE 4 compatible

      myHeight = document.body.clientHeight;

   }



   if( fix )

   {

      document.getElementById('flashcontainer').style.height = minHeight;

   }

   else

   {

      document.getElementById('flashcontainer').style.height = '100%';

   }

}
function popFeatureWidget() {
	popWindow("widget.html", 300, 400, "widget");
}
function popWidget(num)

{
	if(num == 1) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=4833719bded155d3", 332, 270, "widget");
	}else {

		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=477e8b1e933e4f9a", 332, 270, "widget");
	}

}


function popClipsPopup(num){
	if(num == 0) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=483f0274e955e784", 332,315, "popup_clip");
	}else if(num == 1) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d26b6c42aeac8", 332,315, "popup_clip");
	}else if(num == 2) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d2784ee2ea67a", 332,315, "popup_clip");
	}else if(num == 3) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d27bbd7b82e4d", 332,315, "popup_clip");
	}else if(num == 4) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d287a047199f7", 332,315, "popup_clip");
	}else if(num == 5) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d28bcd74b9be8", 332,315, "popup_clip");
	}else if(num == 6) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d289e182dcf2a", 332,315, "popup_clip");
	}else if(num == 7) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d2937b5973448", 332,315, "popup_clip");
	}else if(num == 8) {
		popWindow("http://widgets.clearspring.com/c/widget.bs?wid=486d29e76ba0d4f9", 332,315, "popup_clip");
	}
}




