// JavaScript Document
var titleColours= new Array();
titleColours["home"]="#337693";
titleColours["services"]="#246B07";
titleColours["serious_games"]="#ADAD2F";
titleColours["about_us"]="#4C4C79";
titleColours["business_opportunities"]="#893607";
titleColours["contact"]="#A98235";
mainbanners=["banner0","banner1","banner2","banner3","banner4"];

function getLocationVars(){
	themes=["services","serious_games","about_us","business_opportunities","contact"]
	theme="index";	
	locationvars=document.location.href.split("/");	
	pagename=locationvars[locationvars.length-1];
	subpagenames=pagename.substring(0,pagename.indexOf(".")).split("-");	
	theme=subpagenames[0];
	
	found=false;
	for(i=0;i<themes.length;i++){
		if(themes[i]==theme){
			themenum=i;
			found=true;
		}
	}
	if(!found){
		theme="home";
		themenum=0;
	}
	
	
}


function changeBGImage(tag,thesrc){
		tag.background=thesrc;
}


function pageload(){
	
	document.getElementById("gradientimage").src="images/gradient_" + theme + ".jpg";	
	changeBGImage(document.getElementById("headerbackground"),"images/title_background_" + theme + "_sub.gif");		
	document.getElementById("bodytag").className=theme;
	
	if(subBanner==""){//Set in individual pages if a separate banner to default is needed
		subBanner=mainbanners[themenum];
	}
}


getLocationVars();

function openWindow(theURL,newWidth,newHeight,fullScreen) { //v2.0
  //features="fullscreen=1";
  features="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
  features+=",width=" + newWidth;
  features+=",height=" + newHeight;
  if(fullScreen) {
	  features+=",fullscreen=" + fullScreen;
  }
  windowName="pixel"; 
  _popup = window.open(theURL, windowName, features);
  
 	if (window.focus){
		popupTimer=setTimeout("_popup.focus()",250);		
	}
  
  return _popup;
}
function centerWindow(){
	//alert(screen.width/2);
	window.moveTo(screen.width/2-window.width/2,screen.height/2-window.height/2);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


