<!--
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
dom = (document.getElementById)? true : false;
ie4 = (document.all && !dom)? true : false;
nn4 = (document.layers)? true : false;
isLoaded = false;

function changeImages() {
  if (!document.getElementById) return
  var imgOriginSrc = new Array();
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].setAttribute('srctemp', imgarr[i].getAttribute('src'));
        imgarr[i].onmouseover = function() {
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',this.getAttribute('srctemp'))
        }
    }
  }
}

function windowsOpen() {
  if (!document.getElementById) return;
  var imgarr = document.getElementsByTagName('img');
  var newwin;
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('osrc')) {
      imgarr[i].onclick = function() {
        if (newwin) {newwin.close();}
        var imgWidth = this.getAttribute('owidth');
        imgWidth = parseInt(imgWidth);
        var imgHeight = this.getAttribute('oheight');
        imgHeight = parseInt(imgHeight);
        var posX=Math.round((screen.width-imgWidth)/2);
        var posY=Math.round((screen.height-imgHeight)/2);
        var posCode = (nn4) ? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
        var imgSrc = this.getAttribute('osrc');
        newwin = window.open ('','popUp','');
        newwin.close();
        newwin = window.open ('','popUp',"toolbar=no,directories=no,menubar=no,scrollbars=auto,width=" + imgWidth + ",height=" + imgHeight + ",resizable=yes,"+posCode);
	newwin.document.write ("<html><head><title>crjs.ru</title></head><body style='margin: 0px'><img src=" + imgSrc + " border=0></body></html>");
      }
    }
  }
}

function divShowFunc () {
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('dsrc')) {
        imgarr[i].onclick = function() {
        	divShow.src="images/loading.gif";
		if (window.innerWidth || window.innerHeight){
			docwidth = window.innerWidth;
			docheight = window.innerHeight;
		}
		//IE Mozilla
		if (document.body.clientWidth || document.body.clientHeight){
			docwidth = document.body.clientWidth;
			docheight = document.body.clientHeight;
		}
        	divShow.style.left = (docwidth - 400)/2;
        	divShow.style.top = 20;
			divShow.style.visibility = "visible";
        	var imgTemp = new Image();
        	imgTemp.src = this.getAttribute('dsrc');
            divShowImage.setAttribute('src',this.getAttribute('dsrc'))
        }
    }
  }
}

function init() {
  changeImages ();
  windowsOpen ();
  divShowFunc()
}
onload=init;


function rollOver(defaultImage, lightedUp) {
	this.def = new Image();
	this.def.src = defaultImage;
	this.light = new Image();
	this.light.src = lightedUp;
	return this

}
ros = new Array()
ros['menuImg'] = new rollOver("/i/submenu-bg-over.gif","/i/submenu-sep.gif");

-->
