/*-------Allgemein-------------------------------------------------------------*/

var NS4 = (document.layers);
var IE4 = (document.all);
var mac;if (navigator.userAgent.match(/mac/i)) mac=true;

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function swapImages(ebene,BildName,zwang) {
	if (document.layers && ebene!=null) {
		bild=eval('document.'+ebene+'.document.images["'+BildName+'"].src');
		if (bild.match(/over/)) eval('document.'+ebene+'.document.images["'+BildName+'"].src = '+BildName+'.src')
		else eval('document.'+ebene+'.document.images["'+BildName+'"].src = '+BildName+'over.src');
		if (zwang) eval('document.'+ebene+'.document.images["'+BildName+'"].src = '+BildName+zwang+'.src');
		}
	else {
		bild=eval('document.images["'+BildName+'"].src');
		if (bild.match(/over/)) eval('document.images["'+BildName+'"].src = '+BildName+'.src');
		else eval('document.images["'+BildName+'"].src = '+BildName+'over.src');
		if (zwang) eval('document.images["'+BildName+'"].src = '+BildName+zwang+'.src');
		}
}

function init(ebene) {
	if (NS4) {
		ebeneRef=document.layers[ebene];
		ebeneRef.x =ebeneRef.left;
		ebeneRef.y =ebeneRef.top;
	}
	else if (IE4) {
		ebeneRef=document.all[ebene].style;
		ebeneRef.x = parseInt(ebeneRef.posLeft);
		ebeneRef.y = parseInt(ebeneRef.posTop);
	}		
}
            
function zeige(an,ebene,fn){
init(ebene);
if (an) ebeneRef.visibility="visible";
else {ebeneRef.visibility="hidden";}
eval(fn);
}
 
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

/*-------admin--------------*/
function confirmLink(theLink, theSqlQuery) {
	confirmMsg = "Wollen Sie diesen Eintrag wirklich löschen";
    var is_confirmed = confirm(confirmMsg + ':\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }
    return is_confirmed;
}