var timer;
function resetBackButton() {
    $('#btn_back').css({ display: 'block' });
    $('#btn_back_down').css({ display: 'none' });
}


function goBack(src) {
    $('#btn_back').css({ display: 'none' });
    $('#btn_back_down').css({ display: 'block' });
    setTimeout("resetBackButton()", 200);
    document.location.href = src;
}


function func(uri) {
    clearTimeout(timer);
    height = myImage.height;
    width = myImage.width;
    if(height!=0){
		if (!height) height = "603";
		if (!width) width = "900";
		var scroll = "no";
		var top = 0, left = 0;
		if (width > screen.width - 10 || height > screen.height - 28) scroll = "yes";
		if (height < screen.height - 28) top = Math.floor((screen.height - height) / 2 - 14);
		if (width < screen.width - 10) left = Math.floor((screen.width - width) / 2 - 5);
		width = Math.min(width, screen.width - 10);
		height = Math.min(height, screen.height - 28);
		myImage = null;


		window.open(uri, 'Карта', 'width=' + (width + 20) + ',' + 'height=' + (height + 60) + ',' + 'resizable= no');
	}
	else
		timer=setTimeout("func('" + uri + "')", 600);
}


function OpenPrint(path_detail, uri) {
    //получим размер окна
    myImage = new Image();
    myImage.src = path_detail;

    height = myImage.height;
    width = myImage.width;

    timer=setTimeout("func('" + uri + "')", 600);


}

function showItem(menu_id) {


    $("#" + menu_id).css({ display: "block" });
}
function closeItem(menu_id) {
    $("#" + menu_id).css({ display: "none" });
}


function showMenu(item_id, folder_id) {
    
    $(".mess_prew_p").load("/MenuItem.aspx?folderId_3=" + folder_id + "&itemId_3=" + item_id);
}
function closeMenu() {
    $(".mess_prew").remove();
}
