function open_adv_srch(){  
if (document.getElementById)
{
d=document.getElementById("m"+menu[0]).style.display;	

  if (d=="block")
  {
   b="none";
   icon='url("/images/str12.gif")'; 
  }
 	   else
 	   {
  	    b="block";	
  	    icon='url("/images/str13.gif")';
  	   }	  
	   
document.getElementById("adv_srch_t").style.backgroundImage=icon;
  
for(i=0;i<menu.length;i++) 
document.getElementById("m"+menu[i]).style.display=b; 
}// if (document.getElementById)
  
}


var active=0;
var close_flag;
var x=36, y=165;   
var width=202, height=127;		 


function win_s(close_flag){ 	
								 


		 if(document.body.clientWidth)
		 {  
		  x=document.body.clientWidth-width;
		  }

		   document.getElementById("win_m").style.left=x+"px"; 
		   document.getElementById("win_m").style.top=y+"px";  
			 if(!active) 
			  {
			   document.getElementById("win_m").style.display="block"; 
			   active=1;
			   }
			   		else {
					document.getElementById("win_m").style.display="none"; 
					active=0;
					}

 
 				//document.getElementById("win_m").style.left=x+"px"; 
 				//document.getElementById("win_m").style.top=y+"px";  

 
 				 if(close_flag=="close") 
				  {
				   document.getElementById("win_m").style.display="none"; 
					 }

 }

 

//shows navigator [prev] 1 2 3 4 … [next]
// исправляем баг сравнения товаров



function next_page(p)
{	
if(window.event) window.event.returnValue=false;
window.location = p+"&ComparisonHidden1="+document.ComparisonForm1.ComparisonHidden1.value;
}	   



	function open_window(link,w,h) //opens new window
	{
		//var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
		//newWin = window.open(link,'newWin',win);
		//newWin.focus();	 
		
	    var x=100;
		var y=100; 

		//else if(window.innerWidth) {w_=window.innerWidth; h_=window.innerHeight;}
		
		if(document.body.clientWidth)
		{  
		 x=Math.floor(document.body.clientWidth/2)-Math.floor(w/2);
		 y=Math.floor(document.body.clientHeight/2)-Math.floor(h/2);  
		 }		

		var win = "width="+w+",height="+h+",left="+x+",top=100,menubar=no,location=no,resizable=yes,scrollbars=yes"; 
		   
				
		
		var newWin = window.open(link,'newWin',win);
		
	}

	function open_printable_version(link) //opens new window
	{
		var win = "menubar=no,location=no,resizable=yes,scrollbars=yes";
		newWin = window.open(link,'perintableWin',win);
		newWin.focus();
	}

	function confirmDelete(id, ask, url) //confirm order delete
	{
		temp = window.confirm(ask);
		if (temp) //delete
		{
			window.location=url+id;
		}
	}
		  
	
var zoom='<div id="zoom" title="Увеличить"></div>';		
function load_picture(p,p2,photoID,close,flag_zoom)	
{	

var zoom_plus='<div id="zoom" title="Увеличить"></div>';
//zoom_minus='<div id="zoom-" title="Уменьшить"></div>';	  
var zoom_minus='<div id="zoom" title="Увеличить"></div>';	  

var shadow_plus=' class="shadow" ';
var shadow_minus=' class="shadow_big" ';

if(window.event) window.event.returnValue=false;
if (!close) {
		if (document.all)
 		document.all.zagruzka.style.display="block";
			else if (document.getElementById)
 				document.getElementById("zagruzka").style.display="block";

	

  
   	  if (flag_zoom)
   	  {
   	   if (zoom==zoom_plus) { zoom=zoom_minus;  shadow=shadow_minus;}
 	  	  else {zoom=zoom_plus;  shadow=shadow_plus;}
   	   } else { zoom=zoom_minus; shadow=shadow_minus;} 


if (document.getElementById && p2!='') document.getElementById("photo_dtl_big").innerHTML = '<a id="thumb1" href="/products_pictures/'+p2+'" onclick="return hs.expand(this)" class="highslide">'+zoom+'<img '+shadow+' name="photo_dtl_big" onload="load_picture_off()" src="/products_pictures/'+p+'" border=0></a>';  
else if (document.getElementById) document.getElementById("photo_dtl_big").innerHTML = '<img '+shadow+' name="photo_dtl_big" onload="load_picture_off()" src="/products_pictures/'+p+'" border=0>';  
 

 				// выделение текущей иконки цветом	   
				if (photoID !="" )	
				{
				i=0;					 
				while ( document.getElementById("photo_dtl_"+i) )
					  {  
					    b="photo_dtl_"+i;
  						document.getElementById(b).style.border="1px solid #F3F2EE"; 
  						i++;
					  }

					  if (document.getElementById) document.getElementById(photoID).style.border="1px solid #C1E281";		
			    } //if

}
else 
{
if (document.all) 
 document.all.zagruzka.style.display="none"; 
	else if (document.getElementById)
 		document.getElementById("zagruzka").style.display="none";


}   
}
	
	
function load_picture_off()	
{	 
if (document.all)
 document.all.zagruzka.style.display="none";
	else if (document.getElementById)
 		document.getElementById("zagruzka").style.display="none";
}
