/* Macromedia-Funktionen */

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();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

/* CR-Funktionen */
function CR_jumpMenu(selectedObj,xpos,ypos,w,h,features) {
	if (selectedObj.options[selectedObj.selectedIndex].value!="#") {
		loc = selectedObj.options[selectedObj.selectedIndex].value;
		winName = selectedObj.options.selectedIndex;
		if (w > screen.availWidth || h > screen.availHeight) {
			w = screen.availWidth;
			h = screen.availHeight;
			xpos = 0;
			ypos = 0;
			fenster = window.open(loc, winName, "top="+ypos+",left="+xpos+",width="+w+",height="+h+","+features);
		}
		else {
			xpos = (screen.availWidth-w)/2;
			ypos = (screen.availHeight-h)/2;
			fenster = window.open(loc, winName, "top="+ypos+",left="+xpos+",width="+w+",height="+h+","+features);
		}
	    fenster.focus();
	}
}
function CR_jumpMenuGo(selectedName,xpos,ypos,w,h,features){
	var selectedObj = MM_findObj(selectedName);
	if (selectedObj) {
	  	CR_jumpMenu(selectedObj,xpos,ypos,w,h,features);
	}
}

/* Zeilenmarkierung */
function setPointer(theRow, thePointerColor, offsetVorne, offsetHinten)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length-offsetHinten;
    for (var c = offsetVorne; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }
    return true;
}

/* neues Fenster öffnen
function openwindow(loc,winName,xpos,ypos,w,h,features)
{
	Fenster = window.open(loc, winName, "top="+ypos+",left="+xpos+",width="+w+",height="+h+","+features);
    Fenster.focus();
}
 */

/* neues Fenster in Bildschirmmite öffnen */
function openwindow(loc,winName,xpos,ypos,w,h,features)
{
	if (w > screen.availWidth || h > screen.availHeight) {
		w = screen.availWidth;
		h = screen.availHeight;
		xpos = 0;
		ypos = 0;
		Fenster = window.open(loc, winName, "top="+ypos+",left="+xpos+",width="+w+",height="+h+","+features);
	}
	else {
		xpos = (screen.availWidth-w)/2;
		ypos = (screen.availHeight-h)/2;
		Fenster = window.open(loc, winName, "top="+ypos+",left="+xpos+",width="+w+",height="+h+","+features);
	}
    Fenster.focus();
}

function checkformGaestebuch(text) {
/* nur zum testen
	for (i=0;i<document.formular.elements.length;i++) {
		document.formular.elements[i].value = Math.round(Math.random()*10000+10000);
		document.formular.email.value = "test@biztalker.de";
	}
*/
	if (
		document.formular.autor.value.length < 3 ||
//		document.formular.plz.value.length < 4 ||
//		document.formular.ort.value.length < 2 ||
		document.formular.eintrag.value.length < 5 ||
		document.formular.email.value.length < 9 || document.formular.email.value.indexOf('@') == -1 || document.formular.email.value.indexOf('.') == -1
		) {
		alert(text);
		return false;
	}
	else {
		document.formular.submitbutton.value = text;
		document.formular.submitbutton.disabled = true;
		return true;
	}
}


<!-- Lässt das Browserfesnter wackeln -->
function shake_xy(n) {
if (self.moveBy) {
	for (i = 10; i > 0; i--) {
		for (j = n; j > 0; j--) {
			self.moveBy(0,i);
			self.moveBy(i,0);
			self.moveBy(0,-i);
			self.moveBy(-i,0);
			}
		}
	}
}
function shake_x(n) {
	if (self.moveBy) {
		for (i = 10; i > 0; i--) {
			for (j = n; j > 0; j--) {
				self.moveBy(i,0);
				self.moveBy(-i,0);
			}
		}
	}
}
function shake_y(n) {
	if (self.moveBy) {
		for (i = 10; i > 0; i--) {
			for (j = n; j > 0; j--) {
				self.moveBy(0,i);
				self.moveBy(0,-i);
			}
		}
	}
}
//-->

