function popimg(url, title, width, height)
{
	str="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"><html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n<title>Denon</title>\n</head>\n<body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>\n<img src='"+url+"' alt='"+title+"'>\n</body>\n</html>";
	f_win = window.open(url ,"BigImage" ,'width='+width+',height='+height+',top='+((screen.height/2)-(height/2))+',left='+((screen.width/2)-(width/2))+',toolbar=no,scrollbars=no,resizable=yes,menubar=no,status=no,directories=no,location=no');
	f_win.document.writeln(str);
	f_win.focus();
	f_win.document.close();
}

function popup(url, title, width, height)
{
	f_win = window.open(url ,"" ,'width='+width+',height='+height+',top='+((screen.height/2)-(height/2))+',left='+((screen.width/2)-(width/2))+',toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no');
	f_win.focus();
}

function show_ps(id)
{
  var i=0;
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'block';
    for(i=1; i<=4; i++)
    {
      if(('p'+i) != id)
        document.getElementById('p'+i).style.display = 'none';
    }
  }
}

function show_content(id) //Каталог -> Описание 
{
  var q;
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'block';
    for(q=1;;q++)
    {
      if('layer'+q != id)
	  	var elem=document.getElementById('layer'+q);
		
		if(elem == null)
			break;
		
		elem.style.display = 'none';
    }
  }
  else
  {
    document.getElementById(id).style.display = 'none';
  }
}


function IM_swapImgRestore() { //v3.0
  var i,x,a=document.IM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function IM_preloadImages() 
{ //v3.0
  var d=document; 
  if(d.images)
  { 
	if(!d.IM_p) 
	  d.IM_p=new Array();
    var i,j=d.IM_p.length,a=IM_preloadImages.arguments; 
    for(i=0; i<a.length; i++)
    {
      if (a[i].indexOf("#")!=0)
      { 
        d.IM_p[j]=new Image; 
        d.IM_p[j++].src=a[i];
      }
    }
  }
}

function IM_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=IM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function IM_swapImage() { //v3.0
  var i,j=0,x,a=IM_swapImage.arguments; document.IM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=IM_findObj(a[i]))!=null){document.IM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//--------------from_nick--------------------


var w3c = (document.getElementById) ?true:false;
var iex = (document.all)            ?true:false;
var ns4 = (document.layers)         ?true:false;
var supported = (w3c || iex || ns4) ?true:false;

var active = false;
var curObj,curNest;

function mousemoved (evt){
	if(iex){
		mousex = window.event.clientX+document.body.scrollLeft;
		mousey = window.event.clientY+document.body.scrollTop;
	}
	else if(ns4){
		mousex = evt.pageX+window.pageXOffset;
		mousey = evt.pageY+window.pageYOffset;
	}
	else{
		mousex = evt.pageX;
		mousey = evt.pageY;
	}
	if(active){
		shiftTo(curObj, mousex+20, mousey-20, curNest);
	}
	return true;
}

// =-=-=-=-=-=-=

function getStyle (objstr, nest){
	nest = (nest) ? "document."+nest+"." : "";
	return (w3c) ? document.getElementById(objstr).style : (iex) ? document.all[objstr].style : (ns4) ? eval(nest+"document."+objstr) : false;
}
function shiftTo (objstr, x, y, nest){
	var obj = getStyle(objstr,nest);
	if(iex){
		obj.pixelLeft = x;
		obj.pixelTop = y-5;
	}
	else if(ns4){
		obj.moveTo(x,y);
	}
	else if(w3c){
		obj.left = x;
		obj.top = y-5;
	}
}
function show (objstr,nest){
	curObj = objstr;
	curNest = (nest) ? nest : null;
	getStyle(objstr,nest).visibility = "visible";
	active = true;
}
function hide (){
	getStyle(curObj,curNest).visibility = "hidden";
	active = false;
}

// =-=-=-=-=-=-=

if(supported){
	if(ns4){
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = mousemoved;
}

// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

// Menu
var mid='';

Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};

function on(it) {
	var block = it.getElementsByTagName("ul")[0];
	
	if (block) {
	  if (mid!='' && mid!=block.id) {
	    var old=document.getElementById(mid);
	    old.style.display='none';
      };

	  mid=block.id;
	  if (block.offsetHeight==0)
		block.style.display='block';
	  else block.style.display='none';
	}
}


