// @see: http://annaponomareva.com

var ie = 0;
if (navigator.userAgent.indexOf ("MSIE") != -1){
	ie = 1;
} 

function hideBox(){
	document.getElementById("showTable").style.display = "none";
	document.getElementById("showBg").style.visibility = "hidden";
}

function showBox(){
	var top = 0;
	var show = "table";
        	if(ie == 1) {
		show = "list-item";
		top = document.body.scrollTop;
	}
   	else{
		top = window.pageYOffset; 
	}
	document.getElementById("showBg").style.visibility = "visible";
	document.getElementById("showBg").style.height = getHeight()+"px";
	
	document.getElementById("showTable").style.top = top;
	document.getElementById("showTable").style.display = show;
}

function quickOpen(id){
	var box = document.getElementById("showBox");
	box.innerHTML='<img src="images/font-items/'+id+'.png" onclick="hideBox();">';
	showBox();
}

function getHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight : document.body.offsetHeight + 100;
}

function title(text){
	var text = text.replace('&quot;','"');
	text = text.replace('&quot;','"');
	if(text != ""){
		document.title = document.title+" » "+text;
		document.write("<h1>"+text+"</h1>");
	}
}
function message(text){
	if(text != ""){
		document.write("<font color='red'><b>"+text+"</b></font><br><br>");
	}
}
function sure(text,link){
        text = text || "этот элемент";
        var answer=confirm("Вы уверены, что хотите удалить "+text+"?");
        if(answer>0){
                document.location.replace(link);
        }
}
