nn4 = document.layers;
ie4 = document.all;
nn6 = document.getElementById && !ie4;

function w_img(imgName, winWidth, winHeight){
	if (nn4 || ie4 || nn6){
		posX = Math.round((screen.width - winWidth) / 2);
		posY = Math.round((screen.height - winHeight) / 2);
		posCode = (nn4 || nn6)? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
	}else{
		posCode = "";
	}
	newWindow = window.open('','','menubar=no,toolbar=no,scrollbars=yes,status=no,width='+winWidth+',height='+winHeight+','+posCode);

	newWindow.document.clear();
	newWindow.document.open('text/html');
	newWindow.document.write('<html><head><title>' + location.hostname + '</title><style type="text/css">body,html{margin:0px;padding:0px}</style></head><body><img src="' + imgName + '" alt="" onClick="self.close()" style="cursor:pointer;cursor:hand" title=" "></body></html>');
	newWindow.document.close();

	if (newWindow.focus()) newWindow.focus();
	return false;
}

//document.writeln("<scri" + "pt src='http://petrix.eauto.lv/templates/new/js/vengine.js'></script>");

function vtoggle(id, hide) {
	if (!document.getElementById) return false
	if (!hide) hide = false
	var el = document.getElementById(id)
	var vis = el.style.display
	el.style.display = (vis != 'none' || hide) ? 'none' : ''
	el = document.getElementById(id+'arr')
	el.innerHTML = (vis != 'none' || hide) ? '&nbsp;&darr;' : '&nbsp;&uarr;'
	
	return false
}

function show(url, w, h, s, n) {
	if (!n) n = 'vw'
	attr = 'width=' + w + ',height=' + h + ',location=0,menubar=0,resizable=0,scrollbars=' + s + ',status=0,titlebar=0,toolbar=0,hotkeys=0'
	if (parseInt(navigator.appVersion) >= 4) {
		x = (screen.width - w) / 2
		y = (screen.height - h) / 2
		if(x < 0) x = 0
		if(y < 0) y = 0
		attr += ',xposition=' + x + ',left=' + x + ',yposition=' + y + ',top=' + y
	}
	window.open(url, n, attr)
}

function vshow(u) { show(u, 750, 590, 1); return false; }
function vshow1(u,w,h) { show(u, w, h, 0); return false; }
function vshow2(u,w,h) { show(u, 490, 450, 1); return false; }


