m_bg_col = 0;

function open_window(link,w,h) {
	var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
	newWin = window.open(link,'newWin',win);
}

function validate() {
	if (document.form1.name.value.length<1) {
		alert("Введите имя");
		return false;
	};
	if (document.form1.address.value.length<1) {
		alert("Введите адрес для доставки заказа");
		return false;
	};
	if (document.form1.email.value.length<1) {
		alert("Введите адрес Вашей электронной почты");
		return false;
	};
	return true;
}

function change_lng(ln){
m = document.getElementByName("lng");
m.value=ln;
alert(m.value);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function open_win(theURL, h, w){
scry=window.screen.Height;
scrx=window.screen.Width;
vtop=(scry-h)/2;
vleft=(scrx-w)/2;
window.open(theURL, "imagewin", "statusbar,scrollbars,HEIGHT="+h+",WIDTH="+w+",top="+vtop+",left="+vleft);
};

function s_menu(m_id){
  m = document.getElementById(m_id);
  m_bg_col = m.style.backgroundColor;
  m.style.backgroundColor = "#606060";
};

function h_menu(m_id){
 m = document.getElementById(m_id);
 m.style.backgroundColor = m_bg_col;
};

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
};

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta)
{
if (!document.all)
return
	if (object != "[object]")
	{  //do this so I can take a string too
		setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
		return;
	}

	clearTimeout(nereidFadeTimers[object.sourceIndex]);

	diff = destOp-object.filters.alpha.opacity;
	direction = 1;
	if (object.filters.alpha.opacity > destOp)
	{
		direction = -1;
	}
	delta=Math.min(direction*diff,delta);
	object.filters.alpha.opacity+=direction*delta;

	if (object.filters.alpha.opacity != destOp)
	{
		nereidFadeObjects[object.sourceIndex]=object;
		nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
	}
}