function ResetForms() {
	var CountForms = document.forms.length;
	if (CountForms==0) return false;
	for (i=0; i<CountForms; i++) {
		document.forms[i].reset();
	}
	return true;
}

function SendOrder(Obj) {
	var a=Obj.email.value.indexOf("@")
	var b=Obj.email.value.indexOf(".",a+2)
	var c=Obj.email.value.length

	if (Obj.realname.value == "") {
    	alert('Вы не сообщили свое имя!');
	    Obj.realname.focus();
    	return false 
	    }
	else if (a<1 || b<3 || c<b+3) {
	    alert('Неверный E-mail адрес!');
    	Obj.email.focus();
    	Obj.email.select();
	    return false 
    	}
	else if (Obj.message.value == "") {
	    alert('Вы не написали сообщение!');
    	Obj.message.focus();
	    return false
    	}
return true;
}

//onload=window.print();
//<!-- Foto def -->
function Foto(img){ 
	foto1= new Image(); 
	foto1.src=(img); 
	Control(img);
	}

function Control(img){ 
	if((foto1.width!=0)&&(foto1.height!=0)){ 
		view(img); 
		} 
	else{ 
		funzione="Control('"+img+"')"; 
		intervallo=setTimeout(funzione,20);
		}
	}

function view(img){
	largh=foto1.width+20;
	altez=foto1.height+20;
	stringa="width="+largh+",height="+altez+",resizable=1";
	finestra=window.open(img,"",stringa);
	}

//##############################//##############################//##############################//##############################
//Определение браузера
this.agent=navigator.userAgent
this.MSIE=this.agent.indexOf("MSIE")>-1
this.Firefox=this.agent.indexOf("Firefox")>-1
this.Opera=this.agent.indexOf("Opera")>-1
this.Mac=this.agent.indexOf("Mac")>-1

function wh(){
// Ширина блока с картинкой
	if (navigator.userAgent.indexOf("MSIE")>-1) {
		iWidth = (document.body.offsetWidth-375)/2;
		iHeight = 125;
	}
	else {
		iWidth = (window.innerWidth-390)/2;
		iHeight = 113;
	}
	
	return '{height:'+iHeight+'px; width:'+iWidth+'px; }';
}

function whq(iwd){
// Ширина блока с картинкой
	if (navigator.userAgent.indexOf("MSIE")>-1) {
		iWidth=(document.body.offsetWidth-375)/2;
		iHeight = 125;
	}
	else {
		iWidth=(document.body.offsetWidth-390)/2;
		iHeight = 120;
	}
	for (var i = 1; i <= iwd; i++) {
		idW = "wd_"+i;
		document.getElementById(idW).style.width=iWidth+"px";
		document.getElementById(idW).style.height=iHeight+"px";
	}
}

function e_orders() {
// Если форма e_order существуют, то очистить её
//	document.write("length = "+document.forms.length);
	if (document.forms.length>0){
		for(i=0;i<document.forms.length;i++) {
			if (document.forms[i].name=="e_order")document.forms[i].reset();
		}
	}
}
function changes(mn){
	if (mn.style.display=="none") {
		mn.style.display="block";
	}
	else {
		mn.style.display="none";
	}
}
