 // foto.js// Funktionen f\u00FCr Fotodownload + Leuchtkastenfunction test1() {	if( dlgMode == null ) {dlgMode = false; }	if( dlgMode) {		if ( !confirm("Die aktuelle Lieferanschrift ist Ihre Rechnungsanschrift.\nM\u00F6chten Sie Ihre Rechnungsanschrift \u00E4ndern?") ) {			return;			}	}}function doLupe(evnt, id, GrafikOrientation ) {	//alert("doLupe id=" + id);	//getCurPos();	getThisPos(evnt);	//alert( "curX:" + curX + " ||| curY:"  + curY);		if ( GrafikOrientation == "quer") {		var y = curY - 400;		}	else {		var y = curY - 520;	}		var x = curX - 340;	//window.status = "x:" + x + " ||| y:"  + y ;	divToggle(id,x, y ) ;}function doLupeHP(evnt, id, GrafikOrientation ) {	// Auf Homepage	//alert("doLupeHP id=" + id);	getThisPos(evnt);		if ( GrafikOrientation == "quer") {		var y = curY - 400;		}	else {		var y = curY - 520;	}		var x = curX - 2;	//window.status = "x:" + x + " ||| y:"  + y ;	divToggle(id,x, y ) ;}function doDownload(url) {	//alert("doDownload");	LoadInDownloadWindow(url,'600','600')		}oldDiv = null;function divToggle(id,divLeft, divTop) {	//alert("foto.js - divToggle");	//var ThisForm = document.forms[0];		if (oldDiv == id) {			// Div ist eingeblendet ***********************************			//alert("Aktuelles Div ausblenden1");		divOff(id);					// Button auf low		//alert("Aktuelles Div ausblenden1");			var butid = strLeft(id,"Div") + strRight(id,"Div") + "Img";		rOUT(butid);	}	else {				// Div ist ausgeblendet *****************************************			//alert("Neues Div einblenden1");		// alten Button auf low		if(oldDiv != null) {			var butid = strLeft(oldDiv,"Div") + strRight(oldDiv,"Div") + "Img";			rOUT(butid);			// altes Div ausblenden			divOff(oldDiv);				}				//alert("Neues Div einblenden2");				//Neuer  Button auf high		var butid = strLeft(id,"Div") + strRight(id,"Div") + "Img";		rOVER(butid);		// Neues Div einblenden		divOn(id,divLeft, divTop);								}}function divOn(id,divLeft, divTop) {//	alert("divOn: " + id);	if( id == null | id=="" ) { 		return ;	}		var div = document.getElementById(id);	if(!div) { 		//alert(id + " nicht gefunden");		return;	}	var o = div.style;		if( divLeft != null) {		//divLeft = divLeft - 500 ;		o.left = divLeft ;	}	if( divTop != null) {		//divTop = divTop - 500 ;		o.top = divTop ;	}	//o.top = TopVal ;		o.display = "inline";	//o.visibility = "visible";	oldDiv = id;}function divOff(id){	//alert("divOff: " + id);	if( id == null | id=="" ) { 		return ;	}			var div = document.getElementById(id);	if(!div) { 		//alert(id + " nicht gefunden");		return;	}	var o = div.style;	o.display = "none";	//o.visibility = "hidden";		oldDiv = null;}//******************************************************************//******************  Leuchtkasten-Funktionen ******************function createLeuchtkasten(noteid, unid) {	//alert("createLeuchtkasten: noteid=" + noteid);	var never = new Date()	never.setTime(never.getTime() + 2000*24*60*60*1000);	var expString = never.toGMTString();	var ThisForm = document.forms[0];	var id = ThisForm.NewLeuchtkastenID.value;	var expires = expString;	var path = "/";	var domain = "";	var secure = "";	setCookie( "LeuchtkastenID", id, expires, path, domain, secure) ;	if ( noteid )  {		addToLeuchtkasten( noteid, unid ) 	}	else {		document.location.href = document.location.href ;	}}function addToLeuchtkastenView( noteid, unid ) {  	//alert("addToLeuchtkastenView: " + noteid + " - - " + unid );	var msg = "";	if( unid == null ) {unid = ""; }		var LeuchtkastenID = getCookie( "LeuchtkastenID" );		if (LeuchtkastenID == "") {		msg = "Sie haben noch keinen Leuchtkasten angelegt.\nM\u00F6chten Sie das jetzt tun?\nDabei wird ein Cookie gesetzt.";		if ( confirm(msg) ) {			createLeuchtkasten(noteid, unid) ;			return;		}		else {			return;		}	}	addToLeuchtkasten(noteid, unid)}function addToLeuchtkasten(noteid, unid ) {	//alert("addToLeuchtkasten");	// var imgname = "addToLeuchtkasten" + noteid ;// UNID zu LeuchtkastenUNIDArr hinzuf\u00FCgen	var thisArr = LeuchtkastenUNIDArr ;	//alert("thisArr=" + thisArr );			if( thisArr[0] == "" ) {		thisArr[0] = unid ;	} 	else {		// Pr\u00FCfen, ob unid schon in thisArr steht		var IsInArr = false ;		for (var i=0; i<thisArr.length; i++) {			if( thisArr[i] == unid ) {				IsInArr = true;			}		}		if( IsInArr == true ) {			alert("Das Foto liegt bereits auf Ihrem Leuchtkasten.");			return;		}		else {			thisArr[thisArr.length] = unid;		}			}	//alert("thisArr2=" + thisArr );			var imgID = "GL" + unid +  "Img"	AgentImg = document.getElementById( imgID );	if( !AgentImg) {		alert("AgentImg " + imgID + " nicht gefunden");		return;	}	// Agent gibt retimgname zur\u00FCck	var AgentImgSrc = replacestring( AgentImg.src, "L.gif","H.gif", false);	if( AgentImgSrc == AgentImg.src ) {		//alert( "Ist schon HIGH");		//return;	}				var url = ThisDBurl + "/addThisToLeuchtkastenView?OpenAgent&NOTEID=" + noteid + "&UNID=" + unid + "&IMGSRC=" + AgentImgSrc   ;	//alert("url=" + url ) ;	//alert("AgentImgSrc=" + AgentImgSrc);		AgentImg.src = url ;				// Produktiv	//window.location.href = url ;	// DEBUG		//open(url);								// DEBUG			//AgentImg.src = replacestring( AgentImg.src, "L.gif","H.gif", false);	//AgentImg.name = "AufLeuchtkasten";	//AgentImg.alt = "Das Foto liegt auf Ihrem Leuchtkasten";			// Links markieren	window.setTimeout("markLeuchtkasten()", 100);	// Anzahl im Leuchtkasten aktualisieren	var  o = document.getElementById( "LeuchtKastenAnz" );	if( o ) {		//alert(o.innerHTML);		var anz = thisArr.length ;		//var msg = "LEUCHTKASTEN (" + anz + ")";		var msg =  anz ;		if( o.innerText ) {			o.innerText = msg;				}		else {			o.innerHTML = msg;				}	}			return;}function delFromLeuchtkasten(unid) {	//alert("delFromLeuchtkasten");	var ReturnAddress = ThisDBurl + "/showLeuchtkasten?Open" ;	var url = ThisDBurl + "/deleteThisFromLeuchtkasten?Open&UNID="  + unid  + "&ReturnAddress=" + ReturnAddress ;	// alert(url);	window.location.href = url;}function delLeuchtkasten(cnt) {	//alert("delLeuchtkasten");			var go = confirm("Kompletten Leuchtkasten l\u00F6schen?\nZur Zeit liegen " + cnt + " Fotos auf dem Leuchtkasten.");	if( !go ) {	return;}		var url = ThisDBurl + "/deleteLeuchtkasten?Open" ;	// alert(url);	window.location.href = url;}function markLeuchtkasten() {	//alert("foto.js - markLeuchtkasten");	//alert("LeuchtkastenID=" + LeuchtkastenID );	try {		var thisArr = LeuchtkastenUNIDArr ;		//alert("thisArr=" + thisArr );			// IMG ersetzen		if( thisArr[0] != "" ) {  			for (var i=0; i<thisArr.length; i++) {				// divs pr\u00FCfen ung ggf markieren				var id = "GL" +  thisArr[i] + "Img";				//alert("id=" + id);				o = document.getElementById( id );				if(o) {					//alert("o.src=" + o.src );					var imgSrc = o.src ;					imgSrc = replacestring(imgSrc,"L.", "H.");					o.src = imgSrc ;										o.name = "AufLeuchtkasten";					o.alt = "Das Foto liegt auf Ihrem Leuchtkasten";				}												// Links pr\u00FCfen ung ggf. Title setzen				var id = "GL" +  thisArr[i] + "Link";				o = document.getElementById( id );				if(o) {					//alert("o.title=" + o.title );					o.title = "Das Foto liegt auf Ihrem Leuchtkasten";				}															// Text ersetzen				var id = "GL" +  thisArr[i] + "Div";				//alert("id=" + id);				o = document.getElementById( id );				if(o) {					var className = strLeft(o.className,"hot") ;					if( right(o.className,3) != "hot" ) {						o.className = className + "hot";										}					o.innerHTML = "LIEGT AUF LEUCHTKASTEN";				}											}					}			}	catch(e) {		alert( "Fehler in main.js - markLeuchtkasten:\n" + e.message );		return;	}}//******************  Leuchtkasten-Funktionen ******************//******************************************************************
