/* ******************************************************************************
	CROSSBROWSER-FUNKTIONEN FÜR VERSCHIEDENE BROWSER
******************************************************************************* */


// Browsertyp ermitteln (und in B_Type speichern)
var B_Type = new crossBrowserType();
function crossBrowserType() {
	this.IE = false;
	this.NS4 = false;
	this.NS6 = false;
	this.id = "";

	if (document.all) {this.IE = true; this.id = "IE";}
	else if (document.getElementById) {this.NS6 = true; this.id = "NS6";}
	else if (document.layers) {this.NS4 = true; this.id = "NS4";}
}

// Mausposition zurückgeben
var crossMouseX, crossMouseY;
if (B_Type.NS4) document.captureEvents(Event.MOUSEMOVE);

function crossMousePosition(e) {
	if (B_Type.IE) {
		crossMouseX=event.x + document.body.scrollLeft; 
		crossMouseY=event.y + document.body.scrollTop;
	}
	else {crossMouseX=e.pageX; crossMouseY=e.pageY;}
}


// browserspezifisches DHTML-Objekt anhand von ID zurückgeben
function crossGetObject(id) {
	var obj = null;
	if (B_Type.IE) obj=document.all[id];
	else if (B_Type.NS6) obj=document.getElementById(id);
	else if (B_Type.NS4) obj=document.layers[id];
	return obj;
}

// Text in DHTML-Objekt ausgeben
function crossWrite(obj, text) {
		
	if (B_Type.IE) obj.innerHTML = text;
	else if (B_Type.NS6) obj.innerHTML = text;
	else if (B_Type.NS4) {
		obj.document.open();
		obj.document.write(text);
		obj.document.close();
	}
}

// verfügbare Fensterbreite ermitteln
function crossInnerWindowWidth() {
	var val;
	if (B_Type.IE) val=document.body.clientWidth;
	else if (B_Type.NS6) val=window.innerWidth;
	else if (B_Type.NS4) val=window.innerWidth;
	return val;
}

// tatsächliche Fensterbreite ermitteln
function crossOuterWindowWidth() {
	var val;
	if (B_Type.IE) val=document.body.offsetWidth;
	else if (B_Type.NS6) val=window.outerWidth;
	else if (B_Type.NS4) val=window.outerWidth;
	return val;
}

// verfügbare Fensterhöhe ermitteln
function crossInnerWindowHeight() {
	var val;
	if (B_Type.IE) val=document.body.clientHeight;
	else if (B_Type.NS6) val=window.innerHeight;
	else if (B_Type.NS4) val=window.innerHeight;
	return val;
}

// Scroll-Position ermitteln, "y" = vertikal, "x" = horizontal
function crossGetScroll(achse) {
	var val;
	if (!achse || achse == "y") {  // vertikale Achse
		if (B_Type.IE) val=document.body.scrollTop;
		else if (B_Type.NS6) val=window.pageYOffset;
		else if (B_Type.NS4) val=window.pageYOffset;
	}
	else {  // horizontale Achse
		if (B_Type.IE) val=document.body.scrollLeft;
		else if (B_Type.NS6) val=window.pageXOffset;
		else if (B_Type.NS4) val=window.pageXOffset;
	}
	return val;
}

// Scroll-Position setzen
function crossSetScroll(x, y) {
	window.scrollTo(x, y);
}


// Objekt positionieren x/y
function crossMoveTo(obj, x, y) {
	if (B_Type.IE) {obj.style.pixelLeft=x; obj.style.pixelTop=y;}
	else if (B_Type.NS4) {obj.left=x; obj.top=y;}
	else if (B_Type.NS6) {obj.style.left=x+"px"; obj.style.top=y+"px";}
}

// Objekt-Position ermitteln
function crossGetPositionX(obj) {
	if (B_Type.IE) return obj.style.pixelLeft;
	else if (B_Type.NS4) return obj.left;
	else if (B_Type.NS6) return parseInt(obj.style.left);
}
function crossGetPositionY(obj) {
	if (B_Type.IE) return obj.style.pixelTop;
	else if (B_Type.NS4) return obj.top;
	else if (B_Type.NS6) return parseInt(obj.style.top);
}

