function eid(id)
{
  if (document.all) return document.all[id];
  else return document.getElementById(id);
}

/************************/

$(document).ready(function()
{
  $("a.zoomer").colorbox({"close":"schließen", "opacity":0.7});
  //if (window.location.href.indexOf("?") < 0)
  //  window.open('slieslich.php', 'downloads','height=150, width=600, left=200, top=30, toolbar=no, status=no, scrollbars=yes, resizable=yes, menubar=no');
});
  
/************************/


function section(num)
{
  location.href = "index.php?sect=" + num + "&subsect=-1";
}

function subsection(num)
{
  location.href = "index.php?subsect=" + num;
}

function subsection2(sect, sub)
{
  // this one is combining section and subsection together
  //top.opt_head.location.href = "head.php?sect=" + sect + "&subsect=" + sub;
  location.href = "index.php?sect=" + sect + "&subsect=" + sub;
} //subsection2

/************************/

function toggle_pack(id)
{
  blk = eid(id + "_blk");
  btn = eid(id + "_pack");
  
  if (btn.src.indexOf("unpack") != -1) 
  {
    btn.src = "pict/pack.jpg";
    $(blk).show()
  } else {
    btn.src = "pict/unpack.jpg";
    $(blk).hide()
  }
} // pack

function unpack(id)
{
  blk = eid(id);
  blk.height = "auto";
} // unpack

/************************/

function close_div(id)  { eid(id).className = "div_hidden"; }

/************************/
/************************/

function nameDefined(ckie,nme)
{
   var splitValues
   var i
   for (i=0;i<ckie.length;++i)
   {
      splitValues=ckie[i].split("=")
      if (splitValues[0]==nme) return true
   }
   return false
}
function delBlanks(strng)
{
   var result=""
   var i
   var chrn
   for (i=0;i<strng.length;++i) {
      chrn=strng.charAt(i)
      if (chrn!=" ") result += chrn
   }
   return result
}
function getCookieValue(ckie,nme)
{
   var splitValues
   var i
   for(i=0;i<ckie.length;++i) {
      splitValues=ckie[i].split("=")
      if(splitValues[0]==nme) return splitValues[1]
   }
   return ""
}
function testCookie(cname, cvalue) {  //Tests to see if the cookie 
   var cookie=document.cookie;           //with the name and value 
   var chkdCookie=delBlanks(cookie);  //are on the client computer
   var nvpair=chkdCookie.split(";");
   if(nameDefined(nvpair,cname))       //See if the name is in any pair
   {   
      tvalue=getCookieValue(nvpair,cname);  //Gets the value of the cookie
      if (tvalue == cvalue) return true;
	   else return false;
   }
   else return false;
}
