
var activeNavipoint = null;
var backcopy = "";
var objLayers = new Array();
var blockLink = false;

function doNothing()
{
}

function noLinkMessage()
{
	alert("In der Bearbeitung der Navigation sind die Links deaktiviert!");
}

function showPopUp(strLink,breite,hoehe)
{
   var style = "width=" + breite + ", height=" + hoehe + ", toolbar=no ,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes";
   window.open(strLink,"NofiPopUp",style)
}

function showNaviMenue(event,divid,left,top)
{
    if(divid)
    {
        hideNaviMenue(divid);
        if(document.getElementById(divid).style.display == "none")
        {
           document.getElementById(divid).style.display = "";
        }
        else
        {
//           document.getElementById(divid).style.display = "none";
        }

        if(top == "mouse")
        {
            top = event.clientY;
        }

        if(left == "mouse")
        {
           left = event.clientX;
        }

        document.getElementById(divid).style.top = top;
        document.getElementById(divid).style.left = left;
    }
}

function hideNaviMenue(divid)
{
      for(var x=0;x<objLayers.length;x++)
      {
         if(divid != objLayers[x])
         {
             document.getElementById(objLayers[x]).style.display = "none";
         }
      }
}

function clickNavigation(obj,link,back,back2,target)
{
	var cutvalue = "";
   if(blockLink == true)
   {
	    blockLink = false;
		return;
   }

   if(obj != activeNavipoint)
   {
      if(back != "")
      {
         var cutvalue = back.slice(0,1);
         if(cutvalue == "#")
         {
            obj.setAttribute("bgcolor",back,false);
         }
         else
         {
            back= "../Images/" + back;
            obj.setAttribute("background","nofi/Images/" + back,false);
         }
      }

      if(activeNavipoint)
      {
         activeNavipoint.className=obj.className.replace(/_hoover/,"");
         if(back2 != "")
         {
             var cutvalue = back2.slice(0,1);
             if(cutvalue == "#")
             {
                 activeNavipoint.setAttribute("bgcolor",backcopy,false);
             }
             else
             {
                 activeNavipoint.setAttribute("background","nofi/Images/" + backcopy,false);
             }
         }
      }
      activeNavipoint = obj;
      backcopy = back2;
   }

   document.linkform.target=target;

//  if( (link.indexOf(".htm") > 0 || link.indexOf(".html") > 0) || link.indexOf(".php") == 0)
  if(link.indexOf(".php") > 0)
  {
      document.linkform.method="post";
      document.linkform.action=link;
	  document.linkform.submit();
  }
  else
  {
      document.location.href= link;
  }
}

function outNavigation(obj,back)
{
   var cutvalue = "";
   if(obj != activeNavipoint)
   {
      obj.className=obj.className.replace(/_hoover/,"");
	  var hpl = document.getElementById("link_" + obj.id);
	  if(hpl)
	  {
		hpl.className=hpl.className.replace(/_hoover/,"");
	  }
      if(back != "")
      {
         var cutvalue = back.slice(0,1);
         if(cutvalue == "#")
         {
            obj.setAttribute("bgcolor",back,false);
            obj.setAttribute("background","",false);
         }
         else
         {
            obj.setAttribute("background","nofi/Images/" + back,false);
            obj.setAttribute("bgcolor","",false);
         }
      }
   }
}

function overNavigation(obj,back)
{
   var cutvalue = "";
   if(obj != activeNavipoint)
   {
      obj.className=obj.className + "_hoover";
	  var hpl = document.getElementById("link_" + obj.id);
	  if(hpl)
	  {
		hpl.className=hpl.className + "_hoover";
	  }
      if(back != "")
      {
         var cutvalue = back.slice(0,1);
         if(cutvalue == "#")
         {
            obj.setAttribute("bgcolor",back,false);
            obj.setAttribute("background","",false);
         }
         else
         {
            obj.setAttribute("background","nofi/Images/" + back,false);
            obj.setAttribute("bgcolor","",false);
         }
      }
   }
}


function ViewChangeNavPointStyles(frameid,nofiObjektID,nofiFieldID)
{
	var strLink = "../Site/Include01.php?SiteIndex=CHANGENAVPOINTSTYLES&FrameID=" + frameid + "&IsPopup=1&selectedFieldID=" + nofiFieldID + "&IsPopup=1&selectedObjectID=" + nofiObjektID;
	window.open(strLink,"ViewChangeNavPointStyles","width=790,height=600,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes")
}

