var ext = "";
var isoky = false;
var clkps=1;
var playstop= false;
var pl = false;
var i=0;
var maxi=0;
var imglist = new Array ()
var urllist = new Array ()
function rw () {
i--;
if (i < 0) {
	i=maxi;
}
document.getElementById('picwin').background=imglist[i];
}
function play () {
playstop=false;
autoplay();
}
function stop () {
playstop=true;
}
function ff () {
i++;
if (i > maxi) {
i=0;
}
document.getElementById('picwin').background=imglist[i];
}
function autoplay () {
	if (playstop == false) {
	i++;
		if (i > maxi) {
			i=0;
		}
document.getElementById('picwin').background=imglist[i];
	timerID=setTimeout('autoplay();',5000);
	}
}
function check_ext () {
	if (ext == "com" || ext == "COM") isoky=true;
        if (ext == "net" || ext == "NET") isoky=true;
        if (ext == "org" || ext == "ORG") isoky=true;
        if (ext == "ca" || ext == "CA") isoky=true;
        if (ext == "biz" || ext == "BIZ") isoky=true;
        if (ext == "us" || ext == "US") isoky=true;
        if (ext == "name" || ext == "NAME") isoky=true;
        if (ext == "info" || ext == "INFO") isoky=true;
        if (ext == "mobi" || ext == "MOBI") isoky=true;
        if (ext == "be" || ext == "BE") isoky=true;
        if (ext == "de" || ext == "DE") isoky=true;
        if (ext == "dk" || ext == "DK") isoky=true;
        if (ext == "eu" || ext == "EU") isoky=true;
        if (ext == "es" || ext == "ES") isoky=true;
        if (ext == "fr" || ext == "FR") isoky=true;
        if (ext == "it" || ext == "IT") isoky=true;
        if (ext == "nl" || ext == "NL") isoky=true;
        if (ext == "uk" || ext == "UK") isoky=true;
        if (ext == "at" || ext == "AT") isoky=true;
        if (ext == "cc" || ext == "CC") isoky=true;
        if (ext == "cn" || ext == "CN") isoky=true;
        if (ext == "tv" || ext == "TV") isoky=true;
        if (ext == "ch" || ext == "CH") isoky=true;
        if (isoky == false) ext="";
}
function checkforvals (obj) {
	for (var i =0; i < obj.length; i++)    {
			var tmpV = obj[i].value;
			var tmpN = obj[i].name;
		if (tmpN == "Phone")	{
			for (var ii =0; ii < tmpV.length; ii++)    {
   				var c = tmpV.charCodeAt(ii); 
				//dashes && numbers only
				if ( (c > 57 || c < 48) && c != 45)        
				{
					alert("Allowed text for this field\ndigits 0-9\nPlease Re-enter");
					obj[i].focus();
					return false;
				}
			}
		}
		if (tmpV.length == 0 && tmpN !="Phone" && tmpN != "register_domain" && tmpN != "Address_Suite" && tmpN != "Prov/state" && tmpN != "Extras_Space" && tmpN != "extra_redirect" && tmpN != "extra_Stats" && tmpN != "extra_email" && tmpN != "Notes" && tmpN != "agreement" && tmpN != "Package" && tmpN != "domain_agree")	 {
			alert("This field must be filled out.\nPlease Complete");
			obj[i].focus();
			return false;
		}
	}
		var tmpV = obj["Domain_name"].value;
		var tmpN = obj["Domain_name"].name;
		ext = "";
		isoky = false;
		if (tmpN == "Domain_name") {
			for (i=tmpV.length;i> 1;i--) {
                		var b = tmpV.charAt(i);
				if (b == ".") {
                			for (f=i+1;f< tmpV.length;f++) {
						ext=ext+tmpV.charAt(f);
                        		}
					check_ext ();
				}
        		}
        		if (isoky == false) {
                	alert ("Invalid domain name (Example: affordhost.com).\n If unsure of extension check the pricing chart");
                	return false;
        		}
	}
	if (obj["passwd"].value != obj["confpass"].value)	{
		alert ("Please Confirm Password/Password not match Password Confirm");
		return false;
	}
	if (obj["register_domain"].checked)	{
		if (obj["domain_agree"].checked==false)	{
		alert("Please confirm that you have read the registration agreement");
		obj["agreement"].focus;
		return false;
		}
	}
	if (obj["agreement"].checked)	{
		return true;
	}
	else	{
		alert("Please confirm that you have read the above agreement and that you agree to all the above");
		obj["agreement"].focus;
		return false;
	}
} 
function checkfordomvals (obj) {
		var tmpV = obj["domain"].value;
		var tmpN = obj["domain"].name;
		ext = "";
		isoky = false;
		if (tmpN == "domain") {
			for (i=tmpV.length;i> 1;i--) {
                		var b = tmpV.charAt(i);
				if (b == ".") {
                			for (f=i+1;f< tmpV.length;f++) {
						ext=ext+tmpV.charAt(f);
                        		}
					check_ext ();
				}
        		}
        		if (isoky == false) {
                	alert ("Invalid domain name (Example: affordhost.com).\n");
                	return false;
        		}
			else {
			return true;
			}
		}
} 
function checkfordomvals2 (obj) {
		var tmpV = obj["domain"].value;
		var tmpN = obj["domain"].name;
		ext = "";
		isoky = false;
		if (tmpN == "domain") {
			for (i=tmpV.length;i> 1;i--) {
                		var b = tmpV.charAt(i);
				if (b == ".") {
                			for (f=i+1;f< tmpV.length;f++) {
						ext=ext+tmpV.charAt(f);
                        		}
					check_ext ();
				}
        		}
        		if (isoky == true) {
                	alert ("Invalid domain search, please do not enter a TLD  (the letters after the dot)\n (Example: affordhost).\n");
                	return false;
        		}
			else {
			return true;
			}
		}
} 
function opensite(url)  {
helpWin = window.open(url,'','dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no');
  helpWin.focus();
};
function checksupvals (obj) {
	for (var i =0; i < obj.length; i++)    {
			var tmpV = obj[i].value;
			var tmpN = obj[i].name;
		if (tmpN == "Phone")	{
			for (var ii =0; ii < tmpV.length; ii++)    {
   				var c = tmpV.charCodeAt(ii); 
				//dashes && numbers only
				if ( (c > 57 || c < 48) && c != 45)        
				{
					alert("Allowed text for this field\ndigits 0-9\nPlease Re-enter");
					obj[i].focus();
					return false;
				}
			}
		}
		if (tmpV.length == 0 && tmpN !="Phone" && tmpN !="Domain_name")	 {
			alert("This field must be filled out.\nPlease Complete");
			obj[i].focus();
			return false;
		}
	}
		var tmpV = obj["Domain_name"].value;
		var tmpN = obj["Domain_name"].name;
		ext = "";
		isoky = false;
		if (tmpN == "Domain_name") {
			for (i=tmpV.length;i> 1;i--) {
                		var b = tmpV.charAt(i);
				if (b == ".") {
                			for (f=i+1;f< tmpV.length;f++) {
						ext=ext+tmpV.charAt(f);
                        		}
					check_ext ();
				}
        		}
        		if (isoky == false) {
                	alert ("Invalid domain name (Example: affordhost.com).\n If unsure of extension check the pricing chart");
                	return false;
        		}
	}
} 

