if (document.images){
   home_on=new Image(); home_on.src="images/nav/home_over.gif";
   home_off=new Image(); home_off.src="images/nav/home.gif";

   industry_on=new Image(); industry_on.src="images/nav/industry_news_over.gif";
   industry_off=new Image(); industry_off.src="images/nav/industry_news.gif";

   advertising_on=new Image(); advertising_on.src="images/nav/advertising_over.gif";
   advertising_off=new Image(); advertising_off.src="images/nav/advertising.gif";

   music_on=new Image(); music_on.src="images/nav/stock_music_over.gif";
   music_off=new Image(); music_off.src="images/nav/stock_music.gif";

   production_on=new Image(); production_on.src="images/nav/production_over.gif";
   production_off=new Image(); production_off.src="images/nav/production.gif";

   contact_on=new Image(); contact_on.src="images/nav/contact_over.gif";
   contact_off=new Image(); contact_off.src="images/nav/contact.gif";
}

////////////////////////////////////////////////////////////

function its_empty (str_value){
        return (str_value == "" || str_value == null)
}

////////////////////////////////////////////////////////////

function invalid_email(email_address){
        if (email_address.length < 5)
        return true

        at_location  = email_address.indexOf("@");
        dot_location = email_address.lastIndexOf(".");

        if((at_location == 0)||(dot_location - at_location < 2)||(email_address.length - dot_location < 2))
        return true

        return false
}

////////////////////////////////////////////////////////////


function check_form(form_name) {

 var message = "";
 var em_error = "";
 var el_error = "";
 var od_error = "Book to order\n";

 var return_code = true;

 var site_forms = new Array()
 site_forms['GetbookForm'] = new Array("orderbook","Firstname","Surname","EmailAddress","TelephoneNumber","CompanyName","ProfessionalArea","Address1","TownCity","Postcode","Country");

 var form = document.forms[form_name];

 for(counter=0; counter < form.length; counter++)
 {
    if((form[counter].type == "text") || (form[counter].type == "checkbox") || (form[counter].type == "select-one")){
       for(i=0; i < site_forms[form_name].length; i++){
          if (form[counter].name == site_forms[form_name][i]){

             if(form[counter].name == "EmailAddress"){
                if(invalid_email(form[counter].value)){
                  return_code = false;
                  em_error = "E-mail address is not valid!\n";
                }
             }
             else{

                if(form[counter].name=="orderbook" && form[counter].checked){
                  od_error = "";
                }
                if(form[counter].name=="Firstname" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "First name\n";
                }
                if(form[counter].name=="Surname" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Surname\n";
                }
                if(form[counter].name=="CompanyName" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Company name\n";
                }
                if(form[counter].name=="Address1" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Address\n";
                }
                if(form[counter].name=="TownCity" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Town\n";
                }
                if(form[counter].name=="Postcode" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Postcode\n";
                }
                if(form[counter].name=="Country" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Country\n";
                }
                if(form[counter].name=="EmailAddress" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Email address\n";
                }
                if(form[counter].name=="TelephoneNumber" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Telephone number\n";
                }
                if(form[counter].name=="ProfessionalArea" && its_empty(form[counter].value)){
                  return_code = false;
                  el_error += "Professional area\n";
                }
             }
          }
       }
     }
 }

 if(od_error && return_code)
 return_code = false;

 if(el_error || od_error)
  el_error = "Please fill in :\n" + od_error + el_error

 if(!return_code)
 alert(em_error + el_error);

 return return_code
}

////////////////////////////////////////////////////////////

function on(i) {
  if (document.images)
    document.images[i].src = eval(i + "_on.src");
}

////////////////////////////////////////////////////////////

function off(i) {
  if (document.images)
    document.images[i].src = eval(i + "_off.src");
}