init = function() {
   if (document.getElementById("faq")) {
      var elements = document.getElementById("faq").getElementsByTagName("div");
      var even = false;
      for (var i=0;i<elements.length;i++) {
         if (elements[i].className && elements[i].className.match("faq-headline")) {
            elements[i].onclick = showitem;
         }
         if (elements[i].className && elements[i].className.match("faq-item")) {
            elements[i].className = even ? elements[i].className+" even" : elements[i].className;
            even = ! even;
         }
      }
   }
   if (document.getElementById("teaser")) {
      var teaser = document.getElementById("teaser").getElementsByTagName("div");
      var even2 = false;
      for (var i=0;i<teaser.length;i++) {
         if (teaser[i].className && teaser[i].className.match("teaser-item")) {
            teaser[i].className = even2 ? teaser[i].className : teaser[i].className+" even";
            even2 = ! even2;
         }
      }
   }
}

showitem = function() {
   resetitems();
   this.nextSibling.nextSibling ? this.nextSibling.nextSibling.style.display = "block" : this.nextSibling.style.display = "block";
}

resetitems = function() {
   var elements = document.getElementsByTagName("div");
   for (var i=0;i<elements.length;i++) {
      if (elements[i].className && elements[i].className.match("faq-text")) {
         elements[i].style.display = "none";
      }
   }
}

window.onload = init;

/**
 * FLASH OBJECT hr@netural 16-06-2006
 **/

function flashObj(src,title,width,height,reqVersion,altImage,altLink) {
   this.src = src;
   this.title = title;
   this.width = width;
   this.height = height;
   this.reqVersion = reqVersion;
   this.altImage = altImage;
   this.altLink = altLink;
   this.str = "";
}

flashObj.prototype = {
   write: function(bgcolor,wmode) {
      flashVersion = this.getFlashVersion();
      if (flashVersion >= this.reqVersion) {
         bgcolor = bgcolor ? bgcolor : "#fff";
         wmode = wmode ? wmode : "transparent";
         this.str += "<object";
         this.writeParameter("classid","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
         this.writeParameter("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0");
         this.writeParameter("width",this.width);
         this.writeParameter("height",this.height);
         this.writeParameter("id",this.title);
         this.str += ">";
         this.writeObjectParameter("allowScriptAccess","sameDomain");
         this.writeObjectParameter("movie",this.src);
         this.writeObjectParameter("quality","high");
         this.writeObjectParameter("wmode",wmode);
         this.writeObjectParameter("bgcolor",bgcolor);
         this.writeObjectParameter("allowScriptAccess","sameDomain");
         this.str += "<embed"
         this.writeParameter("src",this.src+((this.urlparameter) ? "?"+this.urlparameter : ""));
         this.writeParameter("quality","high");
         this.writeParameter("wmode",wmode);
         this.writeParameter("bgcolor",bgcolor);
         this.writeParameter("width",this.width);
         this.writeParameter("height",this.height);
         this.writeParameter("name",this.title);
         this.writeParameter("allowScriptAccess","sameDomain");
         this.writeParameter("type","application/x-shockwave-flash");
         this.writeParameter("pluginspage","http://www.macromedia.com/go/getflashplayer");
         this.str += " /></object>";
         document.write(this.str);
      } else if (this.altImage) {
         if (this.altLink) {
            document.write("<a href=\""+this.altLink+"\">");
         }
         document.write("<img src=\""+this.altImage+"\" id=\""+this.title+"\" width=\""+this.width+"\" height=\""+this.height+"\" border=\"0\" />");
         if (this.altLink) {
            document.write("</a>");
         }
      }
   },
   
   writeObjectParameter: function(param, value) {
      this.str += "<param name=\""+param+"\" value=\""+value+"\"/>";
   },
   
   writeParameter: function(param, value) {
      this.str += " "+param+"=\""+value+"\"";
   },
   
   getFlashVersion: function() {
      var flashVersion = 0;
      var agent = navigator.userAgent.toLowerCase();
      if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
         return flashVersion;
      }
      if (navigator.plugins != null && navigator.plugins.length > 0) {
         var flashPlugin = navigator.plugins['Shockwave Flash']; 
         if (typeof flashPlugin == 'object') {
            for (i=25;i>0;i--) {
               if (flashPlugin.description.indexOf(i+'.') != -1) {
                  flashVersion = i;
               }
            }
         }
      } else if ((agent.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >= 4) && (agent.indexOf("win") != -1) && (agent.indexOf("16bit") == -1)) {
         flashVersion = this.getIEFlashVersion();
      }
      return flashVersion;
   },
   
   getIEFlashVersion: function() {
      var swfObj, flashVersion;
      for (i=0;i<25;i++) {
         try {
            swfObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
         } catch(e) {}
         if (swfObj) {
            flashVersion = swfObj.GetVariable("$version").split(" ")[1].split(",")[0];
         }
      }
      return (flashVersion);
   }
}