// JavaScript Document
function openGame (gID) {
	//alert ('WORKING');
	var gPath ='games/'+gID+'/index.html';
	var h= 410;
	var w = 600;
	var winl = ((screen.width-w)/2);
	var wint = ((screen.height-h)/2)-20;
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += 'scrollbars=0;resize=0';
	win = window.open(gPath,gID,settings);
	win.window.focus();	
};
function openIcon(iconName, cid){
	if(!cid){
		cid="uk";
	}
	var win = window.open(cid+'/downloads/potc_icon.html?'+iconName, 'icons', 'width=400, height=415');
	win.focus();
}
function openScreensaver(os, cid){
	if(!cid){
		cid="uk";
	}
	var win = window.open(cid+'/downloads/potc_screensaver_'+os+'.html', 'screensavers', 'width=400, height=455');
	win.focus();
}
function openWallpaper(folderName, cid){
	if(!cid){
		cid="uk";
	}
	var win = window.open(cid+'/downloads/potc_wallpaper.html?'+folderName, 'wallpapers', 'width=400, height=455');
	win.focus();
}
function openSingleWallpaper(folderName, pSize, cid){
	var imgID = folderName;
	if (!imgID) {
		imgID = "jack";
	}
	if(!cid){
		cid="uk";
	}
	
	var win = null;
	formatString = "potc2_"+imgID+"_"+pSize+".jpg";
	path = "desktops/"+ imgID + "/" + formatString;
	var settings = 'scrollbars=1,resize=1';
	win = window.open(cid+'/downloads/getPopUp.html?'+path);
	//win = window.open(cid+"/downloads/getPopUp.html?"+path+",POTC Wallpaper,"+settings);
	win.focus();

}
function openPoster (posterType) {  
	var settings = 'scrollbars=1, resize=1';
	var win = window.open('downloads/potc_poster.html?'+posterType+',poster',settings);
	win.focus();
}
function openOrgan(){
	var win = window.open('games/organ_game.html', 'games', 'width=700, height=505');
	win.focus();
}
function openTrailerPage(){
	trailers = window.open('trailers/trailer2.html', 'trailers', 'width=701, height=501');
	trailers.focus();
}
function openSuperBowl(){
	trailers = window.open('trailers/superbowl.html', 'trailers', 'width=701, height=551');
	trailers.focus();
}
function openTeaserPage(){
	teaser = window.open('trailers/index.html', 'trailers', 'width=701, height=501');
	teaser.focus();
}