function cla(){
	if(document.getElementById("al")){
			that=document.getElementById("al");
		if(that.checked){
			document.getElementById("ala").style.display="block";
			document.getElementById("ala").style.width="598px";
			document.getElementById("es1").style.display="none";
		}else{
			document.getElementById("ala").style.display="none";
			document.getElementById("ala").style.width="597px";
			document.getElementById("es1").style.display="block";
		}
	}
}
function toggle(ziel){
	
}
function gifme(){
	//just 2b defined...
}
function anzahl() {
	var nameEQ = "fitinstyle_c=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return 0;
}
var cc=anzahl();
function anzahlize(){
	document.getElementById("anzahl").innerHTML="warenkorb: "+cc+" artikel";
}
function detect(){
	window.inited=true;
	window.bs="egal";
	if (navigator.userAgent.indexOf("Windows")>-1){
		if(window.navigator.userAgent.indexOf("Windows NT 5.1")>-1){
			bs="xp";
		}else{
			window.bs="windows";
		}
	}else if(navigator.userAgent.indexOf("OS X")>-1){
		window.bs="osx";
	}else if(navigator.userAgent.indexOf("Macintosh")>-1 || navigator.userAgent.indexOf("Mac_PowerPC")>-1){
		window.bs="mac";
	}
	window.browser="ie";
	if(navigator.userAgent.indexOf("Gecko")>-1){ //neuer Mozilla oder kompatible
		if(navigator.userAgent.indexOf("Netscape")>-1){
			window.browser="netscape";
		}else if(navigator.userAgent.indexOf("Safari")>-1){
			window.browser="safari";
		}else if(navigator.userAgent.indexOf("Firefox")>-1){
			window.browser="firefox";
		}else if(navigator.userAgent.indexOf("Camino")>-1){
			window.browser="camino";
		}else if(navigator.userAgent.indexOf("Chimera")>-1){
			window.browser="chimera";
		}else{
			window.browser="mozilla";
		}
	}else if(navigator.userAgent.indexOf("Opera")>-1){ //ohje
		window.browser="opera";
	}else if(navigator.userAgent.indexOf("MSIE")>-1){ // Explorer oder Kopie wie OmniWeb
		if(bs=="mac"){
			if(navigator.userAgent.indexOf("MSIE 5.2")>-1){
				window.bs="osx";
			}
		}
	}else if(navigator.userAgent.indexOf("iCab")>-1){
		window.browser="icab";
	}else if(navigator.appName.indexOf("Netscape")>-1){
		window.browser="netscape_alt";
	}
	window.randy=0;
	window.randx=0;
	window.ies=0;
	window.h_add=0;
	window.b_add=0;
	if(window.bs=="osx"){
		window.randx=0; //linker offset
		window.ies=50;
		switch(window.browser){
		case "safari":	window.randx=0;
						window.randy=23;
						window.h_add=1;
						window.b_add=0;
						break;
		case "firefox":	window.randx=0;
						window.randy=0;
						window.h_add=3;
						break;
		case "icab":	window.randx=1;
						window.randy=23;
						break;
		case "camino":
		case "chimera": window.randx=0;
						window.randy=23;
						window.h_add=3;
						break;
		default:		window.randx=0; //mozilla
						window.randy=0;
						window.h_add=3;
						break;
		}
	}else{
		switch(window.browser){
		case "firefox":	window.randx=0;
						window.randy=0;
						break;
		case "mozilla":	window.randx=0;
						window.randy=0;
						break;
		default:		window.randx=0;
						window.randy=0;
		}
	}
	if(window.bs=="xp"){
		window.randx+=1;
		window.randy+=6;
	}						
}

