function PicWindow(name){
document.open(name, "_blank", "width=455,height=355,left=150%,top=150%");
}

function SetColor(){

    Elementknoten = document.getElementById("mdiv");
    fontel = Elementknoten.getElementsByTagName('font')[0]
    fontel.style.color = "#000000";
    alert(Elementknoten);
}

function load(){
a = new Image();a.src="../images/menu01over.gif";
b = new Image();b.src="../images/menu02over.gif";
c = new Image();c.src="../images/menu03over.gif";
d = new Image();d.src="../images/menu04over.gif";
e = new Image();e.src="../images/menu05over.gif";
f = new Image();f.src="../images/menu06over.gif";
g = new Image();g.src="../images/menu07over.gif";
h = new Image();h.src="../images/menu08over.gif";
i = new Image();i.src="../images/menu09over.gif";
j = new Image();j.src="../images/menu10over.gif";
k = new Image();k.src="../images/menu11over.gif";
l = new Image();l.src="../images/menu12over.gif";
m = new Image();m.src="../images/menu13over.gif";
SetColor();
}

KmailErrEmpty=0;
KmailErrInvalid=0;

function KontaktMailValid(){
	if(doc = document.KontaktForm);
	else(doc = document.forms["0"]);

	mail = doc.KontaktEmail.value;
	if((mail=="")||(!mail)) KmailErrEmpty=1;
	else {
		var check=mail.search( /\@\b/);
		if((check == "-1")||(check == "0")) KmailErrInvalid=1;
		var check=mail.search(/\s/);
	    if((check != "-1")) KmailErrInvalid=1;
	}
	return 0;
}

function SendKontaktForm(){
ERROR = 1;
errText = "";

	if(doc = document.KontaktForm);
	else(doc = document.forms["0"]);

	KontaktMailValid();
	if(KmailErrEmpty && ERROR){
	 errText+="Bitte geben Sie Ihre Email-Adresse ein !\n";
	 doc.KontaktEmail.focus ();
     doc.KontaktEmail.select ();
     ERROR = 0;
	}
	else if(KmailErrInvalid && ERROR){
	 errText+="Üngültige Email-Adresse !\n";
	 doc.KontaktEmail.focus ();
     doc.KontaktEmail.select ();
     ERROR = 0;
	}
	if((KmailErrEmpty+KmailErrInvalid)==0) doc.submit();
	else{
     KmailErrEmpty=0;
	 KmailErrInvalid=0;
	 alert(errText);
	}
}

var scrollerwidth="410px";
var scrollerheight="430px";
var scrollerspeed=2;
scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1); //slow speed down by 1 for NS
var copyspeed=10;
var iedom=document.all||document.getElementById;
var actualheight='';
var cross_scroller, ns_scroller;
var uptime, downtime;
var i=0, j=0;
var UPEND=0;
var DOWNEND=0;
var DOWNVERYEND=1;
var UPVERYEND=1;
function populate(){
	if (iedom){
		cross_scroller=document.getElementById? document.getElementById("iescroller") : document.all.iescroller;
		//cross_scroller.style.top=5;
		//cross_scroller.innerHTML=scrollercontent;
		actualheight=cross_scroller.offsetHeight;
	}
	else if (document.layers){
		ns_scroller=document.ns_scroller.document.ns_scroller2;
		ns_scroller.top=0;//parseInt(scrollerheight)+8;
		ns_scroller.document.write(scrollercontent);
		ns_scroller.document.close();
		actualheight=ns_scroller.document.height;
	}
	DOWNEND=1;
}

function scrollscrollerup(){
  //copyspeed=5;
  if (iedom){
  	//alert(actualheight+'im IEDOM'+cross_scroller.style.top);
    if (!(parseInt(cross_scroller.style.top)>0)){
    	UPVERYEND=1;
      cross_scroller.style.top=parseInt(cross_scroller.style.top)+copyspeed+"px";
    } else {UPEND=0;UPVERYEND=1;}
  }
  else if (document.layers){
		window.status=ns_scroller.top+' - '+(actualheight*(-1)+357-copyspeed);
        if ((ns_scroller.top<0)){
    			UPVERYEND=1;
    			ns_scroller.top+=copyspeed;
    		} else {UPEND=0;UPVERYEND=1;}
    	 }
  if(UPEND&&UPVERYEND) window.setTimeout('scrollscrollerup()',20);
}
function scrollscrollerdown(){
  //copyspeed=5;
  if (iedom){
    if (parseInt(cross_scroller.style.top)>(actualheight*(-1)+357)){
    	DOWNVERYEND=1;
      cross_scroller.style.top=parseInt(cross_scroller.style.top)-copyspeed+"px";
    } else{DOWNEND=1;DOWNVERYEND=0;}
  }
  else if(document.layers){
		window.status=ns_scroller.top;
        if(ns_scroller.top>(actualheight*(-1)+357)){
    			DOWNVERYEND=1;
    	 		ns_scroller.top-=copyspeed;
        } else{DOWNEND=1;DOWNVERYEND=0;}
       }
 if(DOWNEND&&DOWNVERYEND) window.setTimeout('scrollscrollerdown()',20);
}


