function date () {

var now = new Date();
var yr = now.getYear();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;
var dayNr = now.getDate();
var todaysDate;
var version = navigator.appVersion.substring(0,1);

//if(dayNr < 10) dayNr = ("0" + dayNr);

if(dName==1) Day = "Sonntag";
if(dName==2) Day = "Montag";
if(dName==3) Day = "Dienstag";
if(dName==4) Day = "Mittwoch";
if(dName==5) Day = "Donnerstag";
if(dName==6) Day = "Freitag";
if(dName==7) Day = "Samstag";

if(mName==1)  Month = "Januar";
if(mName==2)  Month = "Februar";
if(mName==3)  Month = "März";
if(mName==4)  Month = "April";
if(mName==5)  Month = "Mai";
if(mName==6)  Month = "Juni";
if(mName==7)  Month = "Juli";
if(mName==8)  Month = "August";
if(mName==9)  Month = "September";
if(mName==10) Month = "Oktober";
if(mName==11) Month = "November";
if(mName==12) Month = "Dezember";

if ((navigator.appName.indexOf('Netscape') != -1 && version >= 4 ) || navigator.userAgent.indexOf('Opera') != -1) {
  yr = yr + 1900;
  todaysDate = (' ' + Day + ', ' + dayNr + '. ' + Month + ' ' + yr);
}

else if (navigator.appName.indexOf('Microsoft') != -1) {
  todaysDate = (' ' + Day + ', ' + dayNr + '. ' + Month + ' ' + yr);
}

document.open();
document.write(todaysDate);
document.close();
} //end of function



function suche(){
	keyword = document.prosearch.suche.value;
	keyword = keyword.replace(" ", "%20");
	keyword = keyword.replace("Ä", "%C4");
	keyword = keyword.replace("ä", "%E4");
	keyword = keyword.replace("Ö", "%D6");
	keyword = keyword.replace("ö", "%F6");
	keyword = keyword.replace("Ü", "%DC");
	keyword = keyword.replace("ü", "%FC");
	host_main = window.location.host;
	
	if(document.prosearch.suche0.value == 1){
  	  url_main = "http://" + host_main + "/de/prosearch.php?suche=" + keyword;
  	}
	
	if(document.prosearch.suche0.value == 0){
	  suche1 = 0;
	  suche2 = 0;
	  
	  if(document.prosearch.suche1.checked == true){
	    suche1 = 1;
	  }
	  if(document.prosearch.suche2.checked == true){
	    suche2 = 1;
	  }
	  
	  url_main = "http://" + host_main + "/de/prosearch.php?suche=" + keyword + "&suche1=" + suche1 + "&suche2=" + suche2;
	}
	
	window.location.href = url_main;
} //end of function



function naviopen(wgr,id,id2){
	zustand = document.getElementById(id).style.display;

	if(zustand == "none"){
		document.getElementById(id).style.display =	"block";
		document.getElementById(id2).className =	"wgr" + wgr + "b";
	}
	if(zustand == "block"){
		document.getElementById(id).style.display =	"none";
		document.getElementById(id2).className =	"wgr" + wgr;
	}
}



function naviopen2(id,id2){
	zustand = document.getElementById(id).style.display;

	if(zustand == "none"){
		document.getElementById(id).style.display =	"block";
		document.getElementById(id2).className =	"menulink2";
	}
	if(zustand == "block"){
		document.getElementById(id).style.display =	"none";
		document.getElementById(id2).className =	"menulink";
	}
}



function logpos(ontime){
	infoWidth = document.getElementById('loginfo').style.width;
	pxPos = 	infoWidth.lastIndexOf("px");
	infoWidth = infoWidth.substr(0, pxPos);
	
	document.getElementById('loginfo').style.top = 	document.getElementById('logpos').offsetTop;
	document.getElementById('loginfo').style.left = document.getElementById('logpos').offsetLeft - infoWidth;
	
	document.getElementById('loginfo').style.display = 			"block";
	document.getElementById('loginfo').style.visibility = 		"visible";
	document.getElementById('loghint').style.backgroundColor = 	"#eef4f8";	
	
	window.setTimeout("divHidden()", ontime * 1000);
} //end of function



