if (document.images) {
	// Main nav images
	preloadImage = new Image();
	preloadImage.src = "/img/nav/homeo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gameso.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamedeliveryo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/supporto.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/investorso.gif";
	
	// Top nav images
	preloadImage = new Image();
	preloadImage.src = "/img/nav/abouto.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/mediao.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/contacto.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/sitemapo.gif";

	// Sub nav images
	preloadImage = new Image();
	preloadImage.src = "/img/nav/subnav_arrowo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/subnav_bg.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/subnav_above.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/subnav_below.gif";

	// Lozenge buttons
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gameinfo_moreo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gameinfo_whereo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/scrolllefto.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/scrollrighto.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/moreo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle_whereo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/quoteo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/chartso.gif";
	
	// Gametitle images
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle2_overviewo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle2_screenso.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle2_videoo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle2_howo.gif";
	preloadImage = new Image();
	preloadImage.src = "/img/nav/gamestitle2_reviewso.gif";
}


function sharePrice(spUrl,spWidth,spHeight){
	window.open(spUrl,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable=no,width="+spWidth+",height="+spHeight);
}

function openNew(theURL){
  window.open(theURL,'_blank','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=500');
}


/*******************************************************************
 * soopa-rollovers.js
 * 7/28/2001
 * www.youngpup.net
 *
 * easiest rollovers on earth, baby!
 * see www.youngpup.net for documentation.
 *
 * Modified by Underwired.com, London.
 *
 * Added simple link status rollovers
 * Added fix for IE's dropdown box bug
 *
 *******************************************************************/

function soopaSetup() {
	var img, sh, sn
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			sn = img.getAttribute("src");
			sh = img.getAttribute("id");
			
			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null && sh.indexOf("sub_")!=0) {
					if(sh=="more_cs"){
						sh="more";
					}
					img.h = new Image();
					img.h.src = "/img/nav/"+sh+"o.gif";
					img.onmouseover = soopaSwapOn
					img.onmouseout  = soopaSwapOff
				}
			}
		}
	}

	var thelink, theselect, sh, sn
	for (var i = 0; (thelink = document.links[i]); i++) {
		if (thelink.getAttribute) {
			if(thelink.id.indexOf("suba_")==0){
				thelink.onmouseover = rolloversub;
				thelink.onfocus = rolloversub;
				thelink.onmouseout  = rolloffsub;
				thelink.onblur  = rolloffsub;	
			}else{
				thelink.onmouseover = rollover;
				thelink.onfocus = rollover;
				thelink.onmouseout  = rolloff;
				thelink.onblur  = rolloff;	
			}
		}
	}

	for(var i = 0; (theselect = document.getElementsByTagName('select')[i]); i++){
		if (theselect.getAttribute) {
			theselect.onfocusin = SelectOnFocusIn;
			theselect.onfocus = SelectOnFocus;
		}
	}
}

function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}

function rollover() {
	thehref=this.href;
	endhref=thehref.length;
	if(thehref.substr((endhref-1), endhref)=="/"){
		thehref=thehref.substr(0,(endhref-1));
	}
	thehref=thehref.replace("http://","");
	thehref=thehref.replace("https://","");
	theid=this.id;
	window.status="[ "+thehref+" ]     "+this.title;
	return true;
}
function rolloversub() {
	thehref=this.href;
	theid=this.id;
	endhref=thehref.length;
	if(thehref.substr((endhref-1), endhref)=="/"){
		thehref=thehref.substr(0,(endhref-1));
	}
	thehref=thehref.replace("http://","");
	thehref=thehref.replace("https://","");
	theid=this.id;
	window.status="[ "+thehref+" ]     "+this.title;
	
	subimage=theid.replace("suba_","sub_");
	document.getElementById(subimage).src='/img/subnav_arrowo.gif';
	return true;
}

function rolloff(){
	theid=this.id;
	window.status=" ";
	return true;
}
function rolloffsub(){
	theid=this.id;
	window.status=" ";

	subimage=theid.replace("suba_","sub_");
	document.getElementById(subimage).src='/img/subnav_arrow.gif';
	return true;
}

function subnavarrowov(subimage){
	document.getElementById(subimage).src='/img/subnav_arrowo.gif';
}
function subnavarrowoff(subimage){
	document.getElementById(subimage).src='/img/subnav_arrow.gif';
}

//Set a temp expando to store the current selectedIndex
function SelectOnFocusIn(){
	try{
		var eSrc = window.event.srcElement;
		if (eSrc){
			eSrc.tmpIndex = eSrc.selectedIndex;
		}
	}
	catch (e){
		//HandleError(e, false);
	}
}
//restore the selectedIndex
function SelectOnFocus(){
	try{
		var eSrc = window.event.srcElement;
		if (eSrc){
			eSrc.selectedIndex = eSrc.tmpIndex;
		}
	}
	catch (e){
		//HandleError(e, false);
	}
}

function addresser(username,domain,name,word){
	var atsign = "&#64;";
	var addr = username + atsign + domain;
	document.write("<"+"a"+" "+"href="+"mail"+"to:"+addr+" title=\"Email: "+name+"\">"+word+"<\/a>");
}

// place footer at bottom
function dofooter() {
	var myHeight=0
	if(typeof(window.innerHeight)=='number'){
		//Non-IE
		myHeight = window.innerHeight;
	}else if(document.documentElement&&document.documentElement.clientHeight){
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	}else if(document.body&&(document.body.clientHeight)){
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}

	if(myHeight>553){
		document.getElementById("heightadjustdiv").innerHTML='<div><img src="img/blank.gif" width="1" height="'+eval(myHeight-82)+'" alt="" /></div>';
	}
}

function returntowindowopener(theurl){
	var isParentClosed=this.window.opener.closed;
	if(isParentClosed==false){
		this.window.opener.location=theurl;
		this.window.opener.focus();
	}else{
		window.open(theurl);
	}
}

window.onresize = dofooter;

var thedistr=0, thedistl=0;

function scrollright(thetime,thedist){
	if(thedist>13&&thedistl<15){
		thedistr=thedist;
		thedist=thedist-1;
		setTimeout("scrollright("+eval(thetime+15)+","+thedist+")", thetime);
		
		window.gamechooser.scrollBy(0,thedist);
	}
}
function scrollleft(thetime,thedist){
	if(thedist>13&&thedistr<15){
		thedistl=thedist;
		thedist=thedist-1;
		setTimeout("scrollleft("+eval(thetime+15)+","+thedist+")", thetime);
		
		window.gamechooser.scrollBy(0,-thedist);
	}
}


function checkform(ssform){
	if(ssform.enq_name.value==""|ssform.enq_name.value=="your name"){
		ssform.enq_name.focus();
		ssform.enq_name.className="alert";
		return false;
	}else{
		ssform.enq_name.className="input";
	}

	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
	if(!re.test(ssform.enq_email.value)){
		ssform.enq_email.focus();
		ssform.enq_email.className="alert";
		return false;
	}else{
		ssform.enq_email.className="input";
	}

	if(ssform.enq_enquiry.value==""|ssform.enq_enquiry.value=="your enquiry"){
		ssform.enq_enquiry.focus();
		ssform.enq_enquiry.className="alert";
		return false;
	}else{
		ssform.enq_enquiry.className="input";
	}
}

