

	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 openInside() { 
		width = 564;
		height = 411;
		newWindow = window.open('inside.html','Inside','width=' + width + ',height=' + height + ',top=100,left=100,resize=no,scrollbars=no' + '');
		newWindow.focus();
		return;
	}
	function openRescues() { 
		width = 746;
		height = 411;
		newWindow = window.open('rescues.html','Inside','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('cid/us/img/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('cid/us/img/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/trailer1.html','Trailer','width=714,height=464,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;
	}
	// Downloads section pop-up handler
function downloadPopUp ( target_url, id, width, height ) {
	//alert('pop engaged')
	window.open(target_url+'.html?sec=download&subsec='+target_url+'&ind='+id, null, 'width='+width+',height='+height+',menubar,status')
	
}
if (document.images) {
	var onImgArray = new Array()
	onImgArray[1] = new Image
	onImgArray[2] = new Image
	onImgArray[3] = new Image
	onImgArray[4] = new Image
	onImgArray[5] = new Image
	onImgArray[6] = new Image
	onImgArray[7] = new Image
	onImgArray[8] = new Image
	onImgArray[9] = new Image
	onImgArray[10] = new Image
	onImgArray[11] = new Image
	onImgArray[12] = new Image
	onImgArray[13] = new Image
	onImgArray[14] = new Image
	onImgArray[15] = new Image
	onImgArray[16] = new Image
	onImgArray[1].src = "images/linkbox/alo.gif"
	onImgArray[2].src = "images/linkbox/amed.gif"
	onImgArray[3].src = "images/linkbox/ahi.gif"
	onImgArray[4].src = "images/linkbox/axtrahi.gif"
	onImgArray[5].src = "images/linkbox/alo.gif"
	onImgArray[6].src = "images/linkbox/amed.gif"
	onImgArray[7].src = "images/linkbox/ahi.gif"
	onImgArray[8].src = "images/linkbox/alo.gif"
	onImgArray[9].src = "images/linkbox/amed.gif"
	onImgArray[10].src = "images/linkbox/ahi.gif"
	onImgArray[11].src = "images/linkbox/alo.gif"
	onImgArray[12].src = "images/linkbox/amed.gif"
	onImgArray[13].src = "images/linkbox/ahi.gif"
	onImgArray[14].src = "images/linkbox/alo.gif"
	onImgArray[15].src = "images/linkbox/alo.gif"
	onImgArray[16].src = "images/linkbox/ahi.gif"
	var offImgArray = new Array()
	offImgArray[1] = new Image
	offImgArray[2] = new Image
	offImgArray[3] = new Image
	offImgArray[4] = new Image
	offImgArray[5] = new Image
	offImgArray[6] = new Image
	offImgArray[7] = new Image
	offImgArray[8] = new Image
	offImgArray[9] = new Image
	offImgArray[10] = new Image
	offImgArray[11] = new Image
	offImgArray[12] = new Image
	offImgArray[13] = new Image
	offImgArray[14] = new Image
	offImgArray[15] = new Image
	offImgArray[16] = new Image
	offImgArray[1].src = "images/linkbox/lo.gif"
	offImgArray[2].src = "images/linkbox/med.gif"
	offImgArray[3].src = "images/linkbox/hi.gif"
	offImgArray[4].src = "images/linkbox/xtrahi.gif"
	offImgArray[5].src = "images/linkbox/lo.gif"
	offImgArray[6].src = "images/linkbox/med.gif"
	offImgArray[7].src = "images/linkbox/hi.gif"
	offImgArray[8].src = "images/linkbox/lo.gif"
	offImgArray[9].src = "images/linkbox/med.gif"
	offImgArray[10].src = "images/linkbox/hi.gif"
	offImgArray[11].src = "images/linkbox/lo.gif"
	offImgArray[12].src = "images/linkbox/med.gif"
	offImgArray[13].src = "images/linkbox/hi.gif"
	offImgArray[14].src = "images/linkbox/lo.gif"
	offImgArray[15].src = "images/linkbox/lo.gif"
	offImgArray[16].src = "images/linkbox/hi.gif"
}
function imageOn(i) {
	if (document.images) {
		document.images["btn" + i].src = onImgArray[i].src
	}
}
function imageOff(i) {
	if (document.images) {
		document.images["btn" + i].src = offImgArray[i].src
	}
}

function params(qp) { 
	try{r=unescape(location.search.match(new RegExp(qp+"=+([^&]*)"))[1]);}
	catch(e){r='';} 
	return r; 
}

function embedQuicktime(movieAddress, width, height) {
    //remember to add 16 vertical pixels for the nav bar
	document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="'+width+'" height="'+height+'"><param name="controller" value="TRUE"><param name="type" value="video/quicktime"><param name="autoplay" value="true"><param name="target" value="myself"><param name="src" value="'+movieAddress+'"><param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html"><embed src="'+movieAddress+'" width="'+width+'" height="'+height+'" autostart="true" CONTROLLER="TRUE" TARGET="myself" type="video/quicktime" BGCOLOR="#000000" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html"></EMBED></object>');
}
function embedRealMedia(movieAddress, width, height) {
    document.writeln('<object id=RVOCX classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+width+'" height="'+height+'"><param name="SRC" value="'+movieAddress+'"><param name="controls" value="ImageWindow"><param name="autostart" value="true"><param name="console" value="cons"><embed  name="video" console="cons" type="audio/x-pn-realaudio-plugin" controls="ImageWindow" autostart="true" src="'+movieAddress+'" width="'+width+'" height="'+height+'" controls="ImageWindow"></object><br><object id=RVOCX classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+width+'" height="30"><param name="SRC" value="'+movieAddress+'"><param name="controls" value="ControlPanel"><param name="console" value="cons"><embed  width="'+width+'" height="30" name="video" console="cons" type="audio/x-pn-realaudio-plugin" controls="ControlPanel" autostart="true" src="'+movieAddress+'"></object>');
}
function embedWindowsMedia(movieAddress, width, height) {
    //remember to add 46 vertical pixels for the nav bar
    document.writeln('<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+'"><PARAM NAME="autostart" VALUE="true"><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 embedFlash(movieAddress, width, height) {
    document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"><param name="movie" value="'+movieAddress+'" /><param name="quality" value="high" /><embed src="'+movieAddress+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>');
}
