	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 openAIM() { 
		width = 502;
		height = 522;
		newWindow = window.open('downloads/AIM.html','AIM_Icons','width=' + width + ',height=' + height + ',top=100,left=100' + '');
		newWindow.focus();
		return;
	} 

	function openMovie(num) {
		newWindow=window.open('downloads/movieclips/movie'+num+'/index.html','Movie','width=715,height=495,top=100,left=100' + '');
		newWindow.focus();
	}

	function openAaltoAIM() { 
		width = 502;
		height = 522;
		newWindow = window.open('downloads/aalto_aim.html','AIM_Icons','width=' + width + ',height=' + height + ',top=100,left=100' + '');
		newWindow.focus();
		return;
	}

	function openTrailer() { 
   		width = 714;
  		height = 494;
  	 	newWindow = window.open('downloads/trailerPopUp/trailer1.html','Trailer','width=' + width + ',height=' + height + ',top=100,left=100,scrollbars=0' + '');
   		newWindow.focus();
   		return;
 	} 

	function openSneakPeek() { 
   		width = 714;
  		height = 494;
  	 	newWindow = window.open('downloads/sneakPeak/sneakPeak.html','SneakPeek','width=' + width + ',height=' + height + ',top=100,left=100,scrollbars=0' + '');
   		newWindow.focus();
   		return;
 	} 

	function openWallpaper(path) { 
		width = 800;
		height = 500;
		newWindow = window.open('downloads/Wallpaper.html?path=' + path + '.jpg','Desktops','width=' + width + ',height=' + height + ',top=100,left=100,scrollbars=1' + '');
		newWindow.focus();
		return;
	} 

	function openIntWallpaper(platform) { 
		width = 400;
		height = 200;
		newWindow = window.open('downloads/IntWallpaper.html?platform=' + platform + '','Interactive_Wallpaper','width=' + width + ',height=' + height + ',top=100,left=100' + '');
		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,scrollbars=1' + '');
		newWindow.focus();
		return;
	} 


	function closeMe() {
		window.close();
	}

	function initiateDownload(file) {
		window.location.href = file;
	}

	function getPath() {
		myString = new String(location.href)
		rExp = /AIM.html/gi;
		newString = new String ("img/aim/")
		path = myString.replace(rExp, newString)
		return(path);
	}
