<!--//

	

	var contactfld = new Array('name','company','position','email','phone','subject','message');

	var contactfldtitle = new Array('Имя','Организация','Должность','Email','Телефон','Тема сообщения','Сообщение');



	/* CONTACT FORM VALIDATION */

	function isReadyContact(form)

	{

		var chk=false;

  		var chk1=false;

  		var alertname="";

		

		for(i = 0;i < contactfld.length; i++)

		{

			var str = 'form.' + contactfld[i] + '.value';

			if(eval(str) == "")

			{

				chk=true;

				alertname = alertname + "  "  + contactfldtitle[i] + "\n";

			}

		}

  

   		if(chk == true)

	  	{

	    	alert("Заполните следующие поля:\n"+ alertname );

	    	var a=alertname.indexOf("\n");

	    	var posi=alertname.substring(0,a);

	

			for(i = 0;i < contactfldtitle.length; i++)

			{

		    	if(posi == "  " + contactfldtitle[i])

					var fstr = 'form.' + contactfld[i] + '.focus()';

		      		eval(fstr);

		    }

							

			return false;

	  	}

		

		//check for a valid email

		estr = form.email.value;

		var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,4})+$/i;

		emailok = estr.search(pattern);

		if(emailok == -1)

		{

			alert("Введите корректный адрес электронной почты!");

			form.email.select();

			return false;

		}

				

		if(chk== false && chk1==false){

	      return true;

	    }

			

		return false;

	}

	

	/* display categery item picture */

	function show_image(img)

	{

		var sFeatures = "width=800, height=700, top=50, left=200, location=no, resizable=yes,menubar=no, scrollbars=yes, status=no, toolbar=no";

		win = window.open("show_item_img.php?img="+img, "", sFeatures);

	}

	

	/* display certificate picture */

	function show_cert(img)

	{

		var sFeatures = "width=700, height=650, top=20, left=170, location=no, resizable=yes,menubar=no, scrollbars=yes, status=no, toolbar=no";

		win = window.open("show_item_img.php?certificate=1&img="+img, "", sFeatures);

	}

	

	//show map to office

	function showmap(what)

	{

		if(what == 'td')

		{

			var sFeatures = "width=650, height=620, top=20, left=170, location=no, resizable=yes,menubar=no, scrollbars=yes, status=no, toolbar=no";

			win = window.open("location.php?what=td", "", sFeatures);

		}

		if(what == 'factory')

		{

			var sFeatures = "width=650, height=640, top=20, left=170, location=no, resizable=yes,menubar=no, scrollbars=yes, status=no, toolbar=no";

			win = window.open("location.php?what=factory", "", sFeatures);

		}

	}

//-->	