function check()
{
frm=document.forms.contactForm;

	if(frm.info_list.value == "")
	{
		alert("Veuillez sélectionner un sujet.");
		return false;
	}
	if(frm.firstname.value == "")
	{
		alert("Veuillez saisir votre prénom.");
		return false;
	}
	if(frm.lastname.value == "")
	{
		alert("Veuillez saisir votre nom de famille.");
		return false;
	}
	if(frm.contact_email.value == "")
	{
		alert("Veuillez saisir votre adresse email.");
		return false;
	}
	if(frm.contact_country.selectedIndex == 0)
	{
		alert("Veuillez sélectionner votre pays.");
		return false;
	}

	if(document.getElementById('contact_country').selectedIndex == 1)
	{
		if(frm.mystate.selectedIndex == 0)
		{
			alert("Veuillez sélectionner votre État.");
			return false;
		}
	}
	if(document.getElementById('contact_country').selectedIndex == 2)
	{
		if(frm.companyprovince.selectedIndex == 0)
		{
			alert("Veuillez sélectionner votre province.");
			return false;
		}
	}
	if(frm.contact_workphone.value == "")
	{
		var answer = prompt("Il se peut que nous souhaitions vous contacter par téléphone concernant cette requête. Nous vous assurons que nous ne vous contacterons pour aucune autre raison. Si vous ne souhaitez pas être contacté par téléphone, veuillez cliquer sur 'Annuler.'","Veuillez saisir votre numéro de téléphone ici.");
		if(answer != "Veuillez saisir votre numéro de téléphone ici.")
		{
		   frm.contact_workphone.value = answer;
		}
	}

	return true;

}

function toggleState()
{
frm=document.forms.contactForm;
thisField=document.getElementById('contact_country');
thisstateforeign=document.getElementById('stateforeign');
thisstateusa=document.getElementById('stateusa');
thisstatecanada=document.getElementById('statecanada');
  if(thisField.options[thisField.selectedIndex].value == "UNITED STATES")
  {
	
	thisstateforeign.style.display = "none";
	thisstatecanada.style.display = "none";
	thisstateusa.style.display = "";
  }
  else if(thisField.options[thisField.selectedIndex].value == "CANADA")
  {
	thisstatecanada.style.display = "";
	thisstateforeign.style.display = "none";
	thisstateusa.style.display = "none";
  }
  else
  {
	thisstateusa.style.display = "none";
	thisstatecanada.style.display = "none";
	thisstateforeign.style.display = "";
  }
} 

function get_radiobutton(rd) {
	for (i=rd.length-1; i > -1; i--) {		
		if (rd[i].checked == true) {		
			return rd[i].value;
			break;			
		}
	}
	return false;
}

function get_myelement(obj) {
  if(document.getElementById){ //DOM
    css = document.getElementById(obj).style;
  } else {
    if(document.all){// IE
    	css = document.all[obj].style;
    }
    if(document.layers){//NS
      css = document.layers[obj];
    }
  }
   return css;
}
