// вывод фото в отдельном окне

function Show_Img (path,w,h) {
	window.open (path,"","toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+",top=50,left=100");
}	

function showImage(path,w,h) {
	w += 20;
	h += 28;
	
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes';
	
	window.open(path,"picture",settings);
}

function getElementPosition(elemId) {
    var elem = document.getElementById(elemId);
	
    var w = elem.offsetWidth;
    var h = elem.offsetHeight;
	
    var l = 0;
    var t = 0;
	
    while (elem) {
        l += elem.offsetLeft;
        t += elem.offsetTop;
        elem = elem.offsetParent;
    }

    return {"left":l, "top":t, "width": w, "height":h};
}

function ShowSubMenu(a,b) {
	var nMenu2=a+b+'2';
	var nMenu1=a+b+'1';
	pos = getElementPosition(nMenu1);
	document.getElementById(nMenu2).style.top= pos.top;
	document.getElementById(nMenu2).style.left= pos.left+pos.width-1;
	//showProperties(document.getElementById(nMenu1));
	//alert (t);
	//window.location='./?div='+a+'&sub='+b;
	document.getElementById(nMenu2).style.visibility='visible';
}
function ShowHeaderSubMenu(b) {
	var nMenu2=b+'2';
	var nMenu1=b+'1';
	var pos = getElementPosition(nMenu1);
	document.getElementById(nMenu2).style.top= pos.top+pos.height-4;
	document.getElementById(nMenu2).style.left= pos.left+20;
	//showProperties(document.getElementById(nMenu1));
	//alert (t);
	//window.location='./?div='+a+'&sub='+b;
	document.getElementById(nMenu2).style.visibility='visible';
}
function hideAll(){
	document.getElementById('ordersell2').style.visibility = "hidden";
	document.getElementById('orderlease2').style.visibility = "hidden";
	document.getElementById('sell2').style.visibility = "hidden";
	document.getElementById('sell31').style.display = "none";
	document.getElementById('lease2').style.visibility = "hidden";
}