var startinterval1 = 2500;
var interval1 = 5000;
var imgi = 1;
var imgj = 4;
var preloadFlag = false;

function getpic() {
window.open('http://www.ukpaintballgames.com/pop/paintball2.html','window','width=690,height=550,toolbar=no,location=no,scrollbars=no,resizable=yes'); 
}
function newWindow() {
window.open('http://www.ukpaintballgames.com/callme.html','window','width=160,height=150,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no');
}

function terms() {
window.open('http://www.ukpaintballgames.com/content/booking-terms-conditions.html','window','width=430,height=550,toolbar=no,location=no,scrollbars=yes,resizable');
}

function post() {
window.open('http://www.ukpaintballgames.com/content/booking-by-post.html','window','width=630,height=550,toolbar=yes,location=no,scrollbars=yes,resizable');
}


function vouchers() {
window.open('http://www.ukpaintballgames.com/content/booking-vouchers.html','window','width=550,height=550,toolbar=no,location=no,scrollbars=yes,resizable');
}

function ResizeWindow(action) { 
	if(navigator.appVersion.charAt(0) >=4) { window.resizeTo (860,600) }
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt; }
}


function preloadImages() {
	if (document.images) {
main_0_r = newImage("/images/home3.gif");

preloadFlag = true;

	}
}

function changeImages(name) {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


function picinitialise(){
  window.setTimeout("RotateImg1()", startinterval1);

}

function RotateImg1(){
  document.Image1.src = "img/multi/ani_pic"+imgi+".jpg";
  if (imgi < 19)
	imgi = imgi + 1;
  else
	imgi = 1;
  window.setTimeout("RotateImg1()", interval1);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	//slideshow initialise
  picinitialise();
}

function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt; }
}



var popupWin = 0;		// reference to help window object

function openBrWindow(theURL,winName,features) { //v2.0
	return window.open(theURL,winName,features);
}

