//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  Copyright 2006-2009 by CrossData-Tools
//  www.crossdata-tools.de
// Autor: Horst Mürdter
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Returns the first Document-Element of filename
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function getXMLFromFile(filename) {
	if (document.implementation && document.implementation.createDocument) { // NOT IE
		var req = new XMLHttpRequest();
		req.open("GET", filename, false);
		req.send(null);
		gLangXMLDoc = req.responseXML;
		gLangXMLObj = gLangXMLDoc.documentElement;
	} else {
		gLangXMLDoc = new ActiveXObject ("Microsoft.XMLDOM");
		gLangXMLDoc.async = false;
		gLangXMLDoc.load (filename);
		gLangXMLObj = gLangXMLDoc.documentElement;
	}
	return gLangXMLObj;
}



//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Creates a AJAX Object
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function createAJAXObjekt() {
	var ajaxObj = false;
	if (typeof XMLHttpRequest != 'undefined') {
	    ajaxObj = new XMLHttpRequest();
	}
	if (!ajaxObj) {
	    // Internet Explorer 6 und �lter
	    try {
	        ajaxObj  = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e) {
	        try {
	            ajaxObj  = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch(e) {
	            ajaxObj  = false;
	        }
	    }
	}
	return ajaxObj;
}


function comaToPoint(value) {
	return value.replace(/,/, ".");
}

function escapeValue(value) {
	if (typeof value == "string")
		value = value.replace(/\+/g,'%2b');
	return escape(value);
}

/**
 *
 * @access public
 * @return void
 **/
function stripslashes(str){
	return (str+'').replace(/\0/g, '0').replace(/\\([\\'"])/g, '$1');
}

 function radioWert(rObj) {
    for (var i=0; i<rObj.length; i++) if (rObj[i].checked) return rObj[i].value;
	return false;
  }

  function radioID(rObj) {
    for (var i=0; i<rObj.length; i++) if (rObj[i].checked) return rObj[i].id;
	return false;
  }

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// getInnerText -> for Firefox too
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function getInnerText(elementId) {
	var hasInnerText = (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false;
	var el = document.getElementById(elementId);
	if(!hasInnerText){
	    return el.textContent;
	} else{
	    return el.innerText;
	}
}

function activateKRow(id) {
	document.getElementById("tr" + id).className = "system_tr_active";
}

function desActivateKRow(id) {
	document.getElementById("tr" + id).className = "system_tr";
}

function getYScrollPos() {
	var scrollPos;
	if (typeof window.pageYOffset != 'undefined') {
	   scrollPos = window.pageYOffset;
	}
	else if (typeof document.compatMode != 'undefined' &&
	     document.compatMode != 'BackCompat') {
	   scrollPos = document.documentElement.scrollTop;
	}
	else if (typeof document.body != 'undefined') {
	   scrollPos = document.body.scrollTop;
	}
	return scrollPos;
}

