var websiteurl='http://www.playlottoworld.com';
			
 function goNews() {
 									 goto('updatearea',websiteurl+'/news.php'); 
									 return false;
 }
  function goLotteryPage(id) {
 									 goto('updatearea',websiteurl+'/playboard.php?drawid='+id); 
									 return false;
 }
  function goLotteryPage2(id,name) {
	  var make_url='/lottery-south-africa/'+id+'/'+name+'.html';
	  window.location.href=make_url;
 									// goto('updatearea',websiteurl+'/playboard.php?drawid='+id); 
									 return false;
 }
// Clear prompt from username field, if required.
  function clearYourPrompt() {
    var theField = document.getElementById("yrEmail");
    if (theField.value == "Your Email Address") {
      theField.value = "";
    }
  }

  // Set the prompt for the username field, if required.
  function setYourPrompt() {
    var theField = document.getElementById("yrEmail");
    if (theField.value == "") {
      theField.value = "Your Email Address";
    }
  }
	
	// Clear prompt from username field, if required.
  function clearInvitePrompt() {
    var theField = document.getElementById("invitefriend");
    if (theField.value == "Friends Email Address") {
      theField.value = "";
    }
  }

  // Set the prompt for the username field, if required.
  function setInvitePrompt() {
    var theField = document.getElementById("invitefriend");
    if (theField.value == "") {
      theField.value = "Friends Email Address";
    }
  }

	
	
  // Clear prompt from username field, if required.
  function clearUsernamePrompt() {
    var username = document.getElementById("username");
    if (username.value == "Email Address") {
      username.value = "";
    }
  }

  // Set the prompt for the username field, if required.
  function setUsernamePrompt() {
    var username = document.getElementById("username");
    if (username.value == "") {
      username.value = "Email Address";
    }
  }

  // Clear prompt from password field, if required.
  function clearPasswordPrompt() {
    var password = document.getElementById("password");
    password.style.display = "inline";
    password.focus();
    var passwordPrompt = document.getElementById("passwordPrompt");
    passwordPrompt.style.display = "none";
  }

  // Set the prompt for the password field, if required.
  function setPasswordPrompt() {
    var password = document.getElementById("password");
    if (password.value == "") {
      password.style.display = "none";
      var passwordPrompt = document.getElementById("passwordPrompt");
      passwordPrompt.style.display = "inline";
    }
  }




function padlength(what){
	var output=(what.toString().length==1)? "0"+what : what;
	return output;
}

