// JavaScript Document

function docEngine(strRelativity, strPageOR, intDataID, strHeader, intMenuOR, intMenuID) {
	
	if (strPageOR.length > 0) {
		parent.location.href=strPageOR;
	} else {
		
		/*// if no intDataID given get current ID value
		if (!intDataID | intDataID == 0) {
			intPlace = parent.location.href.indexOf("&");
			intPlace += parent.location.href.substr(intPlace).indexOf("=") + 1;
			intPlace2 = intPlace + parent.location.href.substr(intPlace).indexOf("&");
			intDataID = parent.location.href.substring(intPlace, intPlace2);
			if (!intDataID)
				intDataID = 1; //default
		}
		
		// if no header given get current ID values
		if (!intHeaderID | intHeaderID == 0) {
			intPlace = parent.topFrame.location.href.indexOf("=") + 1;
			intHeaderID = parent.topFrame.location.href.substr(intPlace);
		}
		
		// if not menuIDs given get current ID values
		if (!intMenuOR | intMenuOR == 0) {
			intMenuOR=0;
			
			if (!intMenuID | intMenuID == 0) {
				intPlace = parent.leftFrame.location.href.indexOf("=") + 1;
				//intPlace2 = parent.leftFrame.location.href.indexOf("&");// - 1;
				intMenuID = parent.leftFrame.location.href.substring(intPlace);//, intPlace2);
				//intPlace = parent.leftFrame.location.href.substr(intPlace2).indexOf("=") + 1;
				//intMenuSubID = parent.leftFrame.location.href.substr(intPlace2).substr(intPlace);
				
			}
		}*/
		
		strLocation = strRelativity + "?header=" + strHeader
			+ "&dataID=" + intDataID
		if (!intMenuOR | intMenuOR == 0) {
			strLocation += "&menuID=" + intMenuID;
			//+ "&subMenuID=" + intMenuSubID;
		}
		//strLocation += "&menuOR=" + intMenuOR;
	
		parent.location.href = strLocation;
	}
}

function docEngineOneMove (intFrame, strURL) {
	switch (intFrame) {
		//case 1:	parent.topFrame.location.href = strURL;
			//break;
		//case 2: parent.leftFrame.location.href = strURL;
			//break;
		case 3: parent.display.location.href = strURL;
			break;
		//case 4: parent.location.href = strURL;
	}
}

function docEngineTableDisplayChange(intTableID, blnShow) {
	if (blnShow == true) { 
		document.getElementById(intTableID).style.display = 'block';
  	} else {
		document.getElementById(intTableID).style.display = 'none';
  	}
}

function docEngineAltTableDisplay(intTableID) {
	if (document.getElementById(intTableID).style.display != 'block') { 
		document.getElementById(intTableID).style.display = 'block';
  	} else {
		document.getElementById(intTableID).style.display = 'none';
  	}
}

function docEngineTableDisplayChangeAndOneMove(intTableID, blnShow, intFrame, strURL) {
	docEngineTableDisplayChange(intTableID, blnShow);
	docEngineOneMove(intFrame, strURL);
}

/*
function getNumberOfChanges(intDataID, intHeaderID, intMenuID, intMenuOR) {
	var intRet=0;
	
	if (intDataID > 0) 
		intRet += 1;
		
	if (intHeaderID >0)
		intRet += 1;
		
	if (intMenuID > 0)
		intRet += 1;
	else if (intMenuOR > 0)
		intRet += 1;
		
	return intRet;
}*/

function openWindow (strHref, strWindowName, strWindowProperties) {
	window.open(strHref, strWindowName, strWindowProperties);
}