//centered popup
var popup;
function pop(url,myWidth,myHeight ) { 
    myLeft = (screen.width-myWidth)/2;
    myTop = (screen.height-myHeight)/2;
    coords = 'scrollbars=0, resizable=0,left='+myLeft+',top='+myTop+',width='+myWidth+',height='+myHeight;
    if (popup) popup.close();
	popup=window.open(url,'popek',coords);
	}

//auto-window-size-adjusting centered image popup
var pic;
function popPic(url) { 
	var	poj=new Image;
	poj.onload=function(){
		var myWidth = this.width;
		var myHeight = this.height;
    	myLeft = (screen.width-myWidth)/2;
	    myTop = (screen.height-myHeight)/2;
    	coords = 'scrollbars=0, resizable=0, status=0, left='+myLeft+',top='+myTop+',width='+myWidth+',height='+myHeight;
    	if (pic) {pic.close();}
		pic=window.open('','',coords);
		pic.document.write('<html><head><title>Pepsi Ireland</title></head>'+'<body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 onLoad="self.focus()"><img src="'+this.src+'" onClick="opener.pic=null; self.close()"></body></html>');
		}
	poj.src=url;
}
//rollover/preloader
function roll(){
	this.src = this.src.replace("_off","_over");
	}
function out(){
	this.src = this.src.replace("_over","_off");
	}
im=document.images;

function roller(){
ladowane = new Array();
for (i=0; i<(im.length); i++) {
	if (im[i].src.search('_off.gif')!=-1){
		ladowane[i] = new Image;
		ladowane[i].src = im[i].src.replace("_off","_over");
		im[i].onmouseover = roll;
		im[i].onmouseout = out;
		}
	}
}

//fun section game launchers

function playSumo() {
	window.open('http://www.pepsi.co.uk/sumo/','sumo',  'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=750,height=440');
	
	}
function playBreakout(){
	window.open('http://www.tapety4u.eu/','breakout','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=710,height=547');
	
	}
function playFingerFooty(key,lb)
	{
	window.open('http://www.pepsi.co.uk/games/finger_footy/gamehost.aspx?key='+key+'&lb='+lb,'pepsipinballgame','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=648,height=543');
	}

function playHandball()
	{
	window.open('http://www.tapety4u.eu/','pepsihandballgame','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=552,height=586');
	}
function playBucketLauncher()
	{
	window.open('http://www.tapety4u.eu/','pepsiBucketLauncher','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=740,height=520')
	}	
function playPinballGame()
	{
	window.open('http://www.tapety4u.eu/','pepsiPinball','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=694,height=547');
	}
function playRappers()
	{
	window.open('http://81.29.93.153/games/pepsi_rap/host.asp','pepsiBucketLauncher','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=740,height=585')
	}	
function playQJumpa()
	{
	window.open('http://www.tapety4u.eu/','pepsiPinball','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=694,height=547');
	}

function playSpringDingDong()
	{
	window.open('http://www.bubblegumclub.com/Arcade/spring.html','SpringDingDong','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=400');
	}
	
function playMarbleMotion()
	{
	window.open('http://www.tapety4u.eu/games/roxiomarble.html','MarbleMotion','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=520');
	}
	
function playCaptainScarlet()
	{
	window.open('http://81.29.93.153/games/captain_scarlet/host.asp','CaptainScarlet','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=740,height=560');
	}	
	
function playAdidasClimacool()
	{
	window.open('http://81.29.93.153/games/Adidas_Climacool/host.asp','AdidasClimacool','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=740,height=560');
	}	
