﻿/* --------------------------------------------------------------------------- +
* Project:  JS
* Author:   Janosch Langer,Markus Giesen, edoras GmbH & Co KG, www.edoras.de
* Module:   functions.js
* Created:  2004-08-24
* Edited:   2004-10-18
* ---------------------------------------------------------------------------- +
* Purpose:  Often used JS-Functions for RedDot + Navigation Controller
* History: 
* --------------------------------------------------------------------------- */

/****************************************************/
/********* Sub Navigation Left Highlighting *********/

/******************* Link *******************/
function Link(nodA){
 this.Node = nodA;
 this.Text = this.Node.innerHTML;
}
/******************* Link *******************/
/******************* Navigation path *******************/
function NavigationPath(nodNavigationPath){
 this.Node = nodNavigationPath;
 this.Links = new Array();
 this.ReadLinks = ReadLinks;
 this.ReadLinks();
}
function ReadLinks()
{
    nodAChilds = this.Node.getElementsByTagName("A");
    for(i = 0; i < nodAChilds.length; i++)
    {
        lnk = new Link(nodAChilds[i]);
        this.Links.push(lnk);
    }
}
/******************* Navigation path *******************/
/******************* Menu *******************/
function Menu(nod){
 this.Node = nod;
 this.Entries = null;
 this.ReadEntries = ReadEntries;
}
function ReadEntries(){
 this.Entries = new Array();
 for(j = 0; j < this.Node.childNodes.length; j++){
  if(this.Node.childNodes[j].nodeName == "DIV"){
   this.Entries.push(new Entry(this.Node.childNodes[j]));
  }
 }
}
/******************* Menu *******************/
/******************* Tree menu entry *******************/
function Entry(nod){
 this.Node = nod;
 this.Link = null;
 this.Submenu = null;
 
 this.ReadLink = ReadLink; 
 this.ReadSubmenu = ReadSubmenu;
 this.Activate = Activate;
 
 this.ReadLink();
 this.ReadSubmenu();
}
function ReadLink(){
 for(i = 0; i < this.Node.childNodes.length; i++){
  if(this.Node.childNodes[i].nodeName == "A"){
   this.Link = new Link(this.Node.childNodes[i]);
   break;
  }
 }
}
function ReadSubmenu(){
 for(p = 0; p < this.Node.childNodes.length; p++){
  if(this.Node.childNodes[p].nodeName == "DIV"){
   this.Submenu = new Menu(this.Node.childNodes[p]);
  }
 }
}
function Activate(){
 if(this.Node.className.indexOf("_active") == -1 && this.Node.className !=""){
  this.Node.className += "_active";
 } 
 if(this.Link.Node.className != ""){
  this.Link.Node.className += "_active";
 }
 if(this.Submenu){
  if(this.Submenu.Node.className != ""){
   this.Submenu.Node.className += "_active";
  }
  this.Submenu.ReadEntries();
  for(n = 0; n < this.Submenu.Entries.length; n++){
   if(this.Submenu.Entries[n].Node.className != ""){
    this.Submenu.Entries[n].Node.className += "_active";
   }
  }
 }  
}
/******************* Tree menu entry *******************/
/******************* Tree menu *******************/
function TreeMenu(nodTreeMenu){
 this.Node = nodTreeMenu;
 this.Self = new Menu(this.Node);
 this.ActivateByNavigationPath = ActivateByNavigationPath;
 this.DoActivation = DoActivation;
}
function ActivateByNavigationPath(np, iStartLevel){
 if(np.Links.length > iStartLevel){
  this.DoActivation(np, iStartLevel, this.Self)
 }
}
function DoActivation(np, iLevel, menu){
 menu.ReadEntries();
 for(m = 0; m < menu.Entries.length; m++){
  if(menu.Entries[m].Link.Text == np.Links[iLevel].Text){
   menu.Entries[m].Activate();
   if(menu.Entries[m].Submenu && np.Links.length > iLevel + 1){
    iLevel++;
    this.DoActivation(np, iLevel, menu.Entries[m].Submenu);
   }
  }  
 }
}
/******************* Tree menu *******************/
function Init(){
 nodNaviPath = document.getElementById("navipath");
 np = new NavigationPath(nodNaviPath);
 nodTreeNavi = document.getElementById("navigation");
 tm = new TreeMenu(nodTreeNavi);
 tm.ActivateByNavigationPath(np, 1);
 highlightMainNav();
// if(document.getElementById && document.getElementById("galBlock")) getImages();
 if(document.getElementById && document.getElementById("context-gallery")){
  nodGallery = document.getElementById("context-gallery");
  nodGal = new objGallery(nodGallery);
  IdentifyAndExecute();
  activateImageBlockNav('galBlock');
 }
}
/****************************************************/

