function load_lotterywest_flash(lottoFlashURL) {
 	var so = new SWFObject("860x301_lotterywest_sandjars.swf", "flash", "860", "301", "8");
 	so.addParam("wmode", "transparent"); 	so.write("flash");

	var ebookswf = new SWFObject("/lotterywest/assets/adverts/general/3025/image", "ebookFlash", "151", "214", "9");
 	ebookswf.addParam("wmode", "transparent"); 	ebookswf.write("ebookFlash");

 	var lottoswf = new SWFObject("/lotterywest/assets/adverts/lotto/" + lottoFlashURL + "/image", "lottoFlash", "151", "214", "9");
 	lottoswf.addParam("wmode", "transparent"); 	lottoswf.write("lottoFlash");

 	var snwswf = new SWFObject("http://www.lotterywest.wa.gov.au/assets/adverts/snw/3005/image", "snwFlash", "151", "214", "9");
 	snwswf.addParam("wmode", "transparent"); 	snwswf.write("snwFlash");


 	/* OTP Section 
         - update SWFObject function call parameter 1 to read otpBanner variable 
         - update centerDiv function call parameter to read otpBanner variable */

	/* var randomBanner = (Math.floor(Math.random()*2))+1; */
        /* var otpBanner = "otpBanner" + randomBanner + ".swf"; */


        /*var bigswf = new SWFObject("otpBanner1.swf", "bigflash", "500", "350", "8");
 	bigswf.addParam("wmode", "transparent"); 	bigswf.write("bigflash");
	centerDiv("otpBanner1.swf");*/
 
 }
 
function centerDiv(bannerTitle) {
	var d = document.getElementById('bigflash');
	d.style.left = ((document.body.offsetWidth - d.offsetWidth)/2)+'px';
	d.style.top = ((document.body.offsetHeight - d.offsetHeight)/4)+'px';
	checkCookie = readCookie(bannerTitle);
	if (checkCookie == "Y"){
	
	}
	else{
		d.style.visibility='visible';
		createCookie(bannerTitle,'Y',1)
	}
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}	

