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 popProductionNotes()
{
	popWindow("production_notes/index.html", 750, 500, "ProductionNotes");
}



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

function popIcons()
{
	popWindow("im_icons/index.html", 600, 400, "mmIcons");
}

function popIcons2()
{
	popWindow("im_icons2/index.html", 600, 400, "mmIcons");
}

function popIcons3()
{
	popWindow("im_icons3/index.html", 600, 400, "mmIcons");
}

function popTully()
{
	popWindow("tully/index.html", 449, 600, "mmTully");
}

function popFormula()
{
	popWindow("formula/index.html", 449, 600, "mmFormula");
}

function popShare() {
	popWindow("widget.html", 600, 480, "Duplicity_Trailer_Widget");
}

function popSuperBowl() {
	popWindow("superbowl_widget.html", 600, 480, "superbowl_widget");
}

function popTvWhatTimeIsIt() {
	popWindow("widget_tv_whattimeisit.html", 600, 480, "Widget_tv_WhatTimeIsIt");
}
function popTvDoIKnowYou() {
	popWindow("widget_tv_doiknowyou.html", 600, 480, "Widget_tv_DoIKnowYou");
}
function popTvPersonal() {
	popWindow("widget_tv_personal.html", 600, 480, "Widget_tv_Personal");
}
function popTvDefinition() {
	popWindow("widget_tv_definition.html", 600, 480, "Widget_tv_definition");
}
function popClip1() {
	popWindow("widget_clip1.html", 600, 480, "widget_clip1");
}
function popClip2() {
	popWindow("widget_clip2.html", 600, 480, "widget_clip1");
}
function popClip3() {
	popWindow("widget_clip3.html", 600, 480, "widget_clip1");
}
function popClip4() {
	popWindow("widget_clip4.html", 600, 480, "widget_clip1");
}
function popClip5() {
	popWindow("widget_clip5.html", 600, 480, "widget_clip1");
}


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

