
//The following functions are for the WHOIS module, They can be put in a separate js file.// return the variables required for domain hosting types or levels
function returnSelHostingVariables()
{
  URL='';
  for (optionCounter = 0; optionCounter < document.form_hosting_types.length; optionCounter++)
  {
    if (document.form_hosting_types.elements[optionCounter].getAttribute('type')=='select')	//make sure <select type='select' ... > is added
    {
      //if (document.form_contact_groups.elements[optionCounter].checked){
        //URL=URL+'&'+document.form_hosting_types.elements[optionCounter].name+'=true';
        URL=URL+'&'+document.form_hosting_types.elements[optionCounter].name+'='+document.form_hosting_types.elements[optionCounter].value;
      //}
    }else
    {
      // URL=URL+'&'+document.form_contact_groups.elements[optionCounter].name+'='+document.form_contact_groups.elements[optionCounter].value;
    }
  }
  //alert(URL);
  return URL;
}

// return the variables required for the user who registers a domain
function returnFormVariables()
{
  URL='';
  for (optionCounter = 0; optionCounter < document.form_user_data.length; optionCounter++)
  {
        URL=URL+'&'+document.form_user_data.elements[optionCounter].name+'='+document.form_user_data.elements[optionCounter].value;
  }
  //alert(URL);
  return URL;
}

function submitenter(myfield,e)
{	//used by 'whois' searchbox to capture ENTER keypress
	//submitenter(this, event)
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)	//If key is ASCII 13==ENTER
	{	//Do Whatever, like call the search function
		domainname = document.getElementById('query').value;
		replace_content('scripts/example.php?query='+domainname+'&r='+ Math.random(),'div_main');
	}
	else
		return true;
}