function displaytime(){
	alert('ok');
	serverdate.setSeconds(serverdate.getSeconds()+1);
	var datestring=padlength(dayarray[serverdate.getDay()]+" "+serverdate.getDate())+" "+montharray[serverdate.getMonth()]+" "+serverdate.getFullYear();
	var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds());
	$('srvdate').update( datestring+' - '+timestring + ""); 
}

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
var currentPage = "";
function changeBasket() {
 goto('updatearea','basket_games.php');
}
	plogin = function(page) {
		usern = $F('username');
		upass = $F('password');
		$('panellogin').innerHTML = '<center><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';
		new Ajax.Updater('panellogin', ''+websiteurl+'/login.php', {
		  parameters: { username: usern, password : upass },
                  evalScripts:true
		});
		
		$('panelinvitefriends').innerHTML = '<center><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';
		  goto('panelinvitefriends',''+websiteurl+'/invite_friends_loggedin.php');
			if (currentPage == "basket_games.php") {
			setTimeout( "changeBasket()", 1000 );
			}
		
	usern ='';
	upass = '';
	}

	plogout = function(page) {
		$('panellogin').innerHTML = '<center><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';
		goto('panellogin',''+websiteurl+'/memberlogin.php?logout=1');
		
			 $('updatearea').innerHTML = '<center><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';		
		  goto('updatearea','home.php');
		
		$('panelinvitefriends').innerHTML = '<center><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';
		  goto('panelinvitefriends',''+websiteurl+'/invite_friends_loggedin.php');
			
	}	
	
	SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleChange);
	

	function handleChange(event) {

    var value = SWFAddress.getValue();
		value = value.substr(1, value.length);
		if (value == '') {
		value = 'home.php';
		}
	$('updatearea').innerHTML = '<center>Loading Page Content, Please Wait<br><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';		
			new Ajax.Updater('updatearea', value, {evalScripts: true});
	
		
		}
	goto = function(divid,page) {

			if (divid == "updatearea") {
			 currentPage = page;
			 SWFAddress.setValue(page);
			 	 return false;
			} else {
				$(divid).innerHTML = '<center>Loading Page Content, Please Wait<br><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';		
			new Ajax.Updater(divid, page, {evalScripts: true});
				 return false;
			}
	}
	 function movePageTo(theID) {

  var anchor_node = document.getElementById(theID);
	
  window.scrollTo(0, anchor_node.offsetTop);
return false;
}
	gotof = function(divid,page,theform) {
		 currentPage = page;
		tempvar = $(theform).serialize();
		$(divid).innerHTML = '<center>Loading Page Content, Please Wait<br><img src="'+websiteurl+'/images/gif/ajax_loaders_transparent/flower.gif" alt="" width="35" height="35" /></center>';		
			new Ajax.Updater(divid, page, {evalScripts: true, parameters:tempvar});
	}
	//TICKER
					// Call ticker from within document.observe handler for Prototype
				//document.observe("dom:loaded", function() {
				  // new ticker($$("#news dd"));
				//});

window.onload=function(){
	setInterval("displaytime()", 1000);
}
			

jQuery(document).ready(function() {	
	 
				
	jQuery(".bannermain .desc").show();
	jQuery(".bannermain .block").animate({ opacity: 0.85 }, 1 );
	jQuery(".bannerlist ul li:first").addClass('active'); 
	jQuery(".bannerlist ul li").click(function(){ 
		var imgAlt = jQuery(this).find('img').attr("alt");
		var imgTitle = jQuery(this).find('a').attr("href");
		var imgDesc = jQuery(this).find('.block').html();
		var imgDescHeight = jQuery(".bannermain").find('.block').height();
		if (jQuery(this).is(".active")) {
			return false;
		} else {
			jQuery(".bannermain .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
				jQuery(".bannermain .block").html(imgDesc).animate({ opacity: 0.85,	marginBottom: "0" }, 250 );
				jQuery(".bannermain .imgbanner").attr({ src: imgTitle , alt: imgAlt});
			});
		}
		jQuery(".bannerlist ul li").removeClass('active');
		jQuery(this).addClass('active');
		return false;
		
	}) .hover(function(){
		jQuery(this).addClass('hover');
		}, function() {
		jQuery(this).removeClass('hover');
	});
});

function checkMoney(price) {
				
				 	
							document.mygate.txtPrice.value = price + ".00";
							//goto('updatearea','sendData.php?txtPrice' + document.mygate.txtPrice.value);
						
					new Ajax.Updater('updatearea', ''+websiteurl+'/sendData.php', {
		 parameters: { txtPrice: document.mygate.txtPrice.value }
		});
					
					
}
function checkMoney11(price) {
				
				 	
							document.mygate.txtPrice.value = price + ".00";
							//goto('updatearea','sendData.php?txtPrice' + document.mygate.txtPrice.value);
						
					new Ajax.Updater('updatearea', ''+websiteurl+'/sendDataTest.php', {
		 parameters: { txtPrice: document.mygate.txtPrice.value }
		});
					
					
}
function checkMoney22() {
						 if (document.mygate.pounds.value == "" || document.mygate.pounds.value == null ) {
				 		 alert("Please enter an amount");
						 return false;	
					}
				 	 if (document.mygate.pence.value == "" || document.mygate.pence.value == null ) {
				 		document.mygate.pence.value = "00";
						return false;	
					}
								
								
								document.mygate.txtPrice.value = document.mygate.pounds.value + "." + document.mygate.pence.value;
						//goto('updatearea','sendData.php?txtPrice' + document.mygate.txtPrice.value);
					new Ajax.Updater('updatearea', ''+websiteurl+'/sendDataTest.php', {
		 parameters: { txtPrice: document.mygate.txtPrice.value }
		});
				return false;		
		
}
function checkMoney2() {
						 if (document.mygate.pounds.value == "" || document.mygate.pounds.value == null ) {
				 		 alert("Please enter an amount");
						 return false;	
					}
				 	 if (document.mygate.pence.value == "" || document.mygate.pence.value == null ) {
				 		document.mygate.pence.value = "00";
						return false;	
					}
								
								
								document.mygate.txtPrice.value = document.mygate.pounds.value + "." + document.mygate.pence.value;
						//goto('updatearea','sendData.php?txtPrice' + document.mygate.txtPrice.value);
					new Ajax.Updater('updatearea', ''+websiteurl+'/sendData.php', {
		 parameters: { txtPrice: document.mygate.txtPrice.value }
		});
				return false;		
		
}

