<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*#################################################################
set text
###################################################################*/
function toggleBox(szDivID, iState, TEXT) // 1 visible, 0 hidden
{
	var obj = document.layers ? document.layers[szDivID] :	document.getElementById ?  document.getElementById(szDivID) :	document.all[szDivID];
	obj.innerHTML = TEXT;
//	document.getElementById(szDivID).innerHTML = TEXT;

}
/*#################################################################
CONTACT
###################################################################*/
function checkContact(form)
   	{
			fl=true;
			var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
			if(form.fname.value=='')			{fl=false;toggleBox('fname',1,'<br/>Введите  Имя<br/>'); 			}else{toggleBox('fname',1,'');}
  			if(form.mail.value=='')				{fl=false;toggleBox('mail',1,'<br/>Введите e-Mail<br/>'); 			}else{toggleBox('mail',1,'');}
			if (!form.mail.value.match(filter)) {fl=false;toggleBox('mail',1,'<br/>Введите  правельно e-Mail<br/>');}else{toggleBox('mail',1,'');}
			if(form.comments.value=='')			{fl=false;toggleBox('comments',1,'<br/>Введите коментарии <br/>');  }else{toggleBox('comments',1,'');}
	return fl;
   	}	
	function checkOrder(form)
   	{
			fl=true;
			var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
			if(form.name.value=='')				{fl=false;toggleBox('name',1,'<br/>Введите  Имя<br/>'); 					}else{toggleBox('name',1,'');}
  			if(form.mail.value=='')				{fl=false;toggleBox('mail',1,'<br/>Введите e-Mail<br/>'); 					}else{toggleBox('mail',1,'');}
			if (!form.mail.value.match(filter)) {fl=false;toggleBox('mail',1,'<br/>Введите  правельно e-Mail<br/>');		}else{toggleBox('mail',1,'');}
			if(form.phone.value=='')			{fl=false;toggleBox('phone',1,'<br/>Введите коментарии <br/>');  			}else{toggleBox('phone',1,'');}
			if(form.comp_name.value=='')		{fl=false;toggleBox('comp_name',1,'<br/>Введите название компании <br/>');  }else{toggleBox('comp_name',1,'');}			
	return fl;
   	}	
/*#################################################################
	REGISTARTION
###################################################################*/

