<!--

//escaping js problems, activate only after finishing website
// function oe() {return true;}
// window.onerror = oe;

//reloads the window if Nav4 resized
function reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

// Dake kills the rectangle around links on focus
// note: user is unable to navigate with keyboard
// comment last line to set inactive!
function DakeKillFocusRect() {
	function unCheck() {
		if(this.blur) this.blur();
	}
	for (var i=0; i < window.document.links.length; i++) {
		window.document.links[i].onfocus = unCheck;
	}
}
window.onload = DakeKillFocusRect;

//window open for versand; 
function makewindow(url,breit,hoch,scrollb,toolb,statusb,locationb,fs){	
	if (fs=="") {fs = 0};
   	popup = window.open(url,"winname","width="+breit+",height="+hoch+",screenX=0,screenY=0,top=100,left=100,scrollbars="+scrollb+",status="+statusb+",resizable=0,location="+locationb+",menubar=0,toolbar="+toolb+",fullscreen="+fs+"");
   	popup.moveTo(Math.round((screen.availWidth-290)/2),Math.round((screen.availHeight-300)/2));
		popup.focus();
}

//closes window after timeout
function dkclose(timer){
	setTimeout("self.close()", timer);
	opener.location.href=opener.location.href;
}
	
//delay for send comment function
function sendcheck() {
	if (sendcount == 1) {
		sendcount++; 
		document.write("submit()");
	}
}
//ab hier Kopfbereich
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// next two functions: imageready rollover scripts
function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}
function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

// Zählt die maximale Anzahl der Zeichen bei Mail
function calc_letters()
	{
		/* This script was written by glock64 (glock64@hotmail.com/classicfirearms.org)
		Please leave this message in this script if you want to use it, thanks.
		*/
		var max = 1000;
		var doc1 = document.writemessage.mail.value;     //The Value of the Msg to be calc.
		var l = doc1.length + 1;
		var ll = max - l +1;
		if ( ll < 0 ) {
			ll = 0;
		}
		document.writemessage.countchars.value = 'noch ' + ll +' Zeichen '    //Write the length, in bytes to the box
		if (doc1.length>max-1) {
			alert(max + ' Zeichen erreicht!');
		}
	}
	
function menuauswahl($treffer, $linkstring) {
	// alert($linkstring);
	// alert($treffer);
	
	var auswahl = "module.php?"+eval('$linkstring')+"&menuid="+eval('$treffer');
	// alert (auswahl);
	if (auswahl != "#") {
    	 window.location = auswahl
    }
}

function menuauswahldelete($treffer) {
	var auswahl = "module.php?name=administrator&menuid="+eval('$treffer')+"&op=deletemainmenu&step=2"
	 if (auswahl != "#") {
    	window.location = auswahl
    }
}

function DakeConfirmDelete(txt, loc) {
	choose=window.confirm(txt);
	if (choose==true) {
		window.location.href=loc;
	}
}

function DakeConfirmForm(txt) {
	var choose = window.confirm(txt);
	return choose;
}

function change_bgcolor(element,bg) {
	element.style.backgroundColor = bg;
	element.style.cursor ='hand';
}

function change_back_bgcolor(element,bg) {
	element.style.backgroundColor = bg;	
	element.style.cursor ='auto';
}
// -->
