var jclient=new Array();
jclient[1]='1';
jclient[2]='2';
jclient[3]='3';
jclient[4]='4';
jclient[5]='5';
jclient[6]='6';
jclient[7]='7';
jclient[8]='8';

var idx_client_sel=1;

function idx_client(dir){
	var link_site;
	
	if(idx_client_sel+dir>jclient.length-1)
		idx_client_sel=1;
	else if(idx_client_sel+dir==0)
		idx_client_sel=1;
	else if(idx_client_sel+dir<0)
		idx_client_sel=jclient.length-1;
	else
		idx_client_sel=idx_client_sel+dir;
	
	if(idx_client_sel==1)
		link_site="www.casinoadvisor.com";
	else if(idx_client_sel==2)
		link_site="www.topcasinooffers.com";
	else if(idx_client_sel==3)
		link_site="www.apuestacasino.com";
	else if(idx_client_sel==4)
		link_site="www.biznizmen.com";
	else if(idx_client_sel==5)
		link_site="www.blackjackenlinea.es";
	else if(idx_client_sel==6)
		link_site="www.casinopeople.com";
	else if(idx_client_sel==7)
		link_site="www.PlaySlotsCasino.com";
	else if(idx_client_sel==8)
		link_site="www.RoulettePlay.com";
	else
		link_site="www.casinoadvisor.com";	
	
	document.getElementById('client_holder').innerHTML="<a href='http://"+link_site+"' target='_blank'><img src='images/client_"+idx_client_sel+".jpg' border='0'></a>";
}

function trim(strText){
    while (strText.substring(0,1) == ' ')
	strText = strText.substring(1, strText.length);

    while (strText.substring(strText.length-1,strText.length) == ' ')
	strText = strText.substring(0, strText.length-1);

    return strText;
}

function doContact(){
    var s="";
    if(trim(document.frmContact.fname.value)==""){
		s=s+"Please, fill \"First Name\" field !\r\n";
	}
	if(trim(document.frmContact.lname.value)==""){
		s=s+"Please, fill \"Last Name\" field !\r\n";
	}
	var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");
	if(!rx.test(document.frmContact.email.value)){
		s=s+"Please, verify your \"E-mail Address\" !\r\n";
	}
	if(trim(document.frmContact.phone.value)==""){
		s=s+"Please, fill \"Phone\" field !\r\n";
	}
	if(trim(document.frmContact.country.value)==""){
		s=s+"Please, fill \"Country\" field !\r\n";
	}
	if((document.getElementById("casino").checked==false) && (document.getElementById("poker").checked==false) && (document.getElementById("bingo").checked==false) && (document.getElementById("sports_betting").checked==false) && (document.getElementById("other").checked==false)){
		s=s+"Please, indicate the products of interest by ticking the relevant boxes!\r\n";
	}
	if(trim(document.frmContact.company.value)==""){
		s=s+"Please, fill \"Company Name\" field !\r\n";
	}
	if(trim(document.frmContact.website.value)==""){
		s=s+"Please, fill \"Website(s) (URL)\" field !\r\n";
	}
	if(trim(document.frmContact.core_business.value)==""){
		s=s+"Please, fill \"Overview of current core business\" field !\r\n";
	}
	if(trim(document.frmContact.gaming_history.value)==""){
		s=s+"Please, fill \"Online gaming history or venture plans\" field !\r\n";
	}
	if(trim(document.frmContact.markets.value)==""){
		s=s+"Please, fill \"Target markets\" field !\r\n";
	}
	if(trim(document.frmContact.capital.value)==""){
		s=s+"Please, fill \"What is your capital commitment to this venture?\" field !\r\n";
	}
	if(trim(document.frmContact.launch.value)==""){
		s=s+"Please, fill \"What is your target launch date?\" field !\r\n";
	}
	if(trim(document.frmContact.comments.value)==""){
		s=s+"Please, fill \"Additional information / comments\" field !\r\n";
	}
	if(trim(document.frmContact.contact_method.value)==""){
		s=s+"Please, fill \"Preferred method of contact\" field !\r\n";
	}
	if(s!=""){
		alert(s);
		return;
	}
	document.frmContact.submit();
}