    //--------------------------------------------------------------------------------------
  // Sign Up Affiliate
	function Validate()
		{
	<!-- Verification that all fields are filled in properly -->
	
		if (document.New.Pass.value == "")
			{
			alert("Please select a password for your account !");
			document.New.Pass.focus();
			return false;
			}
		if (document.New.Confirm.value == "")
			{
			alert("Please enter your password again for confirmation !");
			document.New.Confirm.focus();
			return false;
			}
		if (document.New.Last.value == "")
			{
			alert("Please enter your last name !");
			document.New.Last.focus();
			return false;
			}
		if (document.New.First.value == "")
			{
			alert("Please provide your first name !");
			document.New.First.focus();
			return false;
			}
		if (document.New.Country.value == "")
			{
			alert("Please select a country of origin !");
			document.New.Country.focus();
			return false;
			}
			
		if (document.New.Country.value == "-1")
			{
			alert("Please select a country of origin !");
			document.New.Country.focus();
			return false;
			}	
			/*Changed on 12/31/2009 to pass the state when creating affiliates using the application form*/
		if (document.getElementById("lstState").value == "")
			{
			alert("Enter the State to continue !");
			//document.New.lstState.focus();
			return false;
			}
		else
		{
			document.getElementById("selectedState").value=document.getElementById("lstState").options[document.getElementById("lstState").selectedIndex].value;
			//alert(document.getElementById("selectedState").value);
		}
		if(document.New.City.value == "")
			{
			alert("Please enter the city !");
			document.New.City.focus();
			return false;
			}
		if(document.New.Address.value == "")
			{
			alert("The Address field can not be empty !");
			document.New.Address.focus();
			return false;
			}
		if (document.New.ZIP.value == "")
			{
			alert("A ZIP Code is required !");
			document.New.Zip.focus();
			return false;
			}
		if(document.New.Email.value == "")
			{
			alert("An e-mail account is necessary !");
			document.New.Email.focus();
			return false;
			}
		if(document.New.Phone.value == "")
			{
			alert("A telephone number for contact is required !");
			document.New.Phone.focus();
			return false;
			}
		if (isNaN(document.New.Phone.value) == true){
			alert("Please enter only numbers on the Phone Field");
			document.New.Phone.focus();
			return false;
		}	
		if(document.New.Website.value == "")
			{
			alert("Please provide the name of your website !");
			document.New.Website.focus();
			return false;
			}
		if(document.New.URL.value == "")
			{
			alert("Enter the URL to access your website !");
			document.New.URL.focus();
			return false;
			}
		if(document.New.Traffic.value == "")
			{
			alert("Please provide us with the average traffic of your website !");
			document.New.Traffic.focus();
			return false;
			}
			
		if (isNaN(document.New.Traffic.value) == true){
			alert("Please enter only numbers on the Avg Traffic field");
			document.New.Traffic.focus();
			return false;
		}
				
		if(document.New.Promotion.value == "")
			{
			alert("How do you plan on promote our website? !");
			document.New.Promotion.focus();
			return false;
			}
		if(document.New.Commission.value == "")
			{
			alert("Please select what type of commission you would prefer !");
			document.New.Commission.focus();
			return false;
			}
	<!-- Passwords match verification -->
		if(document.New.Pass.value != document.New.Confirm.value)
			{
			alert("The passwords you entered do not match. Please enter them again !");
			document.New.Pass.focus();
			return false;
			}
			
	<!-- checkbox validation -->		
	//alert(document.New.Pass.checked);
	if(!document.New.Terms.checked){
			alert("Please Read the Terms and check the box below");
			return false;
			}		
			
			
		//document.New.submit();
		}
		function getcountry(){
		
		 alert(document.New.Country.value);
		 document.New.action = "AffNewAffiliate.asp"
		  
		
		}

   //--------------------------------------------------------------------------------------
   
   function CheckAdmLogin()
				{
				
				//alert("test");
			 	//alert(document.LoginAdmin.User.value);
			 	
			 	if (document.LoginAdmin.User.value == "")
			 		{
			  		alert("You MUST provide a User Name !");
			  		document.LoginAdmin.User.focus();
			  		return false;
			 		}
 					if (document.LoginAdmin.password.value == "")
 						{
  						alert("You MUST provide a Password !");
  						document.LoginAdmin.password.focus();
  						return false;
 						}
 					document.LoginAdmin.submit();
				}
   
   //---------------------------------------------------------------------------------------------
  // login page
  
  function Validate_loginAFF()
				{
				//alert(document.LoginForm.password.value);
			 	if (document.LoginForm.Affiliate.value == "")
			 		{
			  		alert("You MUST provide a Login Name !");
			  		document.LoginForm.Affiliate.focus();
			  		return false;
			 		}
 					if (document.LoginForm.password.value == "")
 						{
  						alert("You MUST provide a Password !");
  						document.LoginForm.password.focus();
  						return false;
 						}
 					document.LoginForm.submit();
				}


