	function checksearch(){
          var message="";
	  var anum=/(^\d+$)|(^\d+\.\d+$)/
          if (document.search.area_min.value.length != 0)
          if (anum.test(document.search.area_min.value)!=true)
                message += "\n     -  Area min (only numbers!)";
          if (document.search.area_max.value.length != 0)
          if (anum.test(document.search.area_max.value)!=true)
                message += "\n     -  Area max (only numbers!)";

          if (message.length > 0){
                message = "_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        message + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                alert(message);
                return false;
          }
          else {
                return true;
          }

	}//checksearch

	function checkuser(){
          var message="";
          var anum=/(^\d+$)|(^\d+\.\d+$)/
	
	  if (document.users.imie.value.length == 0){
                message += "\n     -  First name";
          }
	  if (document.users.nazwisko.value.length == 0){
                message += "\n     -  Last name";
          }
	  if (document.users.nazwa_firmy.value.length == 0){
                message += "\n     -  Company";
          }
	  if (document.users.login.value.length == 0){
                message += "\n     -  Login";
          }
	  if (document.users.haslo.value.length == 0){
                message += "\n     -  Haslo";
          }
	  if (document.users.data_rozp.value.length == 0){
                message += "\n     -  Data waznosci od";
          }
	  if (document.users.data_zakon.value.length == 0){
                message += "\n     -  Data waznosci do";
          }

	  if (message.length > 0){
                message = "_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        message + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                alert(message);
                return false;
          }
          else {
                return true;
          }


	}//checkuser
	
	function updateuser(){
          var message="";
          var anum=/(^\d+$)|(^\d+\.\d+$)/

          if (document.users.imie.value.length == 0){
                message += "\n     -  First name";
          }
          if (document.users.nazwisko.value.length == 0){
                message += "\n     -  Last name";
          }
          if (document.users.nazwa_firmy.value.length == 0){
                message += "\n     -  Company";
          }
          if (document.users.login.value.length == 0){
                message += "\n     -  Login";
          }
          if (document.users.data_rozp.value.length == 0){
                message += "\n     -  Data waznosci od";
          }
          if (document.users.data_zakon.value.length == 0){
                message += "\n     -  Data waznosci do";
          }

          if (message.length > 0){
                message = "_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        message + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                alert(message);
                return false;
          }
          else {
                return true;
          }


        }//updateuser
        function sure_acc(){
          var message="";
          var anum=/(^\d+$)|(^\d+\.\d+$)/

/*	  if (document.accept.town.value.length == 0){
                message += "\n     -  Town/Community";
          }
          if (document.accept.voivodeship_name.value.length == 0){
                message += "\n     -  Voivodeship";
          }
	  if (anum.test(document.accept.area_total.value)!=true){
                message += "\n     -  Area total (only numbers!)";
	  }
	  if (document.accept.national_road_dist.value.length == 0){
                message += "\n     -  Distance to national road";
          }
	  if (document.accept.railway_dist.value.length == 0){
                message += "\n     -  Distance to railway";
          }
	  if (document.accept.airport_dist.value.length == 0){
                message += "\n     -  Distance to airport";
          }
          if (document.accept.electr_present.value == 2){ //no information
                message += "\n     -  Electricity on site";
          }
          if (document.accept.gas_present.value == 2){ //no information
                message += "\n     -  Gas on site";
          }
          if (document.accept.water_present.value == 2){ //no information
                message += "\n     -  Water on site";
          }
          if (document.accept.halls_present.value == 2){ //no information
                message += "\n     -  Halls on site";
          }
          if (document.accept.office_present.value == 2){ //no information
                message += "\n     -  Offices on site";
          }
          if (document.accept.ware_present.value == 2){ //no information
                message += "\n     -  Warehouses on site";
          } */
          if (document.accept.land_cat.value.length == 0){ 
                message += "\n     -  Oferta nie jest kategorii A lub B.";
          }
          if (document.accept.land_cat.value == 'C'){ 
                message += "\n     -  Oferta nie jest kategorii A lub B.";
          }


          if (message.length > 0){
                message = "_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        message + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                alert(message);
                return false;
          }
          else {
                return true;
          }
	  	  
        }//checkaccept

	function checkform(){
	  var message="";
	  var valid = ",.0123456789";
          var ok = "yes";
          var temp;
	  var anum=/(^\d+$)|(^\d+\.\d+$)/	  
	
	  if (document.nieruch.town.value.length == 0){
		message += "\n     -  Town/Community";
	  }
	  if (anum.test(document.nieruch.area_total.value)!=true)
	  	message += "\n     -  Area total (only numbers!)";

	  if (document.nieruch.voivodship.value == 0){
		message += "\n     -  Voivodeship";
	  }

	/*  for (var i=0; i<document.nieruch.add_area.value.length; i++) {
			temp = "" + document.nieruch.add_area.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") ok = "no";
	  }
	  if (ok == "no") {
			message += "\n     -  Additional area (only numbers!)";
	  }*/
	  if (document.nieruch.main_owner_area.value.length != 0)
          if (anum.test(document.nieruch.main_owner_area.value)!=true)
                message += "\n     -   Area of main owner - (only numbers!)";

	  if (document.nieruch.other_owner_area.value.length != 0)
          if (anum.test(document.nieruch.other_owner_area.value)!=true)
                message += "\n     -  Area of other owners - (only numbers!)";

	  if (document.nieruch.number_owners.value.length != 0)
          if (anum.test(document.nieruch.number_owners.value)!=true)
                message += "\n     -  Number of other owners - (only numbers!)";


          if (document.nieruch.electr_present.value == 2){ //no information
                message += "\n     -  Electricity on site (yes/no)";
          }
          if (document.nieruch.gas_present.value == 2){ //no information
                message += "\n     -  Gas on site (yes/no)";
          }
          if (document.nieruch.water_present.value == 2){ //no information
                message += "\n     -  Water on site (yes/no)";
          }

	  if (document.nieruch.access_road_dist.value.length != 0)
          if (anum.test(document.nieruch.access_road_dist.value)!=true)
                message += "\n     -  Nearest access road - Distance (only numbers!)";

	  if (document.nieruch.voivod_dist.value.length != 0)
          if (anum.test(document.nieruch.voivod_dist.value)!=true)
                message += "\n     -  Nearest voivodeship city - Distance (only numbers!)";

 //	  if (document.nieruch.national_road_dist.value.length != 0)
          if (anum.test(document.nieruch.national_road_dist.value)!=true)
                message += "\n     -  Nearest national road - Distance (only numbers!)";

  //	  if (document.nieruch.railway_dist.value.length != 0)
          if (anum.test(document.nieruch.railway_dist.value)!=true)
                message += "\n     -  Nearest railway - Distance (only numbers!)";

//	  if (document.nieruch.airport_dist.value.length != 0)
          if (anum.test(document.nieruch.airport_dist.value)!=true)
                message += "\n     -  Nearest airport - Distance (only numbers!)";

	  if (document.nieruch.electr_dist.value.length != 0)
          if (anum.test(document.nieruch.electr_dist.value)!=true)
                message += "\n     -  Electricity -  Distance (only numbers!)";

	  if (document.nieruch.gas_dist.value.length != 0)
          if (anum.test(document.nieruch.gas_dist.value)!=true)
                message += "\n     -  Gas - Distance (only numbers!)";

	  if (document.nieruch.water_dist.value.length != 0)
          if (anum.test(document.nieruch.water_dist.value)!=true)
                message += "\n     -  Water - Distance (only numbers!)";

	  if (document.nieruch.sewage_dist.value.length != 0)
          if (anum.test(document.nieruch.sewage_dist.value)!=true)
                message += "\n     -  Sewage system - Distance (only numbers!)";

	  if (document.nieruch.treat_dist.value.length != 0)
          if (anum.test(document.nieruch.treat_dist.value)!=true)
                message += "\n     -  Treatment plant - Distance (only numbers!)";

          if (document.nieruch.halls_present.value == 2){ //no information
                message += "\n     -  Halls on site";
          }
          if (document.nieruch.office_present.value == 2){ //no information
                message += "\n     -  Offices on site";
          }
          if (document.nieruch.ware_present.value == 2){ //no information
                message += "\n     -  Warehouses on site";
          }

	  if (message.length > 0){
		message = "_____________________________\n" +
			"You failed to correctly fill in your:\n" +
			message + "\n_____________________________" +
			"\nPlease re-enter and submit again!";
	        alert(message);
	        return false;
	  }
	  else {
	        return true;
	  }
	}//checkform

	function checkauto(){
          var message="";
	  var anum=/(^\d+$)|(^\d+\.\d+$)/
          if (document.auto.company_name.value.length == 0)
                message += "\n     -  Company name";
          if (document.auto.street.value.length == 0)
                message += "\n     -  Street";
          if (document.auto.city.value.length == 0)
                message += "\n     -  City";
          if (document.auto.id_voivodship.value == 0)
                message += "\n     -  Voivodship";
//        if (document.auto.postal_code1.value.length != 0)
          if (anum.test(document.auto.postal_code1.value)!=true)
                message += "\n     -  Postal code (only numbers!)";
//          if (document.auto.postal_code2.value.length != 0)
          if (anum.test(document.auto.postal_code2.value)!=true)
                message += "\n     -  Postal code (only numbers!)";
//          if (document.auto.year_found.value.length != 0)
          if (anum.test(document.auto.year_found.value)!=true)
                message += "\n     -  Year of foundation (only numbers!)";
//          if (document.auto.employees.value.length != 0)
          if (anum.test(document.auto.employees.value)!=true)
                message += "\n     -  Number of employees (only numbers!)";
//          if (document.auto.f_ownership.value.length != 0)
          if (anum.test(document.auto.f_ownership.value)!=true)
                message += "\n     -  Percentage of foreign ownership (only numbers!)";
          if (document.auto.id_legal_form.value == 0)
                message += "\n     -  Legal form";
          if (document.auto.parent_company.value.length == 0)
                message += "\n     -  Parent company";
          if (document.auto.sl_ct_person.value.length == 0)
                message += "\n     -  Sales contact person";
          if (document.auto.sl_phone.value.length == 0)
                message += "\n     -  Phone";
          if (document.auto.sl_fax.value.length == 0)
                message += "\n     -  Fax";
          if (document.auto.sl_mail.value.length == 0)
                message += "\n     -  E-mail";
          if (document.auto.sl_www.value.length == 0)
                message += "\n     -  WWW";
          if (document.auto.prod_description.value.length == 0)
                message += "\n     -  Product / services description";
          if (document.auto.q_cert.value.length == 0)
                message += "\n     -  Quality certificaties";
          if (document.auto.id_services.value == 0)
                message += "\n     -  Other sectors serviced";
          if (document.auto.sales.value.length != 0)
          if (anum.test(document.auto.sales.value)!=true)
                message += "\n     -  Sales in 2003 (only numbers!)";
          if (document.auto.lc_content.value.length != 0)
          if (anum.test(document.auto.lc_content.value)!=true)
                message += "\n     -  Local content (only numbers!)";
          if (document.auto.sh_export.value.length != 0)
          if (anum.test(document.auto.sh_export.value)!=true)
                message += "\n     -  Share of export (only numbers!)";
          if (document.auto.fp_capacity.value.length != 0)
          if (anum.test(document.auto.fp_capacity.value)!=true)
                message += "\n     -  Free production capacity (only numbers!)";

          if (message.length > 0){
                message = "_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        message + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                alert(message);
                return false;
          }
          else {
                return true;
          }

	}//checksearch
