////////////////////////////////////////////////////////////////
//
// wScript.js 5.0.1
// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de
// erstellt mit Weblication Content Management Server, www.weblication.de
//
////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////
//
// Anzupassende Variablen:
//
////////////////////////////////////////////////////////////////

//var mailPostfix = '@data-quality-on-demand.com';

////////////////////////////////////////////////////////////////
//
// Beschreibung: Browsererkennung
//
////////////////////////////////////////////////////////////////

var ns  = (document.layers) ? 1 : 0;
var ie  = (document.all) ? 1 : 0;
var dom = (document.getElementById) ? 1 : 0;
var mac = (navigator.platform.indexOf("Mac") != -1) ? 1 : 0;
var gecko     = (navigator.userAgent.indexOf("Gecko") != -1) ? 1 : 0;
var geckoVers = parseFloat(navigator.userAgent.replace(/.*rv:(\d+\.\d+).*/, '$1'));
var ieVers    = navigator.appVersion.substring(navigator.appVersion.lastIndexOf("MSIE") + 4,navigator.appVersion.lastIndexOf("MSIE") + 8);
var mode 	= "";

////////////////////////////////////////////////////////////////
//
// Beschreibung: Generiert Spam-sichere Email an Angestellten
//
////////////////////////////////////////////////////////////////