/** --------------------------------------------------------------------------- +
* Project:  JS
* Author:   Dirk Schröer, Markus Giesen, Edoras GmbH & Co KG, www.edoras.de
* Module:   functions.js
* Created:  2004-08-24
* Edited:   2004-10-18
* ---------------------------------------------------------------------------- +
* Purpose:  Often used JS-Functions for RedDot + Navigation Controller
* History: 
* --------------------------------------------------------------------------- */
/** POPUPS 
*  @param: URL
*/
function popupWin(file)
{
    win = window.open(file,"NAME","width=621,height=600,left=50,top=50,resizable=yes,scrollbars=yes");   
    win.focus(); 
}
function popupLink(file)
{
    winLink = window.open(file,"NAME","width=800,height=600,left=50,top=50,resizable=yes,scrollbars=yes");   
    winLink.focus(); 
}
/** ---------------------------------------------------------------------------------- +
* Project:  Wieland Dental Technik
* Author:  Dirk Schröer, Markus Giesen(edits), Edoras GmbH & Co KG, www.edoras.de
* Module:  wieland.js
* Created:  2004-07-15
* ------------------------------------------------------------------------------------ +
* Purpose:  All js for this page
* History: 2004-07-30 DS add Niederlassungen and vertretungen
*   2004-08-11 DS add Functions for multiple Teaser
*   2004-08-16 DS add ansprechpartner-list  
*   2004-09-17 MG edit openLink, deletet prefix->"http://" (DIE prefix, DIE!)  
* ------------------------------------------------------------------------------------ */
function openLink(link)
{
 win = window.open(link, "WielandLink", "width=800,height=600,left=50,top=50,scrollbars=yes,menubar=yes,resizable=yes");
 win.focus();
}
/****************** Image Navigation ****************************/
function effektberechnen(){
    if (document.all){
  //  display multiple changes
    document.getElementById("photolauf").filters.revealTrans.Transition=5
       // Math.floor(Math.random()*23)
       document.getElementById("photolauf").filters.revealTrans.stop()
       document.getElementById("photolauf").filters.revealTrans.apply() 
    }
}
function effektzeigen(){
    if (document.all)
 {
        document.getElementById("photolauf").filters.revealTrans.play()
 }
}
function wievielebilder(){
    window.status="Image "+(which+1)+" of "+photos.length
}
function zurueck(){
    if (which>0){
    which--
    effektberechnen()
    document.getElementById("photolauf").src=photos[which]
    document.getElementById("txt_img").innerHTML = photos_text[which]
    effektzeigen()
    wievielebilder()
    }
}
function weiter(){
    if (which<photos.length-1){
        which++
        effektberechnen()
        document.getElementById("photolauf").src = photos[which]
        document.getElementById("txt_img").innerHTML = photos_text[which]
        effektzeigen()
        wievielebilder()
    }    
}
function transport(){
    window.location=photoslink[which]
}
function zoom(){
 
 var img = photos_link[which]; 
 var winImg = window.open(img,  "DuerrImages", "width=450,height=340,left=50,top=50,resizable=yes,scrollbars=auto,");
 winImg.focus();
}
function resizeWin()
{
 var img = document.getElementById("ProductImg"); 
 window.resizeTo((img.width+12),(img.height+52));
}
/*
function prealoadImages()
{
    var preloadedimages=new Array()
    for (i=0;ibr> preloadedimages[i]=new Image()
        preloadedimages[i].src=photos[i]
    } 
}
*/
// display navigation icons, if more then 1 image 
function getImgNavigation()
{  
 if(photos[which] != undefined)
 {
  if(document.getElementById("photolauf") && document.getElementById("txt_img")){
      document.getElementById("photolauf").src = photos[which] 
      document.getElementById("txt_img").innerHTML = photos_text[which]
  }
 } 
    
 if(photos.length > 1)   
    {
  if(document.getElementById("img_back") && document.getElementById("img_next") && document.getElementById("img_zoom")){
         document.getElementById("img_back").style.visibility = "visible";        
         document.getElementById("img_next").style.visibility = "visible";     
         document.getElementById("img_zoom").style.visibility = "visible";     
  }
    }
}
/***************** Niederlassungen & Aussendienst ***************************/
// fill Region List
function fillRegionList()
{
 var regionlist = document.getElementById("region");
 var a_double = new Array()
 var i_cnt = 0;
 for(var i=0;i<office.length; i++)
 {
  // only unique entries
  if(!a_double[office[i][0]])   
  {  
       var addme = new Option(office[i][0], office[i][0]);
      // fill list
   regionlist.options[i_cnt+1] = addme;
   // set value in compare list
   a_double[office[i][0]] = true;
   i_cnt++;
  } 
   }
}
// to use in other functions
var a_countries = new Array();
// fill Countries depend on region
function fillCountryList()
{
 hidePartners();
 emptyCountryList();
 var regionlist  = document.getElementById("region");
 var countrylist = document.getElementById("country");
 var country_div = document.getElementById("countries");
 var a_double = new Array();
 if(regionlist == "-") 
 {
    country_div.style.visibility = "hidden";
  return;
 }
 var x =0;
 for(var i=0;i<office.length; i++)
 { 
  // multiple countries accociated
  if(office[i][1].indexOf(";") != -1)
  {
  
   var a_country = new Array();
   a_country = office[i][1].split(";");
    for(var z = 0; z < a_country.length; z++)
   {  
    var s_country = alltrim(a_country[z]);
    a_countries[x] = new Array(office[i][0], s_country, office[i][2]);
    x++;
   }  
  } 
  else 
  {  
   // collect countries and associated person-id's
    a_countries[x] = new Array(office[i][0], office[i][1], office[i][2]);
   x++; 
  }
    }
 
    a_countries.sort(); 
 var i_list = 1;
 for(var i=0; i < a_countries.length; i++)
 {
  // only unique entries
  if((!a_double[a_countries[i][1]])    
   && (a_countries[i][0] == regionlist.value ))   
  {  
      var addme = new Option(a_countries[i][1], a_countries[i][1]);
   countrylist.options[i_list] = addme;   
   i_list++;
  }
  a_double[a_countries[i][1]] = true;
   }
 country_div.style.visibility = "visible";
}
// delete all entries in country list
function emptyCountryList()
{
 var countrylist = document.getElementById("country");
 countrylist.length = 1;
/*
alert(countrylist.length); 
 var i_list = countrylist.length;
 for(i=1;i<=i_list; i++)
 {
alert(i); 
     countrylist.options[i] = null;
   }
alert(countrylist.length); 
 */ 
}
// hide all partner cards
function hidePartners()
{
 for(var i=0;i<office.length; i++)
 {
  document.getElementById("partner_"+i).style.display = "none"; 
    }
}
function hideError()
{ 
 document.getElementById("error_txt").style.display = "none"; 
}
// display Partners for niederlassungen & vertretungen
function displayPartner()
{ 
 hidePartners();
 var region = document.getElementById("region").value;
 var country = document.getElementById("country").value;
 if(country == "-") return
 var i_counter = 0;
 for(var i=0;i<a_countries.length; i++)
 {
  if(a_countries[i][1] == country)
  {
   // list the cards, multiple possible
   displayPartners(a_countries[i][2], i_counter);
   i_counter++; 
  }
 } 
 // nothing found
 if(i_counter == 0)
 {
  displayError();
 } 
}
// display partners for Aussendienst in Deutschland
function getAussendienst()
{
 hidePartners();
 hideError();
 var plz1 = document.getElementById("plz1").value;
 var plz2 = document.getElementById("plz2").value;
 var plz3 = document.getElementById("plz3").value;
 var a_partners = new Array();
 var a_double = new Array();
 
 // create new array from plz-list
 var a_plz = new Array();
 var x =0;
 for(var i=0;i<office.length; i++)
 { 
  // multiple plz associated
  if(office[i][0].indexOf(";") != -1)
  {
   var a_plz_temp = new Array();
   a_plz_temp = office[i][0].split(";");
    for(var z = 0; z < a_plz_temp.length; z++)
   {  
    var s_plz = alltrim(a_plz_temp[z]);
    a_plz[x] = new Array(s_plz, i);
  
    x++;
   }  
  } 
  else 
  {  
   // collect countries and associated person-id's
    a_plz[x] = new Array(a_plz_temp[z], i);
   x++; 
  }
    }
 //a_plz.sort();
 if(plz1 == "")
 {
  return;
 } else  {
  if(plz2 != "")
  {
   if(plz3 !== "")
   {
    // PLZ 1 + 2 + 3
    var i_cnt = 0;
    for(var i=0;i<a_plz.length; i++)
    {
     var s_plz =  a_plz[i][0]; 
     if((plz1 == s_plz.charAt(0))
      && (plz2 == s_plz.charAt(1)) 
      && (plz3 == s_plz.charAt(2))) 
     {
      // only unique entries
      if(!a_double[a_plz[i][1]])   
      {      
       a_partners[i_cnt] = a_plz[i][1];
       i_cnt++;
       a_double[a_plz[i][1]] = true;
      }
     } 
    }
   } else {
    // only PLZ 1 + 2
    var i_cnt = 0;
    for(var i=0;i<a_plz.length; i++)
    {
     var s_plz =  a_plz[i][0]; 
     if((plz1 == s_plz.charAt(0))
      && (plz2 == s_plz.charAt(1))) 
     {
      // only unique entries
      if(!a_double[a_plz[i][1]])   
      { 
       a_partners[i_cnt] = a_plz[i][1];
       a_double[a_plz[i][1]] = true;
       i_cnt++;
      }
     } 
    }
   }
  } else {
   // only PLZ 1
   var i_cnt = 0;
   for(var i=0;i<a_plz.length; i++)
   {
    var s_plz =  a_plz[i][0]; 
    if(plz1 == s_plz.charAt(0))
    {
     // only unique entries
     if(!a_double[a_plz[i][1]])   
     { 
      a_partners[i_cnt] = a_plz[i][1];
      a_double[a_plz[i][1]] = true;
      i_cnt++;
     }
    } 
   }
  }
 }
 
 // display partners
 var i_counter = 0;
 for(var i=0;i<a_partners.length; i++)
 {
  displayPartners(a_partners[i], i_counter);
  i_counter++; 
 }
 // nothing found
 if(i_counter == 0)
 {
  displayError();
 }  
} 
// display partners
function displayPartners(i_partner, i_counter)
{
 // list the cards, multiple possible
 var item = document.getElementById("partner_"+i_partner);
 var distance = (175 * i_counter) + 280;
 item.style.top = distance+"px";
 item.style.display = "block";
}
// display default message
function displayError()
{
 var item = document.getElementById("error_txt");
 var distance = 280;
 item.style.top = distance+"px";
 item.style.display = "block";
}
/********************* MULTIPLE TEASER *************************************/
// display and highlight selected card, hide the others
function displayCard(i_card)
{ 
 // arrow-image on topline
 var o_img_arr = document.getElementById("img_arr"); 
 var i_distance = 94 * (i_card - 1);
 if(i_card == 3) i_distance += 1;  // don't ask me...
 o_img_arr.style.marginLeft = i_distance+"px";  
 
 for(var i=1; i<=3; i++)
 {
  var o_card = document.getElementById("card_"+i); 
  var o_head = document.getElementById("head_"+i); 
  if(i == i_card)
  { 
   o_card.style.zIndex = "10";
   o_card.style.visibility = "visible";
   o_head.style.backgroundColor = "#FFFFFF";
  } else {
   o_card.style.visibility = "hidden";
   o_head.style.backgroundColor = "#66CCFF";
  }
 } 
}

