

    

    

    function Is() {
             var  agent     = navigator.userAgent.toLowerCase();
             this.agent     = agent;
             this.version   = parseInt(navigator.appVersion);
             this.versExact = parseFloat(navigator.appVersion);
             this.opera     = agent.indexOf('opera')!= -1;
             this.opera5    = agent.indexOf('opera 5')!= -1;
             this.opera4    = this.opera && this.version == 4 && !this.opera5;
             this.ns        = agent.indexOf('mozilla')!= -1 &&
                              agent.indexOf('spoofer')== -1 &&
                              agent.indexOf('compatible')== -1 &&
                              !this.opera;
             this.ns4       = this.ns && this.version >= 4 && this.version < 5 && !(this.versExact < 4.08);
             this.ns5up     = this.ns && this.version >= 5;
             this.ns4up     = this.ns4 || this.ns5up;
             this.ie        = agent.indexOf("msie") != -1 && agent.indexOf("mac") < 0 && !this.opera;
             this.ie4up     = this.ie && this.version >= 4;
             this.ie55      = this.ie4up && agent.indexOf('msie 5.5') != -1;
             this.ie6       = this.ie4up && agent.indexOf('msie 6.0') != -1;
             this.ie7		= this.ie4up && agent.indexOf('msie 7.0') != -1;
             this.ie6up		= this.ie6 || this.ie7;
             this.ie55up    = this.ie55 || this.ie6up;
             this.ie5       = this.ie4up && agent.indexOf('msie 5') != -1 && !this.ie55;
             this.ie4       = this.ie4up && !this.ie5 && !this.ie55;
             this.w3c       = document.documentElement;
             this.dhtml     = (this.ie4up || this.ns4up || this.w3c) && agent.indexOf("aol") < 0;
    }
    is = new Is();

    var mouseX = -500;
    var mouseY = -500;
    var infoOffsetX = 5;
    var infoOffsetY = 7;
    function handlerMouseMove(e) {
            mouseX = e ? is.opera ? e.clientX
                                  : e.pageX
                       : (is.ie6up ? document.documentElement.scrollLeft
                                 : document.body.scrollLeft) +
                         event.clientX;
            mouseY = e ? is.opera ? e.clientY
                                  : e.pageY
                       : (is.ie6up ? document.documentElement.scrollTop
                                 : document.body.scrollTop) +
                         event.clientY;
            flag = 1;
    }
    if (document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = handlerMouseMove;

    function getObject(id, parentID) {
        if ((is.w3c || is.opera5) && document.getElementById(eval("'" + id + "'")))
            return document.getElementById(id);
        if (is.ie4up && document.all[id]) {
            if (typeof document.all[id] == 'undefined')
                return null;
            return document.all[id];
        }
        if (is.ns4) {
            if (parentID && document.layers[parentID] && document.layers[parentID].document.layers[id])
                return document.layers[parentID].document.layers[id];
            if (document.layers[id])
                return document.layers[id];
        }
        return null;
    }

    function getStyleObject(id, parentID) {
        if ((is.ie4up || is.w3c || is.opera5) && getObject(id))
            return getObject(id).style;
        if (is.ns4)
            return getObject(id, parentID);
        return null;
    }

    function switchLayer(id, visibility, parentID) {
        if (getStyleObject(id, parentID))
            getStyleObject(id, parentID).visibility = (visibility ? "visible" : "hidden");
    }

    function toggle(id, imgName, imgOpen, imgClose) {
        if (getStyleObject(id)) {
            var display = null;
            if (getStyleObject(id).display == "none") {
                display = "";//"inline";
                swap(imgName, imgClose);
            } else {                                             
                display = "none";
                swap(imgName, imgOpen);
            }
            getStyleObject(id).display = display;
            var dummy = new Image();
            dummy.src = "/portal?action=6096&id=" +
                        id + "&open=" + (display == "none" ? "NO" : "YES");
        }
    }

    function moveTo(id, x, y, parentID) {
        if (y != null && getStyleObject(id, parentID))
            is.opera5 ? getStyleObject(id).pixelTop = y
                      : getStyleObject(id, parentID).top  = is.ns4
                            ? y
                            : y + "px";
        if (x != null && getStyleObject(id, parentID))
            is.opera5 ? getStyleObject(id).pixelLeft = x
                      : getStyleObject(id, parentID).left = is.ns4
                            ? x
                            : x + "px";
    }

    function swap(img, imgSrc) {
       if (document[img] != null) {
           document[img].src = eval( imgSrc + '.src' );
           document[img].name = eval( imgSrc + '.name' );
       } else if (img.src != null) {
           img.src = eval( imgSrc + '.src' );
           if (img.name !=null ) {
              img.name = eval( imgSrc + '.name' );
           }
       }
    }

    function preload() {
        var imgs = preload.arguments;
        if (imgs == null || imgs < 1) {
            return;
        }
        if (document.images) {
           for (i = 0; i < imgs.length; i++) {
               var dot = imgs[i].lastIndexOf(".");
               if (dot > -1) {
                   eval("img" + i + "= new Image();"   + "img" + i + ".src ='"  + imgs[i] + "'");
                   if (imgs[i].indexOf('/images/portlet/base/open.gif')  > -1
                       ||
                       imgs[i].indexOf('/images/portlet/base/close.gif') > -1 )
                   {
                       continue;
                   }
                   var hover = imgs[i].substring(0, dot) + "_hover" + imgs[i].substring(dot, imgs[i].length);
                   eval("img" + i + "_ = new Image();" + "img" + i + "_.src ='" + hover   + "'");
               }
           }
        }
    }

    function hover(imgName, imgSrc) {
       if (document.images && document[imgName]) {
                  document[imgName].src = eval( imgSrc + '_hover.src' );
       }
    }

    function off(imgName, imgSrc) {
       if (document.images && document[imgName]) {
          document[imgName].src = eval( imgSrc + '.src' );
       }
    }

    shopWindow = top;
    shopWindow.name = "shopWindow";

    var helpWindow = null;
    function getHelpWindow(url) {
        if (!helpWindow || helpWindow.closed) {
            helpWinFormat = "width=600,height=600,toolbar=no,location=no,scrollbars=yes,status=0,resizable=yes,left=5,top=5,screenX=5,screenY=5";
            helpWindow = window.open(url, "helpWindow", helpWinFormat);
        }
        if (helpWindow) helpWindow.focus();
    }

    function submitForm(name) {
        eval('document.' + name + '.submit()');
    }

/* START: http://www.dhtmlgoodies.com/index.html?whichScript=bubble_tooltip */
    function showToolTip(e,text){
        if(document.all)e = event;
        var obj = document.getElementById('bubble_tooltip');
        var obj2 = document.getElementById('bubble_tooltip_content');
        obj2.innerHTML = text;
        obj.style.display = 'block';
        var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
        if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
        var leftPos = e.clientX - 100;
        if(leftPos<0)leftPos = 0;
        obj.style.left = leftPos + 'px';
        obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';
    }
    function hideToolTip() {
        document.getElementById('bubble_tooltip').style.display = 'none';
    }
/* END: http://www.dhtmlgoodies.com/index.html?whichScript=bubble_tooltip */

    var win=null;
    function NewWindow(mypage,myname,w,h,pos,infocus){
    if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
    settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
    win.focus();
    }

    var win=null;
    function NewWindowScroll(mypage,myname,w,h,pos,infocus){
    if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
    settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
    win.focus();
    }

    function objProp(Objekt) {
       oe = window.open('','oe','height=250,width=160,screenX=5,screenY=5,scrollbars=yes,resizable=yes');
       oe.moveTo(5, 5);
       oe.document.open();
       for (Eigenschaft in Objekt) {
           oe.document.write(Eigenschaft + "::" + Objekt[Eigenschaft] + "<br>");
       }
       oe.document.close();
       oe.focus();
    }

    var tw = null;
    function trace(txt) {
       if (!tw || tw.closed) tw = window.open('','tw','height=500,width=160,screenX=5,screenY=5,scrollbars=yes,resizable=yes');
       tw.moveTo(5, 5);
       tw.document.write(txt + '<br>');
       tw.focus();
    }
    
    function setFrameHeight(h) {
        if (!document.all) {
        	document.getElementById('contentframe').height = h;
        } else if(document.all) {
             document.all.contentframe.style.height = h;
        }
	} 
    
    function fixPrice4calc(price) {
        return price.replace(/\s+/, '').replace(/\./, '').replace(/\,/, '.');
    }
    function fixQuantity4calc(q) {
        return q.replace(/\,/, '.');
    }
    
    // Asynchroner Ajax Aufruf der eine url holt und das Ergbnis
    // in das übergebene DIV Tag schreibt.
    function getRecommendations(url, div) {
	var xmlhttp;
	if (window.XMLHttpRequest) {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4) {
	        //schreibe die antwort in den div container mit der id content 
	        document.getElementById(div).innerHTML = xmlhttp.responseText;
		  }
		}
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
    
    