// Objekt anzeigen
function crossShowObject(obj) {
	if (B_Type.IE || B_Type.NS6) {obj.style.visibility="visible";}
	else if (B_Type.NS4) {obj.visibility="show";}
}
// Objekt ausblenden
function crossHideObject(obj) {
	if (B_Type.IE || B_Type.NS6) {obj.style.visibility="hidden";}
	else if (B_Type.NS4) {obj.visibility="hide";}
}


// Hintergrund-Farbe setzen
function crossBackgroundColor(color, obj) {
	if (typeof obj == "undefined") {document.bgColor=color; return;}
	if (B_Type.IE || B_Type.NS6) {obj.style.backgroundColor=color;}
	else if (B_Type.NS4) {obj.document.bgColor=color;}
}


// Hintergrund-Bild setzen
function crossBackgroundImage(obj, img) {
	if (B_Type.IE || B_Type.NS6) {obj.style.backgroundImage="url(" + img + ")";}
	else if (B_Type.NS4) {obj.background.src = img;}
}





/* ******************************************************************************
	TEASER-FUNKTIONEN FÜR VERSCHIEDENE BROWSER
******************************************************************************* */

//  Globale Initialisierung:
var TeaserCBack      = "#eeeeee";    // Standardhintergrundfarbe
var TeaserHBild      = "background='../layout/mainmenu/bgteaser.gif'" // Standardhintergrundbild, z. B. TeaserHBild = "background='pfad/name.typ'"
var TeaserCRand      = "#ff0000";    // Randfarbe
var TeaserCText      = "#333333";    // Textfarbe
var TeaserBreite     = 130;          // Teaser-Breite (Vorgabewert)
var TeaserHRand      = 10;           // Horizontaler Sicherheitsabstand vom Fensterrand
var TeaserBorder     = 0;            // Randstärke
var TeaserPadding    = 1;            // Cellpadding für Messagetext
var TeaserFont       = "font-size:10px;font-family:Verdana,Arial,Helvetica,Sans-Serif;padding:10px;border:1px solid #333333;"; // abschliessendes Semikolon, ohne Textfarbe
var TeaserHDir       = 0;            // Hor. Ausrichtung; 0=rechts 1=links
var TeaserVDir       = 0;            // Ver. Ausrichtung; 0=unten  1=oberhalb
var TeaserVRand      = 90;           // Schwellwert für Wechsel der V-Ausrichtung am unteren Rand
var TeaserH0Space    = -5;           // Horizontaler Abstand, wenn Teaser rechts vom Cursor
var TeaserH1Space    = -15;          // Horizontaler Abstand, wenn Teaser links vom Cursor
var TeaserV0Space    = 18;           // Vertikaler Abstand vom Cursor, wenn Teaser unterhalb des Cursors ist
var TeaserV1Space    = 0;            // Vertikaler Abstand vom Cursor, wenn Teaser oberhalb des Cursors ist
var TeaserShow       = false;        // Anzeige aktiv/inaktiv

//  Lokale Initialisierung:
var Teaser           = null;         // das DIV-Objekt
var aktTeaserBreite;                 // aktueller Speicher für Teaserbreite
var aktTeaserHDir    = 0;            // aktuelle horizontale Ausrichtung des Teasers
var aktTeaserHDef    = 0;            // Hor. Wunschausrichtung bei Aufruf
var aktTeaserVDir    = 0;	     // aktuelle vertikale Ausrichtung des Teasers

// Teaser-Objekt (div) festlegen
function initTeaser(id, dir, bgcolor, breite) {
	document.onmousemove = cursorMove;

	aktTeaserHDef = TeaserHDir;  // Globalen Wert übernehmen
	aktTeaserHDir = TeaserHDir;  // Globalen Wert übernehmen
	aktTeaserVDir = TeaserVDir;  // Globalen Wert übernehmen
	aktTeaserBreite = TeaserBreite;  // Globalen Wert übernehmen

	if (dir && dir == 0) aktTeaserHDef = 0;
	if (dir && dir == 1) aktTeaserHDef = 1;
	if (bgcolor) TeaserBack = bgcolor;
	if (breite && breite>20) aktTeaserBreite = breite;
	Teaser = crossGetObject(id);
	if (Teaser == null) {
		alert("div für Teaser [ " + id + "] fehlt!");
		showTeaser = noTeaser; hideTeaser = noTeaser;
	}
	TeaserShow = false;
}


