function onBlurSearchForm(id)
{
	var text = document.getElementById(id).value;
	if (text == "") 
	{	
		//alert(text);
		document.getElementById(id).value = "Поиск";
	}
}

function onClickSearchForm(id)
{
	if (document.getElementById(id).value == "Поиск") document.getElementById(id).value = "";
}

function hideTips(event)
{
	//document.getElementById('add_new_rub_block').style.visibility=='visible')
	id = setTimeout("func()",3000);	
	document.getElementById('hidden_block').style.visibility='hidden';
}
function showTips(event)
{
	document.getElementById('hidden_block').style.visibility='visible';
	
	x=event.clientX;
	y=event.clientY;
	//alert("ss")
	document.getElementById('hidden_block').style.top= y;
	document.getElementById('hidden_block').style.left= x;

}
function OpenImagePopup(imgPath) {
    var win = window.open('','preview',
    'width=1,height=1,left=0,top=0,screenX=0,screenY=0,resizable=0,scrollbar=0,status=0');
    
    var winDoc = win.document;
    var content = '<html><head><title>100%, нажмите на изображение для закрытия</title>' +
    			  '<style>body{margin:0px;}img{border:0;}</style>' +
    			  '</head><body><a href="javascript:self.close()">' +
    			  '<img alt="Закрыть" id="image" src="/' + imgPath + '" /></a></body></html>'
    win.document.write(content);
    
    winDoc.body.onload = function() {
    	var obj = winDoc.getElementById('image');
    	var w = obj.width, h = obj.height+30;
    	var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
    	
    	var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
    	var top =  (self.opera ? iHeight : screen.availHeight)/2 - h/2;
    	win.resizeTo(w+10, h);
    	win.moveTo(left, top);
    }
    win.onload = winDoc.body.onload; 
    win.document.close();
    win.focus();
}    
function showComment()
{
	if (document.getElementById('addCmnt').style.visibility=='hidden')
	{
		//document.getElementById('addCmnt').style.backgraund-color='red'; 
		//document.getElementById('addCmnt').style.position='relative'; 
		document.getElementById('addCmnt').style.position=''; 
		document.getElementById('addCmnt').style.visibility='visible';
		document.getElementById('tcUserName').style.visibility='visible';
		document.getElementById('tcCommentText').style.visibility='visible';
		//document.getElementById('tcButton').style.visibility='visible';		
	}
	else
	{
		document.getElementById('addCmnt').style.position='absolute'; 
		document.getElementById('addCmnt').style.visibility='hidden';
		document.getElementById('tcUserName').style.visibility='hidden';
		document.getElementById('tcCommentText').style.visibility='hidden';
		//document.getElementById('tcButton').style.visibility='hidden';
		
	}	
}