function sendMailToEmployee(name){
 location.href = 'mailto:' + name + '@data-quality-on-demand.com';
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster
//
////////////////////////////////////////////////////////////////

function openPopup(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup", optionsPopup);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster vom Typ 1
//
////////////////////////////////////////////////////////////////

function openPopup1(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup1", optionsPopup1);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster vom Typ 2
//
////////////////////////////////////////////////////////////////

function openPopup2(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup2", optionsPopup2);
}


////////////////////////////////////////////////////////////////
//
// Beschreibung: Zeigt die Druckansicht an
//
////////////////////////////////////////////////////////////////

function wShowPrintpreview(){

  var url = location.href;
  var anchor = location.hash;

  url = url.replace(anchor, '');

  if(url.indexOf('?') >= 0){
    url += '&viewmode=print';
  }
  else{
    url += '?viewmode=print';
  }

  openWindow(url, 'wPrintpreview', 'width=768,height=520,scrollbars=yes');
}



/*********************************************************************************/
//
// �ffnet ein Fenster
//
// @param string Url
//
// @param string Name des Fensters
//
// @param string Optionen
//
// @return window
//
/*********************************************************************************/

function openWindow(url, name, options){

  var regWidth = /width=(\d+)/;
  regWidth.exec(options);
  width = RegExp.$1;
  if(width == ''){
    width = 640;
  }

  var regHeight = /height=(\d+)/;
  regHeight.exec(options);
  height = RegExp.$1;
  if(height == ''){
    height = 480;
  }


  if(!name && !width && !height && !options){
    return window.open(url, name);
    return;
  }
  //Zusaetzliche Optionen angeben
  if(!options){
    options = ',resizable=no,scrollbars=no,status=no';
  }
  //Position zentriert festlegen

  var posLeft = (screen.width / 2)  - (width  / 2);
  var posTop  = (screen.height / 2) - (height / 2);
  //alert('top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);<<<
  return window.open(url, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Druckt das aktuelle Dokument
//
////////////////////////////////////////////////////////////////

function printDocument(){

  if(document.all && navigator.appVersion.substring(22,23)==4) {
    self.focus();
    var OLECMDID_PRINT = 6;
    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
    var OLECMDEXECOPT_PROMPTUSER = 1;
    var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
    document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
    WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
    WebBrowser1.outerHTML = '';
  }
  else{
    window.print();
  }
}

/*********************************************************************************/
//
// @description Ruft eine URL auf
//
// @parameter   String Aufzurufende Url
//
// @parameter   Function Nach der Anfrage aufzurufende Funktion
//
// @return      void
//
/*********************************************************************************/

function getUrl(url, functionResult){

  var requestObject = new wRequestObject(url, functionResult);
}

/*********************************************************************************/
//
// @description Ruft eine URL auf
//
// @parameter   String Aufzurufende Url
//
// @parameter   Function Nach der Anfrage aufzurufende Funktion
//
// @return      void
//
/*********************************************************************************/

function wRequestObject(url, functionResult){

  if(typeof functionResult == 'function'){
    var id              = resultFunctions.length;
    //alert(id);

    this.request        = null;

    if(document.all){
      this.request = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
      this.request = new XMLHttpRequest();
    }

    resultFunctions.push(functionResult);
    //alert('push' +  requests.length);

    requests.push(this.request);
    this.request.open('GET', url, true);

    this.request.onreadystatechange = function(){
      var requestObject = requests[id];
      if(requestObject.readyState == 4){
        if(requestObject.status == '200'){
          resultFunctions[id](requestObject.responseText);
        }
      }
    }

    this.request.send('');
  }
}

/***************************************************
* @info  : Oeffnet eine URL in einem popUp         *
* @param : url   : Zu oeffnende URL                *
*          width : Breite des Fensters             *
*          height: Hoehe des Fensters              *
* @return: -                                       *
***************************************************/

function wOpenPopupURL(url, width, height){
  var name = '';

  if(width == '' || width == ' '){
    width = 786;
  }
  if(height == '' || height == ' '){
    height = 677;
  }
  url = url.replace(/&amp;/g, '&');
  options = ',location=no, menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no';
  width   = parseInt(width);
  height  = parseInt(height);
  //Position zentriert festlegen
  var posLeft = (screen.width / 2)  - (width  / 2);
  var posTop  = (screen.height / 2) - (height / 2);
  window.open(url, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);
}


function wOpenPopupVideo(src, width, height){
  var name = '';

  if(width == '' || width == ' '){
    width = 786;
  }
  if(height == '' || height == ' '){
    height = 677;
  }
  var src       = src.replace(/&amp;/g, '&');
  var srcFrame  = '/saas-de/wGlobal/content/areas/popup.area.php';
  var url       = srcFrame+'?vid='+src;

  //alert (url);
  options = ',location=no, menubar=no,toolbar=no,resizable=no,scrollbars=no,status=no';
  width   = parseInt(width);
  height  = parseInt(height);
  //Position zentriert festlegen
  var posLeft = (screen.width / 2)  - (width  / 2);
  var posTop  = (screen.height / 2) - (height / 2);
  window.open(url, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);
}

/***************************************************
* @info  : Oeffnet ein Bild in einem popUp         *
* @param : url   : Zu oeffnende URL                *
* @return: -                                       *
***************************************************/

function wOpenImageAdaptSize(url){

  var name = '';
  var path = '/weblication/grid/scripts/wImage.php?action=getImageSize&path='+url;
  curImageUrl = url;
  getUrl(path, wOpenImageAdaptSizeResponse);
}

function wOpenImageAdaptSizeResponse(response){

  var name = '';
  var size = response;
  if(response == ''){
    size = 'width="800" height="600"';
  }

  var regex = /(?:")(\d+?)(?:").*(?:")(\d+?)(?:")/;
  var match = size.match(regex);d

  if(match){
    width   = match[1];
    height  = match[2];
  }
  else{
    width   = 800;
    height  = 600;
  }

  curImageUrl = curImageUrl.replace(/&amp;/g, '&');
  options = ',location=no, menubar=no,toolbar=no,resizable=no,scrollbars=no,status=no';
  width   = parseInt(width);
  height  = parseInt(height);
  //Position zentriert festlegen
  var posLeft = (screen.width / 2)  - (width  / 2);
  var posTop  = (screen.height / 2) - (height / 2);
  window.open(curImageUrl, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Generiert Spam-sichere Email
//
////////////////////////////////////////////////////////////////

function wWriteMail(name){
	//location.href = 'mailto:' + name + '@scholl.de';
  location.href = 'mailto:' + name + mailPostfix;
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Druckt das aktuelle Dokument
//
////////////////////////////////////////////////////////////////

function wPrintDocument(){

  if(document.all && navigator.appVersion.substring(22,23)==4) {
    self.focus();
    var OLECMDID_PRINT = 6;
    var OLECMDEXECOPT_DONTPROMPTUSER = 2;
    var OLECMDEXECOPT_PROMPTUSER = 1;
    var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
    document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
    WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
    WebBrowser1.outerHTML = '';
  }
  else{
    window.print();
  }
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Generiert Spam-sichere Email
//
////////////////////////////////////////////////////////////////

function wSendMailNospam(name){

  location.href = 'mailto:' + name + mailPostfix;
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Setzt die Sprachversion
//
////////////////////////////////////////////////////////////////

function wSetLanguageVersion(langVersion, redirectUrl){
  //var url = '/weblication/grid/scripts/wSystem.php?action=setLanguageVersion&redirectUrl=' + escape(redirectUrl) + '&langVersion=' + langVersion;
  var url = '/weblication/grid/scripts/wSystem.php?action=setLanguageVersion&redirectUrl=' + decodeURI(redirectUrl) + '&langVersion=' + langVersion;
  location.href = url;
}

function languageSelector(id) {
	if(document.getElementById(id)) {
		if(document.getElementById(id).style.display == 'none' || document.getElementById(id).style.display == '') {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
}



////////////////////////////////////////////////////////////////
//
// Beschreibung: tauscht Bilder aus
//
////////////////////////////////////////////////////////////////
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// Blendet Layer ein / aus

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



////////////////////////////////////////////////////////////////
//
// Beschreibung: Resized den Emotionenbereich im Header
//
////////////////////////////////////////////////////////////////

	function resizeEmotion(){

	pictureResizeOuter = document.getElementById('elementEmotions');
	pictureResizeImg   = pictureResizeOuter.firstChild;
	pictureResize      = pictureResizeImg.className;

	if (pictureResize == 'noresize' && pictureResize != ''){
    document.getElementById('blockEmotions').style.height = '80px';

  } else {
	  	if(document.getElementById('elementCustomer')){
			document.getElementById('elementCustomer').style.position = 'absolute';
			var top = parseInt(document.getElementById('elementCustomer').style.marginTop);
		}
		if(document.getElementById('resizeEmotion')){
			document.getElementById('resizeEmotion').style.position 	= 'absolute';
			var left = parseInt(document.getElementById('resizeEmotion').style.marginLeft);
		}
		if(document.getElementById('blockEmotions')){
			var height 		= parseInt(document.getElementById('blockEmotions').style.height);
		}
		if(document.getElementById('elementEmotions')){
			var marginTop = parseInt(document.getElementById('elementEmotions').style.marginTop);
		}

		if(mode == 'big'){
			if(document.getElementById('blockEmotions')){
	    	document.getElementById('blockEmotions').style.height   = height + 20 +'px';
	    	document.getElementById('blockEmotions').style.overflow = 'hidden';
	    	height = height + 20;
	 	  }

	 	  if(height >= 80 && height <= 220){
	 	  	document.getElementById('elementEmotions').style.marginTop 	= marginTop + (parseInt(document.getElementById('elementEmotions').className)/7) + 'px';
		  }
		  if(document.getElementById('elementCustomer')){
	 	  	document.getElementById('elementCustomer').style.marginTop = height  -20 + 'px'
	 	  }

		}
		else if(mode == 'small'){
			if(document.getElementById('blockEmotions')){
		 		document.getElementById('blockEmotions').style.height   = height - 20 +'px';
		 	  document.getElementById('blockEmotions').style.overflow = 'hidden';
		 	  height = height - 20;
	 	  }

	 	  if(height >= 80 && height <= 220){
	 	    document.getElementById('elementEmotions').style.marginTop 	= marginTop - (parseInt(document.getElementById('elementEmotions').className)/7) + 'px';
		  }
		  if(document.getElementById('elementCustomer')){
	 	  	document.getElementById('elementCustomer').style.marginTop = height - 20 + 'px'
	 	  }

		}

		if(height > 80 && height < 220){
			window.setTimeout("resizeEmotion()", 10);
		}

		if(height == 80){
			if(document.getElementById('blockEmotions')){
	    	document.getElementById('blockEmotions').style.height = 80 +'px';
		 	  document.getElementById('blockEmotions').style.overflow = 'hidden';
	 	  }
		  if(document.getElementById('elementCustomer')){
	 	  	document.getElementById('elementCustomer').style.marginTop = 80-20 + 'px';
	 	  }
	 	  if(document.getElementById('elementEmotions')){
	 	  	document.getElementById('elementEmotions').style.marginTop = - document.getElementById('elementEmotions').className + 'px';
	 	  }
	 	  if(document.getElementById('resizeEmotion')){
		 	  document.getElementById('resizeEmotion').style.marginLeft = 940 + 'px';
		 	  document.getElementById('resizeEmotion').style.marginTop = 10 + 'px';
		 	}
			if(document.getElementById('resizeEmotionLink')){
	 	 		document.getElementById('resizeEmotionLink').title = 'Vergrößern';
	 	 	}

	 	 	if(document.getElementById('resizeEmotionImg')){
			 	document.getElementById('resizeEmotionImg').alt = 'Vergrößern';
			 	document.getElementById('resizeEmotionImg').src = '/saas-de/wGlobal/layout/images/buttons/btn_close.gif';
	 	 	}

		 	document.cookie = "mode=big; path=/;";
			mode = 'big';
		}

		if(height == 220){
			if(document.getElementById('blockEmotions')){
		 		document.getElementById('blockEmotions').style.height   = 220 +'px';
		 	  document.getElementById('blockEmotions').style.overflow = 'hidden';
	 	  }
	 	  if(document.getElementById('elementEmotions')){
	 	  	document.getElementById('elementEmotions').style.marginTop = 0 + 'px';
	 	  }
		  if(document.getElementById('elementCustomer')){
	 	 		document.getElementById('elementCustomer').style.marginTop  = 220-23 + 'px'
	 	  }
	 	 	if(document.getElementById('resizeEmotion')){
		 	  document.getElementById('resizeEmotion').style.marginLeft    = 940 + 'px';
		 	  document.getElementById('resizeEmotion').style.marginTop     = 10 + 'px';
	 	  }

			if(document.getElementById('resizeEmotionLink')){
	 	  	document.getElementById('resizeEmotionLink').title 	= 'Verkleinern';
	 	  }

	 	  if(document.getElementById('resizeEmotionImg')){
			 	document.getElementById('resizeEmotionImg').alt 		= 'Verkleinern';
			 	document.getElementById('resizeEmotionImg').src 		= '/saas-de/wGlobal/layout/images/buttons/btn_open.gif';
		 	}

	 	 	document.cookie = "mode=small; path=/;";
			mode = 'small';
		}
	}
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: setzt das cookie
//
////////////////////////////////////////////////////////////////

	function wSetCookie(){
  	if (document.cookie) {
  		if(ie){
	  		if(document.cookie.toString().indexOf("mode=") == -1){
	  			document.cookie = "mode=small; path=/";
	  			mode = "small";
	  		}
	  		else{
	  			if(document.cookie.toString().indexOf("mode=small") != -1){
	  				var cookiemode = 'small';
	  			}
	  			else if(document.cookie.toString().indexOf("mode=big") != -1){
	  				var cookiemode = 'big';
	  			}

	  			if(cookiemode && cookiemode != mode){
	  				mode = cookiemode;
	  			}
	  		}
	  	}
	  	else{
	  		if(document.cookie.indexOf("mode=") == -1){
	  			document.cookie = "mode=small; path=/";
	  			mode = "small";
	  		}
	  		else{
	  			if(document.cookie.indexOf("mode=small") != -1){
	  				var cookiemode = 'small';
	  			}
	  			else if(document.cookie.indexOf("mode=big") != -1){
	  				var cookiemode = 'big';
	  			}

	  			if(cookiemode && cookiemode != mode){
	  				mode = cookiemode;
	  			}
	  		}
	  	}
  	}
  	else{
  		document.cookie = "mode=small; path=/";
  		mode = "small";
  	}
  	setEmotion();

 	}

////////////////////////////////////////////////////////////////
//
// Beschreibung: setzt die Anzeige f�r die emotion
//
////////////////////////////////////////////////////////////////

	function setEmotion(){

	pictureResizeOuter = document.getElementById('elementEmotions');
	pictureResizeImg   = pictureResizeOuter.getElementsByTagName('img');
	pictureResize      = pictureResizeImg[0].className;

	if (pictureResize == 'noresize' && pictureResize != ''){
    document.getElementById('blockEmotions').style.height = '80px';
    document.getElementById('resizeEmotion').style.display = 'none';
    return null;
  }
  		if(document.getElementById('elementCustomer')){
			document.getElementById('elementCustomer').style.position = 'absolute';
		}
		if(document.getElementById('resizeEmotion')){
			document.getElementById('resizeEmotion').style.position 	= 'absolute';
		}
		if(document.getElementById('blockEmotion')){
			//document.getElementById('blockEmotion').style.position 	= 'absolute';
		}
		if(document.getElementById('elementEmotions')){
			//document.getElementById('elementEmotions').style.position 	= 'absolute';
		}

		if(mode == 'big'){

			if(document.getElementById('blockEmotions')){
	    	document.getElementById('blockEmotions').style.height   = 80 +'px';
		 	  document.getElementById('blockEmotions').style.overflow = 'hidden';
	 	  }
		  if(document.getElementById('elementCustomer')){
	 	  	document.getElementById('elementCustomer').style.marginTop = 80-20 + 'px';
	 	  }
	 	  if(document.getElementById('elementEmotions')){
	 	  	document.getElementById('elementEmotions').style.marginTop = - document.getElementById('elementEmotions').className + 'px';
	 	  }
	 	  if(document.getElementById('resizeEmotion')){
		 	  document.getElementById('resizeEmotion').style.marginLeft = 940 + 'px';
		 	  document.getElementById('resizeEmotion').style.marginTop  = 10 + 'px';
	 	  }

	 	  if(document.getElementById('resizeEmotionLink')){
	 	  	document.getElementById('resizeEmotionLink').title 	= 'Vergrößern';
	 	  }
	 	  if(document.getElementById('resizeEmotionImg')){
			 	document.getElementById('resizeEmotionImg').alt = 'Vergrößern';
			 	document.getElementById('resizeEmotionImg').src = '/saas-de/wGlobal/layout/images/buttons/btn_close.gif';
		 	}

		 	mode = 'big';
	 	}
	 	else if(mode == 'small'){
	 		if(document.getElementById('blockEmotions')){
		 		document.getElementById('blockEmotions').style.height   = 220 +'px';
		 	  document.getElementById('blockEmotions').style.overflow = 'hidden';
	 	  }
	 	  if(document.getElementById('elementEmotions')){
	 	  	document.getElementById('elementEmotions').style.marginTop = 0 + 'px';
	 	  }
		  if(document.getElementById('elementCustomer')){
	 	 		document.getElementById('elementCustomer').style.marginTop  = 220-23 + 'px'
	 	  }
	 	 	if(document.getElementById('resizeEmotion')){
		 	  document.getElementById('resizeEmotion').style.marginLeft    = 940 + 'px';
		 	  document.getElementById('resizeEmotion').style.marginTop     = 10 + 'px';
	 	  }

	 	  if(document.getElementById('resizeEmotionLink')){
	 	  	document.getElementById('resizeEmotionLink').title 	= 'Verkleinern';
	 	  }
	 	  if(document.getElementById('resizeEmotionImg')){
			 	document.getElementById('resizeEmotionImg').alt = 'Verkleinern';
			 	document.getElementById('resizeEmotionImg').src = '/saas-de/wGlobal/layout/images/buttons/btn_open.gif';
		 	}

	 	  mode = 'small';
	 	}
	}

/*
function adaptIframeHeight(parent, iframe, iFrameDiv) {
	//alert(ie+"\n"+newHeight+"\n"+parent+"\n"+parent.document.getElementById(iframe).height);
	if(ie == 1 && parent && parent.frames[iframe] && document.getElementById(iFrameDiv)) {
		var newHeight =  document.getElementById(iFrameDiv).offsetHeight;
		parent.frames[iframe].height = newHeight
	} else if(ie == 0 && parent && parent.document.getElementById(iframe) && document.getElementById(iFrameDiv)) {
		var newHeight =  document.getElementById(iFrameDiv).offsetHeight;
		parent.document.getElementById(iframe).height = newHeight
	}
	//alert(ie+"\n"+parent.document.getElementById(iframe).height);
}
*/
function adaptIframesHeight(parent, iFrameDiv) {
	//alert(iFrameDiv);
	if(parent) {
		//alert(parent.frames.length);
		for(i=0; i<parent.frames.length; i++) {

			var iFrameId 		= (parent.frames[i].id) ? parent.frames[i].id : "";
			var iFrameName 	= (parent.frames[i].name) ? parent.frames[i].name : "";
			if(iFrameId != '') {
				iFrameName = iFrameId;
			}
			//alert(iFrameDiv+"\n"+iFrameName+"\n"+iFrameName);


			if(parent && iFrameName != '' && iFrameName == iFrameDiv && parent.frames[iFrameName] && document.getElementById(iFrameDiv)) {
				//alert(iFrameDiv);
				var newHeight =  document.getElementById(iFrameDiv).offsetHeight;
				parent.document.getElementById(iFrameName).height = newHeight;
				//parent.frames[iFrameName].height = newHeight;
				//alert(newHeight+"\n"+parent.frames[iFrameName].height);
			}


		}
	}
}




function refreshIframe(iframe, src) {
	if(document.getElementById(iframe)) {
		//alert(document.getElementById(iframe)+"\n"+document.getElementById(iframe).src+"\n"+src);
		document.getElementById(iframe).src = src;
	}
}


////////////////////////////////////////////////////////////////
//
// Beschreibung: Weiterempfehlen
//
////////////////////////////////////////////////////////////////
function gettellafriend() {
    var url = location.pathname+encodeURIComponent(location.search);
    if(url == "" || url == "/") {
        url = "/index.php";
    }
    document.location.href = '/saas-de/wTellAFriend/iframes/index.php?url='+url;
}

function navPopup(href) {
	wOpenPopupURL(href, '900', '750');return false;
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Navigationslayer einbinden
//
////////////////////////////////////////////////////////////////

jQuery(document).ready(function(){

  jQuery.get("/wGlobalGS1/wGlobal/scripts/naviLayer.php?php_self=" +  location.pathname, function(data){
    try{
      var naviDom = wLoadXml(data);
      addLayerNavigationLeft(naviDom);
    }
    catch(e){
    }
  });

  //Fancybox
  jQuery('a[class=fancyboxImg]').fancybox({
    'hideOnContentClick': true,
    'overlayShow':true,
    'overlayOpacity': 0.5,
    'centerOnScroll': false
  });

	jQuery(".elementPictureLupeButton").mouseover(function() {
	  jQuery(this).css('background', 'transparent url(/wGlobalGS1/wGlobal/layout/images/icons/but_lupe_r.gif) no-repeat scroll 0 0');

  });
	jQuery(".elementPictureLupeButton").mouseout(function() {
		jQuery(this).css('background', 'transparent url(/wGlobalGS1/wGlobal/layout/images/icons/but_lupe_n.gif) no-repeat scroll 0 0');
  });



  if (jQuery(".accordion").length > 0 ) {
    /*
   jQuery(".accordionArea .accordion .accordionOpener").css('cursor', 'pointer');
   jQuery('.accordionArea .accordion .accordionOpener').hover(function() {
     jQuery(this).addClass('accordionHover');
   }, function() {
     jQuery(this).removeClass('accordionHover');
   });
   jQuery(".accordionArea .accordion .accordionOpener").click(function(e){
   */
   
   jQuery(".accordionArea .accordion .accordionMoreDiv").css('cursor', 'pointer');
   jQuery(".accordionArea .accordion .accordionMoreDiv").click(function(e){
     e.preventDefault();
     var toggleContent = jQuery(this).parent().next();
     /*
     var img = null;
     var imgDefault = "url(/wGlobalGS1/wGlobal/layout/images/icons/left.png)";

     if (toggleContent.is(':visible')) {
		   img = imgDefault;
		   toggleContent.addClass('clicked');

	 } else {
	   img = "url(/wGlobalGS1/wGlobal/layout/images/icons/down.png)";
	   toggleContent.removeClass('clicked');
	 }*/
     //jQuery(this).css({backgroundImage:img}).next().slideToggle(300).parent().siblings(".accordion").find(".accordionContent").slideUp("slow").parent().find('h2').css({backgroundImage:imgDefault});
     //jQuery(this).css({backgroundImage:img}).next().slideToggle(300);
     jQuery(this).parent().next().slideToggle(300);
   });
}
});

function addLayerNavigationLeft(naviDom){

  try{
    while(naviDom.documentElement.hasChildNodes()){
      if(naviDom.documentElement.firstChild.nodeType == 1){
        var nodeContainer = document.getElementById(naviDom.documentElement.firstChild.getAttribute('id').replace('na', 'nl'));
        var nodeToInsert = wImportNode(naviDom.documentElement.firstChild);
        if(nodeContainer){
          if(nodeContainer.firstChild){
            nodeContainer.insertBefore(nodeToInsert, nodeContainer.firstChild);
          }
          else{
            nodeContainer.appendChild(nodeToInsert);
          }
          nodeContainer.innerHTML = nodeContainer.innerHTML;
        }
      }
      naviDom.documentElement.removeChild(naviDom.documentElement.firstChild);
    }
  }
  catch(e){
  }
}

function wImportNode(node){

  if(node.nodeType == 1){

    var newNode = document.createElement(node.nodeName);
    if(node.attributes && node.attributes.length > 0){
      for(var i = 0; i < node.attributes.length; i ++){
        newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i].nodeName));
      }
      if(node.hasChildNodes()){
        for(var i = 0; i < node.childNodes.length; i++){
          newNode.appendChild(wImportNode(node.childNodes[i]));
        }
      }
    }
    return newNode;
  }
  else{
    return document.createTextNode(node.nodeValue);
  }
}

function wLoadXml(str){

  var domObject = null;

  if(document.all){
    var domObject = new ActiveXObject("MSXML.DomDocument");
    if(!domObject.loadXML(str)){
      throw "wLoadXml Parse error";
    }
  }
  else{
    var domParser = new DOMParser();
    domObject     = domParser.parseFromString(str, "text/xml");
  }
  return domObject;
}

function displayBlock(id){
	if(document.getElementById(id)) {
		if(document.getElementById(id).style.display != 'block') {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
}

function displayBlockEventForm(){
  jQuery(document).ready(function() {
   	if(jQuery("tr.formNotSelectable").length > 0 ) {
  	  jQuery("tr.formNotSelectable").slideToggle();
   	}
 	});
}