function noTeaser() 
	{ } // Funktionsaufrufe abfangen


// Teaser kreieren und anzeigen
function showTeaser(msg, dir, breite, bgpicture, txcolor, bgcolor, rdcolor) {
	var b_Back, b_Text, b_Bild;
	var relWidth, relHeight;

	if (Teaser == null) return;


	if (breite && breite > 40) aktTeaserBreite = breite;
	else aktTeaserBreite=TeaserBreite;

	if (bgpicture) b_Bild=bgpicture;
	else b_Bild=TeaserHBild;

	if (txcolor) b_Text=txcolor;
	else b_Text=TeaserCText;

	if (bgcolor) b_Back=bgcolor;
	else b_Back=TeaserCBack;

	if (rdcolor) b_Rand=rdcolor;
	else b_Rand=TeaserCRand;


//	b_span = '<span style=\"'  + TeaserFont + '\color:' + b_Text + '\" >';
//	alert(b_span)
	msg = '<table width=' + aktTeaserBreite + ' border=0 cellpadding=' + TeaserBorder + ' cellspacing=0 bgcolor=\"' + b_Rand + '\"><tr><td><table width=100% border=0 cellpadding=' + TeaserPadding + ' cellspacing=0 bgcolor=\"' + b_Back + '\"' + b_Bild +'><tr><td style=\"'  + TeaserFont + '\color:' + b_Text + '\" >' + msg + '</td></tr></table></td></tr></table>';

	if (!dir) aktTeaserHDef = TeaserHDir;
	else aktTeaserHDef = dir;
	aktTeaserHDir = aktTeaserHDef; 

	relWidth = crossInnerWindowWidth() + crossGetScroll("x");
	relHeight = crossInnerWindowHeight() + crossGetScroll("y");

	aktTeaserHDir = aktTeaserHDef;
	if (crossMouseX + aktTeaserBreite + TeaserH0Space + TeaserHRand > relWidth) aktTeaserHDir = 1;
	else if (crossMouseX < aktTeaserBreite + TeaserH1Space) aktTeaserHDir = 0;

	aktTeaserVDir = TeaserVDir;
	if (crossMouseY + TeaserVRand + TeaserV0Space > relHeight) aktTeaserVDir = 1;
	else aktTeaserVDir = 0;
	crossWrite(Teaser, msg);
	TeaserShow = true;
	crossShowObject(Teaser);
}


function hideTeaser() {
	if (Teaser == null) return;
	crossHideObject(Teaser);
	TeaserShow=false;
	crossMoveTo(Teaser, -300, -200);
}


// der Maus folgen
function cursorMove(e) {
	var posX, posY, aktWidth, aktHeight;
	crossMousePosition(e);
	if (TeaserShow) {
		// Sicherstellen, dass der Teaser horizontal im Fensterbereich bleibt
		aktWidth = crossInnerWindowWidth() + crossGetScroll("x");

		aktTeaserHDir = aktTeaserHDef;
		if (crossMouseX + TeaserBreite + TeaserH0Space + TeaserHRand > aktWidth) aktTeaserHDir = 1;
		else if (crossMouseX < aktTeaserBreite + TeaserH1Space) aktTeaserHDir = 0;

		// Sicherstellen, dass der Teaser vertikal im Fensterbereich bleibt
		aktHeight = crossInnerWindowHeight() + crossGetScroll("y");
		if (crossMouseY + TeaserVRand + TeaserV0Space > aktHeight) 
			{ aktTeaserVDir = 1; }
		else  aktTeaserVDir = 0;

		if (aktTeaserHDir==0) {
			posX = crossMouseX + TeaserH0Space; 
			if (aktTeaserVDir==0) {posY = crossMouseY + TeaserV0Space;}
			else {posY = crossMouseY - TeaserVRand - TeaserV1Space;}
		}
		else {
			posX = crossMouseX - aktTeaserBreite - TeaserH1Space;
			if (aktTeaserVDir==0) {posY = crossMouseY + TeaserV0Space;}
			else {posY = crossMouseY - TeaserVRand - TeaserV1Space;}
		}
		crossMoveTo(Teaser, posX, posY)
	}
}





