
      function is_valid_email (email)
      {
      return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
      }
	function checkonsubmit(){
		var error = "";
		

		if(document.getElementById('betjacksusername').value==""){
			error +="Enter valid username\n";
		}if(document.getElementById('name').value==""){
			error +="Enter valid name\n";
		}if (is_valid_email(document.getElementById('email').value)=="") { 
			error +="Enter valid email\n";
		}if(document.getElementById('product').value==""){
			error +="Select a product\n";
		}if(document.getElementById('message').value==""){
			error +="Enter message\n";
		}
		if(error!=""){
			error = "Please check the errors\n"+error;
			alert(error);
			return false;
		}
		return true;
		
	}
      function is_valid_email (email)
      {
      return /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
      }

	

function popupwindow(url, attribs){
attribs = attribs.replace("800","810");
attribs = attribs.replace("scrollbars=no","scrollbars=yes");
	  var popupWin = null;
    popupWin = window.open(url,'winPopup',attribs);  
	return false;
}
function DisplayTheJackpot(){
	LoadHTML("../feed/current_jackpots.php?Jackpotchoice=TotalAvailable","","JackpotTotal");
	}
function LoadTheJackpot(){
	DisplayTheJackpot(); 
	setInterval('DisplayTheJackpot()',60000);
	} //1000 = every second

function wlocation(url){
	return true;
	//// is only called in urls with ?section & article 
	str="?";
	varurl="";
	//if(url.href!=null && url.href!=""){
	varurl=url.href.replace(str,"#");
	
	location.href=varurl;
	//}
	return false;
}
function extractUrlParams(){
	
	
	subsection = false;
	subarticle = false;
////new code { working with links using # instead of ?
	var alvalue;
	alvalue="" + location + "";
if(alvalue.search(/#/)){
	alvalue=alvalue.split('#');
	
	if(alvalue[1]=='poker_promotions'){
		LoadHTML('ct_x_articles.php?section=poker&amp;article=promotions_bad_beat','','ct_main');
		LoadHTML('ct_x_articles.php?section=lh&amp;article=poker_promotions','','ct_left');
	}
	
	else if(alvalue[1]=='poker_promotions_bonus'){
	LoadHTML('ct_x_articles.php?section=poker&amp;article=promotions_signup','','ct_main');
	LoadHTML('ct_x_articles.php?section=lh&amp;article=poker_promotions','','ct_left');
	}
	
}

//new_code end
	//alert(location.split('#'));
	var t = location.search.substring(1).split('&');
	//var f = [];
	for (var i=0; i<t.length; i++){
		var x = t[ i ].split('=');
		//f[x[0]]=x[1];
		if((x[0] != "")&&(x[0] != undefined)&&(x[1] != "")&&(x[1] != undefined))
		{
			if(x[0]=="section"){subsection = true; subsectionvalue = x[1];}
			if(x[0]=="article"){subarticle = true;subarticlevalue = x[1];}
		}
	}
	//alert(subsection+"uu"+subsarticle);
	if((subsection==true)&&(subarticle==true)){LoadHTML('ct_x_articles.php?section='+subsectionvalue+'&amp;article='+subarticlevalue+'','','ct_main');};
	//return f;
}

var homeloaded=0;
function LoadHTML(url,parameters,id) {
return false;
	if(url.indexOf("mpage=")!=-1 && url.indexOf("sublh=0")!=-1 && homeloaded==1)
	return;
	
	var url = 'modules/'+ url;
	var parameters = parameters;
	var id = id;
	var myAjax = new Ajax.Updater(id , url,
		{
		method: 'get',
		parameters: parameters,
		onFailure: ErrorReport,
		evalScripts: true
		}
	)
	if(url.indexOf("mpage=")!=-1 && url.indexOf("sublh=0")!=-1)
		homeloaded=1;
	else
		homeloaded=0;
}

function ReplacePic(url,parameters,id){
	var url = '/design/pics/'+ url;
	var parameters = parameters;
	var id = id;
	var myAjax = new Ajax.Updater(id , url,
		{
		method: 'get',
		parameters: parameters,
		onFailure: ErrorReport,
		evalScripts: true
		}
	)
}

function ErrorReport(requete) {
	alert('Sorry, there is an error.');
}

/*SCRIPT ANTISPAM
var lhs = "responsiblegaming";
var rhs = "betjacks.com";

print_mail_to_link = function()
{
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(rhs + "\">" + lhs + "@" + rhs + "<\/a>");
   
}*/