function popupflash() {

	var w = 540;
	var h = 450;
	var xdiff = ((screen.width - w) / 2);
	var ydiff = ((screen.height - h) / 2) - 50;
	
	if (typeof(popupWin) == "object" && !popupWin.closed) {
		popupWin.focus();
	}
	else {
		popupWin = openBrWindow('/flashgame.html', 'legals', 'toolbar=no,status=no,location=no,menubar=no,titlebar=no,scrollbars=yes,resizable=no,width=600,height=300,left=' + xdiff + ',top=' + ydiff + '');
	}
}
function popupcomp() {

	var w = 50;
	var h = 50;
	var xdiff = ((screen.width - w) / 2);
	var ydiff = ((screen.height - h) / 2) - 50;
	
	if (typeof(popupWin) == "object" && !popupWin.closed) {
		popupWin.focus();
	}
	else {
		popupWin = openBrWindow('sections/pop/redletterdayentry.html', 'Competition', 'toolbar=no,status=no,location=no,menubar=no,titlebar=no,scrollbars=no,resizable=no,width=380,height=282,left=' + xdiff + ',top=' + ydiff + '');
	}
}
function popupsend() {

	var w = 50;
	var h = 50;
	var xdiff = ((screen.width - w) / 2);
	var ydiff = ((screen.height - h) / 2) - 50;
	
	if (typeof(popupWin) == "object" && !popupWin.closed) {
		popupWin.focus();
	}
	else {
		popupWin = openBrWindow('http://www.ukpaintballgames.com/sections/pop/card.html', 'Send to a friend', 'toolbar=no,status=no,location=no,menubar=no,titlebar=no,scrollbars=no,resizable=no,width=580,height=380,left=' + xdiff + ',top=' + ydiff + '');
	}
}
function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if(this > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('newwin.focus();',250);
	}
}
function redshell ()
{
params="<?php echo $red; ?>";
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.writeln (' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH=443 HEIGHT=20 ID=topbar>');
document.writeln (' <PARAM NAME=movie VALUE="/redshell.swf?' + params + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#333333>');
document.writeln (' <EMBED src="/redshell.swf?' + params + '" quality=high wmode="transparent" bgcolor=#333333  WIDTH=443 HEIGHT=20 name="topbar" align="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}

function topmen () 
{

params="<?php echo $top; ?>";
document.writeln ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.writeln (' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH=742 HEIGHT=32 ID=topbar>');
document.writeln (' <PARAM NAME=movie VALUE="/topshell.swf?' + params + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#FFFFFF>');
document.writeln (' <EMBED src="/topshell.swf?' + params + '" quality=high wmode="transparent" bgcolor=#FFFFFF  WIDTH=742 HEIGHT=32 name="topbar" align="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');

}

/*
	==============================================
	|				U.L.T.I.M.A.T.E				 |
	|					v070502					 |
	==============================================
	|			Powered by Influenzae			 |
	|		For Microsoft Internet Explorer	     |
	==============================================
*/

// Main function
function Ultimate(Utype,Umsgs,Ucursor,Uwidth,Uheight,Ubgcolor,Ubackground,Uspeed,Udelay,Ufirst) {
		
	document.writeln('<span id="Ubox" style="position:relative;width:'+Uwidth+';height:'+Uheight+';overflow:hiden;background-color:'+Ubgcolor+' ;background-image:url('+Ubackground+')">')
	document.writeln('<div style="position:absolute;width:'+Uwidth+';height:'+Uheight+';clip:rect(0 '+Uwidth+' '+Uheight+' 0);left:0;top:0">')
	
	if (Utype==0) {
		document.writeln('<div id="Utxt" style="position:absolute;width:'+Uwidth+';left:0;top:'+Uheight+';">')
		document.write(Umsgs[Ufirst]);
		Uscroll(Utxt,Umsgs,Uheight,Uspeed,Udelay,Ufirst);
	}
	if (Utype==1) {
		document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:'+Uwidth+';top:0;">')
		document.write(Umsgs[Ufirst]);
		Uside(Utxt,Umsgs,Uwidth,Uspeed,Udelay,Ufirst);
	}
	if (Utype==2) {
		document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:'+(Uwidth*-1)+';top:0;">')
		document.write(Umsgs[Ufirst]);
		Ureverseside(Utxt,Umsgs,Uwidth,Uspeed,Udelay,Ufirst,false);
	}
	if (Utype==3) {
		document.writeln('<div id="Utxt"  style="position:absolute;width:'+Uwidth+';left:0;top:0;overflow:hiden;background-color:'+Ubgcolor+' ;">')
		document.write(Umsgs[Ufirst]);
		document.writeln('</div>')
		document.writeln('<div id="Umask"  style="position:absolute;width:'+Uwidth+';left:0;top:0;overflow:hiden;background-color:'+Ubgcolor+' ;">')
		document.write(Ucursor);
		Utouch(Utxt,Umask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ufirst,1,false);
	}
	document.writeln('</div>')
	document.writeln('</div>')
	document.writeln('</span>')
}

// Moves
function Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ufirst){
	ttxt=eval(IDdiv);
	Ustep=eval(Ufirst);
	if (ttxt.style.pixelTop>0&&ttxt.style.pixelTop<=5){
	ttxt.style.pixelTop=0;
	setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
	return
	}
	else {
		if (ttxt.style.pixelTop>=ttxt.offsetHeight*-1){
		ttxt.style.pixelTop-=5
		setTimeout("Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep)",Uspeed);
		return
		}
		else {
		ttxt.style.pixelTop=Uheight;
		if (Ustep>=Umsgs.length-1)
			Ustep=0
			else		
			Ustep++;
		ttxt.innerHTML=Umsgs[Ustep];
		Uscroll(ttxt,Umsgs,Uheight,Uspeed,Udelay,Ustep);
		}
	}
}

function Uside(IDdiv,Umsgs,Uwidth,Uspeed,Udelay,Ufirst){
	ttxt=eval(IDdiv);
	Ustep=eval(Ufirst);
	if (ttxt.style.pixelLeft>0&&ttxt.style.pixelLeft<=5){
	ttxt.style.pixelLeft=0;
	setTimeout("Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Udelay);
	return
	}
	else {
		if (ttxt.style.pixelLeft>=ttxt.offsetWidth*-1){
		ttxt.style.pixelLeft-=5
		setTimeout("Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Uspeed);
		return
		}
		else {
		ttxt.style.pixelLeft=Uwidth;
		if (Ustep>=Umsgs.length-1)
			Ustep=0
			else		
			Ustep++;
		ttxt.innerHTML=Umsgs[Ustep];
		Uside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep);
		}
	}
}

function Ureverseside(IDdiv,Umsgs,Uwidth,Uspeed,Udelay,Ufirst,stop){
	ttxt=eval(IDdiv);
	Ustep=eval(Ufirst);
	if (ttxt.style.pixelLeft>0&&ttxt.style.pixelLeft<=5&&(!stop)) {
	setTimeout("Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep,true)",Udelay);
	return
	}
	else {
		if (ttxt.style.pixelLeft<ttxt.offsetWidth){
		ttxt.style.pixelLeft+=5;
		setTimeout("Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep)",Uspeed);
		return
		}
		else {
		ttxt.style.pixelLeft=Uwidth*-1;
		if (Ustep>=Umsgs.length-1)
			Ustep=0
			else		
			Ustep++;
		ttxt.innerHTML=Umsgs[Ustep];
		Ureverseside(ttxt,Umsgs,Uwidth,Uspeed,Udelay,Ustep);
		}
	}
}

function Utouch(IDdiv,IDmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ufirst,Ufirstsens,stop){
	ttxt=eval(IDdiv);
	tmask=eval(IDmask);
	Ustep=eval(Ufirst);
	Usens=eval(Ufirstsens);
	if (tmask.style.pixelLeft>Uwidth){
	tmask.style.pixelLeft=Uwidth;
	setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,-1)",Udelay);
	return
	}
	else if (tmask.style.pixelLeft>=-5&&tmask.style.pixelLeft<0&&(!stop)){
	tmask.style.pixelLeft=-5;
	if (Ustep>=Umsgs.length-1)
			Ustep=0
			else		
			Ustep++;
	ttxt.innerHTML=Umsgs[Ustep];
	setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,1,true)",Udelay);
	return
	}
	else {
		tmask.style.pixelLeft+=(5*Usens);
		setTimeout("Utouch(ttxt,tmask,Umsgs,Ucursor,Uwidth,Uspeed,Udelay,Ustep,Usens)",Uspeed);
		return
	}
}
/*
	==============================================
	|				U.L.T.I.M.A.T.E				 |
	|					v070502					 |
	==============================================
	|			Powered by Influenzae			 |
	==============================================
*/
