// 2007 Werb'Office http://www.werboffice.de/ for www.leitz.org
//-------------------------------------------------------------------------


// Pop-up Fenster
function PopWin(theURL,winName,features) {
  nWindow = window.open(theURL,winName,features);
  nWindow.focus();
}


// Rollover-Steuerung
  
  function rollover(element, selectedColor) {
      lastForeColor = element.style.color;  
      lastBgColor = element.parentNode.parentNode.style.backgroundColor; 
       
      if (!selectedColor) {
        newBgColor = "#fecf82";
      } else {
        newBgColor = selectedColor;
      }
      //element.style.color="#fff";
      element.parentNode.parentNode.style.backgroundColor= newBgColor;  
  }
  
  function rollout(element) {
     element.style.color=lastForeColor;
     element.parentNode.parentNode.style.backgroundColor=lastBgColor;      
  }

// Layer-ein-/ausblenden
  
  function blend(element, action) {
      
      if (action == "in") {
          document.getElementById(element).style.visibility="visible";
      } else if (action == "out") {
          document.getElementById(element).style.visibility="hidden";
      }

  }

function popup(url, width, height, name){
  pop = window.open(url,name,'width=' + width + ',height=' + height + ',status=yes,resizable=yes,menubar=no,locationbar=no,scrollbars=yes,dependent=yes' );
}

function popup_centered(url, width, height, name)
{
    var sWidth   = screen.width;
    var sHeight  = screen.height;
        
    // Center Popup
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);

	pop = window.open(url,name,'width=' + width + ',height=' + height + ',left=' + posX + ',top=' + posY + ',status=no,resizable=yes,menubar=no,locationbar=no,scrollbars=no,dependent=yes' );
}

function popup_resize(width, height) {
    window.resizeTo(width, height);
    var NS = (navigator.appName=="Netscape")?true:false;    
    var NS = ((!document.all)||window.opera)?true:false;
    var iWidth = (NS)?window.innerWidth:document.body.clientWidth;
    var iHeight = (NS)?window.innerHeight:document.body.clientHeight;    
    
    iWidth = width - iWidth;
    iHeight = height - iHeight;
    
    window.resizeBy(iWidth, iHeight);
    self.focus(); 
    
    // Center Popup
    var sWidth   = screen.width;
    var sHeight  = screen.height;
    var posX    =  (sWidth/2) - (width/2);
    var posY    =  (sHeight/2) - (height/2);
    moveTo(posX,posY);
}

// Dropdown Loose for IE6

sfHover = function() {
  if ( document.getElementById("droplist") ) {
	   var sfEls = document.getElementById("droplist").getElementsByTagName("DIV");
  
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=100; // erforderlich IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			this.style.zIndex=1; // erforderlich IE
		}
	}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


//  Supress right-click 
function click0() {
  if (event.button != 1) {
    alertProtection();
    return false;
  }
}


function alertProtection() {
  alert(unescape("%A9 2008 Leitz GmbH %26 Co. KG"));
  return false;
}

function initProtection () {
    
    for (i=0; i < initProtection.arguments.length; i++) {
        if (document.all)
          if (document.getElementById) {
              document.getElementById(initProtection.arguments[i]).oncontextmenu=alertProtection;
          } else {
              document.onmousedown=click0;
          }
        if (!(document.all) && document.getElementById) {
            document.getElementById(initProtection.arguments[i]).oncontextmenu=alertProtection;
        }
    }
}

