/*  MLV
 *  File: marie-louise-vogt.js
 *  Abstract: javascript for marielouisevogt.com
 
 *  Version: 1.0
 *  © Team Tejat Hamburg 2006 / marcwright.de
 
 */

 if (document.images)
         {
             pre = new Image();
             pre_image_url = new Array();
             // insert your preloads here
             pre_image_url[0] = 'art/loader.gif';
             pre_image_url[1] = 'art/marielouisevogt.gif';
             pre_image_url[2] = 'art/login.png';

             var i = 0;
             for(i=0; i<= 2; i++) 
             pre.src = pre_image_url[i];
             }


  /* Eventlister */

     function addEvent(elm, evType, fn, useCapture) 
     {
     if (elm.addEventListener){
     elm.addEventListener(evType, fn, useCapture);
      return true;
     } else if (elm.attachEvent){
     var r = elm.attachEvent("on"+evType, fn);
     return r;
     }
     }

 /* -------------------------------------------*/
 function init(){
     var siteHeight  = "710";
     
     if (navigator.userAgent.indexOf('MSIE') != -1) 
        {
            document.getElementById('container').style.top = -40+"px";
        }else{
            var screenHight = window.innerHeight ;
            var siteTopPadding = (screenHight-siteHeight)/2;
            document.getElementById('container').style.top = siteTopPadding+"px";
            
        }
     }

/*  -------- The Fading  -------- */
     /* the loading fade aut */
     A=90; // alpha start loadlayer
     
     function fadeOUT(){
         document.getElementById('load_text').innerHTML = "."; //+document.getElementById('boxDrag_portfolio_name').innerHTML;
         if(A>=5) {
                 A-=10;  
                 fadeTarget = document.getElementById("loading");
                 showTarget = document.getElementById("container");
                 //alert(fadeTarget.style.opacity);

                 if(fadeTarget.style.opacity!=null){
                 fadeTarget.style.opacity=(A/100)-.001;
                 }
                 else if (fadeTarget.style.filter!=null) {
                     fadeTarget.style.filter = "alpha(opacity="+A+")";
                     /* worth noting: IE's opacity needs values in a range of 0-100, not 0.0 - 1.0 */
                     }
                 fade = setTimeout("fadeOUT()",20);
                 //alert(document.getElementById('loading').innerHTML);

                 // Layer ausblenden
                     if(A == 0){
                     fadeTarget.style.visibility = "hidden";
                     fadeTarget.style.opacity=0;
                     showTarget.style.display       = "block";
                     showTarget.style.visibility    = "visible";
                     window.clearTimeout(fade);
                     }
                 }
          }

         /* -------------------------------------------*/
         /* end:loading fadeOUT*/


function theReload(){
    if (navigator.userAgent.indexOf('MSIE') != -1) 
        {
            return false;
            }else{
                location.href = '/index.php';
                
            }
    }


function admin(popup2) {
    OpenWin = this.open(popup2, "CtrlWindow2", "toolbar=no,menubar=no,location=no,scrollbars=yes,resize=yes, status=yes, width=1000,height=700");
    }
    
    
/* gets rid of some anoying flickering when opening the naviagtion */
 function antiflicker(a) {
      var e = document.getElementById(a);
      if (!e) return true;
      if (e.style.display == "none") {
        //e.style.display = "block";
        //document.getElementById('p').style.height ="0px";
        e.style.height = "0px";
        //overflow: visible/hidden/scroll/auto;
      } else {
        e.style.display = "none";
        
      }
      return true;
    }