function checkMoney3() {
						 if (document.mygate.pounds.value == "" || document.mygate.pounds.value == null ) {
				 		 alert("Please enter an amount");
						 return false;	
					}
				 	 if (document.mygate.pence.value == "" || document.mygate.pence.value == null ) {
				 		document.mygate.pence.value = "00";
						return false;	
					}
								
								
								document.mygate.txtPrice.value = document.mygate.pounds.value + "." + document.mygate.pence.value;
								withDrawAmount = parseFloat(document.mygate.txtPrice.value);
								maxAmount = parseFloat(document.mygate.max.value);
								minAmount = parseFloat(20);
								
								if (withDrawAmount > maxAmount) {
									 alert("You dont have enough funds in your account");
						 			 return false;	
								}
									if (withDrawAmount < minAmount) {
									 alert("You must withdraw at least �20");
						 return false;	
								}
								
						//goto('updatearea','sendData.php?txtPrice' + document.mygate.txtPrice.value);
					new Ajax.Updater('updatearea', ''+websiteurl+'/sendFundRequest.php', {
		 parameters: { txtPrice: document.mygate.txtPrice.value }
		});
				return false;		
		
}
 function searchByDate() {
 					
 		var dayIndex=document.searchDate.day.selectedIndex
	 var dayValue = document.searchDate.day.options[dayIndex].value;
	 if (dayValue.length < 2) {
	 		dayValue = "0"+dayValue;
	 }
	 
	 var monthIndex=document.searchDate.month.selectedIndex
	 var monthValue = document.searchDate.month.options[monthIndex].value;
	 if (monthValue.length < 2) {
	 		monthValue = "0"+monthValue;
	 }
	  var yearIndex=document.searchDate.year.selectedIndex
	 var yearValue = document.searchDate.year.options[yearIndex].value;
	 var theDate = yearValue + "-" + monthValue + "-" + dayValue;

	 var byIndex=document.searchDate.searchBy.selectedIndex
	 var byValue = document.searchDate.searchBy.options[byIndex].value;
	 
	new Ajax.Updater('updatearea', ''+websiteurl+'/ticketSearchResults.php', {
		  parameters: { theDate: theDate, searchBy :byValue }
		});
		
		
 return false;
 }
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}
function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {alert(alerttxt);return false;}
  else {return true;}
  }
}
function validate_form(thisform)
{

with (thisform)
  {
	if (validate_required(fname,"Please enter a name!")==false) {
		 fname.focus();return false;}

	if (validate_required(lname,"Please enter a last name!")==false)
  {lname.focus();return false;}
 
	if (validate_required(comments,"Please enter a comment!")==false)
  {comments.focus();return false;}
	
  if (validate_email(email,"Not a valid e-mail address!")==false)
    {email.focus();return false;}
  
	 gotof('updatearea2',''+websiteurl+'/sendComment.php',thisform);
		}	 
}
