// ---------------------------------------------------------------------------------------	
// scripte fuer Sage ERP X3
// author michael schulze, www.ju-mi.com, 2008
// ---------------------------------------------------------------------------------------	

	
//---------------------------------------------------------------------------------------	
//allgemeine scripts
	//Bilder tauschen
	function swapImage(where, to) { 
		eval('window.document.' + where + '.src=' + to + '.src');
	}
	
//---------------------------------------------------------------------------------------	
//Ebenenfunktionen
	// Layer zeigen - verbergen
	function showLayer(layerName) {
		if (eval('document.getElementById("'+ layerName + '")')) {eval('document.getElementById("'+layerName+'").style.display="block"');}
	}
	function hideLayer(layerName) {
		if (eval('document.getElementById("'+ layerName + '")')) {eval('document.getElementById("'+layerName+'").style.display="none"');}
	}
	function hideAll(bereich, anzahl) {
		for(count=1; count <= anzahl; count++){
			if (eval('document.getElementById("'+ bereich + count +'")')) eval('document.getElementById("'+ bereich + count +'").style.display="none"');
		}	
	}
	
	
//---------------------------------------------------------------------------------------	
// Schutzfunktionen
	// E-Mail-Adresse sichern
	var domains = new Array();
	domains[0] = 'sage.de';
	domains[1] = 'sagebaeurer.de';
	
	function writeMail(dom,pre){
		document.write("<a href='mailto:" + pre + "@" + domains[dom] + "'>" + pre + "@" + domains[dom] + "</a>");
	}


	
//---------------------------------------------------------------------------------------	
//Formular-Funktionen
	function initForm(name){
		if (document.layers) {eval('ref="document.text.document.' + name + '";');}
		else				 {eval('ref="document.' + name + '";');}
	}
	
	function clearForm(name){
		if (confirm('Do you sure to reset your entries?') == true) {
			var ref="document." + name;
			eval(ref + '.reset()');
		}
	}
	
	
	
//---------------------------------------------------------------------------------------	
// Seitenspezifische Funktionen
	function showDD(nr){
		hideAll('dd',6);
		showLayer('dd' + nr);
	}	
	
	function resetNav(){
		hideAll('dd',6);
	}
	
	function showFulltext(nr){
		hideLayer('text' + nr);
		showLayer('text' + nr + 'f')
	}
	
	function hideFulltext(nr){
		showLayer('text' + nr);
		hideLayer('text' + nr + 'f')
	}
	
	function open_adonixDemo() {
	//opens the richmedia presentation in a popup window and moves the latter to x=0;y=0
	url='http://www.sageerpx3.com/data/demo/en/player.html'; //url of popup window
	id='sfr'; //id of popup window
	h=648; //height of popup window
	w=930; //width of popup window
	avaya=window.open(url,id,'toolbar=no,menubar=no,location=no,resizable=yes,status=no,scrollbars=no,menubar=no,height='+h+',width='+w);
}	
function open_adonixDemo_ger() {
	//opens the richmedia presentation in a popup window and moves the latter to x=0;y=0
	url='http://www.sageerpx3.com/data/demo/de/sx3_onlinedemo-de.php'; //url of popup window
	id='sfr'; //id of popup window
	h=780; //height of popup window
	w=1100; //width of popup window
	avaya=window.open(url,id,'toolbar=no,menubar=no,location=no,resizable=yes,status=no,scrollbars=no,menubar=no,height='+h+',width='+w);
}	
