//-----------
//PNG
function pngdisplay(image, width, height, iclass) {
	if (navigator.appName=='Microsoft Internet Explorer') { 
		document.write('<img src="images/i.gif" style="width: ' + width + '; height: ' + height + '; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + image + ', sizingMethod=scale)" class="' + iclass + '" border=0 />');
	} else {
		document.write('<img src="' + image + '" style="width: ' + width + '; height: ' + height + ';" class="' + iclass + '" />');
	}
}
// Я не машина, я только учусь.
function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

function getStyleObject(objectId, doc) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
		return getObjNN4(document,objectId);
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    var styleObject = getStyleObject(objectId, document);
    if(styleObject) {
		styleObject.visibility = newVisibility;
		return true;
    }else{
		return false;
    }
}


//менюшки
var ie4, nn4, nn6;
var rX, lX, tY, bY;
var xH=0;
var yH=22;
var zi=250;

function show(e,obj, parent, imagesrc){
	img=eval('img'+obj);
	obj='menu'+obj;
	themenu=getStyleObject(obj, document);
	//parent=getStyleObject(parent, document);
	parent=eval(parent);
	object=eval(obj);
	parentwidth=parent.offsetWidth;
	menuheight=object.scrollHeight;
	themenu.top=yH;//-menuheight;
	themenu.left=xH;//-xpos;
	themenu.width=parentwidth;
    img.src = imagesrc;
	if (themenu.visibility=="hidden"){
		changeObjectVisibility(obj, 'visible');
		themenu.zIndex=zi++;
	}
}

function hidemenu (whichone, imagesrc){
	img=eval('img'+whichone);
    img.src = imagesrc;
	whichone='menu'+whichone;
	changeObjectVisibility(whichone, 'hidden');
}

function hideIE4(whichone){
	whichone='menu'+whichone;
	if(window.themenu)
		themenu.style.visibility="hidden";
}