﻿//*******************************************//**** Globale Variablen - Configuration ****//*******************************************//********************//*** Browsercheck ***//********************var dom = document.getElementById ? true:false;var nn4 = !dom && document.layers ? true:false;var ie4 = !dom && !nn4 && document.all ? true:false;//**************************//*** SPAMSCHUTZ ***  //**************************// UnCryptMailto() entschluesselt die Mail-Adresse, zu zuvor mit// der PHP-Funktion encryptEmail() verschlüsselt wurde// Anwendung:/*<?php $link="javascript:linkTo_UnCryptMailto('".encryptEmail("john@doe.de")."');"; ?><a href="<?php echo $link ?>">E-Mail an John Doe schreiben</a>*/ // JS function for uncrypting spam-protected emails:function UnCryptMailto(s) {	//	var n=0;	var r="";	for(var i=0; i < s.length; i++) {		n=s.charCodeAt(i);		if (n>=8364) {n = 128;}		r += String.fromCharCode(n-(1));	}	return r;}  // JS function for uncrypting spam-protected emails:function linkTo_UnCryptMailto(s)	{	//	location.href="mailto:"+UnCryptMailto(s);}//******************//*** CSS WEICHE ***//******************document.write("<!--[if IE 5]>");	document.write("<link href='"+startpfad_+"css/ie6.css' rel='stylesheet' type='text/css' media='all'>");document.write("<![endif]-->");document.write("<!--[if IE 6]>");	document.write("<link href='"+startpfad_+"css/ie6.css' rel='stylesheet' type='text/css' media='all'>");document.write("<![endif]-->");//************************//*** TIMER FUNKTIONEN ***//************************var infoLayer=null;var TimeOutEvents=0; function checkInfoLayer(){	//var dummy=document.getElementById("infobox");	//dummy.innerHTML=infoLayer+"  "+TimeOutEvents;	if(infoLayer==null)	{		TimeOutEvents=0;	}	else	{		TimeOutEvents++;	}	if(TimeOutEvents==2)	{		infoLayer.style.visibility="visible";	}}//************************//*** MENUE FUNKTIONEN ***//************************// sind in "menue.js" vorhanden //***********************************************************//*** JAVACRIPT BEFEHLSERWEITERUNGEN***//***********************************************************//-------- Variable testen//--- Erwartet als Parameter den Namen der Variable in einem String.isDefined = function(variable){ 	return this[variable] === undefined ? false : true;};//----------- Stringfunction strReplace(strsearch, strreplace, haystack){	// Autor : Thomas B?chler	// Erstellt : 13.04.2004	// Beschreibung : Ersetzt alle strsearch innerhalb haystack durch strreplace	if ((haystack == null) || (strsearch == null))	{		return null;	}   	   	if ((haystack.length == 0) || (strsearch.length == 0))   	{   		return haystack;   	}    if ((strreplace == null) || (strreplace.length == 0))    {     	strreplace = "";    }    var len_strsearch = strsearch.length;    var len_strreplace = strreplace.length;    var Pos = haystack.indexOf(strsearch, 0);    while (Pos >= 0)    {    	haystack = haystack.substring(0, Pos) + strreplace + haystack.substring(Pos + len_strsearch);    	Pos = haystack.indexOf(strsearch, Pos + len_strreplace);    }        return haystack;}//-------- AJAXfunction createXMLHttpRequest() { var req = null;   try    {     req = new ActiveXObject("MSXML2.XMLHTTP");   }     catch (err_MSXML2) {     try     {       req = new ActiveXObject("Microsoft.XMLHTTP");     }     catch (err_Microsoft) {       if (typeof XMLHttpRequest != "undefined")         req = new XMLHttpRequest;     }   }   return req;}//***************************//*** FORMULAR FUNKTIONEN *** //***************************// Autor : Andreas Jaehrling// Erstellt : 13.07.06// Beschreibung: Die Funktionen "FieldContentDel" (onmousedown) und "FieldContentRestore" (onblur) werden typischerweise f?r ein E-Mail Feld mit dem vorgegebenen Wert "E-Mail" verwendet. function FieldContentDel(obj, val){	if(obj.value==val)	{		obj.value="";	}}function FieldContentRestore(obj, val){	if(obj.value=="")	{		obj.value=val;	}}// Autor : Andreas Jaehrling// Erstellt : 11.07.06// Beschreibung: Schreibt den Wert "val" ind das Formularobjekt "obj". function FormWriteValue(obj, val){	switch(obj.type)	{						case "select-one":			for(var f=0; f<obj.length; f++)			{				if(obj.options[f].value==val)				{					obj.options[f].selected=true;				}			}		break;		case "select-multiple":			for(var f=0; f<obj.length; f++)			{				if(obj.options[f].value==val)				{					obj.options[f].selected=true;				}			}		break;					case "checkbox":			obj.checked=true;		break;						case "radio": 			if(obj.elements[i].value == val)			{				obj.checked=true;			}		break;																default:			obj.value = val;		break;	}}//**************************//*** FENSTER FUNKTIONEN ***  //**************************function winArchivShow(img, directory){	// Autor : Andreas Jaehrling	// Erstellt : 18.08.2006	// Beschreibung: Erzeugt ein Zoom-Fenster mit einem Bild aus dem Archiv.	// Übergeben wird das Objekt (img) oder der Name des Originalbildes, sowei das Verzeichnis in dem innerhalb von "archiv/images/" gesucht wird. 	// Das Fenster passt sich der Größe des Bildes an. 		if(typeof(img)=="object")	{		img = img.src;	} 			var l=img.length;	var pos=img.lastIndexOf("/");	var fileName=img.substring(pos+1, l);	var img=img.substring(0,pos+1);	var newImage="archiv/images/"+directory+"/"+fileName;	 	 	winZoomShow(newImage, startpfad_);}function winBigShow(img){	// Autor : Andreas Jaehrling	// Erstellt : 09.08.2006	// Beschreibung: "Klassische" Version. Erzeugt ein Zoom-Fenster mit einem Bild als Inhalt. Übergeben wird das Objekt oder der Pfad des Originalbildes.	// Die Funktion geht davon aus dass das Bild im Verzeichnis "big" innerhalb des Verzeichnisses des Originalbildes liegt.	 		if(typeof(img)=="object")	{		img = img.src;	}	else	{		path = document.location.href;		var pos=path.lastIndexOf("/");		var path=path.substring(0,pos+1);		img=path+"images/"+img;	} 		var l=img.length;	var pos=img.lastIndexOf("/");	var fileName=img.substring(pos+1, l);	var img=img.substring(0,pos+1);	var newImage=img+"big/"+fileName;		winZoomShow(newImage, startpfad_);}function winZoomShow(img, startpfad){	// Autor : Andreas Jaehrling	// Erstellt : 22.06.2006	// Beschreibung: Erzeugt ein Zoom-Fenster mit einem Bild als Inhalt.	// Das Fenster passt sich der Größe des Bildes an. 		 	 	open(startpfad+"zoom/index.php?image="+img,"Zoom","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=150,height=150,screenX=20,screenY=20,top=20,left=20");}function winPageOpen(path, width, height){	// Autor : Andreas Jaehrling	// Erstellt : 23.06.2006	// Beschreibung: Erzeugt ein Zoom-Fenster mit einer Datei als Inhalt. Die aktuelle Bildschirmaufl?sung wird dabei ber?cksichtigt.		var buffer=50;	var width= width+buffer>screen.availWidth?screen.availWidth-buffer : width;	var height= height+buffer>screen.availHeight?screen.availHeight-buffer : height;  	open(path,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+width+",height="+height+",screenX=10,screenY=10,top=10,left=10");}//---------------- Zeigt ein "Infofenster" (Layer) beim Objektfunction showInfoLayer(e){	if(!e)		e=window.event;	var obj = (e.target) ? e.target : e.srcElement;	id=obj.id;	var Eltern = obj.offsetParent;	var x=obj.offsetLeft;	var y=obj.offsetTop;	while (Eltern) {		x=x+Eltern.offsetLeft;		y=y+Eltern.offsetTop;   		Eltern = Eltern.offsetParent;	}		var h = obj.offsetHeight;	var w = obj.offsetWidth;		if(infoLayer) hideInfoLayer();	infoLayer=document.getElementById("infoLayer");	infoLayer.innerHTML=prdImageText[id];	var ilWidth=infoLayer.offsetWidth;	infoLayer.style.left=(x+(w-10))+"px";		infoLayer.style.top=(y+10)+"px";}function hideInfoLayer(){	infoLayer.style.visibility="hidden";	infoLayer=null;	TimeOutEvents=0;}//-------------- Printversionfunction showPrintVersion(idName){	// Autor : Thomas Büchler	// Erstellt : 01.10.2004	// Geändert: 11.08.06 - Andreas Jährling - Neuer Aufbau der Seite	// Kommentar : ACHTUNG Version ohne Headline-Filterung		var textzelle = document.getElementById(idName);	var text = textzelle.innerHTML;		///////////////////// Links filtern			while (text.indexOf("href=\"") != -1)	{		var part0 = text.substr(text.indexOf("href=\"")+6,text.length);		var part1 = part0.substr(0,part0.indexOf("\""));					part1 = "href=\""+part1+"\"";		var newLnk = "";		text = strReplace(part1, newLnk, text);	}	///////////////////// Links filtern						if(text.length > 0)	{		text = strReplace("&lt;&lt; zurück", "", text);				neues_fenster = window.open('', "Window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=550,screenX=10,screenY=10,top=10,left=10");		neues_fenster.document.open();		var content ="<div id='button'><a href='javascript:self.print();'>"+item["print-window"]+"</a> <a href='javascript:self.close();'>"+item["close-window"]+"</a></div>";			content="<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>";			content=content+"<html>";				content=content+"<head>";					content=content+"<meta http-equiv='content-type' content=content+'text/html;charset=utf-8'>";					content=content+"<title>Printversion</title>";					content=content+"<link href='"+startpfad_+"css/printversion.css' type='text/css' rel='stylesheet' media='all'>";				content=content+"</head>";					content=content+"<body bgcolor='#ffffff'>";					content=content+"<div id='content'>";					content=content+"<p><img id='logo' src='"+startpfad_+"images/ebene2/printlogo.gif' alt='' border='0'></p>";						content=content+"<div id='button'><a href='javascript:self.print();'>"+item["print-window"]+"</a> <a href='javascript:self.close();'>"+item["close-window"]+"</a></div>";						content=content+"<div id='dynamicContent'>"+text+"</div>";						content=content+"<p><b>"+item["cus-company"]+"</b><br>"+item["cus-street"]+"</p>";						content=content+"<p>"+item["cus-zip"]+" "+item["cus-city"]+"</p>";						content=content+"<div class='phone'>"+item["phone"]+"</div><div class='number'>"+item["cus-phone"]+"</div>";						content=content+"<div class='phone'>"+item["fax"]+"</div><div class='number'>"+item["cus-fax"]+"</div>";						content=content+"<div class='phone'>E-Mail</div><div class='number'>"+item["cus-mail"]+"</div>";					content=content+"</div>";				content=content+"</body>";			content=content+"</html>";		with(neues_fenster.document)		{			writeln(content);		}		neues_fenster.document.close();		neues_fenster.focus();	}}