$(document).ready(function(){
		   $("#zone-bar li a").click(function() {
		   		var hidden = $(this).parents("li").children("ul").is(":hidden");
		   		
				$("#zone-bar>ul>li>ul").slideUp('fast');       
			   	$("#zone-bar>ul>li>a").removeClass();
			   		
			   	if (hidden) {
			   		$(this)
				   		.parents("li").children("ul").slideDown('fast')
				   		.parents("li").children("a").addClass("zoneCur");
				   	} 
			   });
			   
			   $(document).click(function(e) {
      if (!$(e.target).parents("li").children("ul").andSelf().is('#zone-bar>ul>li>ul')) {
            $("#zone-bar>ul>li>ul").fadeOut('200', function() { });        
			$("#zone-bar>ul>li>a").removeClass();
      }
			});
		});

{
    document.getElementById(img).src = img_src;
}

function mouseOutImage(img, img_src)
{
    document.getElementById(img).src = img_src;
}

$(document).ready(function() 
	    { 
	        $("#vlada").tablesorter( {sortList: [[4,0], [1,0]]} ); 
				}
	     );
	   
	function showPic (whichpic) {
	 if (document.getElementById) {
	  document.getElementById('placeholder').src = whichpic.id;
	  if (whichpic.title) {
	   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
	  } else {
	   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
	  }
	  return false;
	 } else {
	  return true;
	 }
	}

	function ChangeColor(tableRow, highLight)
	    {
	    if (highLight)
	    {
	      tableRow.style.background = '#1D4482';
		  tableRow.style.color = '#f2ef13';
		  tableRow.style.cursor="pointer";
	    }
	    else
	    {
	      tableRow.style.background = '#f2ef13';
		  tableRow.style.color = '#1D4482';
	    }
	  }
	
	function loadXMLDoc(url)
	{
	var xmlhttp;

	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
	    document.getElementById("content").innerHTML=xmlhttp.responseText;
	    }
	  }
	xmlhttp.open("GET",url,true);
	xmlhttp.send();
	}

	function loadPicture(whichpic)
	{
		var link = whichpic.id+"?cat="+whichpic.title;
	var xmlhttp;

	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
	    document.getElementById("image").innerHTML=xmlhttp.responseText;
	    }
	  }
	xmlhttp.open("GET",link,true);
	xmlhttp.send();
	}


	var timeout         = 500;
	var closetimer		= 0;
	var ddmenuitem      = 0;

	// open hidden layer
	function mopen(id)
	{	
		// cancel close timer
		mcancelclosetime();

		// close old layer
		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

		// get new layer and show it
		ddmenuitem = document.getElementById(id);
		ddmenuitem.style.visibility = 'visible';

	}
	// close showed layer
	function mclose()
	{
		if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	}

	// go close timer
	function mclosetime()
	{
		closetimer = window.setTimeout(mclose, timeout);
	}

	// cancel close timer
	function mcancelclosetime()
	{
		if(closetimer)
		{
			window.clearTimeout(closetimer);
			closetimer = null;
		}
	}

	// close layer when click-out
	document.onclick = mclose; 

	function ImgError(source){
		source.src = "http://vessax.rs/Images/vessax.png";
		source.onerror = "";
		return true;
	}



