// ------------------------------------------------------------------------------------------
//  File: wwp_scripts.js
//	Desc: wwp javascripts fuer die standard wwp features
//  Version: 0.9
//  Datum:   04/05/2001
//  History:
//  28/04/2001 lsimma
//    	+ Version, Datum und History eingefuegt   
//    	! an default_wwp.xsl version 0.9 angepasst
//	01/05/2001 lsimma
//			+ Rollovereffekte fuer Images mit viewImg und loadImg realisiert
//			  Diese funktion kann auch zum Austausch von Bildern andersweitig verwendet werden 
//				bsp. Agentur-BAP einblenden von Mitarbeiterbildern
//	01/05/2001 lsimma
//			+ globale Variable lang, wird vom XSL automatisch uebergeben nachdem das script geladen wurde
//				ist dann global verwendbar zur ermittlung welche sparche die webseite hat
// 			+ mehrsprachiges Messages ueber getMsg(id) abrufbar
//      09/08/001 lsimma
//                      + messages in www_scripts_form verlagert da nur in forms verwendet
// ------------------------------------------------------------------------------------------

var refer=true;
function combo() {
if (refer) {
  document.all.contents.style.visibility="visible";
  refer=false;
}
else {
  document.all.contents.style.visibility="hidden";
  refer=true;
}
}


// kA wie man das beschreibt .. aufklappen und zusammen klappen mit javascript flash effekt
function hide(direct)
  {
    if(document.getElementById(direct).style.display=="none") {
		document.getElementById(direct).style.display = "block";
		} else {
		document.getElementById(direct).style.display = "none";
		}
}


// Diese Varible wird durch das XSL im HEAD vom HTML gesetzt mit de, en oder it
function setLang(l) {
	lang=l;	
}

// Rollovereffekte bei Images
// ermoeglicht preloading mit der fkt. rolloverLoad()
loadedImages=new Array();

function viewImg(imgid,name) {
	var img1=document.images[imgid];
	var img2=loadedImages[name];

	if (img1&&img2) { // pruefen ob beide objekte vorhanden sind
		img1.src=img2.src;
	}
}

function loadImg(name,img) {
  loadedImages[name]=new Image();
  loadedImages[name].src=img;
}

// Oeffnen von Seiten in neuen Fenstern
function openpopup(url,width,height) {
	if (width != "" && height != "") {
		win1 = window.open(url, "_new_","width="+width+",height="+height+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else if (width != "")  {
		win1 = window.open(url, "_new_","width="+width+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else if (height != "")  {
		win1 = window.open(url, "_new_","height="+height+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else {
		win1 = window.open(url, "_new_","toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	}
	win1.focus();
}

// Oeffnen von Seiten in neuen Fenstern
function openpopup1(url,width,height) {
	if (width != "" && height != "") {
		win1 = window.open(url, "_new1_","width="+width+",height="+height+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else if (width != "")  {
		win1 = window.open(url, "_new1_","width="+width+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else if (height != "")  {
		win1 = window.open(url, "_new1_","height="+height+",toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	} else {
		win1 = window.open(url, "_new1_","toolbar=no,directories=no,status=no,scrollbars=auto,resizable=yes,location=no,menubar=no");
	}
	win1.focus();
}

// Oeffnen von Seiten in neuen Fenstern
function openpopup2(url,width,height) {
	if (width != "" && height != "") {
		win1 = window.open(url, "_checkout_","width="+width+",height="+height+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=yes");
	} else if (width != "")  {
		win1 = window.open(url, "_checkout_","width="+width+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=yes");
	} else if (height != "")  {
		win1 = window.open(url, "_checkout_","height="+height+",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=yes");
	} else {
		win1 = window.open(url, "_checkout_","toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=yes");
	}
	win1.focus();
}


function openwindow(url,width,height) {
	if (width != "" && height != "") {
		win1 = window.open(url, "_new_","width="+width+",height="+height+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else if (width != "")  {
		win1 = window.open(url, "_new_","width="+width+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else if (height != "")  {
		win1 = window.open(url, "_new_","height="+height+",toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	} else {
		win1 = window.open(url, "_new_","toolbar=yes,directories=yes,statusbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,dependent=yes");
	}
	win1.focus();
}

function closewindow() {
	self.close();
}

function openSiteInOpener(url) {
	opener.location.href=url;
	self.close();
}