function divHidden(){
	document.getElementById('loginfo').style.display = 			"none";
	document.getElementById('loginfo').style.visibility = 		"hidden";
	document.getElementById('loghint').style.backgroundColor = 	"#dee9f2";
} //end of function



function divVisible(){
	document.getElementById('loginfo').style.display = 			"block";
	document.getElementById('loginfo').style.visibility = 		"visible";
	document.getElementById('loghint').style.backgroundColor = 	"#eef4f8";
} //end of function



function divHeight(recht,recht2){
  recht = document.getElementById(recht).value;
  recht2 = document.getElementById(recht2).value;
  
  if(recht == "A"){
    recht_data = new Array(); //visible
	recht_data2 = new Array(1,2,3,4,5,6,7,8,9,10,11,12); //hidden
	id = "bestell_";
  }
  if(recht2 == "B"){
    recht_data3 = new Array(); //visible
	recht_data4 = new Array(1,2,3,4,5,6,7,8); //hidden
	idB = "bestell2_";
  }
  if(recht == 1){
    recht_data = new Array(1,2,7,8,9,10,11,12); //visible
	recht_data2 = new Array(3,4,5,6); //hidden
	id = "bestell_";
  }
  if(recht == 2){
    recht_data = new Array(3,4,5,6,7,8,9,10,11,12); //visible
	recht_data2 = new Array(1,2); //hidden
	id = "bestell_";
  }
  if(recht2 == 1){
    recht_data3 = new Array(1,2,7,8); //visible
	recht_data4 = new Array(3,4,5,6); //hidden
	idB = "bestell2_";
  }
  if(recht2 == 2){
    recht_data3 = new Array(3,4,5,6,7,8); //visible
	recht_data4 = new Array(1,2); //hidden
	idB = "bestell2_";
  }
  
  for(i=0; i < recht_data.length; i++){
	id2 = id + recht_data[i];
	document.getElementById(id2).style.display = "";
  } //end of for
  
  for(i=0; i < recht_data2.length; i++){
	id2 = id + recht_data2[i];
	document.getElementById(id2).style.display = "none";
  } //end of for
  
  for(i=0; i < recht_data3.length; i++){
	id2 = idB + recht_data3[i];
	document.getElementById(id2).style.display = "";
  } //end of for
  
  for(i=0; i < recht_data4.length; i++){
	id2 = idB + recht_data4[i];
	document.getElementById(id2).style.display = "none";
  } //end of for
} //end of function



function liefAdr(){
  gleicheAdr = document.getElementsByName("adradr")[0].checked;

  if(gleicheAdr == true){
    data = new Array("a","b","c","d",1,2,3,4,5,6,7,8);
    display = "none";
  }
  if(gleicheAdr == false){
    data = new Array("a","b","c","d");
    display = "";
	divHeight("anschrift","anschrift2");
  }
  
  for(i=0; i < data.length; i++){
	id = "bestell2_" + data[i];
	document.getElementById(id).style.display = display;
	//document.getElementById("anschrift2").value = "B";
  } //end of for
} //end of function



function kontroll(aktion){
  if(aktion == 1){ //Bestelldaten ändern
    document.getElementById("kontroll").value = "ändern";
  }
  if(aktion == 2){ //Bestelldaten bestätigen
    document.getElementById("kontroll").value = "bestätigen";
  }
  
  document.getElementById("bestellung").submit(); 
} //end of function



function zubemenge(id){
  if(document.all("zumat" + id).checked == true){
    document.all("menge" + id).style.visibility = 	"visible";
	
	if(document.all("hmenge1").value >= 1){
	  document.all("menge" + id).value = document.all("hmenge1").value;
	}
	if(document.all("hmenge1").value < 1){
	  document.all("menge" + id).value = 1;
	}
  }
  if(document.all("zumat" + id).checked == false){
    document.all("menge" + id).style.visibility = 	"hidden";
  }
} //end of function