/* ******************************************************************************
	SONSTIGE FUNKTIONEN FÜR VERSCHIEDENE BROWSER
******************************************************************************* */
function makeSPlink() {
	if (document.all && navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("Mac")==-1) 
	document.write('<A href="javascript:makeSPhref();" onClick="makeSP(this);" onfocus="this.blur()" alt="" title="" class="welcomerb"style="font-size: 11px;" >&nbsp;Startseite&nbsp;</a> |');
}

function makeSP(who) {
	who.style.behavior='url(#default#homepage)';
	who.setHomePage('http://www.tecnovativ.de');
}


function makeFVlink() {
	if (document.all && navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("Mac")==-1) 
	document.write('| <a href="javascript:makeSPhref();" onClick="makeFV();" onfocus="this.blur()" alt="" title="" >&nbsp; Zu Favoriten &nbsp;</a>');
}

function makeFV() {
	window.external.AddFavorite('http://www.ingrid-maria-bertram.de', 'ingrid-maria-bertram.de ... Apothekerin und Autorin');
}


function makeSPhref() { }

function oW(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=yes,width=" + w + ",height=" + h + ",left=10,top=20")
  newWin.focus()
}

function oWNo(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=no,width=" + w + ",height=" + h + ",left=10,top=20")
  newWin.focus()
}

function oWAuto(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=auto,width=" + w + ",height=" + h + ",left=10,top=20")
  newWin.focus()
}

function oWcslemail(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=no,width=" + w + ",height=" + h +",left=10, top=15");
  newWin.focus();
}

function EF(URL1,F1)
{  
  parent.frames[F1].location.href=URL1;
}

function ZF(URL1,F1,URL2,F2)
{  
  parent.frames[F1].location.href=URL1;
  parent.frames[F2].location.href=URL2;
}

function DF(URL1,F1,URL2,F2,URL3,F3)
{  
  parent.frames[F1].location.href=URL1;
  parent.frames[F2].location.href=URL2;
  parent.frames[F3].location.href=URL3;
}

function VF(URL1,F1,URL2,F2,URL3,F3,URL4,F4)
{  
  parent.frames[F1].location.href=URL1;
  parent.frames[F2].location.href=URL2;
  parent.frames[F3].location.href=URL3;
  parent.frames[F4].location.href=URL4;
}

function zoomExample(bereich,bild,ausrichtung) {
	if (ausrichtung == "h"){
		zoom = window.open('zoom.html',bereich+bild+ausrichtung,'width=640,height=480');
		zoom.focus();
	} else {
		zoom = window.open('zoom.html',bereich+bild+ausrichtung,'width=480,height=640');
		zoom.focus();
	}
}

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.0
  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 && document.getElementById) x=document.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];}
}

function swap_font() 
{
	akt_url_name=self.location+"";
        akt_url_name=akt_url_name.toLowerCase();
	akt_url_name=akt_url_name.replace("#top","");
	if ( parent.akt_css_nfont=='12' ) { parent.akt_css_nfont='14'; parent.akt_css_refer = '<style> .langtext { font-size: 14px; } .maintext { font-size: 14px; }</style>'; }
	else { parent.akt_css_nfont='12'; parent.akt_css_refer = '<style> .langtext { font-size: 12px; } .maintext { font-size: 12px; }</style>'; }
	location.href=akt_url_name;
	return;
}

function swap_font_refer()
{
	if ( parent.akt_css_nfont=='12' ) { document.write(parent.akt_css_refer); }
	else if ( parent.akt_css_nfont=='14') { document.write(parent.akt_css_refer); }
	else { document.write('<style> .langtext { font-size: 12px; } .maintext { font-size: 12px; }</style>'); }
	return;
}

  function nachoben() 
  {
	akt_url_name=self.location+"";
        akt_url_name=akt_url_name.toLowerCase();
	akt_url_name=akt_url_name.replace("#top","");
	location.href=akt_url_name+"#top";
	return;
  }

