//	QUERY SEARCH BEGIN
function QueryString(key)
{
	var value = null;
	for (var i=0;i<QueryString.keys.length;i++)
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];
			break;
		}
	return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();

function QueryString_Parse()
{
	var query = unescape(window.location.search.substring(1) );
    
	var pairs = query.split("&");
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;		
		}
	}
}

QueryString_Parse();

//	FEATURES
var feature = unescape(QueryString("feature") );

//	ECARDS
var ecard = unescape(QueryString("ecard") );
var to = unescape(QueryString("to") );
var from = unescape(QueryString("from") );
//	QUERY SEARCH END

//	GENERIC OPEN WINDOW
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//	AUTOMATICALLY POP WINDOWS IF THERE IS A VARIABLE. INDEX.HTML?______
var pageLoc = document.location;
pageLoc = pageLoc + " ";

var charNum = pageLoc.indexOf("?");
	if(charNum != -1)	{
		var page = pageLoc.substring(charNum+1,pageLoc.length-1);
		if (page == "photos")	{
				picWindow = window.open('photo/index.html','photo','width=400,height=528,resizable=0,scrollbars=0')
				picWindow.focus()
		}	else if (page == "poster")	{
				picWindow = window.open('poster/index.html','poster','width=400,height=500,resizable=1,scrollbars=1')
				picWindow.focus()
		}	else  if (page == "story")	{
				picWindow = window.open('story/index.html','story','width=380,height=470,resizable=0,scrollbars=0')
				picWindow.focus()
		}	else if (page == "trailer")	{
				picWindow = window.open('trailer/index.html','trailer','width=500,height=520,resizable=0,scrollbars=0')
				picWindow.focus()
		}	else if (page == "video" || page == "musicvideo")	{
				picWindow = window.open('video/index.html','video','width=500,height=550,resizable=0,scrollbars=0')
				picWindow.focus()
		}	else if (page == "wallpaper")	{
				picWindow = window.open('wallpaper/index.html','wallpaper','width=380,height=390,resizable=0,scrollbars=0')
				picWindow.focus()
		}	else if (page == "message")	{
				picWindow = window.open('email/index.html','wallpaper','width=516,height=390,resizable=0,scrollbars=1')
				picWindow.focus()
		}	
	}

//	FEATURE POPUPS
if (feature == "photos"){
	picWindow = window.open('photo/index.html','photo','width=400,height=528,resizable=0,scrollbars=0')
	picWindow.focus()
}
if (feature == "poster"){
	picWindow = window.open('poster/index.html','poster','width=400,height=500,resizable=1,scrollbars=1')
	picWindow.focus()
}
if (feature == "story"){
	picWindow = window.open('story/index.html','story','width=380,height=470,resizable=0,scrollbars=0')
	picWindow.focus()
}
if (feature == "trailer"){
	picWindow = window.open('trailer/index.html','trailer','width=500,height=520,resizable=0,scrollbars=0')
	picWindow.focus()
}
if (feature == "video" || feature == "musicvideo"){
	picWindow = window.open('video/index.html','video','width=500,height=550,resizable=0,scrollbars=0')
	picWindow.focus()
}
if (feature == "wallpaper"){
	picWindow = window.open('wallpaper/index.html','wallpaper','width=380,height=390,resizable=0,scrollbars=0')
	picWindow.focus()
}
if (feature == "invite"){
	picWindow = window.open('party/invite/index.html','invite','width=716,height=450,resizable=0,scrollbars=1')
	picWindow.focus()
}
if (feature == "planner"){
	picWindow = window.open('party/index.html','invite','width=716,height=450,resizable=0,scrollbars=1')
	picWindow.focus()
}
if (feature == "game"){
	picWindow = window.open('game/index.html','game','width=625,height=550,resizable=0,scrollbars=0')
	picWindow.focus()
}
//	ECARDS POPUP
if ((ecard != "null") && (ecard != "")){
	picWindow = window.open('send_to_friend/index.html?from='+from+'&ecard='+ecard,'ecards','width=500,height=540,resizable=0,scrollbars=0')
	picWindow.focus()
}

function popBurst() {
	picWindow = window.open('http://disney.go.com/disneyvideos/television/lizziemcguire/index.html','lizzieTV');
}
