//--built 08---------------------------------------------------------------------------//
//--by      martin hein  www.digitale-mehrwerte.eu  (hein@digitale-mehrwerte.eu)-------//
//alert("init.js");

addLoadEvent(init);  
function init ()
             {//alert ("init()");
              //init menu
              menu_init();
              if(typeof(admin)=="undefined")mask_emails();

              http_root = this.location.href.replace(/http:\/\/[^\/]+/, "").replace(/\/_.+/, "");
              if(http_root.substr(-1)=="/") http_root = http_root.substring(0, -1);
             // imageflow_init();
             }       
           
function menu_init ()
                 {
																	 menuObj = document.getElementById("menu_div");
																		if (!menuObj) return;
                  menuA = menuObj.getElementsByTagName('ul')[0].getElementsByTagName('div');
                  width = (966/menuA.length)-4;
                  for (i=0; i<menuA.length; i++)
                     {
                      menuA[i].style.width = width+"px";
                      menuA[i].onmouseover = function() {this.className="highlite";}
                      menuA[i].onmouseout = function() {if(this.id!="menu_highlite")this.className="";}
                     }
                 }
                 
function imageflow_init ()                 
                       {
                        obj = document.getElementById("imageflow");
                        imageflow_left = obj.offsetLeft;
                        //console("imageflow_top : "+imageflow_top);
                        //console("obj.clientTop : "+obj.clientHeight);
                        while (obj=obj.offsetParent)
                             {
                              console(obj.id+" "+obj.className+" "+obj.offsetLeft);
                              if(obj) imageflow_left+= obj.offsetLeft;
                             }
                        //alert(obj);
                        //obj_top = obj.offsetTop;
                        console("imageflow_Left : "+imageflow_left);
                        //console("obj.clientTop : "+obj.clientHeight);
                       }
                       
function mask_emails ()
                    {//alert("mask_emails()");
                     var a = document.getElementsByTagName("a");
                     for (var i = a.length-1; i >= 0; i--) 
                        {
                         if (a[i].className.search(/\bemail\b/) != -1) 
                           {
                            var email = a[i].firstChild.data + "@" + a[i].lastChild.data;
                            a[i].innerHTML = email;
                            a[i].href = "mailto:" + email;
                           }
                        }
                    }                       