var whitespace = " \t\n\r";
var defaultEmptyOK = false;
function ajaxFunction(url,action)
  {  
var xmlHttp;
  try
    {    
// Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
			tcpres=xmlHttp.responseText;
			//alert(tcpres);
			document.getElementById('results').value=tcpres;
			switch (action)
			{
			case 'checkname':
				var t=setTimeout("displayresults()",1000)
			break
			case 'whoislookup':
				var t=setTimeout("displaywhoisresults()",1000)
			break
			case 'metavalidate':
				var t=setTimeout("displaymetavalidateresults()",1000)
			break
			case 'checkpop':
				var t=setTimeout("displaypopresults()",1000)
			break
			case 'bulkcheck':
				displaybulkcheck()
				//var t=setTimeout("displaybulkcheck()",1)
			break
			case 'myiplookup':
				var t=setTimeout("displaymyipresults()",1000)
			break
			default:
			}
			//displayresults();
			//return tcpres;
        }
      }
	xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
  }

function checkname()
{
			document.registerForm.searchbutton.disabled=true;
			if ( isWhitespace(document.getElementById('domain').value) )
			{
				alert("Please Enter a Domain");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			var isInvalid=document.getElementById('domain').value.indexOf(".");
			if (isInvalid<=0)
			{
				alert("Invalid Domain Name\nDomain Name needs to be in the format of SLD.TLD (e.g. droc.ca)");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			if (!isLegal(document.getElementById('domain').value))
			{
				alert("Invalid Domain Name\nIllegal Character found\nDomain Name needs to be in the format of SLD.TLD (e.g. droc.ca)");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			var TLDx
			var TLDcontinue="No"
			var myTLDs = new Array()
			myTLDs[0]=".com"
			myTLDs[1]=".net"
			myTLDs[2]=".org"
			myTLDs[3]=".info"
			myTLDs[4]=".biz"
			myTLDs[5]=".ca"
			myTLDs[6]=".ws"
			myTLDs[7]=".tv"
			myTLDs[8]="co.uk"
			myTLDs[9]="org.uk"
			myTLDs[10]=".cc"
			myTLDs[11]=".name"
			for (TLDx in myTLDs)
			{
				var TLD2check=myTLDs[TLDx];
				var isValidTLD=document.getElementById('domain').value.toLowerCase().indexOf(TLD2check);
				//var isValidTLD=$('domain').indexOf(TLD2check);
				//alert (isValidTLD)
				if (isValidTLD>0)
				{
					TLDcontinue+="Yes"
				}
				else
				{
					TLDcontinue+="No"
				}
			}
			//alert (TLDcontinue.indexOf("Yes"))
			if (TLDcontinue.indexOf("Yes")>0)
			{
				//Its Fine
			}
			else
			{
					alert("Invalid TLD. Please try another TLD e.g. .com .net .org");
					document.registerForm.searchbutton.disabled=false;
					return false;
			}
			var url2send='check.asp?randSID='+Math.random()+'&dom='+document.getElementById('domain').value+'&type=domain';
			domstatusSTR='<fieldset><legend>Checking '+document.getElementById('domain').value+' Status</legend>'
			domstatusSTR+='<table border="0" bgcolor="white" align="center" width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			//domstatusSTR+='Site Undergoing Planned Maintenance. Please Try Again Later'
			domstatusSTR+='This process may take up to 30 seconds.'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='<img src="images/working.gif" border="0">'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('register_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			var sendurl=ajaxFunction(url2send,'checkname');

}

function checkpop()
{
			document.registerForm.searchbutton.disabled=true;
			if ( isWhitespace(document.getElementById('domain').value) )
			{
				alert("Please Enter a Domain");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			var isInvalid=document.getElementById('domain').value.indexOf(".");
			if (isInvalid<=0)
			{
				alert("Invalid Domain Name\nDomain Name needs to be in the format of SLD.TLD (e.g. droc.ca)");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			if (!isLegal(document.getElementById('domain').value))
			{
				alert("Invalid Domain Name\nIllegal Character found\nDomain Name needs to be in the format of SLD.TLD (e.g. droc.ca)");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			var url2send='check.asp?randSID='+Math.random()+'&dom='+document.getElementById('domain').value+'&type=domain';
			domstatusSTR='<fieldset><legend>Checking POP status for '+document.getElementById('domain').value+'</legend>'
			domstatusSTR+='<table border="0" bgcolor="white" align="center" width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='This process may take up to 30 seconds.'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='<img src="images/working.gif" border="0">'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('register_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			document.getElementById('results').value="<pre><e>2</e></pre>";
			var t=setTimeout("displaypopresults()",1000)
			//var sendurl=ajaxFunction(url2send,'checkpop');
}

function bulkcheck(domain)
{
	var url2send='check.asp?randSID='+Math.random()+'&dom='+domain+'&type=domain';
	var sendurl=ajaxFunction(url2send,'bulkcheck');
}

function displayresults()
{
			var verisignres=document.getElementById('results').value
			//alert(verisignres);
			var startstr=verisignres.indexOf("<pre>")+5;
			var endtstr=verisignres.indexOf("</pre>");
			var whoisresponse=verisignres.substring(startstr,endtstr);
			var whatstatus=whoisresponse.substring(whoisresponse.indexOf("<e>")+3,whoisresponse.indexOf("</e>"));
			var defaultprice=whoisresponse.substring(whoisresponse.indexOf("<defaultprice>")+14,whoisresponse.indexOf("</defaultprice>"));
			var dom=whoisresponse.substring(whoisresponse.indexOf("<inDomain>")+10,whoisresponse.indexOf("</inDomain>"));
			var emsg=whoisresponse.substring(whoisresponse.indexOf("<errormsg>")+10,whoisresponse.indexOf("</errormsg>"));
			switch(whatstatus)
			{
				case '0':
					var isavailableSTR="<b>"+dom+"</b> is available for registration";
					var whattype="N";
					var expdate="";
					break
				case '3':
					var isavailableSTR="<b>"+dom+"</b> can not be processed.<br><br><span class=small>Please call our customer service department at 1-866-434-0212.</span>";
					var whattype="F";
					var expdate="";
					break
				case '4':
					var isavailableSTR="<b>"+dom+"</b> can not be processed.<br><br><span class=small>Please call our customer service department at 1-866-434-0212</span>";
					var whattype="F";
					var expdate="";
					break
				case '5':
					var isavailableSTR="<b>"+dom+"</b> can not be processed.<br><br> The domain is in REDEMPTION status.<br> Please call our customer service department for your options at 1-866-434-0212</span>";
					var whattype="F";
					var expdate="";
					break
				case '-1':
					var isavailableSTR="<b>"+dom+"</b> can be processed at this time.";
					var whattype="T";
					var expdate="";
					break
				case '888':
					var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br><br><span class=small> Please call our customer service department for your options <br>Toll Free: 1-866-434-0212</span>";
					var whattype="F";
					var expdate="";
					break
				case '88':
					var isavailableSTR="<b>"+dom+"</b> is invalid. " + emsg;
					var whattype="F";
					var expdate="";
					break
				case '1':
					var isavailableSTR="<b>"+dom+"</b> can be Renewed/Transferred.<br><br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					break
				case '2':
					var isavailableSTR="<b>"+dom+"</b> is available for renewal.<br><br><span class=small><i>Please Note:</i> Only the registered name holder can renew this name!</span>";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="E";
					break
				default:
					var isavailableSTR="<b>"+dom+"</b> is NOT Available for Registration<br><br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					if (whatstatus>1)
					{
						var isavailableSTR="<b>"+dom+"</b> can be Renewed<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
						var whattype="E";
					}
			}
			//alert(whattype)
			domstatusSTR=''
			domstatusSTR+='<fieldset><legend>Domain Status</legend>\n'
			domstatusSTR+='<table border=0 id="domainstatus_table" width="100%">\n'
			domstatusSTR+='<tr valign="top">\n'
			domstatusSTR+='<td>\n'
				domstatusSTR+='<table border="0" id="domainstatusleft_table" width="100%">\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td valign="top" width="25%">Domain:</td>\n'
				domstatusSTR+='<td width="75%">\n'
				domstatusSTR+='<span id="isavail" class="isavail">'+isavailableSTR+'</span>\n'
				domstatusSTR+='</td>\n'
				domstatusSTR+='</tr>\n'
			if (whattype=='F')
			{
			}
			else
			{
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td>Expiry Date:</td>\n'
				domstatusSTR+='<td>\n'
				domstatusSTR+='<span><span id="exp" class="small"><b>'+expdate+'</b></span></span>\n'
				domstatusSTR+='<input type="hidden" id="exphidden" name="exphidden" value="'+expdate+'">\n'
				domstatusSTR+='</td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td>Number of Years:</td>\n'
				domstatusSTR+='<td>\n'
				domstatusSTR+='<select id="domList" onchange="gettotal()">\n'
				//domstatusSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>'
				domstatusSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
				domstatusSTR+='</select>\n'
				domstatusSTR+='</td>\n'
				domstatusSTR+='</tr>\n'
				/*domstatusSTR+='<tr>'
				domstatusSTR+='<td>result:</td>'
				domstatusSTR+='<td>'
				domstatusSTR+='<textarea cols="30" rows="6">'+whoisresponse+'</textarea>'
				domstatusSTR+='</td>'
				domstatusSTR+='</tr>'*/
			}
				domstatusSTR+='</table><br>\n'
			domstatusSTR+='</td>\n'
			domstatusSTR+='</tr>\n'
			domstatusSTR+='</table>\n'
			domstatusSTR+='</fieldset>\n'
			if (whattype=='F')
				{
				}
			else
				{
				domstatusSTR+='<br>\n'
				domstatusSTR+='<fieldset><legend>Included Service with Every Domain</legend>\n'
				domstatusSTR+='<table border=0 id=servicesfree_table>\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td><ul><li><b>Free Web Hosting</b></li><li>Free Domain Privacy</li><li>Email Forwarding</li><li>Total DNS Control</li><li>Domain Locking</li><li>Free Parked Page</li></ul></td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='</table>\n'
				domstatusSTR+='</fieldset>\n'
				domstatusSTR+='<br>\n'
				domstatusSTR+='<fieldset><legend>Optional Paid Services</legend>\n'
				servicesoptionaltext='These services are only for the primary Domain.<b>('+dom+')</b><br><br>If you wish to purchase Search Submission or POP3 email for any of the optional names below<br>please call us at 1-866-434-0212.<br>\n'
				domstatusSTR+='<table width="100%" border=0 id=servicesoptional_table>\n'
				domstatusSTR+='<tr>\n'
				ssexplaintext='DROC now offers Search Engine Submission for only $40/year. Over 85% of Internet users find what they are looking for, on the Web, by searching through Search Engines.<br><br>Get YOUR site listed on the top Engines!\n'
				domstatusSTR+='<td width="25%"><u><a onmouseover=optionalserviceexplain(ssexplaintext) onmouseout=optionalserviceexplain(servicesoptionaltext)>Search Engine Submission:</u></a></td>\n'
				//domstatusSTR+='<td><u>Search Engine Submission:</u></td>'
				domstatusSTR+='<td>\n'
				domstatusSTR+='<select id="ssList" onchange=gettotal()>\n'
				domstatusSTR+='<option value="0|0">None</option>\n'
				domstatusSTR+='<option value="1|40">1 year ($40.00)</option>\n'
				domstatusSTR+='<option value="2|70">2 years ($70.00)</option>\n'
				domstatusSTR+='<option value="5|160">5 years ($160.00)</option>\n'
				domstatusSTR+='<option value="10|280">10 years ($280.00)</option>\n'
				domstatusSTR+='</select>\n'
				domstatusSTR+='</td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='<tr>\n'
				popexplaintext='DROC now offers pop3 E-mail accounts for as low as $15/year. Why use your hotmail, AOL, or yahoo account when you can have a professional address like sales@'+dom+' or you@'+dom+'.<br><br>Take advantage of our low introductory pricing and save big!\n'
				domstatusSTR+='<td><u><a onmouseover=optionalserviceexplain(popexplaintext) onmouseout=optionalserviceexplain(servicesoptionaltext)>POP3 Email:</u></a></td>\n'
				//domstatusSTR+='<td><u><a onmouseover=show_popup(event,popexplaintext)>POP3 Email:</u></a></td>'
				//domstatusSTR+='<td><u>POP3 Email:</u></td>'
				domstatusSTR+='<td>\n'
				domstatusSTR+='<select id="p3List" onchange=gettotal()>\n'
				domstatusSTR+='<option value="0|0">None</option>\n'
				domstatusSTR+='<option value="1|15">Bronze Package (5 Accounts, 10 Megs,$15)</option>\n'
				domstatusSTR+='<option value="2|30">Standard Package (10 Accounts, 10 Megs,$30)</option>\n'
				domstatusSTR+='<option value="3|45">Gold Package (10 Accounts, 30 Megs,$45)</option>\n'
				domstatusSTR+='<option value="4|60">Platinum Package (20 Accounts, 30 Megs,$60)</option>\n'
				domstatusSTR+='</select>\n'
				domstatusSTR+='</td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td colspan="2">'+servicesoptionaltext+'</td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='</table>\n'
				domstatusSTR+='</fieldset>\n'
				if (whoisresponse.indexOf("<othername")>0)
					{
					domstatusSTR+='<br>\n'
					domstatusSTR+='<fieldset><legend>Optional Available Names for Registration:</legend>\n'
					domstatusSTR+='<table border=0 id=domainoptional_table>\n'
					for (i=0;i<=3 ;i++ )
					{
						if (whoisresponse.indexOf("<othername_"+i+">")>0)
							{
							domstatusSTR+='<tr>\n'
							otherdom=whoisresponse.substring(whoisresponse.indexOf("<othername_"+i+">")+13,whoisresponse.indexOf("</othername_"+i+">"))
							domstatusSTR+='<td><b>'+otherdom.split(".")[0]+'.'+otherdom.split(".")[1]+'</b>: <input type="hidden" id="othername_'+i+'" name="othername_'+i+'" value="'+otherdom+'"></td>\n'
							domstatusSTR+='<td>\n'
							domstatusSTR+='<select name="domList_'+i+'" id="domList_'+i+'" onchange="gettotal()">\n'
							domstatusSTR+='<option value="0|0">None</option>\n'
							domstatusSTR+=whoisresponse.substring(whoisresponse.indexOf("<pricelist_default>")+15,whoisresponse.indexOf("</pricelist_default>"));
							domstatusSTR+='</select>\n'
							domstatusSTR+='</td>\n'
							domstatusSTR+='</tr>\n'
							}
						else
							{
							domstatusSTR+='<tr>\n'
							domstatusSTR+='<td colspan="2">\n'
							domstatusSTR+='<input type="hidden" name="othername_'+i+'" id="othername_'+i+'" value=""><input type="hidden" id="domList_'+i+'" name="domList_'+i+'" value="0|0">\n'
							domstatusSTR+='</td>\n'
							domstatusSTR+='</tr>\n'
							}
					}
					domstatusSTR+='</table>\n'
					domstatusSTR+='</fieldset>\n'
					}
				else
					{
						//No Extra Names
						domstatusSTR+='<table border=0 id=domainoptional_table>\n'
						domstatusSTR+='<tr>\n'
						domstatusSTR+='<td colspan="2">\n'
						for (i=0;i<=3 ;i++ )
						{
							domstatusSTR+='<input type="hidden" name="othername_'+i+'" value="">\n'
							domstatusSTR+='<input type="hidden" name="domList_'+i+'" value="0|0">\n'
						}
						domstatusSTR+='</td>\n'
						domstatusSTR+='</tr>\n'
						domstatusSTR+='</table>\n'
					}
				domstatusSTR+='<br>\n'
				domstatusSTR+='<fieldset><legend>Sub Total</legend>\n'
				domstatusSTR+='<table border=0 id=subtotal_table>\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td class="subtotal"><span id="total" class="total">'+defaultprice+'</span></td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='</table>\n'
				domstatusSTR+='</fieldset>\n'
				domstatusSTR+='<br>\n'
				domstatusSTR+='<table border=0 id=add2cart_table>\n'
				domstatusSTR+='<tr>\n'
				domstatusSTR+='<td><input type="hidden" value="" name="checkeddomain" id="checkeddomain"><input type="hidden" value="" name="whattype" id="whattype"><input type="button" value="Add To Cart" onclick="addtocart();" class="button"></td>\n'
				domstatusSTR+='</tr>\n'
				domstatusSTR+='</table>\n'
				}
			var x=document.getElementById('register_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			if (whattype=='F')
			{
				document.registerForm.searchbutton.disabled=false;
			}
			else
			{
			document.getElementById('checkeddomain').value=dom;
			document.getElementById('whattype').value=whattype;
			var x=document.getElementById('register_Table').rows[0].cells;
			x[0].innerHTML='';
			}
			//dom='';
			if (whattype=='N')
			{
				var x=document.getElementById('domainstatusleft_table').rows[1].cells;
				x[0].innerHTML='';
				x[1].innerHTML='';
			}
}


function displaypopresults()
{
			var verisignres=document.getElementById('results').value
			//alert(verisignres);
			var startstr=verisignres.indexOf("<pre>")+5;
			var endtstr=verisignres.indexOf("</pre>");
			var whoisresponse=verisignres.substring(startstr,endtstr);
			var whatstatus=whoisresponse.substring(whoisresponse.indexOf("<e>")+3,whoisresponse.indexOf("</e>"));
			var dom=document.getElementById('domain').value;
			switch(whatstatus)
			{
				case '0':
					var isavailableSTR="<b>"+dom+"</b> is available for registration";
					var whattype="N";
					var expdate="";
					break
				case '3':
					var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br>Please call our customer service department at 1-866-434-0212.";
					var whattype="F";
					var expdate="";
					break
				case '4':
					var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br>Please call our customer service department at 1-866-434-0212";
					var whattype="F";
					var expdate="";
					break
				case '5':
					var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br> The domain is in REDEMPTION status.<br> Please call our customer service department for your options at 1-866-434-0212";
					var whattype="F";
					var expdate="";
					break
				case '-1':
					var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br> Please Try Again Later <br>or<br> Please call our customer service department for your options at 1-866-434-0212";
					var whattype="F";
					var expdate="";
					break
				case '88':
					var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br> Please call our customer service department for your options <br>Toll Free: 1-866-434-0212";
					var whattype="F";
					var expdate="";
					break
				case '1':
					var isavailableSTR="<b>"+dom+"</b> can be Renewed/Transferred.<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					break
				case '2':
					var isavailableSTR="<b>"+dom+"</b> is available for renewal.<br><span class=small><i>Please Note:</i> Only the registered name holder can renew this name!</span>";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="E";
					break
				default:
					var isavailableSTR="<b>"+dom+"</b> is NOT Available for Registration<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					if (whatstatus>1)
					{
						var isavailableSTR="<b>"+dom+"</b> can be Renewed<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
						var whattype="E";
					}
			}
			//alert(whattype)
			domstatusSTR=''
			domstatusSTR+='<fieldset><legend>POP3 Email Status</legend>'
			domstatusSTR+='<table border=0 id=domainstatus_table>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td>'
				domstatusSTR+='<table border=0 id=domainstatusleft_table>'
				domstatusSTR+='<tr>'
				domstatusSTR+='<td valign="top" width="25%">Domain:</td>'
				domstatusSTR+='<td>'
				domstatusSTR+='<span id="isavail">'+dom+'</span>'
				domstatusSTR+='</td>'
				domstatusSTR+='</tr>'
				domstatusSTR+='<tr>'
				domstatusSTR+='<td><u>POP3 Email:</u></td>'
				domstatusSTR+='<td>'
				domstatusSTR+='<select id="p3List" onchange=gettotalpop()>'
				domstatusSTR+='<option value="0|0">None</option>'
				domstatusSTR+='<option value="1|10">Bronze Package (5 Accounts, 10 Megs,$10)</option>'
				domstatusSTR+='<option value="2|20" selected>Standard Package (10 Accounts, 10 Megs,$20)</option>'
				domstatusSTR+='<option value="3|30">Gold Package (10 Accounts, 30 Megs,$30)</option>'
				domstatusSTR+='<option value="4|40">Platinum Package (20 Accounts, 30 Megs,$40)</option>'
				domstatusSTR+='</select>'
				domstatusSTR+='</td>'
				domstatusSTR+='</tr>'
				domstatusSTR+='</table>'			
				domstatusSTR+='<br>'
				domstatusSTR+='<fieldset><legend>Sub Total</legend>'
				domstatusSTR+='<table border=0 id=subtotal_table>'
				domstatusSTR+='<tr>'
				domstatusSTR+='<td class="subtotal"><span id="total" class="total">$20.00</span></td>'
				domstatusSTR+='</tr>'
				domstatusSTR+='</table>'
				domstatusSTR+='</fieldset>'
				domstatusSTR+='<br>'
				domstatusSTR+='<table border=0 id=add2cart_table>'
				domstatusSTR+='<tr>'
				domstatusSTR+='<td><input type="hidden" value="0|0" name="domList" id="domList"><input type="hidden" value="0|0" name="ssList" id="ssList"><input type="hidden" value="" name="checkeddomain" id="checkeddomain"><input type="hidden" value="" name="whattype" id="whattype"><input type="button" value="Add To Cart" onclick="addpoptocart();" class="button"></td>'
				domstatusSTR+='</tr>'
				domstatusSTR+='</table>'
			var x=document.getElementById('register_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			document.getElementById('checkeddomain').value=dom;
			document.getElementById('whattype').value=whattype;
			var x=document.getElementById('register_Table').rows[0].cells;
			x[0].innerHTML='';
			//dom='';
}

function displaybulkcheck()
{
			var verisignres=document.getElementById('results').value
			//alert(verisignres);
			var startstr=verisignres.indexOf("<pre>")+5;
			var endtstr=verisignres.indexOf("</pre>");
			var whoisresponse=verisignres.substring(startstr,endtstr);
			var whatstatus=whoisresponse.substring(whoisresponse.indexOf("<e>")+3,whoisresponse.indexOf("</e>"));
			var dom=whoisresponse.substring(whoisresponse.indexOf("<inDomain>")+10,whoisresponse.indexOf("</inDomain>"));
			//alert(whoisresponse);
			switch(whatstatus)
			{
				case '0':
					//var isavailableSTR="<b>"+dom+"</b> is available for registration";
					var whattype="N";
					var expdate="";
					var isavailableSTR="<input type='checkbox' name='doma' value='"+dom+"."+whattype+"'>";
					statusSTR="Available For Registration";
					termSTR='<select name="'+dom+'_price" id="'+dom+'_price">';
					//termSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>';
					termSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
					termSTR+='</select>';
					break
				case '3':
					//var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br>Please call our customer service department at 1-866-434-0212.";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '4':
					//var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br>Please call our customer service department at 1-866-434-0212";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '5':
					//var isavailableSTR="<b>"+dom+"</b> can not be renewed.<br> The domain is in REDEMPTION status.<br> Please call our customer service department for your options at 1-866-434-0212";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process, REDEMPTION status)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '-1':
					//var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br> Please Try Again Later <br>or<br> Please call our customer service department for your options at 1-866-434-0212";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process - Try Again Later)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '88':
					//var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br> Please call our customer service department for your options <br>Toll Free: 1-866-434-0212";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '99':
					//var isavailableSTR="<b>"+dom+"</b> can not be processed at this time.<br> Please call our customer service department for your options <br>Toll Free: 1-866-434-0212";
					var isavailableSTR="<img src='images/checkbox.gif'>";
					var statusSTR="(Unable To Process - INVALID TLD)";
					termSTR='&nbsp;';
					var whattype="F";
					var expdate="";
					break
				case '1':
					//var isavailableSTR="<b>"+dom+"</b> can be Renewed/Transferred.<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					var isavailableSTR="<input type='checkbox' name='doma' value='"+dom+"."+whattype+"'>";
					var statusSTR="Renewal/Transfer";
					termSTR='<select name="'+dom+'_price" id="'+dom+'_price">';
					//termSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>';
					termSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
					termSTR+='</select>';
					break
				case '2':
					//var isavailableSTR="<b>"+dom+"</b> is available for renewal.<br><span class=small><i>Please Note:</i> Only the registered name holder can renew this name!</span>";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="E";
					var isavailableSTR="<input type='checkbox' name='doma' value='"+dom+"."+whattype+"'>";
					var statusSTR="Existing Renewal";
					termSTR='<select name="'+dom+'_price" id="'+dom+'_price">';
					//termSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>';
					termSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
					termSTR+='</select>';
					break
				default:
					//var isavailableSTR="<b>"+dom+"</b> is NOT Available for Registration<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
					var startstr2=verisignres.indexOf("<enomexp>")+9;
					var endtstr2=verisignres.indexOf("</enomexp>");
					var expdate=verisignres.substring(startstr2,endtstr2);
					var whattype="T";
					var isavailableSTR="<input type='checkbox' name='doma' value='"+dom+"."+whattype+"'>";
					var statusSTR="Renewal/Transfer";
					termSTR='<select name="'+dom+'_price" id="'+dom+'_price">';
					//termSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>';
					termSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
					termSTR+='</select>';
					if (whatstatus>1)
					{
						//var isavailableSTR="<b>"+dom+"</b> can be Renewed<br>You may renew this name if it belongs to you.<br> If it does not, you will not be able to acquire the name.";
						var whattype="E";
						var isavailableSTR="<input type='checkbox' name='doma' value='"+dom+"."+whattype+"'>";
						var statusSTR="Renewal/Transfer";
						termSTR='<select name="'+dom+'_price" id="'+dom+'_price">';
						//termSTR+='<option value="1|30">1 year ($30.00)</option><option value="2|50" selected>2 years ($50.00)</option><option value="3|65">3 years ($65.00)</option><option value="4|80">4 years ($80.00)</option><option value="5|95">5 years ($95.00)</option><option value="6|115">6 years ($115.00)</option><option value="7|135">7 years ($135.00)</option><option value="8|150">8 years ($150.00)</option><option value="9|165">9 years ($165.00)</option><option value="10|175">10 years ($175.00)</option>';
						termSTR+=whoisresponse.substring(whoisresponse.indexOf("<price>")+7,whoisresponse.indexOf("</price>"));
						termSTR+='</select>';
					}
			}
//alert (tempdom);
document.getElementById(dom).innerHTML=isavailableSTR;
document.getElementById(dom+'_status').innerHTML=statusSTR;
document.getElementById(dom+'_term').innerHTML=termSTR;
document.getElementById(dom+'_domain').innerHTML='<input type="text" readonly size="20" value="'+dom+'">';
document.getElementById('results').value="";
}

function displaywhoisresults()
{
			var verisignres=document.getElementById('results').value
			var startstr=verisignres.indexOf("<pre>")+5;
			var endtstr=verisignres.indexOf("</pre>");
			var whoisresponse=verisignres.substring(startstr,endtstr);
			domstatusSTR='<fieldset><legend>Domain Whois</legend>'
			domstatusSTR+='<table border=0 width="200">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td><pre>'+whoisresponse+'</pre></td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('whois_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
}

function displaymyipresults()
{
			var verisignres=document.getElementById('results').value
			var startstr=verisignres.indexOf("<pre>")+5;
			var endtstr=verisignres.indexOf("</pre>");
			var whoisresponse=verisignres.substring(startstr,endtstr);
			var findlocale=whoisresponse.substring(whoisresponse.indexOf("<findlocale>")+12,whoisresponse.indexOf("</findlocale>"));
			var REMOTE_ADDR=whoisresponse.substring(whoisresponse.indexOf("<REMOTE_ADDR>")+13,whoisresponse.indexOf("</REMOTE_ADDR>"));
			domstatusSTR='<fieldset><legend>IP Lookup</legend>'
			domstatusSTR+='<table border=0 width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td><br></td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center"><span class="bigspan">Your IP Address is '+REMOTE_ADDR+'</span></td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center"><span class="bigspan">You are located in '+findlocale+'</span></td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td><br></td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('myip_Table').rows[0].cells;
			x[0].innerHTML=domstatusSTR;
}

function displaymetavalidateresults()
{
			var metares=document.getElementById('results').value
			domstatusSTR=metares
			var x=document.getElementById('metavalidate').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
}

function whoislookup()
{
			if ( isWhitespace(document.getElementById('domain').value) )
			{
				alert("Please Enter a Domain");
				return false;
			}
			var isInvalid=document.getElementById('domain').value.indexOf(".");
			if (isInvalid<=0)
			{
				alert("Invalid Domain Name\nDomain Name needs to be in the format of SLD.TLD (e.g. droc.ca)");
				document.registerForm.searchbutton.disabled=false;
				return false;
			}
			var url2send='whois-bg2.asp?randSID='+Math.random()+'&dom='+document.getElementById('domain').value+'&type=domain';
			domstatusSTR='<fieldset><legend>Pulling Up Whois on  '+document.getElementById('domain').value+'</legend>'
			domstatusSTR+='<table border="0" bgcolor="white" align="center" width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='This process may take up to 30 seconds.'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='<img src="images/working.gif" border="0">'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('whois_Table').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			var sendurl=ajaxFunction(url2send,'whoislookup');

}

function myiplookup()
{

			var url2send='myip-bg.asp?randSID='+Math.random();
			domstatusSTR='<fieldset><legend>Pulling Up Your IP Information</legend>'
			domstatusSTR+='<table border="0" bgcolor="white" align="center" width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='This process may take up to 30 seconds.'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='<img src="images/working.gif" border="0">'
			domstatusSTR+='<input name="results" id="results" type="hidden">'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			domstatusSTR+='</fieldset>'
			var x=document.getElementById('myip_Table').rows[0].cells;
			x[0].innerHTML=domstatusSTR;
			var sendurl=ajaxFunction(url2send,'myiplookup');

}

function validatetags()
{
			if ( isWhitespace(document.getElementById('domain').value) )
			{
				alert("Please Enter a Domain");
				return false;
			}
			var url2send='metavalidate.asp?randSID='+Math.random()+'&dom='+document.getElementById('domain').value;
			domstatusSTR='<table border="0" bgcolor="white" align="center" width="100%">'
			domstatusSTR+='<tr valign="top">'
			domstatusSTR+='<td align="center">'
			domstatusSTR+='<img src="images/working.gif" border="0">'
			domstatusSTR+='</td>'
			domstatusSTR+='</tr>'
			domstatusSTR+='</table>'
			var x=document.getElementById('metavalidate').rows[1].cells;
			x[0].innerHTML=domstatusSTR;
			var sendurl=ajaxFunction(url2send,'metavalidate');

}


function addtocart()
{

	url2send="cart.asp?action=add&itemstring="+document.getElementById('checkeddomain').value+"."+document.getElementById('whattype').value+"*"+document.getElementById("domList").value.split("|")[0]+"*"+document.getElementById("domList").value.split("|")[1]+"|"+document.getElementById('checkeddomain').value+".S*"+document.getElementById("ssList").value.split("|")[0]+"*"+document.getElementById("ssList").value.split("|")[1]+"|"+document.getElementById('checkeddomain').value+".P*"+document.getElementById("p3List").value.split("|")[0]+"*"+document.getElementById("p3List").value.split("|")[1];
	for (i=0;i<=3 ;i++ )
	{
		var isothername=document.getElementById("domList_"+i).value.split("|")[0];
		if (isothername>0)
		{
			url2send+="|"+document.getElementById("othername_"+i).value+"*"+document.getElementById("domList_"+i).value.split("|")[0]+"*"+document.getElementById("domList_"+i).value.split("|")[1]
		}
	}
	//alert(url2send);
	//return false;
	window.location=url2send;
}

function addpoptocart()
{

	url2send="cart.asp?action=add&itemstring="+document.getElementById('checkeddomain').value+"."+document.getElementById('whattype').value+"*"+document.getElementById("domList").value.split("|")[0]+"*"+document.getElementById("domList").value.split("|")[1]+"|"+document.getElementById('checkeddomain').value+".S*"+document.getElementById("ssList").value.split("|")[0]+"*"+document.getElementById("ssList").value.split("|")[1]+"|"+document.getElementById('checkeddomain').value+".P*"+document.getElementById("p3List").value.split("|")[0]+"*"+document.getElementById("p3List").value.split("|")[1];
	//alert(url2send);
	//return false;
	window.location=url2send;
}

function gettotalpop()
{
var p3price=document.getElementById("p3List").value.split("|")[1];
var totalprice=parseFloat(p3price);
document.getElementById("total").innerHTML=formatCurrency(totalprice);
}

function optionalserviceexplain(servicetext)
{
			var y=document.getElementById('servicesoptional_table').rows[2].cells;
			y[0].innerHTML=servicetext;
}


function getinnerfromtags(txt,tag)
{
		
		var startstr=txt.indexOf('<'+tag+'>')+tag.length+2;
		var endtstr=txt.indexOf('</'+tag+'>');
		var response=txt.substring(startstr,endtstr);
		return response;
}

function hostinglogin()
{

			var url2send='ajax-hostinglogin.asp?action=h&randSID='+Math.random()+'&dom='+$F('login_name')+'&type=domain';
			//alert (url2send);
			new Ajax.Request(url2send, {
			method: 'get',
			onSuccess: function(transport) {

				var whoisresponse=getinnerfromtags(transport.responseText,"pre");
				var server=getinnerfromtags(whoisresponse,"server");
				var url='https://'+server+':8443/login_up.php3';
				//alert(url);
				//alert (whoisresponse);
				if (getinnerfromtags(whoisresponse,"result")=="Success")
				{
				document.form1.action=url;
				document.form1.submit();
				}
				else
				{
					alert("An Error Occured. The Domain does not exist in our system.");
				}
				//alert(whoisresponse)

			}
			});
}

function domainlogin()
{
			if ( isWhitespace($F('domain')) )
			{
				alert("Please Enter a Domain");
				return false;
			}
			if ( isWhitespace($F('password')) )
			{
				alert("Please Enter a Password");
				return false;
			}				
			var url2send='ajax-hostinglogin.asp?action=d&randSID='+Math.random()+'&dom='+$F('domain')+'&pwd='+$F('password')+'&type=domain';
			//alert(url2send);
			new Ajax.Request(url2send, {
			method: 'get',
			onSuccess: function(transport) {

				var whoisresponse=getinnerfromtags(transport.responseText,"pre");
				result=getinnerfromtags(whoisresponse,"result");
				error1=getinnerfromtags(whoisresponse,"error1");
				if (result=="Fail")
				{
					alert(result+": "+error1);
					return false;
				}
			}
			});
			//alert (url2send);
}

function gettotal()
{
var domprice=document.getElementById("domList").value.split("|")[1];
var ssprice=document.getElementById("ssList").value.split("|")[1];
var p3price=document.getElementById("p3List").value.split("|")[1];
var totalprice=parseFloat(domprice)+parseFloat(ssprice)+parseFloat(p3price);

for (i=0; i<=3;i++ )
{
var domprice1=document.getElementById("domList_"+i).value.split("|")[1];
totalprice+=parseFloat(domprice1);
}
document.getElementById("total").innerHTML=formatCurrency(totalprice);
}

function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function show_popup(event,text)
{
x=event.clientX
y=event.clientY
var p=window.createPopup()
var pbody=p.document.body
pbody.style.backgroundColor="c0c0c0"
pbody.style.border="solid black 1px"
pbody.innerHTML=text
p.show(x,y,500,150,document.body)
}


function countrycheck(type)
{
//alert(type)
var mylist=document.getElementById(type+"_country")
var owner_country=mylist.options[mylist.selectedIndex].text
//alert(owner_country)
var x=document.getElementById(type+'_Table').rows[6].cells
var y=document.getElementById(type+'_Table').rows[7].cells
//alert(type + " " + owner_country)
switch (owner_country)
{
case 'United States':
statefields='<select name='+type+'"_state">'
statefields+='<option value="AL">Alabama</option>'
statefields+='<option value="AK">Alaska</option>'
statefields+='<option value="AZ">Arizona</option>'
statefields+='<option value="AR">Arkansas</option>'
statefields+='<option value="CA">California</option>'
statefields+='<option value="CO">Colorado</option>'
statefields+='<option value="CT">Connecticut</option>'
statefields+='<option value="DE">Delaware</option>'
statefields+='<option value="DC">District of Columbia</option>'
statefields+='<option value="FL">Florida</option>'
statefields+='<option value="GA">Georgia</option>'
statefields+='<option value="HI">Hawaii</option>'
statefields+='<option value="ID">Idaho</option>'
statefields+='<option value="IL">Illinois</option>'
statefields+='<option value="IN">Indiana</option>'
statefields+='<option value="IA">Iowa</option>'
statefields+='<option value="KS">Kansas</option>'
statefields+='<option value="KY">Kentucky</option>'
statefields+='<option value="LA">Louisiana</option>'
statefields+='<option value="ME">Maine</option>'
statefields+='<option value="MD">Maryland</option>'
statefields+='<option value="MA">Massachusetts</option>'
statefields+='<option value="MI">Michigan</option>'
statefields+='<option value="MN">Minnesota</option>'
statefields+='<option value="MS">Mississippi</option>'
statefields+='<option value="MO">Missouri</option>'
statefields+='<option value="MT">Montana</option>'
statefields+='<option value="NE">Nebraska</option>'
statefields+='<option value="NV">Nevada</option>'
statefields+='<option value="NH">New Hampshire</option>'
statefields+='<option value="NJ">New Jersey</option>'
statefields+='<option value="NM">New Mexico</option>'
statefields+='<option value="NY">New York</option>'
statefields+='<option value="NC">North Carolina</option>'
statefields+='<option value="ND">North Dakota</option>'
statefields+='<option value="OH">Ohio</option>'
statefields+='<option value="OK">Oklahoma</option>'
statefields+='<option value="OR">Oregon</option>'
statefields+='<option value="PA">Pennsylvania</option>'
statefields+='<option value="RI">Rhode Island</option>'
statefields+='<option value="SC">South Carolina</option>'
statefields+='<option value="SD">South Dakota</option>'
statefields+='<option value="TN">Tennessee</option>'
statefields+='<option value="TX">Texas</option>'
statefields+='<option value="UT">Utah</option>'
statefields+='<option value="VT">Vermont</option>'
statefields+='<option value="VA">Virginia</option>'
statefields+='<option value="WA">Washington</option>'
statefields+='<option value="WV">West Virginia</option>'
statefields+='<option value="WI">Wisconsin</option>'
statefields+='<option value="WY">Wyoming</option>'
statefields+='</select>'
x[0].innerHTML="State: "
x[1].innerHTML=statefields
y[0].innerHTML="Zip: "
break
//alert(owner_country)
case 'Canada':
statefields='<select name='+type+'"_state">'
statefields+='<option value="ON">Ontario</option>'
statefields+='<option value="AB">Alberta</option>'
statefields+='<option value="BC">British Columbia</option>'
statefields+='<option value="MB">Manitoba</option>'
statefields+='<option value="NB">New Brunswick</option>'
statefields+='<option value="NF">Newfoundland</option>'
statefields+='<option value="NS">Nova Scotia</option>'
statefields+='<option value="NT">Northwest Territories</option>'
statefields+='<option value="NU">Nunavut</option>'
statefields+='<option value="PE">Prince Edward Island</option>'
statefields+='<option value="QC">Quebec</option>'
statefields+='<option value="SK">Saskatchewan</option>'
statefields+='<option value="YK">Yukon</option>'
statefields+='</select>'
x[0].innerHTML="Province: "
x[1].innerHTML=statefields
y[0].innerHTML="Postal Code: "
break
default:
statefields='<input type="text" name=name='+type+'"_state" id=name='+type+'"_state">'
x[0].innerHTML="State: "
x[1].innerHTML=statefields
y[0].innerHTML="Zip: "
//alert(owner_country)
}
}


function check(checkwhat,r)
{
var i=r.parentNode.parentNode.rowIndex
var j=i+1
//alert(i+":"+j)
switch (checkwhat)
{
case 'billing-useown':
var x=document.getElementById('myTable').rows[3].cells
billingfields='<table width="100%" border="0" id="billing_Table">'
billingfields+='<tr><td width="200">First Name:</td><td><input type="text" name="billing_first_name" id="billing_first_name"></td></tr>'
billingfields+='<tr><td>Last Name:</td><td><input type="text" name="billing_last_name" id="billing_last_name"></td></tr>'
billingfields+='<tr><td>Organization:</td><td><input type="text" name="billing_org_name" id="billing_org_name"></td></tr>'
billingfields+='<tr><td>Address 1:</td><td><input type="text" name="billing_address1" id="billing_address1"><input type="hidden" name="billing_address2" id="billing_address2"><input type="hidden" name="billing_address3" id="billing_address3"></td></tr>'
billingfields+='<tr><td>City:</td><td><input type="text" name="billing_city" id="billing_city"></td></tr>'
billingfields+='<tr><td>Country: </td>'
billingfields+='<td>'
billingfields+="<SELECT NAME=billing_country id=billing_country onchange=countrycheck('billing')>"
billingfields+='<option value="CA">Canada</option>'
billingfields+='<option value="US">United States</option>'
billingfields+='<option value="AF">Afghanistan</option>'
billingfields+='<option value="AL">Albania</option>'
billingfields+='<option value="DZ">Algeria</option>'
billingfields+='<option value="AS">American samoa</option>'
billingfields+='<option value="AD">Andorra</option>'
billingfields+='<option value="AO">Angola</option>'
billingfields+='<option value="AI">Anguilla</option>'
billingfields+='<option value="AQ">Antarctica</option>'
billingfields+='<option value="AG">Antigua and Barbuda</option>'
billingfields+='<option value="AR">Argentina</option>'
billingfields+='<option value="AM">Armenia</option>'
billingfields+='<option value="AW">Aruba</option>'
billingfields+='<option value="AU">Australia</option>'
billingfields+='<option value="AT">Austria</option>'
billingfields+='<option value="AZ">Azerbaijan</option>'
billingfields+='<option value="BS">Bahamas</option>'
billingfields+='<option value="BH">Bahrain</option>'
billingfields+='<option value="BD">Bangladesh</option>'
billingfields+='<option value="BB">Barbados</option>'
billingfields+='<option value="BY">Belarus</option>'
billingfields+='<option value="BE">Belgium</option>'
billingfields+='<option value="BZ">Belize</option>'
billingfields+='<option value="BJ">Benin</option>'
billingfields+='<option value="BM">Bermuda</option>'
billingfields+='<option value="BT">Bhutan</option>'
billingfields+='<option value="BO">Bolivia</option>'
billingfields+='<option value="BA">Bosnia and Herzegowina</option>'
billingfields+='<option value="BW">Botswana</option>'
billingfields+='<option value="BV">Bouvet island</option>'
billingfields+='<option value="BR">Brazil</option>'
billingfields+='<option value="IO">British Indian Ocean Territory</option>'
billingfields+='<option value="BN">Brunei Darussalam</option>'
billingfields+='<option value="BG">Bulgaria</option>'
billingfields+='<option value="BF">Burkina Faso</option>'
billingfields+='<option value="BI">Burundi</option>'
billingfields+='<option value="KH">Cambodia</option>'
billingfields+='<option value="CM">Cameroon</option>'
billingfields+='<option value="CA">Canada</option>'
billingfields+='<option value="CV">Cape Verde</option>'
billingfields+='<option value="KY">Cayman Islands</option>'
billingfields+='<option value="CF">Central African Republic</option>'
billingfields+='<option value="TD">Chad</option>'
billingfields+='<option value="CL">Chile</option>'
billingfields+='<option value="CN">China</option>'
billingfields+='<option value="CX">Christmas Island</option>'
billingfields+='<option value="CC">Cocos (Keeling) Islands</option>'
billingfields+='<option value="CO">Colombia</option>'
billingfields+='<option value="KM">Comoros</option>'
billingfields+='<option value="CG">Congo</option>'
billingfields+='<option value="CK">Cook Islands</option>'
billingfields+='<option value="CR">Costa Rica</option>'
billingfields+='<option value="CI">Cote DIvoire</option>'
billingfields+='<option value="HR">Croatia</option>'
billingfields+='<option value="CU">Cuba</option>'
billingfields+='<option value="CY">Cyprus</option>'
billingfields+='<option value="CZ">Czech Republic</option>'
billingfields+='<option value="DK">Denmark</option>'
billingfields+='<option value="DJ">Djibouti</option>'
billingfields+='<option value="DM">Dominica</option>'
billingfields+='<option value="DO">Dominican Republic</option>'
billingfields+='<option value="TP">East Timor</option>'
billingfields+='<option value="EC">Ecuador</option>'
billingfields+='<option value="EG">Egypt</option>'
billingfields+='<option value="SV">El Salvador</option>'
billingfields+='<option value="GQ">Equatorial Guinea</option>'
billingfields+='<option value="ER">Eritrea</option>'
billingfields+='<option value="EE">Estonia</option>'
billingfields+='<option value="ET">Ethiopia</option>'
billingfields+='<option value="FK">Falkland Islands (Malvinas)</option>'
billingfields+='<option value="FO">Faroe Islands</option>'
billingfields+='<option value="FJ">Fiji</option>'
billingfields+='<option value="FI">Finland</option>'
billingfields+='<option value="FR">France</option>'
billingfields+='<option value="GF">French Guiana</option>'
billingfields+='<option value="PF">French Polynesia</option>'
billingfields+='<option value="TF">French Southern Territories</option>'
billingfields+='<option value="GA">Gabon</option>'
billingfields+='<option value="GM">Gambia</option>'
billingfields+='<option value="GE">Georgia</option>'
billingfields+='<option value="DE">Germany</option>'
billingfields+='<option value="GH">Ghana</option>'
billingfields+='<option value="GI">Gibraltar</option>'
billingfields+='<option value="GR">Greece</option>'
billingfields+='<option value="GL">Greenland</option>'
billingfields+='<option value="GD">Grenada</option>'
billingfields+='<option value="GP">Guadeloupe</option>'
billingfields+='<option value="GU">Guam</option>'
billingfields+='<option value="GT">Guatemala</option>'
billingfields+='<option value="GN">Guinea</option>'
billingfields+='<option value="GW">Guinea-Bissau</option>'
billingfields+='<option value="GY">Guyana</option>'
billingfields+='<option value="HT">Haiti</option>'
billingfields+='<option value="HM">Heard and MC Donald Islands</option>'
billingfields+='<option value="HN">Honduras</option>'
billingfields+='<option value="HK">Hong Kong</option>'
billingfields+='<option value="HU">Hungary</option>'
billingfields+='<option value="IS">Iceland</option>'
billingfields+='<option value="IN">India</option>'
billingfields+='<option value="ID">Indonesia</option>'
billingfields+='<option value="IR">Iran</option>'
billingfields+='<option value="IQ">Iraq</option>'
billingfields+='<option value="IE">Ireland</option>'
billingfields+='<option value="IL">Israel</option>'
billingfields+='<option value="IT">Italy</option>'
billingfields+='<option value="JM">Jamaica</option>'
billingfields+='<option value="JP">Japan</option>'
billingfields+='<option value="JO">Jordan</option>'
billingfields+='<option value="KZ">Kazakhstan</option>'
billingfields+='<option value="KE">Kenya</option>'
billingfields+='<option value="KI">Kiribati</option>'
billingfields+='<option value="KP">North Korea</option>'
billingfields+='<option value="KR">South Korea</option>'
billingfields+='<option value="KW">Kuwait</option>'
billingfields+='<option value="KG">Kyrgyzstan</option>'
billingfields+='<option value="LA">Lao peoples Democratic Republic</option>'
billingfields+='<option value="LV">Latvia</option>'
billingfields+='<option value="LB">Lebanon</option>'
billingfields+='<option value="LS">Lesotho</option>'
billingfields+='<option value="LR">Liberia</option>'
billingfields+='<option value="LY">Libyan Arab Jamahiriya</option>'
billingfields+='<option value="LI">Liechtenstein</option>'
billingfields+='<option value="LT">Lithuania</option>'
billingfields+='<option value="LU">Luxembourg</option>'
billingfields+='<option value="MO">Macau</option>'
billingfields+='<option value="MK">Macedonia</option>'
billingfields+='<option value="MG">Madagascar</option>'
billingfields+='<option value="MW">Malawi</option>'
billingfields+='<option value="MY">Malaysia</option>'
billingfields+='<option value="MV">Maldives</option>'
billingfields+='<option value="ML">Mali</option>'
billingfields+='<option value="MT">Malta</option>'
billingfields+='<option value="MH">Marshall Islands</option>'
billingfields+='<option value="MQ">Martinique</option>'
billingfields+='<option value="MR">Mauritania</option>'
billingfields+='<option value="MU">Mauritius</option>'
billingfields+='<option value="YT">Mayotte</option>'
billingfields+='<option value="MX">Mexico</option>'
billingfields+='<option value="FM">Micronesia</option>'
billingfields+='<option value="MD">Moldova</option>'
billingfields+='<option value="MC">Monaco</option>'
billingfields+='<option value="MN">Mongolia</option>'
billingfields+='<option value="MS">Montserrat</option>'
billingfields+='<option value="MA">Morocco</option>'
billingfields+='<option value="MZ">Mozambique</option>'
billingfields+='<option value="MM">Myanmar</option>'
billingfields+='<option value="NA">Namibia</option>'
billingfields+='<option value="NR">Nauru</option>'
billingfields+='<option value="NP">Nepal</option>'
billingfields+='<option value="NL">Netherlands</option>'
billingfields+='<option value="AN">Netherlands Antilles</option>'
billingfields+='<option value="NC">New Caledonia</option>'
billingfields+='<option value="NZ">New Zealand</option>'
billingfields+='<option value="NI">Nicaragua</option>'
billingfields+='<option value="NE">Niger</option>'
billingfields+='<option value="NG">Nigeria</option>'
billingfields+='<option value="NU">Niue</option>'
billingfields+='<option value="NF">Norfolk Island</option>'
billingfields+='<option value="MP">Northern Mariana Islands</option>'
billingfields+='<option value="NO">Norway</option>'
billingfields+='<option value="OM">Oman</option>'
billingfields+='<option value="PK">Pakistan</option>'
billingfields+='<option value="PW">Palau</option>'
billingfields+='<option value="PA">Panama</option>'
billingfields+='<option value="PG">Papua New Guinea</option>'
billingfields+='<option value="PY">Paraguay</option>'
billingfields+='<option value="PE">Peru</option>'
billingfields+='<option value="PH">Philippines</option>'
billingfields+='<option value="PN">Pitcairn</option>'
billingfields+='<option value="PL">Poland</option>'
billingfields+='<option value="PT">Portugal</option>'
billingfields+='<option value="PR">Puerto Rico</option>'
billingfields+='<option value="QA">Qatar</option>'
billingfields+='<option value="RE">Reunion</option>'
billingfields+='<option value="RO">Romania</option>'
billingfields+='<option value="RU">Russian Federation</option>'
billingfields+='<option value="RW">Rwanda</option>'
billingfields+='<option value="KN">Saint Kitts and Nevis</option>'
billingfields+='<option value="LC">Saint Lucia</option>'
billingfields+='<option value="VC">Saint Vincent and the Grenadines</option>'
billingfields+='<option value="WS">Samoa</option>'
billingfields+='<option value="SM">San Marino</option>'
billingfields+='<option value="ST">Sao Tome and Principe</option>'
billingfields+='<option value="SA">Saudi Arabia</option>'
billingfields+='<option value="SN">Senegal</option>'
billingfields+='<option value="SC">Seychelles</option>'
billingfields+='<option value="SL">Sierra Leone</option>'
billingfields+='<option value="SG">Singapore</option>'
billingfields+='<option value="SK">Slovakia (Slovak Republic)</option>'
billingfields+='<option value="SI">Slovenia</option>'
billingfields+='<option value="SB">Solomon Islands</option>'
billingfields+='<option value="SO">Somalia</option>'
billingfields+='<option value="ZA">South Africa</option>'
billingfields+='<option value="GS">South Georgia and the South Sandwich Islands</option>'
billingfields+='<option value="ES">Spain</option>'
billingfields+='<option value="LK">Sri Lanka</option>'
billingfields+='<option value="SH">St. Helena</option>'
billingfields+='<option value="PM">St. Pierre and Miquelon</option>'
billingfields+='<option value="SD">Sudan</option>'
billingfields+='<option value="SR">Suriname</option>'
billingfields+='<option value="SJ">Svalbard and Jan Mayen Islands</option>'
billingfields+='<option value="SZ">Swaziland</option>'
billingfields+='<option value="SE">Sweden</option>'
billingfields+='<option value="CH">Switzerland</option>'
billingfields+='<option value="SY">Syrian Arab Republic</option>'
billingfields+='<option value="TW">Taiwan, Province of China</option>'
billingfields+='<option value="TJ">Tajikistan</option>'
billingfields+='<option value="TZ">Tanzania, United Republic of</option>'
billingfields+='<option value="TH">Thailand</option>'
billingfields+='<option value="TG">Togo</option>'
billingfields+='<option value="TK">Tokelau</option>'
billingfields+='<option value="TO">Tonga</option>'
billingfields+='<option value="TT">Trinidad and Tobago</option>'
billingfields+='<option value="TN">Tunisia</option>'
billingfields+='<option value="TR">Turkey</option>'
billingfields+='<option value="TM">Turkmenistan</option>'
billingfields+='<option value="TC">Turks and Caicos Islands</option>'
billingfields+='<option value="TV">Tuvalu</option>'
billingfields+='<option value="UG">Uganda</option>'
billingfields+='<option value="UA">Ukraine</option>'
billingfields+='<option value="AE">United Arab Emirates</option>'
billingfields+='<option value="GB">United Kingdom</option>'
billingfields+='<option value="UM">United States Minor Outlying Islands</option>'
billingfields+='<option value="UY">Uruguay</option>'
billingfields+='<option value="UZ">Uzbekistan</option>'
billingfields+='<option value="VU">Vanuatu</option>'
billingfields+='<option value="VA">Vatican City State</option>'
billingfields+='<option value="VE">Venezuela</option>'
billingfields+='<option value="VN">Viet Nam</option>'
billingfields+='<option value="VG">Virgin Islands (British)</option>'
billingfields+='<option value="VI">Virgin Islands (U.S.)</option>'
billingfields+='<option value="WF">Wallis and Futuna Islands</option>'
billingfields+='<option value="EH">Western Sahara</option>'
billingfields+='<option value="YE">Yemen</option>'
billingfields+='<option value="YU">Yugoslavia</option>'
billingfields+='<option value="ZR">Zaire</option>'
billingfields+='<option value="ZM">Zambia</option>'
billingfields+='<option value="ZW">Zimbabwe</option>'
billingfields+='</select>'
billingfields+='</td>'
billingfields+='</tr>'
billingfields+='<tr><td>Province: </td>'
billingfields+='<td>'
billingfields+='<select name="billing_state">'
billingfields+='<option value="ON">Ontario</option>'
billingfields+='<option value="AB">Alberta</option>'
billingfields+='<option value="BC">British Columbia</option>'
billingfields+='<option value="MB">Manitoba</option>'
billingfields+='<option value="NB">New Brunswick</option>'
billingfields+='<option value="NF">Newfoundland</option>'
billingfields+='<option value="NS">Nova Scotia</option>'
billingfields+='<option value="NT">Northwest Territories</option>'
billingfields+='<option value="NU">Nunavut</option>'
billingfields+='<option value="PE">Prince Edward Island</option>'
billingfields+='<option value="QC">Quebec</option>'
billingfields+='<option value="SK">Saskatchewan</option>'
billingfields+='<option value="YK">Yukon</option>'
billingfields+='</select>'
billingfields+='</td>'
billingfields+='</tr>'
billingfields+='<tr><td>Postal Code: </td><td><input type="text" name="billing_zip" id="billing_zip"></td></tr>'
billingfields+='<tr><td>Phone Number: </td><td><input type="text" name="billing_phone" id="billing_phone"></td></tr>'
billingfields+='<tr><td>Fax Number: </td><td><input type="text" name="billing_fax" id="billing_fax"></td></tr>'
billingfields+='<tr><td>Email: </td><td><input type="text" name="billing_email" id="billing_email"></td></tr>'
billingfields+='</table>'
x[0].innerHTML=billingfields
  break
case 'billing-usereg':
var x=document.getElementById('myTable').rows[3].cells
x[0].innerHTML=''
  break

case 'tech-useown':
var x=document.getElementById('myTable').rows[5].cells
techfields='<table width="100%" border="0" id="tech_Table">'
techfields+='<tr><td width="200">First Name: </td><td><input type="text" name="tech_first_name" id="tech_first_name"></td></tr>'
techfields+='<tr><td>Last Name: </td><td><input type="text" name="tech_last_name" id="tech_last_name"></td></tr>'
techfields+='<tr><td>Organization: </td><td><input type="text" name="tech_org_name" id="tech_org_name"></td></tr>'
techfields+='<tr><td>Address: </td><td><input type="text" name="tech_address1" id="tech_address1"><input type="hidden" name="tech_address2" id="tech_address2"><input type="hidden" name="tech_address3" id="tech_address3"></td></tr>'
techfields+='<tr><td>City: </td><td><input type="text" name="tech_city" id="tech_city"></td></tr>'
techfields+='<tr><td>Country: </td>'
techfields+='<td>'
techfields+="<SELECT NAME=tech_country id=tech_country onchange=countrycheck('tech')>"
techfields+='<option value="CA">Canada</option>'
techfields+='<option value="US">United States</option>'
techfields+='<option value="AF">Afghanistan</option>'
techfields+='<option value="AL">Albania</option>'
techfields+='<option value="DZ">Algeria</option>'
techfields+='<option value="AS">American samoa</option>'
techfields+='<option value="AD">Andorra</option>'
techfields+='<option value="AO">Angola</option>'
techfields+='<option value="AI">Anguilla</option>'
techfields+='<option value="AQ">Antarctica</option>'
techfields+='<option value="AG">Antigua and Barbuda</option>'
techfields+='<option value="AR">Argentina</option>'
techfields+='<option value="AM">Armenia</option>'
techfields+='<option value="AW">Aruba</option>'
techfields+='<option value="AU">Australia</option>'
techfields+='<option value="AT">Austria</option>'
techfields+='<option value="AZ">Azerbaijan</option>'
techfields+='<option value="BS">Bahamas</option>'
techfields+='<option value="BH">Bahrain</option>'
techfields+='<option value="BD">Bangladesh</option>'
techfields+='<option value="BB">Barbados</option>'
techfields+='<option value="BY">Belarus</option>'
techfields+='<option value="BE">Belgium</option>'
techfields+='<option value="BZ">Belize</option>'
techfields+='<option value="BJ">Benin</option>'
techfields+='<option value="BM">Bermuda</option>'
techfields+='<option value="BT">Bhutan</option>'
techfields+='<option value="BO">Bolivia</option>'
techfields+='<option value="BA">Bosnia and Herzegowina</option>'
techfields+='<option value="BW">Botswana</option>'
techfields+='<option value="BV">Bouvet island</option>'
techfields+='<option value="BR">Brazil</option>'
techfields+='<option value="IO">British Indian Ocean Territory</option>'
techfields+='<option value="BN">Brunei Darussalam</option>'
techfields+='<option value="BG">Bulgaria</option>'
techfields+='<option value="BF">Burkina Faso</option>'
techfields+='<option value="BI">Burundi</option>'
techfields+='<option value="KH">Cambodia</option>'
techfields+='<option value="CM">Cameroon</option>'
techfields+='<option value="CA">Canada</option>'
techfields+='<option value="CV">Cape Verde</option>'
techfields+='<option value="KY">Cayman Islands</option>'
techfields+='<option value="CF">Central African Republic</option>'
techfields+='<option value="TD">Chad</option>'
techfields+='<option value="CL">Chile</option>'
techfields+='<option value="CN">China</option>'
techfields+='<option value="CX">Christmas Island</option>'
techfields+='<option value="CC">Cocos (Keeling) Islands</option>'
techfields+='<option value="CO">Colombia</option>'
techfields+='<option value="KM">Comoros</option>'
techfields+='<option value="CG">Congo</option>'
techfields+='<option value="CK">Cook Islands</option>'
techfields+='<option value="CR">Costa Rica</option>'
techfields+='<option value="CI">Cote DIvoire</option>'
techfields+='<option value="HR">Croatia</option>'
techfields+='<option value="CU">Cuba</option>'
techfields+='<option value="CY">Cyprus</option>'
techfields+='<option value="CZ">Czech Republic</option>'
techfields+='<option value="DK">Denmark</option>'
techfields+='<option value="DJ">Djibouti</option>'
techfields+='<option value="DM">Dominica</option>'
techfields+='<option value="DO">Dominican Republic</option>'
techfields+='<option value="TP">East Timor</option>'
techfields+='<option value="EC">Ecuador</option>'
techfields+='<option value="EG">Egypt</option>'
techfields+='<option value="SV">El Salvador</option>'
techfields+='<option value="GQ">Equatorial Guinea</option>'
techfields+='<option value="ER">Eritrea</option>'
techfields+='<option value="EE">Estonia</option>'
techfields+='<option value="ET">Ethiopia</option>'
techfields+='<option value="FK">Falkland Islands (Malvinas)</option>'
techfields+='<option value="FO">Faroe Islands</option>'
techfields+='<option value="FJ">Fiji</option>'
techfields+='<option value="FI">Finland</option>'
techfields+='<option value="FR">France</option>'
techfields+='<option value="GF">French Guiana</option>'
techfields+='<option value="PF">French Polynesia</option>'
techfields+='<option value="TF">French Southern Territories</option>'
techfields+='<option value="GA">Gabon</option>'
techfields+='<option value="GM">Gambia</option>'
techfields+='<option value="GE">Georgia</option>'
techfields+='<option value="DE">Germany</option>'
techfields+='<option value="GH">Ghana</option>'
techfields+='<option value="GI">Gibraltar</option>'
techfields+='<option value="GR">Greece</option>'
techfields+='<option value="GL">Greenland</option>'
techfields+='<option value="GD">Grenada</option>'
techfields+='<option value="GP">Guadeloupe</option>'
techfields+='<option value="GU">Guam</option>'
techfields+='<option value="GT">Guatemala</option>'
techfields+='<option value="GN">Guinea</option>'
techfields+='<option value="GW">Guinea-Bissau</option>'
techfields+='<option value="GY">Guyana</option>'
techfields+='<option value="HT">Haiti</option>'
techfields+='<option value="HM">Heard and MC Donald Islands</option>'
techfields+='<option value="HN">Honduras</option>'
techfields+='<option value="HK">Hong Kong</option>'
techfields+='<option value="HU">Hungary</option>'
techfields+='<option value="IS">Iceland</option>'
techfields+='<option value="IN">India</option>'
techfields+='<option value="ID">Indonesia</option>'
techfields+='<option value="IR">Iran</option>'
techfields+='<option value="IQ">Iraq</option>'
techfields+='<option value="IE">Ireland</option>'
techfields+='<option value="IL">Israel</option>'
techfields+='<option value="IT">Italy</option>'
techfields+='<option value="JM">Jamaica</option>'
techfields+='<option value="JP">Japan</option>'
techfields+='<option value="JO">Jordan</option>'
techfields+='<option value="KZ">Kazakhstan</option>'
techfields+='<option value="KE">Kenya</option>'
techfields+='<option value="KI">Kiribati</option>'
techfields+='<option value="KP">North Korea</option>'
techfields+='<option value="KR">South Korea</option>'
techfields+='<option value="KW">Kuwait</option>'
techfields+='<option value="KG">Kyrgyzstan</option>'
techfields+='<option value="LA">Lao peoples Democratic Republic</option>'
techfields+='<option value="LV">Latvia</option>'
techfields+='<option value="LB">Lebanon</option>'
techfields+='<option value="LS">Lesotho</option>'
techfields+='<option value="LR">Liberia</option>'
techfields+='<option value="LY">Libyan Arab Jamahiriya</option>'
techfields+='<option value="LI">Liechtenstein</option>'
techfields+='<option value="LT">Lithuania</option>'
techfields+='<option value="LU">Luxembourg</option>'
techfields+='<option value="MO">Macau</option>'
techfields+='<option value="MK">Macedonia</option>'
techfields+='<option value="MG">Madagascar</option>'
techfields+='<option value="MW">Malawi</option>'
techfields+='<option value="MY">Malaysia</option>'
techfields+='<option value="MV">Maldives</option>'
techfields+='<option value="ML">Mali</option>'
techfields+='<option value="MT">Malta</option>'
techfields+='<option value="MH">Marshall Islands</option>'
techfields+='<option value="MQ">Martinique</option>'
techfields+='<option value="MR">Mauritania</option>'
techfields+='<option value="MU">Mauritius</option>'
techfields+='<option value="YT">Mayotte</option>'
techfields+='<option value="MX">Mexico</option>'
techfields+='<option value="FM">Micronesia</option>'
techfields+='<option value="MD">Moldova</option>'
techfields+='<option value="MC">Monaco</option>'
techfields+='<option value="MN">Mongolia</option>'
techfields+='<option value="MS">Montserrat</option>'
techfields+='<option value="MA">Morocco</option>'
techfields+='<option value="MZ">Mozambique</option>'
techfields+='<option value="MM">Myanmar</option>'
techfields+='<option value="NA">Namibia</option>'
techfields+='<option value="NR">Nauru</option>'
techfields+='<option value="NP">Nepal</option>'
techfields+='<option value="NL">Netherlands</option>'
techfields+='<option value="AN">Netherlands Antilles</option>'
techfields+='<option value="NC">New Caledonia</option>'
techfields+='<option value="NZ">New Zealand</option>'
techfields+='<option value="NI">Nicaragua</option>'
techfields+='<option value="NE">Niger</option>'
techfields+='<option value="NG">Nigeria</option>'
techfields+='<option value="NU">Niue</option>'
techfields+='<option value="NF">Norfolk Island</option>'
techfields+='<option value="MP">Northern Mariana Islands</option>'
techfields+='<option value="NO">Norway</option>'
techfields+='<option value="OM">Oman</option>'
techfields+='<option value="PK">Pakistan</option>'
techfields+='<option value="PW">Palau</option>'
techfields+='<option value="PA">Panama</option>'
techfields+='<option value="PG">Papua New Guinea</option>'
techfields+='<option value="PY">Paraguay</option>'
techfields+='<option value="PE">Peru</option>'
techfields+='<option value="PH">Philippines</option>'
techfields+='<option value="PN">Pitcairn</option>'
techfields+='<option value="PL">Poland</option>'
techfields+='<option value="PT">Portugal</option>'
techfields+='<option value="PR">Puerto Rico</option>'
techfields+='<option value="QA">Qatar</option>'
techfields+='<option value="RE">Reunion</option>'
techfields+='<option value="RO">Romania</option>'
techfields+='<option value="RU">Russian Federation</option>'
techfields+='<option value="RW">Rwanda</option>'
techfields+='<option value="KN">Saint Kitts and Nevis</option>'
techfields+='<option value="LC">Saint Lucia</option>'
techfields+='<option value="VC">Saint Vincent and the Grenadines</option>'
techfields+='<option value="WS">Samoa</option>'
techfields+='<option value="SM">San Marino</option>'
techfields+='<option value="ST">Sao Tome and Principe</option>'
techfields+='<option value="SA">Saudi Arabia</option>'
techfields+='<option value="SN">Senegal</option>'
techfields+='<option value="SC">Seychelles</option>'
techfields+='<option value="SL">Sierra Leone</option>'
techfields+='<option value="SG">Singapore</option>'
techfields+='<option value="SK">Slovakia (Slovak Republic)</option>'
techfields+='<option value="SI">Slovenia</option>'
techfields+='<option value="SB">Solomon Islands</option>'
techfields+='<option value="SO">Somalia</option>'
techfields+='<option value="ZA">South Africa</option>'
techfields+='<option value="GS">South Georgia and the South Sandwich Islands</option>'
techfields+='<option value="ES">Spain</option>'
techfields+='<option value="LK">Sri Lanka</option>'
techfields+='<option value="SH">St. Helena</option>'
techfields+='<option value="PM">St. Pierre and Miquelon</option>'
techfields+='<option value="SD">Sudan</option>'
techfields+='<option value="SR">Suriname</option>'
techfields+='<option value="SJ">Svalbard and Jan Mayen Islands</option>'
techfields+='<option value="SZ">Swaziland</option>'
techfields+='<option value="SE">Sweden</option>'
techfields+='<option value="CH">Switzerland</option>'
techfields+='<option value="SY">Syrian Arab Republic</option>'
techfields+='<option value="TW">Taiwan, Province of China</option>'
techfields+='<option value="TJ">Tajikistan</option>'
techfields+='<option value="TZ">Tanzania, United Republic of</option>'
techfields+='<option value="TH">Thailand</option>'
techfields+='<option value="TG">Togo</option>'
techfields+='<option value="TK">Tokelau</option>'
techfields+='<option value="TO">Tonga</option>'
techfields+='<option value="TT">Trinidad and Tobago</option>'
techfields+='<option value="TN">Tunisia</option>'
techfields+='<option value="TR">Turkey</option>'
techfields+='<option value="TM">Turkmenistan</option>'
techfields+='<option value="TC">Turks and Caicos Islands</option>'
techfields+='<option value="TV">Tuvalu</option>'
techfields+='<option value="UG">Uganda</option>'
techfields+='<option value="UA">Ukraine</option>'
techfields+='<option value="AE">United Arab Emirates</option>'
techfields+='<option value="GB">United Kingdom</option>'
techfields+='<option value="UM">United States Minor Outlying Islands</option>'
techfields+='<option value="UY">Uruguay</option>'
techfields+='<option value="UZ">Uzbekistan</option>'
techfields+='<option value="VU">Vanuatu</option>'
techfields+='<option value="VA">Vatican City State</option>'
techfields+='<option value="VE">Venezuela</option>'
techfields+='<option value="VN">Viet Nam</option>'
techfields+='<option value="VG">Virgin Islands (British)</option>'
techfields+='<option value="VI">Virgin Islands (U.S.)</option>'
techfields+='<option value="WF">Wallis and Futuna Islands</option>'
techfields+='<option value="EH">Western Sahara</option>'
techfields+='<option value="YE">Yemen</option>'
techfields+='<option value="YU">Yugoslavia</option>'
techfields+='<option value="ZR">Zaire</option>'
techfields+='<option value="ZM">Zambia</option>'
techfields+='<option value="ZW">Zimbabwe</option>'
techfields+='</select>'
techfields+='</td>'
techfields+='</tr>'
techfields+='<tr><td>State: </td>'
techfields+='<td>'
techfields+='<select name="tech_state">'
techfields+='<option value="ON">Ontario</option>'
techfields+='<option value="AB">Alberta</option>'
techfields+='<option value="BC">British Columbia</option>'
techfields+='<option value="MB">Manitoba</option>'
techfields+='<option value="NB">New Brunswick</option>'
techfields+='<option value="NF">Newfoundland</option>'
techfields+='<option value="NS">Nova Scotia</option>'
techfields+='<option value="NT">Northwest Territories</option>'
techfields+='<option value="NU">Nunavut</option>'
techfields+='<option value="PE">Prince Edward Island</option>'
techfields+='<option value="QC">Quebec</option>'
techfields+='<option value="SK">Saskatchewan</option>'
techfields+='<option value="YK">Yukon</option>'
techfields+='</select>'
techfields+='</td>'
techfields+='</tr>'
techfields+='<tr><td>ZIP: </td><td><input type="text" name="tech_zip" id="tech_zip"></td></tr>'
techfields+='<tr><td>Phone Number: </td><td><input type="text" name="tech_phone" id="tech_phone"></td></tr>'
techfields+='<tr><td>Fax Number: </td><td><input type="text" name="tech_fax" id="tech_fax"></td></tr>'
techfields+='<tr><td>Email: </td><td><input type="text" name="tech_email" id="tech_email"></td></tr>'
techfields+='</table>'
x[0].innerHTML=techfields
  break
case 'tech-usereg':
var x=document.getElementById('myTable').rows[5].cells
x[0].innerHTML=''
  break

}
}

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)

{
	
	var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function fnBuildString (strInA,strInB, strSep)
{	//Concatinates strInB to end of strInA.
	//If strInA is blank then just returns strInB.
	//Otherwise returns strInA concatinated with strInB and separted with string strSep.
	if (isWhitespace(strInA) )
	{	
		strInA = strInB
	}
	else
	{	
		strInA += (strSep + strInB)
	} 
	return strInA   
}

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function validate()
{
	var BillMsg="[The Following Billing Fields are Required] "
	var AdminMsg="[The Following Administrative Fields are Required] "
	var TechMsg="[The Following Technical Fields are Required] "
	var DNSMsg="[The Following DNS Fields are Required] "
	var PayMsg="[The Following Payment Fields are Required] "
	var RegAgreeMsg="[You Need To Agree With The Registration Policy Before You Can Proceed]"
	var strMsgAdmin=""
	var strMsgBill=""
	var strMsgTech=""
	var strMsgDNS=""
	var strMsgPay=""
	var strMsgAll=""
	var strOrg = "Organization"
	var strFName = "First Name"
	var strLName = "Last Name"
	var strPhone = "Phone"
	var strEmail = "EMail"
	var strAddy = "Address"
	var strCity = "City"
	var strZip = "Zip/Postal Code"
	var validateAdmin=false
	var validateBill=false
	var validateTech=false
	var validateDNS=false
	var validatePay=false
	var validateRegPol=false

	var	policy_agree=document.myForm.policy_agree.checked
	//alert(policy_agree);
	if (policy_agree!=true)
	{
		validateRegPol=true;
	}

	if (!document.myForm.use_dns.checked)
	{
		if ( isWhitespace(document.myForm.fqdn1.value) )
		{
			validateDNS=true;
			strMsgDNS += "NameServer 1\n";
		}	
		if ( isWhitespace(document.myForm.fqdn2.value) )
		{
			validateDNS=true;
			strMsgDNS += "NameServer 2\n";
		}			
	}


	var	cc_num=document.myForm.cc_num.value
	var	CVV=document.myForm.CVV.value

	if ( isWhitespace(cc_num) )
	{
		validatePay=true;
		strMsgPay += "Credit Card Number\n";
	}
	if ( isWhitespace(CVV) )
	{
		validatePay=true;
		strMsgPay += "CVV\n";
	}

	if ( Mod10(cc_num)!=true )
	{
		validatePay=true;
		strMsgPay += "Invalid Credit Card Number\n";
	}

	var owner_first_name=document.myForm.owner_first_name.value
	var	owner_last_name=document.myForm.owner_last_name.value
	var	owner_org_name=document.myForm.owner_org_name.value
	var	owner_address1=document.myForm.owner_address1.value
	var	owner_city=document.myForm.owner_city.value
	var	owner_zip=document.myForm.owner_zip.value
	var	owner_phone=document.myForm.owner_phone.value
	var	owner_email=document.myForm.owner_email.value

	if ( isWhitespace(owner_first_name) )
	{
		validateAdmin=true;
		strMsgAdmin = strFName+"\n";
	}

	if ( isWhitespace(owner_last_name) )
	{
		validateAdmin=true;
		strMsgAdmin += strLName+"\n";
	}

	if ( isWhitespace(owner_org_name) )
	{
		validateAdmin=true;
		strMsgAdmin += strOrg+"\n";
	}

	if ( isWhitespace(owner_address1) )
	{
		validateAdmin=true;
		strMsgAdmin += strAddy+"\n";
	}
	if ( isWhitespace(owner_city) )
	{
		validateAdmin=true;
		strMsgAdmin += strCity+"\n";
	}
	if ( isWhitespace(owner_zip) )
	{
		validateAdmin=true;
		strMsgAdmin += strZip+"\n";
	}
	if ( isWhitespace(owner_phone) )
	{
		validateAdmin=true;
		strMsgAdmin += strPhone+"\n";
	}
	if ( isWhitespace(owner_email) )
	{
		validateAdmin=true;
		strMsgAdmin += strEmail+"\n";
	}
	if ( !isEmail(owner_email) )
	{
		validateAdmin=true;
		strMsgAdmin += "Email Address is Invalid\n";
	}
	
	//alert(document.myForm.admin_is_billingcontact[0].checked)
	if (document.myForm.admin_is_billingcontact[1].checked)
	{
		var billing_first_name=document.myForm.billing_first_name.value
		var	billing_last_name=document.myForm.billing_last_name.value
		var	billing_org_name=document.myForm.billing_org_name.value
		var	billing_address1=document.myForm.billing_address1.value
		var	billing_city=document.myForm.billing_city.value
		var	billing_zip=document.myForm.billing_zip.value
		var	billing_phone=document.myForm.billing_phone.value
		var	billing_email=document.myForm.billing_email.value

		if ( isWhitespace(billing_first_name) )
		{
			validateBill=true;
			strMsgBill = strFName+"\n";
		}

		if ( isWhitespace(billing_last_name) )
		{
			validateBill=true;
			strMsgBill += strLName+"\n";
		}

		if ( isWhitespace(billing_org_name) )
		{
			validateBill=true;
			strMsgBill += strOrg+"\n";
		}

		if ( isWhitespace(billing_address1) )
		{
			validateBill=true;
			strMsgBill += strAddy+"\n";
		}
		if ( isWhitespace(billing_city) )
		{
			validateBill=true;
			strMsgBill += strCity+"\n";
		}
		if ( isWhitespace(billing_zip) )
		{
			validateBill=true;
			strMsgBill += strZip+"\n";
		}
		if ( isWhitespace(billing_phone) )
		{
			validateBill=true;
			strMsgBill += strPhone+"\n";
		}
		if ( isWhitespace(billing_email) )
		{
			validateBill=true;
			strMsgBill += strEmail+"\n";
		}
		if ( !isEmail(billing_email) )
		{
			validateBill=true;
			strMsgBill += "Email Address is Invalid\n";
		}

	}

	if (document.myForm.admin_is_techcontact[1].checked)
	{
		var tech_first_name=document.myForm.tech_first_name.value
		var	tech_last_name=document.myForm.tech_last_name.value
		var	tech_org_name=document.myForm.tech_org_name.value
		var	tech_address1=document.myForm.tech_address1.value
		var	tech_city=document.myForm.tech_city.value
		var	tech_zip=document.myForm.tech_zip.value
		var	tech_phone=document.myForm.tech_phone.value
		var	tech_email=document.myForm.tech_email.value

		if ( isWhitespace(tech_first_name) )
		{
			validateTech=true;
			strMsgTech = strFName+"\n";
		}

		if ( isWhitespace(tech_last_name) )
		{
			validateTech=true;
			strMsgTech += strLName+"\n";
		}

		if ( isWhitespace(tech_org_name) )
		{
			validateTech=true;
			strMsgTech += strOrg+"\n";
		}

		if ( isWhitespace(tech_address1) )
		{
			validateTech=true;
			strMsgTech += strAddy+"\n";
		}
		if ( isWhitespace(tech_city) )
		{
			validateTech=true;
			strMsgTech += strCity+"\n";
		}
		if ( isWhitespace(tech_zip) )
		{
			validateTech=true;
			strMsgTech += strZip+"\n";
		}
		if ( isWhitespace(tech_phone) )
		{
			validateTech=true;
			strMsgTech += strPhone+"\n";
		}
		if ( isWhitespace(tech_email) )
		{
			validateTech=true;
			strMsgTech += strEmail+"\n";
		}
		if ( !isEmail(tech_email) )
		{
			validateTech=true;
			strMsgTech += "Email Address is Invalid\n";
		}

	}

	if (validateAdmin==true || validateBill==true || validateTech==true || validatePay==true || validateRegPol==true || validateDNS==true)
	{
		// Build Registrant alert message

		strMsgAll="SIGN UP ERROR\n\n"
		strMsgAll += "_____________________________________________________\n\n";
		strMsgAll += "The form was not submitted because of the following error(s).\n";
		strMsgAll += "Please correct these error(s) and re-submit.\n";
		strMsgAll += "_____________________________________________________\n\n";
		if (validateAdmin==true)
		{
			strMsgAll += AdminMsg+"\n"+strMsgAdmin+"\n"
		}
		if (validateBill==true)
		{
			strMsgAll += BillMsg+"\n"+strMsgBill+"\n"
		}
		if (validateTech==true)
		{
			strMsgAll += TechMsg+"\n"+strMsgTech+"\n"
		}
		if (validateDNS==true)
		{
			strMsgAll += DNSMsg+"\n"+strMsgDNS+"\n"
		}
		if (validatePay==true)
		{
			strMsgAll += PayMsg+"\n"+strMsgPay+"\n"
		}
		if (validateRegPol==true)
		{
			strMsgAll += RegAgreeMsg+"\n\n"
		}
		// display alert message
		alert(strMsgAll)
		//return to page without submitting form
		return false
	}	
}


function validateexist()
{
	var BillMsg="[The Following Billing Fields are Required] "
	var AdminMsg="[The Following Administrative Fields are Required] "
	var TechMsg="[The Following Technical Fields are Required] "
	var PayMsg="[The Following Payment Fields are Required] "
	var RegAgreeMsg="[You Need To Agree With The Registration Policy Before You Can Proceed]"
	var strMsgAdmin=""
	var strMsgBill=""
	var strMsgTech=""
	var strMsgPay=""
	var strMsgAll=""
	var strOrg = "Organization"
	var strFName = "First Name"
	var strLName = "Last Name"
	var strPhone = "Phone"
	var strEmail = "EMail"
	var strAddy = "Address"
	var strCity = "City"
	var strZip = "Zip/Postal Code"
	var validateAdmin=false
	var validateBill=false
	var validateTech=false
	var validatePay=false
	var validateRegPol=false

	var	policy_agree=document.myForm.policy_agree.checked
	//alert(policy_agree);
	if (policy_agree!=true)
	{
		validateRegPol=true;
	}

	var	cc_num=document.myForm.cc_num.value
	var	CVV=document.myForm.CVV.value

	if ( isWhitespace(cc_num) )
	{
		validatePay=true;
		strMsgPay += "Credit Card Number\n";
	}
	if ( isWhitespace(CVV) )
	{
		validatePay=true;
		strMsgPay += "CVV\n";
	}

	if ( Mod10(cc_num)!=true )
	{
		validatePay=true;
		strMsgPay += "Invalid Credit Card Number\n";
	}

	if (validateAdmin==true || validateBill==true || validateTech==true || validatePay==true || validateRegPol==true)
	{
		// Build Registrant alert message

		strMsgAll="SIGN UP ERROR\n\n"
		strMsgAll += "_____________________________________________________\n\n";
		strMsgAll += "The form was not submitted because of the following error(s).\n";
		strMsgAll += "Please correct these error(s) and re-submit.\n";
		strMsgAll += "_____________________________________________________\n\n";
		if (validateAdmin==true)
		{
			strMsgAll += AdminMsg+"\n"+strMsgAdmin+"\n"
		}
		if (validateBill==true)
		{
			strMsgAll += BillMsg+"\n"+strMsgBill+"\n"
		}
		if (validateTech==true)
		{
			strMsgAll += TechMsg+"\n"+strMsgTech+"\n"
		}
		if (validatePay==true)
		{
			strMsgAll += PayMsg+"\n"+strMsgPay+"\n"
		}
		if (validateRegPol==true)
		{
			strMsgAll += RegAgreeMsg+"\n\n"
		}
		// display alert message
		alert(strMsgAll)
		//return to page without submitting form
		return false
	}	
}
/***********************************************
* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
                
function handleEnter (field, event, pageto) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			switch (pageto)
			{
			case 'checkname':
				checkname();
			break
			case 'whoislookup':
				whoislookup();
			break
			case 'metavalidate':
				validatetags();
			break
			default:
			}
			/*var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();*/
			return false;
		} 
		else
		return true;
	}      

function Mod10(ccNumb) 
{  // v2.0
var valid = "0123456789"  // Valid digits in a credit card number
var len = ccNumb.length;  // The length of the submitted cc number
var iCCN = parseInt(ccNumb);  // integer of ccNumb
var sCCN = ccNumb.toString();  // string of ccNumb
sCCN = sCCN.replace (/^\s+|\s+$/g,'');  // strip spaces
var iTotal = 0;  // integer total set at zero
var bNum = true;  // by default assume it is a number
var bResult = false;  // by default assume it is NOT a valid cc
var temp;  // temp variable for parsing string
var calc;  // used for calculation of each digit

// Determine if the ccNumb is in fact all numbers
for (var j=0; j<len; j++) {
  temp = "" + sCCN.substring(j, j+1);
  if (valid.indexOf(temp) == "-1"){bNum = false;}
}

// if it is NOT a number, you can either alert to the fact, or just pass a failure
if(!bNum){
  /*alert("Not a Number");*/bResult = false;
}

// Determine if it is the proper length 
if((len == 0)&&(bResult)){  // nothing, field is blank AND passed above # check
  bResult = false;
} else{  // ccNumb is a number and the proper length - let's see if it is a valid card number
  if(len >= 15){  // 15 or 16 for Amex or V/MC
    for(var i=len;i>0;i--){  // LOOP throught the digits of the card
      calc = parseInt(iCCN) % 10;  // right most digit
      calc = parseInt(calc);  // assure it is an integer
      iTotal += calc;  // running total of the card number as we loop - Do Nothing to first digit
      i--;  // decrement the count - move to the next digit in the card
      iCCN = iCCN / 10;                               // subtracts right most digit from ccNumb
      calc = parseInt(iCCN) % 10 ;    // NEXT right most digit
      calc = calc *2;                                 // multiply the digit by two
      // Instead of some screwy method of converting 16 to a string and then parsing 1 and 6 and then adding them to make 7,
      // I use a simple switch statement to change the value of calc2 to 7 if 16 is the multiple.
      switch(calc){
        case 10: calc = 1; break;       //5*2=10 & 1+0 = 1
        case 12: calc = 3; break;       //6*2=12 & 1+2 = 3
        case 14: calc = 5; break;       //7*2=14 & 1+4 = 5
        case 16: calc = 7; break;       //8*2=16 & 1+6 = 7
        case 18: calc = 9; break;       //9*2=18 & 1+8 = 9
        default: calc = calc;           //4*2= 8 &   8 = 8  -same for all lower numbers
      }                                               
    iCCN = iCCN / 10;  // subtracts right most digit from ccNum
    iTotal += calc;  // running total of the card number as we loop
  }  // END OF LOOP
  if ((iTotal%10)==0){  // check to see if the sum Mod 10 is zero
    bResult = true;  // This IS (or could be) a valid credit card number.
  } else {
    bResult = false;  // This could NOT be a valid credit card number
    }
  }
}
// change alert to on-page display or other indication as needed.
if(bResult) {
  //alert("This IS a valid Credit Card Number!");
}
if(!bResult){
  //alert("This is NOT a valid Credit Card Number!");
}
  return bResult; // Return the results
}


function disp_confirm(what)
  {
  var r=confirm(what)
  if (r==true)
    {
    return true;
    }
  else
    {
    return false;
    }
  }

function forwardingcheckold()
{
	document.myForm.fqdn1.disabled=false;
	document.myForm.fqdn2.disabled=false;
	document.myForm.fqdn1.value='';
	document.myForm.fqdn2.value='';
	if (document.myForm.use_dns.checked)
	{
		document.myForm.fqdn1.disabled=true;
		document.myForm.fqdn2.disabled=true;
	}
}

function forwardingcheck()
{
ddrivetipcolor='#CED5DD';
var x=document.getElementById('dnsTable').rows[0].cells
x[0].innerHTML='Primary DNS: '
ddrivetip1='<b><u>Primary DNS Server</u></b><br>Should be in the name form e.g. ns1.nameserver.com';
x[1].innerHTML='<input type="text" name="fqdn1" id="fqdn1" size="25" maxlength="100" onMouseover="ddrivetip(ddrivetip1,ddrivetipcolor, 300)"; onMouseout="hideddrivetip()">'
var x=document.getElementById('dnsTable').rows[1].cells
x[0].innerHTML='Secondary DNS: '
ddrivetip2='<b><u>Secondary DNS Server</u></b><br>Should be in the name form e.g. ns2.nameserver.com';
x[1].innerHTML='<input type="text" name="fqdn2" id="fqdn2" size="25" maxlength="100" onMouseover="ddrivetip(ddrivetip2,ddrivetipcolor, 300)"; onMouseout="hideddrivetip()">'
var x=document.getElementById('dnsTable').rows[2].cells
x[0].innerHTML='If you specify nameservers you will override the URL/Email Forwarding provided by us.'
	if (document.myForm.use_dns.checked)
	{
		var x=document.getElementById('dnsTable').rows[0].cells
		x[0].innerHTML=''
		x[1].innerHTML=''
		var x=document.getElementById('dnsTable').rows[1].cells
		x[0].innerHTML=''
		x[1].innerHTML=''
		var x=document.getElementById('dnsTable').rows[2].cells
		x[0].innerHTML='Our DNS Service Includes the Ability to Modify:<ul><li>URL Forwarding<li>URL Frame<li>Email Forwarding<li>CNAME Records<li>Address Records<li>MX Records</ul>'
	}
}

function isLegal(txt) 
{
var invalids = "!@#$%^&*(),'<>/?;:\|[]+=_"
for(i=0; i<invalids.length; i++) {
if (txt.indexOf(invalids.charAt(i)) >= 0 ) 
{
return false;
}
}
return true;
}
