var xPos = 0, yPos = 0
// alert(self.name.indexOf('overlayFr'))
if(top.frames.length > 0 && self.name!="fileMngPreview" && self.name.indexOf('overlayFr')==-1) top.location.href=self.location;

// --------------------------------- Standard --------------------------------- //

document.onmousedown = getPos;

function getPos(e){
if(document.all){xPos = window.event.screenX; yPos = window.event.screenY;}
else if(document.getElementById){xPos = e.screenX;yPos = e.screenY;}}

function topInfo(cont,target,w,h)
{var topInf = window.open(cont,target,'width='+w+',height='+h+',dependent=yes,resizable=yes,scrollbars=yes,menubar=yes,status=yes'); topInf.focus(); return false;}

// -------------------------------- Schnellkontakt ---------------------------- //

function cFocus(x,txt){
x.className = x.className.replace(/On/, "") + "On";
if(x.value==txt)x.value = "";
}

function cBlur(x,txt){
if(x.value==""){
	x.value = txt; 
	x.className = x.className.replace(/On/, "");
	}
}

function checkCallback(){
var cN = document.callbackForm.callbackName.value;
var cT = document.callbackForm.callbackNumb.value;
if(cN == "" || cT == "" || cN == "Ihr Name" || cT == "Telefon-Nummer")
{alert("Bitte geben Sie Name und Telefon-Nummer ein"); return false;} else {return true;}
}

// -------------------------------- Suchformular ------------------------------ //

function showX(x){showEl(x);}
function hideX(x){hideEl(x);}

function showExtSearch(){
	showEl('extSearch'); hideEl('showExtSearch'); showEl('hideExtSearch');
}

function hideExtSearch(){
	document.searchForm.reset();
	hideEl('extSearch'); showEl('showExtSearch'); hideEl('hideExtSearch');
}

function showEl(x){
document.getElementById(x).style.display='block';}

function hideEl(x){
document.getElementById(x).style.display='none';}


// -------------------------- Korrektur padding mainDiv ----------------------- //

var setDivBalanceDisabled = false;	// wird beim editieren deaktiviert //

function setDivBalance(){	// nur wenn Style aktiv //
if(document.getElementById('checkCSS').offsetHeight > 0) return false;
var emH = document.getElementById('emHeightHlp').offsetHeight;
var c = 14; 	// Korrektur //
var xx = document.getElementById('addContainer').offsetHeight + c - document.getElementById('mainBg').offsetHeight;
if(xx>0 && !setDivBalanceDisabled){
document.getElementById('contFlexFoot').style.height = Math.round(xx/emH*40000)/10000 + 'em';
}}

function footCorrection(){		/* Anzeige-Korrektur fuer IE */
	if(document.getElementById('containerFoot')){ 
		document.getElementById('containerFoot').style.bottom = '0px';
		document.getElementById('containerFootL').style.bottom = '0px';
		document.getElementById('containerFootR').style.bottom = '0px';

		document.getElementById('containerFoot').style.bottom = '-1px';
		document.getElementById('containerFootL').style.bottom = '-1px';
		document.getElementById('containerFootR').style.bottom = '-1px';
}}

// --------------------------------- Overlay ----------------------------------

function hideOverlay(x){
	var d = document; if(x) d = parent.document;
	if(d.getElementById('detailOverlay')) d.getElementById('detailOverlay').style.display = "none";
}


