function openWin(url, name, w, h, scroll) {
	var winl = ((screen.width - w) / 2);
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no,toolbar=no';
	var win = window.open(url, name, winprops);
	if(!win){
		alert('We have detected that you are using popup blocking software.\nPlease disable it and try again.');
	}
}

function openExperience(){
	openWin('index.html', 'experience', window.screen.availWidth, window.screen.availHeight, '0');
}

function openCredits(){
	openWin('credits.html', 'credits', '925', '120', '0');
}

function openTerms(){
	openWin('http://www.paramountmovies.com/legal/termsofuse.php?bgcolor=000000&linkcolor=00aad4&fontcolor=ffffff', 'terms', '530', '760', '1');
}

function openPrivacy(){
	openWin('http://www.paramountmovies.com/legal/privacypolicy.php?bgcolor=000000&linkcolor=00aad4&fontcolor=ffffff', 'privacy', '530', '760', '1');
}

function openRegister(){
	openWin('register.html', 'register', '425', '625', '0');
}

function getObject(name){
	return document.getElementById ? document.getElementById(name) : document.all ? document.all[name] : null;
}

function focusSWF(){
	getObject('main').focus();
}

function parseQuery(q_str) {
	var pairHalves;
	var queryVars = {};
	var N_V_pairs = q_str.split("&");
	var l = N_V_pairs.length;
	
	for(i=0; i<l; i++){
		pairHalves = N_V_pairs[i].split("=");
		queryVars[pairHalves[0]] = pairHalves[1];
	}
	
	return queryVars;
}