/*************************** ANSPRECHPARTNER SEITEN-LISTEN ******************/
// fill Person List
function fillPersonList()
{
 var o_personlist = document.getElementById("personlist");
 var i_cnt = 1; 
 
 for(var i=0; i < a_personList.length; i++)
 {
     var addme = new Option(a_personList[i][0], a_personList[i][1]);      // fill list
  o_personlist.options[i_cnt] = addme;
  if(a_personList[i][0] == s_hdl_page)
  {
   o_personlist.options.selectedIndex = i+1;  // select current entry in list
  } 
  i_cnt++;
    }
}
// jump to selectet page
function gotoPage()
{
 var o_personlist = document.getElementById("personlist");
 if(o_personlist.options[o_personlist.options.selectedIndex].value == "-") return
 document.location.href = o_personlist.options[o_personlist.options.selectedIndex].value;
}
/*********************** GENERAL FUNCTION *****************************/
// trim all whitespaces
function alltrim(wert)
{
 s=s=/(^\s+|\s+$)/g
 wert=wert.replace(s,"")
 return wert
}
/*::::::::::::::::::::: Toolbox Scripts ::::::::::::::::::::::::::::::*/

function faqMouseOver(element){
 if(element.parentNode.getElementsByTagName("DIV")[0].className=="answer")
 {
  element.parentNode.getElementsByTagName("DIV")[0].className+=' visible';
 }else
 {
  element.parentNode.getElementsByTagName("DIV")[0].className="answer";
 }
}
var allTrue=false;
function printAllFAQ(status,parentBlockId){
 minOneTrue = false;
 chkArr = document.getElementById(parentBlockId).getElementsByTagName('input');
 if(status=="selectAll")
 if(allTrue==false)
 {
  for(i=0; i<chkArr.length; i++){
   chkArr[i].checked = true;
   chkArr[i].parentNode.className="faqdiv printfaq";
   allTrue = true;
  }
 }else{
  for(i=0; i<chkArr.length; i++){
   chkArr[i].checked = false;
   chkArr[i].parentNode.className="faqdiv noprintfaq";
   allTrue = false;
  }
 }
 if(status=="printSelected")
 {
  for(i=0; i<chkArr.length; i++){
   if(chkArr[i].checked==true){
    chkArr[i].parentNode.className="faqdiv printfaq";
    minOneTrue = true;
   }else
   {
    chkArr[i].parentNode.className="faqdiv noprintfaq";
   }
  }
  if(minOneTrue==false)
  {
   alert("Sie haben keine FAQs ausgewaehlt! - No FAQs selected!");
  }else
  {
   window.print();
  }
 }
}