function ddatum()
	{
		var DOWArray = new initArray("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
		var MOYArray = new initArray("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
		var modate = new Date();
		jahr = modate.getYear();
		if (jahr < 80) 
			jahr += 2000;
		else if (jahr >= 80 && jahr < 200)
			jahr += 1900;
		monat = MOYArray[modate.getMonth()+1];
		motag = modate.getDate();
		if (motag < 10)
			motag = "0"+motag;
		wotag=DOWArray[(modate.getDay()+1)];
		ergeb =wotag+", "+motag+". "+monat+" "+jahr;
		return(ergeb)
	}

  
function shopdatum()
  {
	var DOWArray = new shopdinit("So","Mo","Di","Mi","Do","Fr","Sa");
	var modate = new Date(document.lastModified);
	jahr = modate.getYear();
	if (jahr < 80) { jahr += 2000; }
	else if (jahr >= 80 && jahr < 200) { jahr += 1900; }
	monat = modate.getMonth()+1;
	if (monat < 10) { monat="0"+monat; }
	motag = modate.getDate();
	if (motag < 10) { motag="0"+motag; }
	wotag=DOWArray[(modate.getDay()+1)];
	ergeb =wotag+'., '+motag+'.'+monat+'.'+jahr;
	return(ergeb);
  }

function dokdatum()
{
	var modate = new Date(document.lastModified);
	jahr = modate.getYear();
 	if (jahr < 80) { jahr += 2000; }
  	else if (jahr >= 80 && jahr < 200) { jahr += 1900; }
	monat = modate.getMonth()+1;
	if (monat < 10) { monat = "0"+monat; }
	motag = modate.getDate();
	if (motag < 10) { motag = "0"+motag; }
	dokergeb =motag+"."+monat+"."+jahr;
return(dokergeb);
}


		function swappicsprofil()
		{
			if (swappicnr=="1")
			{
				document.swappic1.src="toppic/wortmann.jpg";
				document.swappic2.src="toppic/mmv-leasing20.jpg";
				document.swappic3.src="toppic/comteam12.jpg";
				swappicnr="2";
			}
			else if (swappicnr=="2")
			{
				document.swappic1.src="toppic/mmv-leasing.jpg";
				document.swappic2.src="toppic/comteam20.jpg";
				document.swappic3.src="toppic/wortmann12.jpg";
				swappicnr="3";
			}
			else
			{
				document.swappic1.src="toppic/comteam.jpg";
				document.swappic2.src="toppic/wortmann20.jpg";
				document.swappic3.src="toppic/mmv-leasing12.jpg";
				swappicnr="1";
			}
		}



		function swappicswebdesign()
		{
			if (swappicnr=="1")
			{
				document.swappic1.src="toppic/site2.jpg";
				document.swappic2.src="toppic/site316.jpg";
				document.swappic3.src="toppic/site412.jpg";
				document.swappic4.src="toppic/site510.jpg";
				document.swappic5.src="toppic/site108.jpg";
				swappicnr="2";
			}
			else if (swappicnr=="2")
			{
				document.swappic1.src="toppic/site3.jpg";
				document.swappic2.src="toppic/site416.jpg";
				document.swappic3.src="toppic/site512.jpg";
				document.swappic4.src="toppic/site110.jpg";
				document.swappic5.src="toppic/site208.jpg";
				swappicnr="3";
			}
			else if (swappicnr=="3")
			{
				document.swappic1.src="toppic/site4.jpg";
				document.swappic2.src="toppic/site516.jpg";
				document.swappic3.src="toppic/site112.jpg";
				document.swappic4.src="toppic/site210.jpg";
				document.swappic5.src="toppic/site308.jpg";
				swappicnr="4";
			}
			else if (swappicnr=="4")
			{
				document.swappic1.src="toppic/site5.jpg";
				document.swappic2.src="toppic/site116.jpg";
				document.swappic3.src="toppic/site212.jpg";
				document.swappic4.src="toppic/site310.jpg";
				document.swappic5.src="toppic/site408.jpg";
				swappicnr="5";
			}
			else
			{
				document.swappic1.src="toppic/site1.jpg";
				document.swappic2.src="toppic/site216.jpg";
				document.swappic3.src="toppic/site312.jpg";
				document.swappic4.src="toppic/site410.jpg";
				document.swappic5.src="toppic/site508.jpg";
				swappicnr="1";
			}
		}










/* ********************************************************************
   Datei: csle.js (c) 2000-2003, zuletzt aktualisiert: 26.05.2011 by ee
*********************************************************************** */

