

var DomYes=document.getElementById?1:0;

function expandit(curobj){
	if (DomYes) {
  		var catrow=document.getElementById("cat_"+curobj.id).style;
  		var catprow=document.getElementById(curobj.id);
	} else {
		var catrow=document.all["cat_"+curobj.id].style;
		var catprow=document.all[curobj.id];
	}

	if (catrow.display=="none") 
	{
		catrow.display="";
		catprow.className="minus";
	}else {
  		catrow.display="none";
		catprow.className="plus";
	}
}

function mexpandit1(curobj){
	if (DomYes) {
  		var catrow=document.getElementById("cat_1_"+curobj.id).style;
  		var catprow=document.getElementById(curobj.id);
	} else {
		var catrow=document.all["cat_1_"+curobj.id].style;
		var catprow=document.all[curobj.id];
	}

	if (catrow.display=="none") 
	{
		catrow.display="";
		catprow.className="minus";
	}else {
  		catrow.display="none";
		catprow.className="plus";
	}
}

function mexpandit2(curobj){
	if (DomYes) {
  		var catrow=document.getElementById("cat_2_"+curobj.id).style;
  		var catprow=document.getElementById(curobj.id);
	} else {
		var catrow=document.all["cat_2_"+curobj.id].style;
		var catprow=document.all[curobj.id];
	}

	if (catrow.display=="none") 
	{
		catrow.display="";
		catprow.className="minus";
	}else {
  		catrow.display="none";
		catprow.className="plus";
	}
}

function mexpandit3(curobj){
	if (DomYes) {
  		var catrow=document.getElementById("cat_3_"+curobj.id).style;
  		var catprow=document.getElementById(curobj.id);
	} else {
		var catrow=document.all["cat_3_"+curobj.id].style;
		var catprow=document.all[curobj.id];
	}

	if (catrow.display=="none") 
	{
		catrow.display="";
		catprow.className="minus";
	}else {
  		catrow.display="none";
		catprow.className="plus";
	}
}


function getsel(attr,opt)
{
   var selected = new Array();
   var index = 0;
   for (var intLoop = 0; intLoop < opt.length; intLoop++) {
      if ((opt[intLoop].selected) || (opt[intLoop].checked)) {
         index = selected.length;
         selected[index] = new Object;
         selected[index].value = opt[intLoop].value;
         selected[index].index = intLoop;
      }
   }

   var strSel = "";
   for (var item in selected)       
      strSel += selected[item].value + ",";

   return "*" + attr + ";" + strSel;
}



function GetParameter(querystring, param)
{
 var sValue;

 
 var start = querystring.indexOf(param) +
  param.length + 1;


if (querystring.indexOf(param)==-1)
	return "";

  var length = querystring.indexOf("&", start);

 if (length == -1)
 {
  sValue = querystring.substr(start);
 }
 else
 {
  sValue = querystring.substr(start, length - start);
 }

 sValue = sValue.replace(/\+/g, " ");

 return sValue;
}

function  DisplayImage(what,picWidth,picHeight)
{

   var done=false;
   if (!done)
   {

	var writePop = window.open('','_blank','resizable,width=50,height=50');
	
	var popTop = '';
	popTop += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n';
	popTop += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n';
	popTop += '\n';
	popTop += '<html xmlns="http://www.w3.org/1999/xhtml" lang="sk" xml:lang="sk">\n';
	popTop += '<head>\<\script>\n';
	popTop += 'function resizeZoomer(){\n';
	popTop += 'document.getElementById(\'loading\').style.display=\'none\';\n';
	popTop += 'document.getElementById(\'image\').style.visibility=\'visible\';\n';
	popTop += 'var sizeX = document.getElementById(\'image\').offsetWidth+32;\n';
	popTop += 'var sizeY = document.getElementById(\'image\').offsetHeight+52;\n';
	popTop += 'window.resizeTo(sizeX,sizeY);\n';
	popTop += '}\<\/script>\n';
	popTop += '<title>'+document.title+'</title>\n';
	popTop += '</head>\n';
	popTop += '<body style="margin: 10px; background: #fff;" onload="resizeZoomer();">\n';
	popTop += '<img id="loading" style="display: block; margin: 10px;" src="/images/loading.gif" width="43" height="5" alt="loading" />\n';
	popTop += '<a href="javascript:window.close();"><img id="image" style="visibility: hidden;" src="' + what + '" alt="" border="0" /></a>\n';
	popTop += '</body>\n';
	popTop += '</html>\n';
	
	popRocks = writePop.document;
	popRocks.open();
	popRocks.write(popTop);
	popRocks.close();
 }
 return done;

}

function openwindow(url,width,height)
{
 window.open(url,"or","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height);
 return false;
}

function launchViewer(filename,x,y)
 { 
 var done=false;
 if (!done)
 {
  window.imagex=x;
  window.imagey=y;
  window.imagename=filename;
  viewer=window.open('_z.html','VIEWER','scrollbars,status,resizable');
  viewer.opener=window;
  viewer.focus();
 }
 return done;
}

function fixE(e) {
	if (!e && window.event) e = window.event;
	if (!e.target) e.target = e.srcElement;
	return e;
}


function extract_menu(e) {
 
 
//debugger;
 e = fixE(e);
 var obj = (e.currentTarget) ? e.currentTarget : e.target;
 //var objImg;
 while (obj.tagName != "LI") {
   if (obj.tagName=="A")
   {
   	//objImg=obj.children[0];
   }
   obj = obj.parentNode;
 }
 var uls = obj.getElementsByTagName("ul")
 if (uls.length>0) {
   if (uls[0].style.display=="none") {
     uls[0].style.display = "block";
     //objImg.src="Themes/Site/_collapse.gif";
	//obj.children[0].style.backgroundImage=url("_minus.gif");
    
   } else {
     uls[0].style.display = "none";
     //objImg.src="Themes/Site/_expand.gif";
	//obj.children[0].style.backgroundImage=url("_plus.gif");
     
   }
   return false;
 } else return true;
}

 
var obj_menu = (document.all?document.all["mmenu"]:document.getElementById("mmenu"))
 if (obj_menu) {
   var m_node = obj_menu.getElementsByTagName("a")
   for (x=0;x<m_node.length;x++) {
     var lis = m_node[x].parentNode;
     if (lis ) {
       if (lis.className=="submenu"){
       	var uls = lis.getElementsByTagName("ul");
       	if (uls.length>0) {
         //if (uls[0].id=='') uls[0].style.display = "none";
         m_node[x].onclick = extract_menu;
	}       
       }
     }
   }
 }