//---------------------------------------------------------------------------------------------
// edit Password

function ValidateEditPass()
		{
		if (document.EditPass.OldPwd.value == "")
			{
			alert("You MUST enter your original password!");
			document.EditPass.OldPwd.focus();
			return false;
			}
		if (document.EditPass.NewPwd.value == "")
			{
			alert("You MUST provide a new Password !");
			document.EditPass.NewPwd.focus();
			return false;
			}
		if(document.EditPass.Confirm.value == "")
			{
			alert("Please enter your new password again to confirm !");
			document.EditPass.Confirm.focus();
			return false;
			}
		if(String(document.EditPass.OldPwd.value) != String(document.EditPass.Original.value))
			{
			alert("Your password must match our record for your account");
			document.EditPass.OldPwd.focus();
			return false;
			}
		if(document.EditPass.NewPwd.value != document.EditPass.Confirm.value)
			{
			alert("The new password entered must match in both boxes");
			document.EditPass.NewPwd.focus();
			return false;
			}
		if(document.EditPass.NewPwd.value == document.EditPass.OldPwd.value)
			{
			alert("You must enter a different password in order to change it");
			document.EditPass.NewPwd.focus();
			return false;
			}
		document.EditPass.submit();
		}
		

//---------------------------------------------------------------------------------------------

function ValidateAffEditPass()
		{
		if (document.EditPass.OldPwd.value == "")
			{
			alert("You MUST enter your original password!");
			document.EditPass.OldPwd.focus();
			return false;
			}
		if (document.EditPass.NewPwd.value == "")
			{
			alert("You MUST provide a new Password !");
			document.EditPass.NewPwd.focus();
			return false;
			}
		if(document.EditPass.Confirm.value == "")
			{
			alert("Please enter your new password again to confirm !");
			document.EditPass.Confirm.focus();
			return false;
			}
		if(String(document.EditPass.OldPwd.value) != String(document.EditPass.Original.value))
			{
			alert("Your password must match our record");
			document.EditPass.OldPwd.focus();
			return false;
			}
		if(document.EditPass.NewPwd.value != document.EditPass.Confirm.value)
			{
			alert("The new password entered must match in both boxes");
			document.EditPass.NewPwd.focus();
			return false;
			}
		if(document.EditPass.NewPwd.value == document.EditPass.OldPwd.value)
			{
			alert("You must enter a different password in order to change it");
			document.EditPass.NewPwd.focus();
			return false;
			}
		document.EditPass.submit();
		}	
		
			
//---------------------------------------------------------------------------------------------
function ajaxLoader(url,id) 
	{	
	  var valuest = "";

	  if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();	
	  }
	  if (x) {
		x.onreadystatechange = function() {
		  if (x.readyState == 4 && x.status == 200) {
			el = document.getElementById(id);		
			//alert(valuest + " " +id + " " + url + " \n " + x.responseText);
			el.innerHTML = x.responseText;
		  }
		}
		country = document.getElementById("country");
		valuest = country.options[country.selectedIndex].value;
		var finurl = url+"?con="+valuest;
		//alert(finurl);
		x.open("GET", finurl, true);
		x.send(null);
	  }
	}
