var IFrameTag;
//window.onerror = ErrorHandler;
//

function str_replace(t, u, s) {
  /*
  **  Replace a token in a string
  **    s  string to be processed
  **    t  token to be found and removed
  **    u  token to be inserted
  **  returns new String
  */
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + u;
  if ( i + t.length < s.length)
    r += str_replace(s.substring(i + t.length, s.length), t, u);
  return r;
 }

function myFocus (obj) {
	obj.className = "inpTextActive";
}
function myBlur (obj) {
	obj.className = "inpText";
}

function myScrollToView(a) {
	if (a.length > 0) {
		var obj = MM_findObj(a);
		if (obj) {
			obj.scrollIntoView(true);
		}
	}
}

function IxChangeImage( ImageName, FileName ) {
	var obj = MM_findObj(ImageName);
	obj.src = FileName;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showDetails (id) {
	var rowVersionDetails = MM_findObj("rowVersionDetails"+id);
	var rowVersion = MM_findObj("rowVersion"+id);
	var rowVersionDetailsDiv = MM_findObj("rowVersionDetailsDiv"+id);
	//
	if (rowVersionDetails && rowVersion && rowVersionDetailsDiv && rowVersionDetailsDiv.innerHTML != undefined) {
		if (rowVersionDetails.className != "rowVersionDetailsActive") {
			rowVersionDetails.className = "rowVersionDetailsActive";
			rowVersion.className = "rowVersionActive";
			rowVersionDetailsDiv.innerHTML = IFrameTag.toString().split('###X###').join(id);
		} else {
			rowVersionDetails.className = "rowVersionDetails";
			rowVersion.className = "rowVersion";
			rowVersionDetailsDiv.innerHTML = "";
		}
		rowVersionDetailsDiv.innerHTML+= "";
		return true;
	}
	return false;
}

function trRollOver (obj) {
	if (obj.className != "rowVersionActive") obj.className = "rowVersionOver";
}

function trRollOut (obj) {
	if (obj.className == "rowVersionOver") obj.className = "rowVersion";
}

function drawLoadingAni() {
	if (MM_findObj("frame")) {
		document.write('<div id="loadingAni"><strong><img src="glob_img/loadingAni.gif" alt="Bitte warten" width="160" height="15" border="1"></strong></div>');
		window.onload = hideLoadingAni;
	}
}

function hideLoadingAni() {
	var obj = MM_findObj("loadingAni");
	if (obj) {
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		obj.width= 0;
		obj.height = 0;
	}
}

function ErrorHandler(e) {
	return true;
}