$(document).ready(function() {

  //Id's van de countries in de EU, eventueel vervangen door in DB te zoeken welke in EU is.
	var EU_countries = new Array("14","21","32","52","53","54","64","68","69","75",
								 "78","89","95","97","109","115","116","123","142",
								 "163","164","168","181","182","188","200");
  var ID_USA = 220;


   if (! in_array(($("select[@name=ID_country]").val()), EU_countries) ){
    $("input[@name=tax_number]").parent().parent().hide();
   }
  $("select[@name=ID_country]").change(function() {
    if (in_array(($("select[@name=ID_country]").val()), EU_countries)){
      $("input[@name=tax_number]").parent().parent().show();
    }else
    {
      $("input[@name=tax_number]").parent().parent().hide();
    }

  });
  
  //Help divs tonen
  $("div[@class=help]").hide();

  $("input").hover(function(){
    $(this).next("div[@class=help]").show("fast");
  }, function(){
    $(this).next("div[@class=help]").hide("fast");
  });

  $("select").hover(function(){
    $(this).next("div[@class=help]").show("fast");
  }, function(){
    $(this).next("div[@class=help]").hide("fast");
  });
  
  //help function
  function in_array(string, array) {
  	for (s = 0; s < array.length; s++) {
  		array_element = array[s].toString();
  		if (array_element == string) {
  			return true;
  		}
  	}
	  return false;
  }

});