//---------------------------------------------------------------------------------------------	
	function LoaderImageSize(url,id) 
	{	
	  var valuest = "";

	  if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();	
	  }
	  if (x) {
		x.onreadystatechange = function() {
		  if (x.readyState == 4 && x.status == 200) {
			el = document.getElementById(id);		
			//alert(valuest + " " +id + " " + url + " \n " + x.responseText);
			el.innerHTML = x.responseText;
		  }
		}
		sportID = document.getElementById("sportID");
		alert(sportID);
		valuest = sportID.options[sportID.selectedIndex].value;
		alert(valuest);
		var finurl = url+"?con="+valuest;
		//alert(finurl);
		x.open("GET", finurl, true);
		x.send(null);
	  }
	}

//---------------------------------------------------------------------------------------------	
	function getsize(){
	
      document.form1.action = "AFFGetBanner.asp";
      document.form1.submit();	
	
	}
	
//---------------------------------------------------------------------------------------------		
function CommissionSms(idtxt,id)
	{
	  var ErrorTXT = "";
	  
	  txt = document.getElementById(idtxt).value;
	  el = document.getElementById(id);
	  
	  if (txt == 1){
		ErrorTXT = "The commission is based on the losses of the customers referred by your website. Only when losing can you earn commission.";
	  }
	  else{
		ErrorTXT = "Commission is based on First Deposits by your referrals. <br> A maximum commission of $50 per referral. Minimum of 3 times Rollover";
	  }
	 
	     el.innerHTML = ErrorTXT; //ErrorTXT;
}	

//---------------------------------------------------------------------------------------------		
function ValidateAddUrl(){

if (document.AddUrl.url.value == "")
			{
			alert("You MUST enter the Url!");
			document.AddUrl.url.focus();
			return false;
			}

return isURL(document.AddUrl.url.value);
//return false;
}

function isURL(urlStr){
	if (urlStr.indexOf(" ")!=-1){
		alert("Spaces are not allowed in a URL");
		return false;
		}
	if(urlStr==""||urlStr==null){
		return false;
		}
		urlStr=urlStr.toLowerCase();
		var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
		var validChars="\[^\\s" + specialChars + "\]";
		var atom=validChars + '+';
		var urlPat=/^http:\/\/(\w*)\.([\-\+a-z0-9]*)\.(\w*)/;
		var matchArray=urlStr.match(urlPat);
		
	if (matchArray==null){
			alert("The URL seems incorrect \nplease check that it begins with http://\n and it has 2 dots");
			return false;
		}
		var user=matchArray[2];
		var domain=matchArray[3];
		for (i=0; i<user.length; i++) {
			if (user.charCodeAt(i)>127) {
				alert("This domain contains invalid characters.");
				return false;
				}
		}
		for (i=0; i<domain.length; i++) {
			if (domain.charCodeAt(i)>127) {
				alert("This domain name contains invalid characters.");
				return false;
				}
		}
		var atomPat=new RegExp("^" + atom + "$");
		var domArr=domain.split(".");
		var len=domArr.length;
		for (i=0;i<len;i++) {
			if (domArr[i].search(atomPat)==-1) {
				alert("The domain name does not seem to be valid.");
				return false;}
		}
		if (domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
			alert("The address must end in a well-known domain or two letter " + "country.");
			return false;
			}
		return true;
		}
		
//-------------------------------------------------------------------------------------------------

function ValidateUrlForm(){
	
	if (document.UrlForm.AffUrlId.value == "-1"){
		
		alert("Please select the Url")
		//return false;
		}
	
      document.UrlForm.submit();	
	
	}
	
	
	//-------------------------------------------------------------------------------------------------

function ValidateRequest(){
	
	
	if (document.RequestPayout.amount.value == ""){
		
		alert("Please Enter the Payout Amount")
		return false;
		}
	
      document.RequestPayout.submit();	
	
	}