

	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;		
			}
		}
	}

	function embedQuicktime(movieAddress, width, height) {
	    height += 16; //remember to add 16 vertical pixels for the nav bar
	    document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="'+width+'" HEIGHT="'+height+'" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">');
	    document.write('<PARAM NAME="controller" VALUE="TRUE">');
	    document.write('<PARAM NAME="type" VALUE="video/quicktime">');
	    document.write('<PARAM NAME="autoplay" VALUE="true">');
	    document.write('<PARAM NAME="target" VALUE="myself">');
	    document.write('<PARAM NAME="src" VALUE="'+movieAddress+'">');
	    document.write('<PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/indext.html">');
	    document.write('<EMBED WIDTH="'+width+'" HEIGHT="'+height+'" CONTROLLER="TRUE" TARGET="myself" SRC="'+movieAddress+'" type="video/quicktime" BGCOLOR="#000000" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html"></EMBED>');
	    document.write('</OBJECT>');
	}

	function embedWindowsMedia(movieAddress, width, height) {
	    height += 46;  //remember to add 46 vertical pixels for the nav bar
	    document.write('<OBJECT ID="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"  standby="Loading Microsoft Windows Media Player components..." TYPE="application/x-oleobject" width="'+width+'" height="'+height+'"><PARAM NAME="FileName" VALUE="'+movieAddress+'" width="'+width+'" height="'+height+'"><EMBED TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" SRC="'+movieAddress+'" Name=MediaPlayer ShowControls=1 ShowDisplay=0 ShowStatusBar=0 width='+width+' height='+height+' AUTOPLAY="true"></EMBED></OBJECT>');
	}

	
	function openAIM() { 
		
		width = 715;
		height = 494;
		
		newWindow = window.open('downloads/aim/aim.html','AIM_Icons','width=' + width + ',height=' + height + ',top=100,left=100,resize=no,scrollbars=no' + '');
		newWindow.focus();
		return;
	}

	function openSweeps() { 
		
		width = 600;
		height = 533;
		newWindow = window.open('sweepstakes.html','Sweepstakes','width=' + width + ',height=' + height + ',top=100,left=100,resize=no,scrollbars=no' + '');
		newWindow.focus();
		return;
	}

	function openOrder() { 
		
  		openWin = window.open('http://go-disneyshopping.com/LeroyStitchDVD');
	
		return;
	}

	function openWallpaper(size, name) { 
		width = 800;
		height = 500;
		newWindow = window.open('downloads/wallpaper.html?size=' + size + '&name=' + name + '','Desktops','width=' + width + ',height=' + height + ',top=100,left=100,scrollbars=1' + '');
		newWindow.focus();
		return;
	} 

	function openScreensaver(platform) { 
	
		width = 400;
		height = 200;
		newWindow = window.open('downloads/screensaver.html?platform=' + platform + '','Screensaver','width=' + width + ',height=' + height + ',top=100,left=100' + '');
		newWindow.focus();
		return;
	} 

	function openPoster() { 
		width = 620;
		height = 600;
		newWindow = window.open('downloads/Poster.html','Poster','width=' + width + ',height=' + height + ',top=100,left=100' + '');
		newWindow.focus();
		return;
	} 

	function openMain() { 
		newWindow = window.open('index.html','How_To_Eat_Fried_Worms','width=1017,height=582,top=0,left=0,scrollbars=1, toolbar=1,menubar=1,location=1, status=1,resizable=1');
		newWindow.moveTo(0,0);
		newWindow.resizeTo(screen.availWidth,screen.availHeight);
		return;
	} 
	
	function popupExternal(url) { 
		newWindow = window.open('sendToFriend.html','How_To_Eat_Fried_Worms_-_Send_to_a_Friend','width=650,height=140,top=100,left=100');
		newWindow.focus();
		return;
	} 
	function sentToFriendPopup() { 
		newWindow = window.open('sendToFriend.html','How_To_Eat_Fried_Worms_-_Send_to_a_Friend','width=650,height=140,top=100,left=100');
		newWindow.focus();
		return;
	} 

	function popupTrailer() { 
		newWindow = window.open('trailer_popup.html','Trailer','width=650,height=594,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	} 
	function popupSountrack() { 
		newWindow = window.open('soundtrack.html','Sountrack','width=650,height=594,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	} 

	function popupGreetingCards(url) { 
		
		newWindow = window.open('greeting.html','GreetingCards','width=700,height=594,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	} 

	function popupMail() { 
		newWindow = window.open('sendToFriendPopup.html','SendToAFrend','width=650,height=140,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	}
	function popupWormout() { 
		
		newWindow = window.open('games/wormout.html','Wormout','width=590,height=500,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	}

	function popupWormslinger() { 
		
		newWindow = window.open('games/wormslinger.html','Wormslinger','width=770,height=430,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	}

	function popupWormaoke() { 
		newWindow = window.open('games/wormaoke.html','Wormout','width=590,height=500,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	}

	function popupPromo() { 
		newWindow = window.open('promo/index.html','Trailer','width=603,height=565,top=10,left=10,scrollbars=no');
		newWindow.focus();
		return;
	}

		function popupPressure() { 
		newWindow = window.open('pressurepoints.html','PressurePoints','width=715,height=475,top=100,left=100,scrollbars=no');
		newWindow.focus();
		return;
	}
	
	function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
		
		newWindow=window.open(URLtoOpen, windowName, windowFeatures);
	}
	function openPopup( theURL, winName, features ) { 
		
	   	window.open( theURL, winName, features ); 
	} 
	
	function openWin(url, w, h)  { 
		var winprop = "width=" + w + ",height=" + h; 
		openwin = window.open(url,'',winprop); 
	} 

	function closeMe() {
		window.close();
	}

	function initiateDownload(file) {
		window.location.href = file;
	}