function popup_pic(link, titelname, id, breite, hoehe, xoff, yoff, scroll){
	if(!window.inited){detect();};
	pars="width="+(breite+window.b_add)+", height="+(hoehe+window.h_add)+", resizable=yes, scrollbars="+scroll+", toolbar=no, status=no, left="+(xoff+window.randx)+", top="+(yoff+window.randy);
	link="bildansicht.php?titel="+titelname+"&pfad="+link;
	window.open(link, id, pars);
}
function popup(link, titelname, id, breite, hoehe, xoff, yoff, scroll){
	if(!window.inited){detect();};
	pars="width="+(breite+window.b_add)+", height="+(hoehe+window.h_add)+", resizable=yes, scrollbars="+scroll+", toolbar=no, status=no, left="+(xoff+window.randx)+", top="+(yoff+window.randy);
	window.open(link, id, pars);
}
function picswap(ident,bild,alttext){
	document.getElementById(ident).src=bild;
	document.getElementById(ident).alt=alttext;
}
//IE hover-Ersatzfunktionen
function dotit(id,ord){
	if(window.browser=="ie" || ord){
		var boxitem=document.getElementById(id);
		boxitem.className="logoboxh";
		//boxitem.style.margin="0px";
		//boxitem.style.borderWidth="1px";
	}
}
function undotit(id, ord){
	if(window.browser=="ie" || ord){
		var boxitem=document.getElementById(id);
		boxitem.className="logobox";
		//boxitem.style.margin="1px";
		//boxitem.style.borderWidth="0px";
	}
}
//Classchange
function chKlasse(id,klasse){
	var boxitem=document.getElementById(id);
	boxitem.className=klasse;
}
function chBild(id,bild){
	var boxitem=document.getElementById(id);
	boxitem.src=bild;
}
function chBg(id,bild){
	var boxitem=document.getElementById(id);
	boxitem.style.backgroundImage='url('+bild+')';
}
function leeren(feldId,wert){
	if (document.getElementById(feldId).value == wert) document.getElementById(feldId).value = '';
}
function fuellen(feldId,wert){
	if (document.getElementById(feldId).value == '') document.getElementById(feldId).value = wert;
}
function vorladen(url){
	var bild=new Image;
	bild.src=url;
	bilder.push(bild);
}
function kuenstlerchoice(){
	k_list=["bartussek.html","beck.html","bracke.html","chodakowska.html","hoffmann.html","lensing-hebben.html","kippert.html","nettlich.html","nolte.html","pentaphonic.html","ruengeler.html","saed.html","weiher.html","wolter.html"];
	mplier=k_list.length;
	zahl=Math.floor(Math.random()*mplier);
	document.getElementById("m02").href=k_list[zahl];
}
function konvalidiere(){
	if(document.kontakt.vorname.value==""){
		document.kontakt.vorname.focus();
		alert("Bitte geben Sie Ihren Vornamen an.");
		return false;
	}else if(document.kontakt.nachname.value==""){
		document.kontakt.nachname.focus();
		alert("Bitte geben Sie Ihren Nachnamen an.");
		return false;
	}	if(document.kontakt.kommentar.value.length<10){
		document.kontakt.kommentar.focus();
		alert("Sie haben noch keine Nachricht eingegeben.");
		return false;
	}else if((document.kontakt.email.value.indexOf("@")<1 || document.kontakt.email.value.indexOf(".")<1) && document.kontakt.tel.value.length<7){
		document.kontakt.email.focus();
		return confirm("Moechten Sie die Nachricht wirklich ohne Angabe Ihrer Emailadresse oder Telefonnummer versenden? Wir koennen Sie dann nicht kontaktieren.");
	}else return true;
}

function de_nwlvalidiere(){
	if(document.katform.noemail.value.indexOf("@")<1 || document.katform.noemail.value.indexOf(".")<1){
		document.katform.noemail.focus();
		alert("Bitte geben Sie Ihre vollstaendige Emailadresse an.");
		return false;
	}else{
		alert("alles abbestellt!");
		return true;	
	}
}

function nwlvalidiere(){
	if(document.katform.vorname.value==""){
		document.katform.vorname.focus();
		alert("Bitte geben Sie Ihren Vornamen an.");
		return false;
	}else if(document.katform.nachname.value==""){
		document.katform.nachname.focus();
		alert("Bitte geben Sie Ihren Nachnamen an.");
		return false;
	}else if(document.katform.email.value.indexOf("@")<1 || document.katform.email.value.indexOf(".")<1){
		document.katform.email.focus();
		alert("Bitte geben Sie Ihre Emailadresse in beiden Emailfeldern an.");
		return false;
	}else if(document.katform.email.value != document.katform.email_w.value){
		document.katform.email.focus();
		alert("Bitte geben Sie in beiden Emailfeldern die gleiche Emailadresse an. Dies dient der Korrektur von etwaigen Tippfehlern.");
		return false;
	}else{
		return true;	
	}
}