function checkRegistration(form)
{

//setRegistartion(form,form.fname.value,form.lname.value,form.city.value,form.mail.value,form.mailCheck.value,form.mphone.value,form.mphone.value,form.hphone.value);
		fl=true;
		szDivID='fizic';

		 if(document.getElementById)	  //gecko(NN6) + IE 5+
		{
			var obj = document.getElementById(szDivID);
		   if(obj.style.visibility == "visible"){
				if(form.company.value==''){fl=false;toggleBox('company',1,'<br/>Введите Название Компании<br/>'); }else{toggleBox('company',1,'');}
				if(form.fcode.value==''){fl=false;toggleBox('fcode',1,'<br/>Введите фискальный код<br/>'); }else{toggleBox('fcode',1,'');}
				if(form.ncode.value==''){fl=false;toggleBox('ncode',1,'<br/>Введите код ндс<br/>'); }else{toggleBox('ncode',1,'');}
				if(form.rbank.value==''){fl=false;toggleBox('rbank',1,'<br/>Введите реквезиты банка<br/>'); }else{toggleBox('rbank',1,'');}		
		   }else{
	
	}
	
		}
		else if(document.all)	// IE 4
		{
		  if(document.layers[szDivID].style.display == "block"){
				if(form.company.value==''){fl=false;toggleBox('company',1,'<br/>Введите Название Компании<br/>'); }else{toggleBox('company',1,'');}
				if(form.fcode.value==''){fl=false;toggleBox('fcode',1,'<br/>Введите фискальный код<br/>'); }else{toggleBox('fcode',1,'');}
				if(form.ncode.value==''){fl=false;toggleBox('ncode',1,'<br/>Введите код ндс<br/>'); }else{toggleBox('ncode',1,'');}
				if(form.rbank.value==''){fl=false;toggleBox('rbank',1,'<br/>Введите реквезиты банка<br/>'); }else{toggleBox('rbank',1,'');}		
		  }else{
	
		  }
	
		}							
							
		

		if(form.fname.value==''){fl=false;toggleBox('fname',1,'<br/>Введите Имя<br/>'); }else{toggleBox('fname',1,'');}
		if(form.lname.value==''){fl=false;toggleBox('lname',1,'<br/>Введите Фамилию<br/>'); }else{toggleBox('lname',1,'');}
		if(form.city.value==''){fl=false;toggleBox('city',1,'<br/>Введите Город<br/>'); }else{toggleBox('city',1,'');}
		if(form.index.value==''){fl=false;toggleBox('index',1,'<br/>Введите Почтовый индекс<br/>'); }else{toggleBox('index',1,'');}
		if(form.adress.value==''){fl=false;toggleBox('adress',1,'<br/>Введите Адрес <br/>'); }else{toggleBox('adress',1,'');}
		
		var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
		if(form.mail.value==''){fl=false;toggleBox('mail',1,'<br/>Введите E-mail<br/>');}else{toggleBox('mail',1,'');}
		if(!form.mail.value.match(filter)) {fl=false;toggleBox('mail',1,'<br/>Введите  правельно e-Mail<br/>'); }else{toggleBox('mail',1,'');}
		if(form.login.value==''){fl=false;toggleBox('login6',1,'<br/>Введите Логин<br/>');}else{toggleBox('login6',1,'');}		
		
		if(form.psw.value==''){fl=false;toggleBox('epsw',1,'<br/>Введите пожалуста пароль<br/>');}else{toggleBox('epsw',1,'');}
		if(form.psw.value.length < 4 || (form.psw.value!=form.pswCheck.value)){fl=false;toggleBox('epswCheck',1,'<br/>Введите правельно пароль, не меньше 4 символов<br/>');}else{toggleBox('epswCheck',1,'');}

//		if(form.liscence.checked==false){fl=false; toggleBox('liscence',1,'<br/>Если вы согласны с условиями Elcom поставте галачку<br/>');}else{toggleBox('liscence',1,'');}

return fl;
}
function checkRegistrationEdit(form)
{

//setRegistartion(form,form.fname.value,form.lname.value,form.city.value,form.mail.value,form.mailCheck.value,form.mphone.value,form.mphone.value,form.hphone.value);
		fl=true;
		 var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
		if(form.fname.value==''){fl=false;toggleBox('fname',1,'<br/>Введите  Имя<br/>'); }else{toggleBox('fname',1,'');}
		if(form.lname.value==''){fl=false;toggleBox('lname',1,'<br/>Введите  Фамилию<br/>'); }else{toggleBox('lname',1,'');}
		if(form.city.value==''){fl=false;toggleBox('city',1,'<br/>Введите Город<br/>'); }else{toggleBox('city',1,'');}
		if(form.index.value==''){fl=false;toggleBox('index',1,'<br/>Введите Почтовый индекс<br/>'); }else{toggleBox('index',1,'');}
		if(form.adress.value==''){fl=false;toggleBox('adress',1,'<br/>Введите Адрес <br/>'); }else{toggleBox('adress',1,'');}
		
		if(form.mail.value==''){fl=false;toggleBox('mail',1,'<br/>Введите  E-mail<br/>');}else{toggleBox('mail',1,'');}
		if(!form.mail.value.match(filter)) {fl=false;toggleBox('mail',1,'<br/>Введите  правельно e-Mail<br/>'); }else{toggleBox('mail',1,'');}

		if(form.login.value==''){fl=false;toggleBox('login',1,'<br/>Введите Логин<br/>');}else{toggleBox('login',1,'');}

		if(form.psw.value==''){fl=false;toggleBox('epsw',1,'<br/>Введите пожалуста пароль<br/>');}else{toggleBox('epsw',1,'');}
		if(form.psw.value.length < 4 || (form.psw.value!=form.pswCheck.value)){fl=false;toggleBox('epswCheck',1,'<br/>Введите правельно пароль, не меньше 4 символов<br/>');}else{toggleBox('epswCheck',1,'');}

return fl;
}
function setRegistartion(form,vfname,vlname,vcity,vmail,vmailCheck,vmphone,vmphone,vhphone)
{		

	form.fname.value=checkOnQuoteQuote(checkOnQuote(vfname));
	form.lname.value=checkOnQuoteQuote(checkOnQuote(vlname));
	form.city.value=checkOnQuoteQuote(checkOnQuote(vcity));
	form.mail.value=checkOnQuoteQuote(checkOnQuote(vmail));
	form.mailCheck.value=checkOnQuoteQuote(checkOnQuote(vmailCheck));
	form.mphone.value=checkOnQuoteQuote(checkOnQuote(vmphone));
	form.hphone.value=checkOnQuoteQuote(checkOnQuote(vhphone));
//	form.wphone.value=checkOnQuoteQuote(checkOnQuote(vwphone));
					
}