/*::::::::::::::::::::: News Ticker ::::::::::::::::::::::::::::::::::*/

var initDelay=2000 // Delaytime until Start
var contentSpeed=1 // Scrollspeed higher==faster
var tickerStopAble=1 // Stop scrolling onMousever 0==no | 1==stops
var scrollSpeed=contentSpeed
var pausespeed=(tickerStopAble==0)? scrollSpeed: 0
var actualheight=''
function tickerScroll(){
// document.getElementById("demo").innerHTML=(actualheight*(-1)+8);
 if (parseInt(tickerContent.style.top)>(actualheight*(-1)+4)){
  tickerContent.style.top=parseInt(tickerContent.style.top)-scrollSpeed+"px";
 }else{
  tickerContent.style.top=parseInt(contentHeight)+4+"px";
 }
}
function tickerStart(){
 if(document.getElementById && document.getElementById("newsticker-content")){
  tickerContent=document.getElementById("newsticker-content");
  tickerContent.style.top=0;
  contentHeight=document.getElementById("newsticker-box").offsetHeight;
  actualheight=tickerContent.offsetHeight;
  if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ // Ausstieg für Opera oder Netscape 7x
   tickerContent.style.height=contentHeight+"px";
   tickerContent.style.overflow="scroll";
   return
  }
  setTimeout('lefttime=setInterval("tickerScroll()",60)', initDelay)
 }
}
if (window.addEventListener){
 window.addEventListener("load", tickerStart, false);
}else if (window.attachEvent){
 window.attachEvent("onload", tickerStart);
}else if (document.getElementById){
 window.onload=tickerStart;
}
/*::::::::::::::::::::: Slideshow Table Visibility :::::::::::::::::::*/