function katvalidiere(){
	if(document.katform.vorname.value==""){
		document.katform.vorname.focus();
		alert("Bitte geben Sie Ihren Vornamen an.");
		return false;
	}else if(document.katform.nachname.value==""){
		document.katform.nachname.focus();
		alert("Bitte geben Sie Ihren Nachnamen an.");
		return false;
	}else if(document.katform.strasse.value==""){
		document.katform.strasse.focus();
		alert("Bitte geben Sie die Strasse an.");
		return false;
	}else if(document.katform.plz.value==""){
		document.katform.plz.focus();
		alert("Bitte geben Sie Ihre Postleitzahl an.");
		return false;
	}else if(document.katform.ort.value==""){
		document.katform.ort.focus();
		alert("Bitte geben Sie Ihren Ort an.");
		return false;
	}else if(document.katform.land.value==""){
		document.katform.land.focus();
		alert("Bitte geben Sie das Zielland an.");
		return false;
	}else if(document.katform.email.value.indexOf("@")<1 || document.katform.email.value.indexOf(".")<1){
		document.katform.email.focus();
		alert("Bitte geben Sie Ihre Emailadresse in beiden Emailfeldern an.");
		return false;
	/*}else if(document.katform.email.value=="" && document.katform.tel.value==""){
		document.katform.email.focus();
		alert("Bitte geben Sie Ihre Emailadresse oder Ihre Telefonnummer an.");
		return false;*/
	}else if(document.katform.email.value != document.katform.email_w.value){
		document.katform.email.focus();
		alert("Bitte geben Sie in beiden Emailfeldern die gleiche Emailadresse an. Dies dient der Korrektur von etwaigen Tippfehlern.");
		return false;
	}else return true;
}
//developers context
farben={blau:"#7da5d8", blau2008:"#589cbf", fitgruen:"#79cc62", pink:"#ea9de5", grau:"#bbbcca"};
function colorize(that){
	farbe=farben[that.value];
	if(document.styleSheets && document.styleSheets[0].cssRules){
		document.styleSheets[0].cssRules[1].style.borderColor = farbe;
		document.styleSheets[0].cssRules[2].style.backgroundColor = farbe;
		document.styleSheets[0].cssRules[3].style.color = farbe;
	}else if(document.styleSheets && document.styleSheets[0].rules){ //IE
		document.styleSheets[0].rules[1].style.borderColor = farbe;
		document.styleSheets[0].rules[2].style.backgroundColor = farbe;
		document.styleSheets[0].rules[3].style.color = farbe;
	};
}
function navigate(that){
	document.location.href=that.value;
}
function cpix(obi,pnum){
	nn=ppl[0];
	ppl[0]=ppl[pnum];
	ppl[pnum]=nn;
	document.getElementById("bpic").src=pix[ppl[0]].pf+"thumb400_400.jpg";
	document.getElementById("bpic").title=pix[ppl[0]].i;
	obi.src=pix[ppl[pnum]].pf+"thumb100_100.jpg";
	obi.title=pix[ppl[pnum]].i;
	bpo="url("+dspix[ppl[0]].pf+")";
	opic=ppl[0];
	nowpic=ppl[0];
	document.getElementById("diarahmen").style.backgroundImage=bpo;
}
function diashow(){
	document.getElementById("diacanvas").style.display="block";
}
function diahide(){
	nowpic=opic;
	document.getElementById("diarahmen").style.backgroundImage=bpo;
	document.getElementById("diacanvas").style.display="none";
		}
function naechstes(){
	if(nowpic==ppl.length-1){
		nowpic=0;
	}else{
		nowpic+=1;
	}
	bp="url("+dspix[nowpic].pf+")";
	document.getElementById("diarahmen").style.backgroundImage=bp;
}
function vorheriges(){
	if(nowpic==0){
		nowpic=ppl.length-1;
	}else{
		nowpic-=1;
	}
	bp="url("+dspix[nowpic].pf+")";
	document.getElementById("diarahmen").style.backgroundImage=bp;
	
}
//init:
var bilder=[];
detect();