function ScrollAreaTop(){
	if (iedom){
		document.write("<div style=\"position:relative;width:"+scrollerwidth+";height:"+scrollerheight+";overflow:hidden\">");
		document.write("<div id=\"iescroller\" style=\"position:absolute;left:0px;top:0px;width:100%\">");
	} else {//if (document.layers){\n".
		document.write("<ilayer width="+scrollerwidth+" height="+scrollerheight+" top=0 name=\"ns_scroller\">");
		document.write("<layer top=0 name=\"ns_scroller2\">");
	}
};


function ScrollAreaBottom(){
	if (iedom){
		document.write("</div>");
		document.write("</div>");
	} else {//if (document.layers){\n".
		document.write("</layer>");
		document.write("</ilayer>");
	}
};

function ArrowUp(){
 	if (iedom){
 		document.write("<div onMousedown=\"UPEND=1;scrollscrollerup();\" onMouseup=\"UPEND=0;\" onMouseout=\"UPEND=0;\">");
 		document.write("<a href=\"javascript://\"><IMG SRC=\"images/gbook/up.gif\" WIDTH=11 HEIGHT=18 BORDER=0></a></div>");
 	}	else {//if (document.layers){
 		document.write("<ilayer name=ns_scroller2>");
 		document.write("<a href=\"javascript://nothingup\" onMousedown=\"UPEND=1;scrollscrollerup();\" onMouseup=\"UPEND=0;\" onMouseout=\"UPEND=0;\">");
 		document.write("<IMG SRC=\"\"../images/up.gif\" WIDTH=11 HEIGHT=18 BORDER=0></a></ilayer>");
 	}
}


function ArrowDown(){
	if (iedom){
		document.write("<div onMousedown=\"DOWNEND=1;scrollscrollerdown();\" onMouseup=\"DOWNEND=0;\" onMouseout=\"DOWNEND=0;\">");
		document.write("<a href=\"javascript://\"><IMG SRC=\"images/gbook/down.gif\" WIDTH=11 HEIGHT=18 BORDER=0></a></div>");
	}	else {//if (document.layers){
		document.write("<ilayer name=ns_scroller2>");
		document.write("<a href=\"javascript://nothingdown\" onMousedown=\"DOWNEND=1;scrollscrollerdown();\" onMouseup=\"DOWNEND=0;\" onMouseout=\"DOWNEND=0;\">");
		document.write("<IMG SRC=\"../images/down.gif\" WIDTH=11 HEIGHT=18 BORDER=0></a></ilayer>");
		}
}


function CheckForm(){

	if(doc = document.InsertForm);
	else(doc = document.forms["0"]);

    if(doc.GbName.value!=0) NameERR=0;
    else NameERR=1;

    if(doc.GbEmail.value!=0){
        erg=doc.GbEmail.value.match(/(\S.*)@(\S.*)/);
        if(erg) MailERR=0;
        else MailERR=1;
    }
    else MailERR=0;

    if(doc.GbText.value!=0) TextERR=0
    else TextERR=1;

    if(doc.GbControl.value!=0) ControlERR=0;
    else ControlERR=1;

    ERRORTEXT='Ungültige Eingabe\n_______________________________\n\n';

    if(NameERR) ERRORTEXT=ERRORTEXT+'- Bitten geben Sie Ihren Namen ein!\n\n';
    if(MailERR) ERRORTEXT=ERRORTEXT+'- Bitten geben Sie eine gültige Email-Adresse ein!\n\n';
    if(TextERR) ERRORTEXT=ERRORTEXT+'- Bitten geben Sie Ihren Text ein!\n\n';
	if(ControlERR) ERRORTEXT=ERRORTEXT+'- Bitten geben Sie die Buchstabenfolge ein!\n\n';
    if((NameERR+MailERR+TextERR+ControlERR)==0) doc.submit();
    else alert(ERRORTEXT);

}