function getTableStatus(status)
{
    if(document.getElementById)
    {
        if(photos=="")
        {
            if(document.getElementById("txt_img").innerHTML=="")
            {
                document.getElementById("slideTableControl").style.display="none";
            }
        }
        if(document.getElementById("slideTable"))
        {
            document.getElementById("slideTable").style.display=status;
            if("none"==status)
            {
                document.getElementById("slideTable").style.margin="0";
            }
        }
    }
}
function rollOutMenu(element)
{
    e_DivChilds=element.getElementsByTagName("DIV");
    if(element.className=='rollOutHead')
    {
        element.className='rollOutHeadAct';
        for(i=0;i<e_DivChilds.length;i++)
        {
            e_DivChilds[i].style.display='block';
        }
    }else if(element.className=='rollOutHeadAct')
    {
        element.className='rollOutHead';
        for(i=0;i<e_DivChilds.length;i++)
        {
            e_DivChilds[i].style.display='none';
        }
    }
}
function highlightMainNav(){
    if(document.getElementById && document.getElementById("navipath").firstChild)
    {
        mainNavAct = "mainNav" + document.getElementById("navipath").firstChild.innerHTML;
        if(document.getElementById(mainNavAct))
        {
            document.getElementById(mainNavAct).className="activatedMainNav";
        }
    }
}
var popUpWin = false;
popUpWindow = function(URLStr, left, top, width, height)
{
    if(popUpWin)
    {
        if(!popUpWin.closed) popUpWin.close();
    }
    popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
 


/*::: DHTML image gallery :::*/
function objLink(nodA){
 this.Node = nodA;
 this.Img = this.Node.firstChild;
 this.ContentImage = new Image;
 this.ContentImage.src = this.Node.href;
 this.ContentHeadline = this.Node.title;
 this.ContentText = this.Node.parentNode.getElementsByTagName("P")[0].innerHTML;
 this.PopupLink = this.Node.parentNode.getElementsByTagName("a")[1].href;
 this.Title = this.Node.title;
 this.nextSibling = "";
 this.previousSibling = "";
 this.Node.onclick = IdentifyAndExecute;
 this.Id = 0;
}
function IdentifyAndExecute(){
 this.Node = this;
 if(!this.Node.id) { // If InitGal
  this.Node = document.getElementById("context-gallery").getElementsByTagName("A")[0];
 }
 if(this.Node.id.indexOf("Left")!=-1)
 {
  this.Id = nodGal.PreviousNode.id;
 } else if (this.Node.id.indexOf("Right")!=-1)
 {
  this.Id = nodGal.NextNode.id;
 } else {
  this.Id = this.Node.id;
 }
//  alert(this.Id);
 if(this.Id){
  this.TempId = this.Id;
  this.TempId = this.TempId.slice(6, 10);
  if(!isNaN(this.TempId)){ 
   // Object ist ein Thumb
   this.Id = this.TempId;
  }else{ 
   // Object ist kein Thumb, sondern navigationselement
   return true;
  }
  
  this.linkNod = nodGal.arrLinks[(this.Id-1)];
  nodGal.PopupPage = this.linkNod.PopupLink; // PopupLink
  if(nodGal && nodGal.placeholder) 
  {
   nodGal.placeholder.src=this.linkNod.ContentImage.src;
   nodGal.placeholder.onclick = function(){ popUpWindow(nodGal.PopupPage,50,50,606,595) }
   nodGal.ZoomLoupe.onclick = nodGal.placeholder.onclick;
   nodGal.ImageHeadline.innerHTML = this.linkNod.ContentHeadline;
   nodGal.ImageText.innerHTML = this.linkNod.ContentText;
   if(this.linkNod.previousSibling!="" && nodGal.PreviousImage){
    nodGal.PreviousNode = this.linkNod.previousSibling.Node;
    nodGal.PreviousImage.onclick = IdentifyAndExecute;
   } else{ nodGal.PreviousNode =""; nodGal.PreviousImage.onclick=""; }
   if(this.linkNod.nextSibling!="" && nodGal.NextImage){
    nodGal.NextNode = this.linkNod.nextSibling.Node;
    nodGal.NextImage.onclick = IdentifyAndExecute;
   } else{ nodGal.NextNode =""; nodGal.NextImage.onclick=""; }
   // highlighting
   var j = nodGal.arrLinks.length;
   for(i=0;i<j;i++){
    nodGal.arrLinks[i].Node.className="";
   }
   this.linkNod.Node.className="active";
   
   // display imageblocks
   showImageBlock(this.linkNod.Node.parentNode.parentNode.parentNode.id);
   
   return false;
  }else 
  {
   return true;
  }
   
   
 }
}
var popUpWin = false;
popUpWindow = function(URLStr, left, top, width, height)
{
    if(popUpWin)
    {
        if(!popUpWin.closed) popUpWin.close();
    }
    popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function setImageCount(){
 var imageCount = this.arrLinks.length;
 return(imageCount);
}
function countAllImages(){
 var imageCount = this.arrLinks.length;
 return(imageCount);
}
function objGallery(nodGalleryImages){
 this.Node = nodGalleryImages;
 this.arrLinks = new Array();
 this.ReadImages = ReadImages;
 this.ReadImages();
 this.SetSiblings = SetSiblings;
 this.SetSiblings(this.arrLinks);
 
 this.PageBreakCount = document.getElementById('galBlock').className.slice(9, 12);
 this.ActiveImageBlock = "imageBlock1";
 
 this.placeholder = document.getElementById('placeholder');
 this.ZoomLoupe = document.getElementById('zoomloupe');
 this.ImageHeadline = document.getElementById('desc');
 this.ImageText = document.getElementById('imageText');
 
 // SiblingNodes and Nav
 this.PreviousImage = document.getElementById('imageNavigationLeft');
 this.PreviousNode = "";
 this.NextImage = document.getElementById('imageNavigationRight');
 this.NextNode = "";
 
 this.PopupPage = "empty";
 this.setImageCount = setImageCount;
 this.setImageCount();
}
function ReadImages()
{
    nodAChilds = this.Node.getElementsByTagName("A");
    for(i = 0; i < nodAChilds.length; i++)
    {
  if(nodAChilds[i].firstChild.tagName=="IMG" && nodAChilds[i].parentNode.tagName!="SPAN"){
   lnk = new objLink(nodAChilds[i]);
   this.arrLinks.push(lnk);
  }
    }
}
function SetSiblings(arrLinkObjects)
{
    for(i = 0; i < arrLinkObjects.length; i++)
    {
  arrLinkObjects[i].Id = i;
  if(arrLinkObjects[i-1]) arrLinkObjects[i].previousSibling = arrLinkObjects[i-1];
  if(arrLinkObjects[i+1]) arrLinkObjects[i].nextSibling = arrLinkObjects[i+1];
    }
}
function activateImageBlockNav(objRef) {
 if(document.getElementById && document.getElementById(objRef))
 {
  var AllSpanEls = document.getElementById(objRef).getElementsByTagName("span");
  var j=AllSpanEls.length; 
  for(i=0; i<j; i++){
   if(AllSpanEls[i].className.indexOf('hidden')!=-1){
    AllSpanEls[i].className = 'visible';
   }
  }
  showImageBlock('imageBlock1');
 }
}
function showImageBlock(objRefId) {
 if(document.getElementById && document.getElementById('galBlock'))
 {
  var AllLiEls = document.getElementById('galBlock').getElementsByTagName("LI");
  var j=AllLiEls.length; 
  for(i=0; i<j; i++){
   if(AllLiEls[i].id){
    AllLiEls[i].className = 'hidden';
   }
  }
  document.getElementById(objRefId).className = 'visible';
 }
}
 



/*: Funktionen für FlashDetection! :*/
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
 // NS/Opera version >= 3 check for Flash plugin in plugin array
 if (navigator.plugins != null && navigator.plugins.length > 0) {
  if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
   var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
        var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
   descArray = flashDescription.split(" ");
   tempArrayMajor = descArray[2].split(".");
   versionMajor = tempArrayMajor[0];
   versionMinor = tempArrayMajor[1];
   if ( descArray[3] != "" ) {
    tempArrayMinor = descArray[3].split("r");
   } else {
    tempArrayMinor = descArray[4].split("r");
   }
        versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
       } else {
   flashVer = -1;
  }
 }
 // MSN/WebTV 2.6 supports Flash 4
 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
 // WebTV 2.5 supports Flash 3
 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
 // older WebTV supports Flash 2
 else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
 // Can't detect in all other cases
 else {
  
  flashVer = -1;
 }
 return flashVer;
} 
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
  reqVer = parseFloat(reqMajorVer + "." + reqRevision);
    // loop backwards through the versions until we find the newest version 
 for (i=25;i>0;i--) { 
  if (isIE && isWin && !isOpera) {
   versionStr = VBGetSwfVer(i);
  } else {
   versionStr = JSGetSwfVer(i);  
  }
  if (versionStr == -1 ) { 
   return false;
  } else if (versionStr != 0) {
   if(isIE && isWin && !isOpera) {
    tempArray         = versionStr.split(" ");
    tempString        = tempArray[1];
    versionArray      = tempString .split(",");    
   } else {
    versionArray      = versionStr.split(".");
   }
   versionMajor      = versionArray[0];
   versionMinor      = versionArray[1];
   versionRevision   = versionArray[2];
   
   versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
   versionNum        = parseFloat(versionString);
         // is the major.revision >= requested major.revision AND the minor version >= requested minor
   if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
    return true;
   } else {
    return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false ); 
   }
  }
 } 
}
 

/*: Funktionen für die Toolbox der Seite ! :*/
function bookmark(url,title){
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
        window.external.AddFavorite(url,title);
    } else if (navigator.appName == "Netscape") {
        window.sidebar.addPanel(title,url,"");
    } else {
        alert("Bitte drücken Sie Strg+D (Netscape) oder Strg-T (Opera) um die Seite zu speichern.");
    }
}