

function runden(zahl, nachkommastellen) {

  if (nachkommastellen < 1 || nachkommastellen > 14) return false;
  var e = Math.pow(10, nachkommastellen);
  var k = (Math.round(zahl * e) / e).toString();
  if (k.indexOf('.') == -1) k += '.';
  k += e.toString().substring(1);
  return k.substring(0, k.indexOf('.') + nachkommastellen+1);

} // ende runden








function addition(){
	
	
	anzahl = parseFloat(document.shopform1.anzahl.value);
	einzelNetto = parseFloat(document.shopform1.einzel_netto.value);


	anzahlCheckboxes = parseFloat(document.shopform1.anzahl_checkboxes.value);

	//alert(mwst);

	
	summeNetto=(einzelNetto * anzahl);

	k=0;
	
for(i=0;k<anzahlCheckboxes;i++){
	if(eval("document.shopform1.shop_zubehoer_"+i+".checked")==true){
		//alert(document.getElementById('preis_'+i).value);
		summeNetto= parseFloat(summeNetto) + ( parseFloat(document.getElementById('preis_'+i).value) * parseFloat(document.getElementById('zubehoer_anzahl_'+i).value));
	}
	i++;
	k++;
	
}
	
	
	document.getElementById('summe_netto').innerHTML=runden(summeNetto,2);
	
	
	
	
	// ZEICHEN ERSETZEN NETTO
		document.getElementById('summe_netto').innerHTML=document.getElementById('summe_netto').innerHTML.replace('.','a'); // punkt in a
		document.getElementById('summe_netto').innerHTML=document.getElementById('summe_netto').innerHTML.replace(',','b'); // komma in b
		document.getElementById('summe_netto').innerHTML=document.getElementById('summe_netto').innerHTML.replace('a',','); //  a in komma
		document.getElementById('summe_netto').innerHTML=document.getElementById('summe_netto').innerHTML.replace('b','.'); // b in punkt
		
		


	


} // end function









function addbox(boxname,uncheck){

if(eval("document.shopform1."+boxname+".checked")==true && uncheck != "farbe"){
	eval("document.shopform1."+boxname+".checked=false");
}
else {
	eval("document.shopform1."+boxname+".checked=true");
}
	addition();
}// end addbox








// BEI CLICK AUF ANZAHL SOLL DIE FARBE IMMER SICHTBAR SEIN
function anzahlShow(divid){ 

		document.getElementById(divid).style.display="block";

}





























function zoomall(newpic){
	document.images['zoompic'].src=newpic;
   document.getElementById('zoom').style.display="block";
   
   var detect = navigator.userAgent.toLowerCase();
	if(navigator && navigator.userAgent && navigator.userAgent.toLowerCase) {
  		if(detect.indexOf('msie') + 1) {
  	   	var xcord=Math.round((document.body.offsetWidth -913) / 2);
			document.getElementById('zoom').style.left=(xcord + 294)+"px";	
  	   }
  	 }
}
	

function hide(divid){
	document.images['zoompic'].src="../sys_pics/blank.gif";
	document.getElementById(divid).style.display="none";
}

// FTP-UPLOAD zeigt gif an
function zeige(divid){ 

	if(document.getElementById(divid).style.display == "block"){ //wird ausgeblendet
		document.getElementById(divid).style.display="none";
	}
	else {
		document.getElementById(divid).style.display="block";
	}
	
}






// WARENKORB WENN PULLDOWN BETÄTIGT WIRD
function zeigePulldown(divid){ 
	
	document.getElementById(divid).style.display="block";
		
}






<!-- 
// BILDSWAP
function swap(bildname,tauschbild)
{
document.images[bildname].src=tauschbild;
}
//-->













function interesse(){

	if(document.getElementById('interesse').style.display == "none"){
		document.getElementById('interesse').style.display = "block";
	}
	else {
		document.getElementById('interesse').style.display = "none";
	}

} // end function interesse





// AB HIER CHECK FORMULAR

// NUR ZAHLEN IN DER PLZ
function nurZahlen(el)
{
  var val = el.value.replace(/[^\.^,\d]/g, '');
  el.value = val;
} // end function nur zahlen






function chkFormular (zahl) {
	// zahl=0 wenn es nur ein Formular auf der Seite gibt
	// zahl=1 wenn es ZWEI Formulare auf gibt
/*
  if (document.forms[zahl].elements[1].checked == false && document.forms[zahl].elements[2].checked == false) {
    alert(unescape("Please select a salutatory address!"));
    
    return false;
  }
*/

 if (document.formular2.name.value == "") {
    alert("Please enter surname!");
    document.formular2.name.focus();
    return false;
  }
  
  /*
   if (document.formular2.vorname.value == "") {
    alert("Please enter name!");
    document.formular2.vorname.focus();
    return false;
  }
  
 

  if (document.formular2.strasse.value == "") {
    alert("Please enter street!");
    document.formular2.strasse.focus();
    return false;
  }
  */
  
  
     if (document.formular2.plz.value == "") {
    alert("Please enter zip code!");
    document.formular2.plz.focus();
    return false;
  }
  
  
    if (document.formular2.ort.value == "") {
    alert("Please enter city!");
    document.formular2.ort.focus();
    return false;
  }
  
     if (document.formular2.telefon.value == "") {
    alert("Please enter phone number!");
    document.formular2.telefon.focus();
    return false;
  }
  
  
     var sem = document.formular2.emailneu.value;
    if ((sem == "") || (sem.indexOf ('@', 0) == -1) || (sem.indexOf ('.', 0) == -1) || (sem.length < 6|| sem.indexOf ('.',0) == -1)) {
     alert("Please enter e-mail address!");
    document.formular2.emailneu.focus();
    return false;
    }
  
  
  
  
	if (document.formular2.land.value==""){
	alert(unescape("Please enter country!"));
	return false
	}


} // end function check formular







// CHECK PASSWORD
function chkPasswd () {

	 if (document.formular2.passwort1.value == "" || document.formular2.passwort1.value.length < 4) {
    alert("Password must be at least 4 characters!");
    document.formular2.passwort1.focus();
    return false;
  }
  
  
  if (document.formular2.passwort1.value != document.formular2.passwort2.value) {
  alert(unescape("Passwords don't match!"));
    document.formular2.passwort2.focus();
    return false;
  }
  
}// end function checkPassword




// COPYRIGHT INFO
function copyright () {
	alert(unescape("%A9 Copyright by EVOLUTION Friendship GmbH 2008 \n\n Die heruntergeladene Datei ist Eigentum der Evolution Friendship GmbH und darf nur im Rahmen eines Projektes verwendet werden. Eine Weitergabe an Dritte ist nicht zul%E4ssig."));
}



// S H O P 
function changeFarbe (id,farbwert) {
	var longstring=farbwert;
	var brokenstring=longstring.split(",");
	document.getElementById(id).style.background="#" + brokenstring[0];	
	document.getElementById(id).style.display="block";
}



// Checkt Anzahl + Farbe
function chkShop (formular,ausf){

var anzahl = eval("document."+formular+".anzahl.value");

	if (anzahl == "" || anzahl =="0"){
	alert(unescape("Please enter quantity!"));
	return false;
	}
	
	
	
if(ausf != ""){	
var farbe = eval("document."+formular+".farbe.value");
	if (farbe==""){
	alert(unescape("Please select colour!"));
	return false;
	}
}
	

	
}//end function



