NS4 = (document.layers)?1:0;
NS5 = (document.getElementById)?1:0;
NS6 = (document.getElementById)?1:0;
NS7 = (document.getElementById)?1:0;
IE4 = (document.all)?1:0;
if( IE4 == 1) NS5 = 0;
var strBrowserName = navigator.appName;
var fBrowserVersion = parseFloat(navigator.appVersion);

// *********************************************** getDiv *********************************************
function getDiv(strDiv){
// Wer       : US 13.09.2004 www.stelzerinformatik.ch
// Parameter : divName
// Beschrieb : Gibt das div je nach Browser zurück
// Rückgabe  : div

   myDiv = strDiv;
	 if (NS5) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS4) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS6) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS7) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS4) {
	    myDiv=strDiv;
	 }
	 return myDiv;
}

function fakeClick(pToClickID){
	if (typeof Event != "undefined")
		return true;

	if ((event.which || event.keyCode) && (document.getElementById(pToClickID))){
		if ((event.which == 13) || (event.keyCode == 13)){
			document.getElementById(pToClickID).click();
			return false;}}
	else{
		return true;}}

function setFocus(pID){
	if(document.getElementById(pID))
		document.getElementById(pID).focus();}
		
function invertFaq(id) {       
    div = document.getElementById(id);
    if (div.style.display == 'block') {
        div.style.display = 'none'; }
    else {
        div.style.display = 'block'; } 
}		

function cmdHelp(id){

    divHelp = document.getElementById("helpText" + id);
    var divVisibility = divHelp.style.visibility;
		
		var divs = document.getElementsByTagName("div");
  
    for (var i=0;i<divs.length;i++) {	
        if (divs[i].id.substring(0, 8) == "helpText") {
        	divs[i].style.visibility = 'hidden';
        }
    }

    if (divVisibility == 'visible') {
      divHelp.style.visibility = 'hidden';
    }        
    else { 
      divTitle = document.getElementById("help" + id);  
      divHelp.style.top = divTitle.offsetTop - divHelp.offsetHeight + 1;
      divHelp.style.left = divTitle.offsetLeft - divHelp.offsetWidth + 1;     
      divHelp.style.visibility = 'visible';
    }
		return false;		
}

function uploadFile(strFile) {
	var intHeight = 300;
	var intWidth = 500;
	myTop =  (screen.height - intHeight) / 2;
	myLeft = (screen.width  - intWidth) / 2;
	myWin = window.open("php/upload.php?path=" + strFile,"Upload","Status=yes,toolbar=yes,location=no,top=" + myTop + ",left=" + myLeft + ",menu=no,width=" + (intWidth + 30) + ",height="  + (intHeight + 30) + ",scroll=yes,scrollbars=yes,resizable=yes");	
	myWin.focus();			
 return false;
}


function pagePrint(href){
	var intHeight = 400;
	var intWidth = 580;
	myTop =  (screen.height - intHeight) / 2;
	myLeft = (screen.width  - intWidth) / 2;
	myWin = window.open("index.php?" + href, "Print","Status=yes,toolbar=yes,location=no,top=" + myTop + ",left=" + myLeft + ",menu=no,width=" + (intWidth + 30) + ",height="  + (intHeight + 30) + ",scroll=yes,scrollbars=yes,resizable=yes");	
	myWin.focus();			
 // if(window.print) window.print();
 // else{
  //  if(agt.indexOf("mac") != -1)alert("To print this page press Command-P.")
  //  else alert("To print this page press Control-P.")
  //}
	//myWin.focus();	
	return false;
}

function bill(href){
	var intHeight = 400;
	var intWidth = 580;
	myTop =  (screen.height - intHeight) / 2;
	myLeft = (screen.width  - intWidth) / 2;
	myWin = window.open(href, "Print","Status=yes,toolbar=yes,location=yes,top=" + myTop + ",left=" + myLeft + ",menu=yes,width=" + (intWidth + 30) + ",height="  + (intHeight + 30) + ",scroll=yes,scrollbars=yes,resizable=yes");	
	myWin.focus();			
 // if(window.print) window.print();
 // else{
  //  if(agt.indexOf("mac") != -1)alert("To print this page press Command-P.")
  //  else alert("To print this page press Control-P.")
  //}
	//myWin.focus();	
	return false;
}

function zoom(divID){	
	//eval(getDiv(divID)+".innerHTML='<img src=" + strImage + ">'");
	document.getElementById(divID).style.visibility = 'visible';			 
}
function closeZoom(divID){
	document.getElementById(divID).style.visibility = 'hidden';	
}