function checkOnQuote(val){
var re = /"/g;
return val.replace(re, "&quot;");
}

function checkOnQuoteQuote(val){
var re = /'/g;
return val.replace(re, "&quot;");
}

function checkLogin(form)
{			fl=true;
			var error="";

			if(form.login.value == '') {fl=false;error+='Введите  логин \n';	}
			if(form.psw.value.length < 4 ){fl=false;     error+='Введите правельно пароль, не меньше 4 символов\n';}
			
			if(error){ alert(error); }
			return fl;
}
/// regesstration 
function checkForgot(form)
{			fl=true;
			var error="";
			var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
			if(!form.mail.value.match(filter)) {fl=false;error+='Введите  правельно e-Mail (логин)\n';	}
			if(error){ alert(error); }
			return fl;
}


function toggleBoxDiv2(szDivID) // 1 visible, 0 hidden
{
 
    if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
       if(obj.style.visibility == "visible"){
	   	obj.style.visibility = "hidden";
	   	obj.style.display = "none";
	   }else{
		   obj.style.visibility = "visible";
	   		 obj.style.display = "block";	  
	   }

    }
    else if(document.all)	// IE 4
    {
      if(document.layers[szDivID].style.display == "block"){
	      document.all[szDivID].style.visibility ="hidden";
		  document.layers[szDivID].style.display = "none";	 

	  }else{
	      document.all[szDivID].style.visibility ="visible";
		  document.layers[szDivID].style.display = "block";

	  }

    }
}

function toggleBoxDiv3(szDivID,f) // 1 visible, 0 hidden
{
 
    if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
       if(f == 0){
	   	obj.style.visibility = "hidden";
	   	obj.style.display = "none";
	   }else{
		   obj.style.visibility = "visible";
	   		 obj.style.display = "block";	  
	   }

    }
    else if(document.all)	// IE 4
    {
      if(f == 0){
	      document.all[szDivID].style.visibility ="hidden";
		  document.layers[szDivID].style.display = "none";	 

	  }else{
	      document.all[szDivID].style.visibility ="visible";
		  document.layers[szDivID].style.display = "block";

	  }

    }
}
function toggleBoxDiv(szDivID) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
      if(document.layers[szDivID].visibility=='visible'){
	  	 document.layers[szDivID].visibility = "hide";
		 document.layers[szDivID].style.display = "none";
	  }else{
	  	  document.layers[szDivID].visibility = "show";
  		  document.layers[szDivID].style.display = "block";	  
	  }
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
       if(obj.style.visibility=='visible'){
		    obj.style.visibility = "hidden";
		   	obj.style.display = "none";
	   }else{
			 obj.style.visibility = "visible";
	   		 obj.style.display = "block";	  
	   }
    }
    else if(document.all)	// IE 4
    {
      if(document.all[szDivID].style.visibility=='visible'){
	      document.all[szDivID].style.visibility ="hidden";
		  document.layers[szDivID].style.display = "none";	 
	  }else{
	      document.all[szDivID].style.visibility ="visible";
		  document.layers[szDivID].style.display = "block";
	  }
    }
}


function checkMail(form)
{			fl=true;
			 var filter =/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
  			if(form.mail.value==''){fl=false;toggleBox('mail',1,'Введите e-Mail (логин)');}else{toggleBox('mail',1,'');}
			if(!form.mail.value.match(filter)) {fl=false;toggleBox('mail',1,'Введите  правельно e-Mail (логин)');	}else{toggleBox('mail',1,'');}
			
			return fl;
}

function passwngers(){
		total = document.forms['passengersList'].quantity.value;
		if(!total || total<0 || total>100){
			alert('Please Insert value (1-8)');
		}else{
			passengers='<table cellpadding="0" cellspacing="5" border="0" width="100%"   class="text">';
			passengers+='<tr><td>#</td><td>Артикул</td><td>Наименование</td><td>Цвет</td><td>Количество</td></tr>';
			for(var i =1; i<=total;i++){
				passengers+='<tr><td>'+i+'.</td><td><input type="text" width="100" name="article['+i+']"></td><td><input type="text" width="100" name="pname['+i+']"></td><td><input type="text" width="100" name="color['+i+']"></td><td><input type="text" width="100" name="pquantity['+i+']"></td></tr>';


			} 
			passengers+='</table>';
			toggleBox('passengerList', 1, passengers);
		}
	}

//-->