var oldLayerToHide = 0;

function showHideLayer(id) {
    if(oldLayerToHide != 0 && document.getElementById('Tipp_head_'+oldLayerToHide) != null) {
        document.getElementById('Tipp_head_'+oldLayerToHide).style.textDecoration = 'underline';
        document.getElementById('Tipp_head_'+oldLayerToHide).style.borderBottom = '1px solid #cccccc';
    }
    if (document.getElementById('Tipp_text_'+id).style.display == '') {
//            document.getElementById('Tipp_text_'+id).style.display = 'none';
            document.getElementById('Tipp_head_'+id).style.textDecoration = 'underline';
            document.getElementById('Tipp_head_'+id).style.borderBottom = '1px solid #cccccc';
    } else {
//            document.getElementById('Tipp_text_'+id).style.display = '';
            document.getElementById('Tipp_head_'+id).style.textDecoration = 'none';
            document.getElementById('Tipp_head_'+id).style.borderBottom = 'none';
    }
    oldLayerToHide = id;
}

function hideAmount(id) {
    if(document.getElementById(id).style.display == "none") {
       document.getElementById(id).style.display = "";
    } else {
       document.getElementById(id).style.display = "none";
    }
}

function isEmpty( inputStr ) {if ( null == inputStr || "" == inputStr ) {return true;}return false;}

function allowSigns(e,input) {
 if(input.value=='') {
	var allowedText = "123456789";
 } else {
	var allowedText = "0123456789";
 }
 var key;
 var keychar;
 //alert(e.which);
 if (window.event)
  key = window.event.keyCode;
 else if (e)
  key = e.which;
 else
  return true;
 
 keychar = String.fromCharCode(key);
 
 if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27)) {
    return true;
 } else if ((allowedText.indexOf(keychar) > -1)) {
    return true;
 } else {
    return false;
 }
}

function allowSignsZipCode(e,input) {
 if(input.value=='') {
	var allowedText = "0123456789";
 } else {
	var allowedText = "0123456789";
 }
 var key;
 var keychar;
 //alert(e.which);
 if (window.event)
  key = window.event.keyCode;
 else if (e)
  key = e.which;
 else
  return true;
 
 keychar = String.fromCharCode(key);
 
 if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27))
  return true;
 else if ((allowedText.indexOf(keychar) > -1))
  return true;
 else
  return false;
}

function emailCheck (emailStr) {
	var res;
	/* The following variable tells the rest of the function whether or not
	to verify that the address ends in a two-letter country or well-known
	TLD.  1 means check it, 0 means don't. */
	
	var checkTLD=1;
	
	/* The following is the list of known TLDs that an e-mail address must end with. */
	
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|pl|asia|name|tel|travel|post|cat|jobs|xxx)$/;
	
	/* The following pattern is used to check if the entered e-mail address
	fits the user@domain format.  It also is used to separate the username
	from the domain. */
	
	var emailPat=/^(.+)@(.+)$/;
	
	/* The following string represents the pattern for matching all special
	characters.  We don't want to allow special characters in the address. 
	These characters include ( ) < > @ , ; : \ " . [ ] */
	
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	
	/* The following string represents the range of characters allowed in a 
	username or domainname.  It really states which chars aren't allowed.*/
	
	var validChars="\[^\\s" + specialChars + "\]";
	
	/* The following pattern applies if the "user" is a quoted string (in
	which case, there are no rules about which characters are allowed
	and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	is a legal e-mail address. */
	
	var quotedUser="(\"[^\"]*\")";
	
	/* The following pattern applies for domains that are IP addresses,
	rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	e-mail address. NOTE: The square brackets are required. */
	
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	
	/* The following string represents an atom (basically a series of non-special characters.) */
	
	var atom=validChars + '+';
	
	/* The following string represents one word in the typical username.
	For example, in john.doe@somewhere.com, john and doe are words.
	Basically, a word is either an atom or quoted string. */
	
	var word="(" + atom + "|" + quotedUser + ")";
	
	// The following pattern describes the structure of the user
	
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	
	/* The following pattern describes the structure of a normal symbolic
	domain, as opposed to ipDomainPat, shown above. */
	
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	
	/* Finally, let's start trying to figure out if the supplied address is valid. */
	
	/* Begin with the coarse pattern to simply break up user@domain into
	different pieces that are easy to analyze. */
	
	var matchArray=emailStr.match(emailPat);
	
	if (matchArray==null) {
	
	/* Too many/few @'s or something; basically, this address doesn't
	even fit the general mould of a valid e-mail address. */
	
	//alert("Ungültige E-Mail Adresse");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	
	// Start by checking that only basic ASCII characters are in the strings (0-127).
	
	for (i=0; i<user.length; i++) {
	if (user.charCodeAt(i)>127) {
	//alert("Ungültige E-Mail Adresse");
		return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
	if (domain.charCodeAt(i)>127) {
	//alert("Ungültige E-Mail Adresse");
		return false;
	   }
	}
	
	// See if "user" is valid 
	
	if (user.match(userPat)==null) {
	
	// user is not valid
	
		//alert("Ungültige E-Mail Adresse");
		return false;
	}
	
	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */
	
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
	
	// this is an IP address
	
	for (var i=1;i<=4;i++) {
	if (IPArray[i]>255) {
		//alert("Ungültige E-Mail Adresse");
		return false;
	   }
	}
		return true;
	}
	
	// Domain is symbolic name.  Check if it's valid.
	 
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
	if (domArr[i].search(atomPat)==-1) {
		//alert("Ungültige E-Mail Adresse");
		return false;
	   }
	}
	if (checkTLD && domArr[domArr.length-1].length!=2 && 
	domArr[domArr.length-1].search(knownDomsPat)==-1) {
		//alert("Ungültige E-Mail Adresse");
		return false;
	}
	if (len<2) {
		//alert("Ungültige E-Mail Adresse");
		return false;
	}
	
	// If we've gotten this far, everything's valid!
	//onclick="goSubmit()"
	//goSubmit()
return true
}

function showNhide(idToShow,idToHide,secondIdToShow,secondIdToHide) {
	//if(secondIdToHide=='') {
	//	secondIdToHide=false;	
	//}
	//if(secondIdToShow=='') {
//		secondIdToShow=false;	
	//}
	if(document.getElementById(idToShow) != null)
        if(!idToShow=='') {
            if(document.getElementById(idToShow).style.display == 'none') {
                    document.getElementById(idToShow).style.display='';
            } else {
                    document.getElementById(idToShow).style.display='none';
            }
        }

        if(!idToHide=='') {
            if(document.getElementById(idToHide) != null)
            if(document.getElementById(idToHide).style.display=='') {
                    document.getElementById(idToHide).style.display='none';
            } else {
                    document.getElementById(idToHide).style.display='';
            }
        }
	
	if(document.getElementById(secondIdToHide) != null)
	if(!secondIdToHide=='') {
		if(document.getElementById(secondIdToHide).style.display=='') {	
			document.getElementById(secondIdToHide).style.display='none';
		} else {
			document.getElementById(secondIdToHide).style.display='';
		}
	}
	if(document.getElementById(secondIdToShow) != null)
	if(!secondIdToShow=='') {
		if(document.getElementById(secondIdToShow).style.display=='none') {	
			document.getElementById(secondIdToShow).style.display='';
		} else {
			document.getElementById(secondIdToShow).style.display='none';
		}
	}
}
function onlyShow(idToShow,idToHide,secondIdToShow,secondIdToHide) {
	
	if(document.getElementById(idToShow) != null)
	if(document.getElementById(idToShow).style.display == 'none') {
		document.getElementById(idToShow).style.display='';
	}
	
	if(document.getElementById(idToHide) != null)
	if(document.getElementById(idToHide).style.display=='') {
		document.getElementById(idToHide).style.display='none';
	}
	
	if(!secondIdToHide=='') {
		if(document.getElementById(secondIdToHide) != null)
		if(document.getElementById(secondIdToHide).style.display=='') {	
			document.getElementById(secondIdToHide).style.display='none';
		}
	}
	
	if(!secondIdToShow=='') {
		if(document.getElementById(secondIdToShow) != null)
		if(document.getElementById(secondIdToShow).style.display=='none') {	
			document.getElementById(secondIdToShow).style.display='';
		}
	}
}

function show_id(idToShow) {
	if(document.getElementById(idToShow).style.display == 'none') {
		document.getElementById(idToShow).style.display='';
	}
}
function hide_id(idToHide) {
	if(document.getElementById(idToHide).style.display == '') {
		document.getElementById(idToHide).style.display='none';
	}
}
function checkZipCode(zipcode,country,id){
  var result;
  //alert(zipcode);
  //alert(country);
  if(document.getElementById(country).value=='D') {
    if(isEmpty(document.getElementById(zipcode).value) || document.getElementById(zipcode).value.length<5 || document.getElementById(zipcode).value.length>5) {
	  if(document.getElementById(id) != null) document.getElementById(id).innerHTML='Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!';
      if(document.getElementById(id) != null) document.getElementById(id).style.display='';
	  result=false;
    } else {
	  if(document.getElementById(id) != null) document.getElementById(id).innerHTML='';
	  if(document.getElementById(id) != null) document.getElementById(id).style.display='none';
      result=true;
    }
  } else {
    if(isEmpty(document.getElementById(zipcode).value) || document.getElementById(zipcode).value.length<4 || document.getElementById(zipcode).value.length>4) {
	  if(document.getElementById(id) != null) document.getElementById(id).innerHTML='Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!';
          if(document.getElementById(id) != null) document.getElementById(id).style.display='';
	  result=false;
    } else {
	  if(document.getElementById(id) != null) document.getElementById(id).innerHTML='';
	  if(document.getElementById(id) != null) document.getElementById(id).style.display='none';
      result=true;
    }
  }
  return result;
}

function checkStep3() {
        var massage = "";
	var result;
	var result1;
	var result2;
	result=true;
	result2=true;
	var warning_text="Alle Felder mit * müssen ausgefüllt werden.";
	var difEmail_text="Die eingegebenen E-Mail-Adressen sind unterschiedlich. Bitte geben Sie Ihre E-Mail-Adresse nochmal ein.";
	var badEmail_text="Ungültige E-Mail Adresse";
        var verifyEmail_text='Bitte füllen Sie das Feld aus "E-Mail wiederholen"';
	var plz_text="Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!";
	
	//var arrRequired = new Array("title","name","surname","street","str_nr","country","zipcode","city","telephone1");
	var arrRequired = new Array("title","name","surname","street","str_nr","city","telephone1");
        var arrWarnings = new Array(
                                    "Bitte füllen Sie das Feld Anrede aus",
                                    "Bitte füllen Sie das Feld Name aus",
                                    "Bitte füllen Sie das Feld Vorname aus",
                                    "Bitte füllen Sie das Feld Straße aus",
                                    "Bitte füllen Sie das Feld Straße Nr. aus",
                                    "Bitte füllen Sie das Feld PLZ/Ort aus",
                                    "Bitte füllen Sie das Feld Telefon aus"
                                    );

        var requiredError = false;
	for(i=0;i<arrRequired.length;i++) {
		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
                        requiredError = true;
//                        document.getElementById(arrRequired[i]+'_error').innerHTML=arrWarnings[i];
//                        document.getElementById(arrRequired[i]+'_error').style.display = "";
                        document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//			document.getElementById('alert_ibox').innerHTML=arrWarnings[i];
//			iBox.showURL('#alert_ibox');
			result=false;
		} else {
                    document.getElementById(arrRequired[i]+'_error').style.display = "none";
                    document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                }
        }
        result0=checkZipCode('zipcode','country','zipcode_error');
        if(!result0) {
            result=false;
            massage += plz_text+"\n";
            document.getElementById('zipcode_error').style.display = "none";
            document.getElementById("zipcode").style.backgroundColor = "#ED9A9A";
        } else {
            document.getElementById("zipcode").style.backgroundColor = "#F7FAF2";   
        }
	if(document.getElementById('address_for_documents2').checked==true){
		var arrRequired = new Array("title_billing","name_billing","surname_billing","street_billing","str_nr_billing","country_billing","zipcode_billing","city_billing");	
		
		for(i=0;i<arrRequired.length;i++) {
			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
                                requiredError = true;
//                                document.getElementById(arrRequired[i]+'_error').innerHTML=warning_text;
//                                document.getElementById(arrRequired[i]+'_error').style.display = "";
                                document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
				result=false;
                        } else {
                            document.getElementById(arrRequired[i]+'_error').style.display = "none";
                            document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                        }
		}	
		result2=checkZipCode('zipcode_billing','country_billing','zipcode_alert1');
                if(!result2) {
                    result=false;
                    massage += plz_text+"\n";
                    document.getElementById('zipcode_alert1').style.display = "none";
                    document.getElementById("zipcode_billing").style.backgroundColor = "#ED9A9A";
                } else {
                    document.getElementById("zipcode_billing").style.backgroundColor = "#F7FAF2";   
                }
	}

	if(document.getElementById('sms_button_yes').checked==true){
		var arrRequired = new Array("cell_phone");	
		
		for(i=0;i<arrRequired.length;i++) {
			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
                            requiredError = true;
//                                document.getElementById(arrRequired[i]+'_error').innerHTML=warning_text;
//                                document.getElementById(arrRequired[i]+'_error').style.display = "";
                                document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
				result=false;
			} else {
                            document.getElementById(arrRequired[i]+'_error').style.display = "none";
                            document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                        }
		}	
	}
        if(requiredError) massage += warning_text+"\n";
	
	//result1=checkZipCode('zipcode','country','zipcode_alert1');
	//if(result1==false) {
	//	document.getElementById('alert_ibox').innerHTML=plz_text;
	//	iBox.showURL('#alert_ibox');
	//	result=false;
	//}
//	if(result2==false) {
//		document.getElementById('alert_ibox').innerHTML=plz_text;
//		iBox.showURL('#alert_ibox');
//		result=false;
//	}
//tu
    if(document.getElementById('email').value!=document.getElementById('verify_email').value) {
                massage += difEmail_text+"\n";
//                document.getElementById('verify_email_error').innerHTML=difEmail_text;
//                document.getElementById('verify_email_error').style.display = "";
                document.getElementById('verify_email').style.backgroundColor = "#ED9A9A";
    //		document.getElementById('alert_ibox').innerHTML=difEmail_text;
    //		iBox.showURL('#alert_ibox');
                result=false;
    } else {
        document.getElementById('verify_email_error').style.display = "none";
        document.getElementById('verify_email').style.backgroundColor = "#F7FAF2";
    }
  
  var email_txt;
  email_txt=document.getElementById('email').value;
  //alert(email_txt);
  //emailCheck(email_txt);
  
  if(document.getElementById('verify_email').value == "") {
      massage += verifyEmail_text+"\n";
//    document.getElementById('verify_email_error').innerHTML=verifyEmail_text;
//    document.getElementById('verify_email_error').style.display = "";
    document.getElementById('verify_email').style.backgroundColor = "#ED9A9A";
//    document.getElementById('alert_ibox').innerHTML=verifyEmail_text;
//    iBox.showURL('#alert_ibox');
    result=false;
  } else {
      document.getElementById('verify_email_error').style.display = "none";
      document.getElementById('verify_email').style.backgroundColor = "#F7FAF2";
      if(emailCheck(email_txt)==false) {
          massage += badEmail_text+"\n";
//            document.getElementById('email_error').innerHTML=badEmail_text;
//            document.getElementById('email_error').style.display = "";
            document.getElementById('email').style.backgroundColor = "#ED9A9A";
//            document.getElementById('alert_ibox').innerHTML=badEmail_text;
            //document.getElementById('alert_ibox').innerHTML='emailCheck wyplul blad';
//            iBox.showURL('#alert_ibox');
            result=false;
      } else {
            document.getElementById('email_error').style.display = "none";
            document.getElementById('email').style.backgroundColor = "#F7FAF2";
        }
  }
  /*if (email_txt.indexOf("@")=='-1')  {
    document.getElementById('alert_ibox').innerHTML=badEmail_text;
    iBox.showURL('#alert_ibox');     
    result=false;
  }*/

    if(!result) {
        alert(massage);
    }
    
    if(result == true) {
        document.location.href='/index.php?page=1562&p=4';
    }
}

function checkStep2(offSeason) {
	var result;
	var warning_text="<br>Wählen Sie Ihren Zahlungsweise.";
	var radiobutton=document.getElementsByName("payment_option");
//        if(offSeason == 0) {
            for (var i = 0; i < radiobutton.length; i++) {
                    if (radiobutton[i].checked == true) {
                            result=true;
                            break;
                    } else {
                            result=false;
                    }
            }
//        } else {
//            result=true;
//        }
	
	if(result==true) {
		document.location.href='/index.php?page=1562&p=3';
	} else {
		document.getElementById('alert_ibox').innerHTML=warning_text;
		iBox.showURL('#alert_ibox');
	}
}

function checkStep4_delivery() {
	var result=true;
	var warning_text="<br>Alle Felder mit * müssen ausgefüllt werden.";
	
	var arrRequired = new Array("title","name","surname","street","str_nr","country_change","zipcode_change","city_change");
	
	for(i=0;i<arrRequired.length;i++) {
		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
			document.getElementById('alert_ibox').innerHTML=warning_text;
			iBox.showURL('#alert_ibox');
			result=false;
		}
    }
	
	if(result==true) {
		showNhide('delivery_address','address_change');
	}
	return result;
}

function checkStep4_billing() {
	var result=true;
	var warning_text="<br>Alle Felder mit * müssen ausgefüllt werden.";
	
	var arrRequired = new Array("title_billing","name_billing","surname_billing","street_billing","str_nr_billing","country_billing_change","zipcode_billing_change","city_billing_change");	
		
	for(i=0;i<arrRequired.length;i++) {
		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
			document.getElementById('alert_ibox').innerHTML=warning_text;
			iBox.showURL('#alert_ibox');
			result=false;
		}
	}
	var warning_text="<br>Wählen Sie Ihren Zahlungsweise.";
	var radiobutton=document.getElementsByName("payment_option");
	for (var i = 0; i < radiobutton.length; i++) { 
		if (radiobutton[i].checked == true) {
			result=true;
			break;
		} else {
			result=false;
		}
    }
	if(result==true) {
		showNhide('billing_address','billing_change');
	}
	return result;
}

function checkStep4_kontakt() {
	var result=true;
	var warning_text="<br>Alle Felder mit * müssen ausgefüllt werden.";
	var difEmail_text="<br>Die eingegebenen E-Mail-Adressen sind unterschiedlich. Bitte geben Sie Ihre E-Mail-Adresse nochmal ein.";
	var badEmail_text="<br>Ungültige E-Mail Adresse";
	
	var arrRequired = new Array("email","telephone1");
	
	for(i=0;i<arrRequired.length;i++) {
		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
			document.getElementById('alert_ibox').innerHTML=warning_text;
			iBox.showURL('#alert_ibox');
			result=false;
		}
    }
	
	if(document.getElementById('sms_button_yes').checked==true){
		var arrRequired = new Array("cell_phone");	
		
		for(i=0;i<arrRequired.length;i++) {
			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
				document.getElementById('alert_ibox').innerHTML=warning_text;
				iBox.showURL('#alert_ibox');
				result=false;
			}
		}	
	}
	
	if(document.getElementById('email').value!=document.getElementById('verify_email').value) {
		document.getElementById('alert_ibox').innerHTML=difEmail_text;
		iBox.showURL('#alert_ibox');
		result=false;
	}
  
	var email_txt;
	email_txt=document.getElementById('email').value;
	
	if(emailCheck(email_txt)==false) {
		document.getElementById('alert_ibox').innerHTML=badEmail_text;
		iBox.showURL('#alert_ibox');
		result=false;
	}
	  
	/*if (email_txt.indexOf("@")=='-1')  {
	  document.getElementById('alert_ibox').innerHTML=badEmail_text;
	  iBox.showURL('#alert_ibox');     
	  result=false;
	}*/
	
	if(result==true) {
		showNhide('contact_data','contact_change');
	}
	return result;
}
function checkStep4_payment() {
	var result;
	var warning_text="<br>Wählen Sie Ihren Zahlungsweise.";
	var radiobutton=document.getElementsByName("payment_option");
	for (var i = 0; i < radiobutton.length; i++) { 
		if (radiobutton[i].checked == true) {
			result=true;
			break;
		} else {
			result=false;
		}
    }
	
	if(result==true) {
		showNhide('payment_data','payment_change');
	} else {
		document.getElementById('alert_ibox').innerHTML=warning_text;
		iBox.showURL('#alert_ibox');
	}
	return result;
}

function checkStep4() {
	var result=true;
	var result1=false;
	var result2;
	
	var check1=1,check2=1,check3=1,check4=1,check5=1,check6=1,check7=1,check8=1;
	
	var warning_text="<br>Alle Felder mit * müssen ausgefüllt werden.";
	var date_text="<br>Wählen Sie Ihren Abholtermin.";
	var difEmail_text="<br>Die eingegebenen E-Mail-Adressen sind unterschiedlich. Bitte geben Sie Ihre E-Mail-Adresse nochmal ein.";
	var badEmail_text="<br>Ungültige E-Mail Adresse";
	var email_text="<br>Wählen Sie Ihren Zahlungsweise.";
        var lzi_warning = "Bitte bestätigen Sie, daß Sie die Liefer- und Zahlungsbedingungen gelesen haben und akzeptieren.";
        var agb_warning = "Bitte bestätigen Sie, daß Sie die Allgemeinen Geschäftsbedingungen gelesen haben und akzeptieren.";
	
	//if(document.getElementById('sms_button_yes').checked==true){
	//	var arrRequired = new Array("cell_phone");	
	//	
	//	for(i=0;i<arrRequired.length;i++) {
	//		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
	//			document.getElementById('alert_ibox').innerHTML=warning_text;
	//			iBox.showURL('#alert_ibox');
	//			onlyShow('contact_change');
	//			check1=0;
	//		}
	//	}	
	//}
	
	//billing
	//alert(document.getElementById('billingVisible').value);
//	if(document.getElementById('billingVisible').value=='2') {
//		var arrRequired = new Array("title_billing","name_billing","surname_billing","street_billing","str_nr_billing","country_billing_change","zipcode_billing_change","city_billing_change","title","name","surname","street","str_nr","country_change","zipcode_change","city_change","email","telephone1");
//	} else {
//		//delivery
//		var arrRequired = new Array("title","name","surname","street","str_nr","country_change","zipcode_change","city_change","email","telephone1");
//	}
//	
//	for(i=0;i<arrRequired.length;i++) {
//		if (isEmpty(document.getElementById(arrRequired[i]).value)) {
//			document.getElementById('alert_ibox').innerHTML=warning_text;
//			iBox.showURL('#alert_ibox');
//			check2=0;
//		}
//    }
	
	//if(document.getElementById('email').value!=document.getElementById('verify_email').value) {
	//	document.getElementById('alert_ibox').innerHTML=difEmail_text;
	//	iBox.showURL('#alert_ibox');
	//	check3=0;
	//}
  
	//var email_txt;
	//email_txt=document.getElementById('email').value;
	//
	//if(emailCheck(email_txt)==false) {
	//	document.getElementById('alert_ibox').innerHTML=badEmail_text;
	//	iBox.showURL('#alert_ibox');
	//	check4=0;
	//}
	
	/*if (email_txt.indexOf("@")=='-1')  {
	  document.getElementById('alert_ibox').innerHTML=badEmail_text;
	  iBox.showURL('#alert_ibox');     
	  onlyShow('contact_change');
	  result=false;
	}*/
		
	//alert(document.getElementById('checkCalendar').value);
	//if(document.getElementById('checkCalendar').value==1) {
	//	document.getElementById('alert_ibox').innerHTML=date_text;
	//	iBox.showURL('#alert_ibox');
	//	check5=0;
	//}
	
//	if(document.getElementById('LZI_button').checked==false){
//		document.getElementById('alert_ibox').innerHTML=lzi_warning;
//		iBox.showURL('#alert_ibox');
//		check6=0;
//	}
//	if(document.getElementById('AGB_button').checked==false){
//		document.getElementById('alert_ibox').innerHTML=agb_warning;
//		iBox.showURL('#alert_ibox');
//		check7=0;
//	}
	
//	var radiobutton=document.getElementsByName("payment_option");
//	for (var i = 0; i < radiobutton.length; i++) { 
//		if (radiobutton[i].checked == true) {
//			result1=true;
//		}
//    }
	//if(result1==true) {
	//	check8=1;
	//} else {
	//	document.getElementById('alert_ibox').innerHTML=email_text;
	//	iBox.showURL('#alert_ibox');
	//	check8=0;
	//}
	//alert(check1+' '+check2+' '+check3+' '+check4+' '+check5+' '+check6+' '+check7+' '+check8);
	var wynik=Number;
	//wynik=(check1*check2*check3*check4*check5*check6*check7*check8);
	wynik=(check6*check7);
	
	if(wynik==1) {
		result=true;
	} else {
		result=false;
	}
	
	if(result==true) {
		document.location.href='/index.php?page=1562&p='+p;
		//alert('przejde do innej strony:)');
	} else {
	}
	return result;
}

function checkAnfragen() {
        var massage = "";
	var result;
	var result1;
	var result2;
	result=true;
	result2=true;
	var warning_text="Alle Felder mit * müssen ausgefüllt werden.";
	var difEmail_text="Die eingegebenen E-Mail-Adressen sind unterschiedlich. Bitte geben Sie Ihre E-Mail-Adresse nochmal ein.";
	var badEmail_text="Ungültige E-Mail Adresse";
	var plz_text="Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!";
	
	var arrRequired = new Array("title", "name", "surname", "country","zipcode","city", "comment", "email");
        
        var requiredError = false;
	for(i=0;i<arrRequired.length;i++) {
		if (document.getElementById(arrRequired[i]) != null && isEmpty(document.getElementById(arrRequired[i]).value)) {
                        requiredError = true;
//                        document.getElementById(arrRequired[i]+'_error').innerHTML=warning_text;
//                        document.getElementById(arrRequired[i]+'_error').style.display = "";
                        document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//			document.getElementById('alert_ibox').innerHTML=warning_text;
//			iBox.showURL('#alert_ibox');
			result=false;
		} else {
                    document.getElementById(arrRequired[i]+'_error').style.display = "none";
                    document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                }
        }
		
//	if(document.getElementById('address_for_documents2').checked==true){
//		var arrRequired = new Array("title_billing","name_billing","surname_billing","street_billing","str_nr_billing","country_billing","zipcode_billing","city_billing");
//
//		for(i=0;i<arrRequired.length;i++) {
//			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
//				result=false;
//			}
//		}
//		result2=checkZipCode('zipcode_billing','country_billing','zipcode_alert2');
//	}
	
//	if(document.getElementById('sms_button_yes').checked==true){
//		var arrRequired = new Array("cell_phone");
//
//		for(i=0;i<arrRequired.length;i++) {
//			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
//				result=false;
//			}
//		}
//	}
	
	result1=checkZipCode('zipcode','country','zipcode_error');
	if(result1==false) {
                massage += plz_text+"\n";
                document.getElementById('zipcode_error').style.display = "none";
//                document.getElementById('zipcode_error').innerHTML=plz_text;
//                document.getElementById('zipcode_error').style.display = "";
                document.getElementById('zipcode').style.backgroundColor = "#ED9A9A";
//		document.getElementById('alert_ibox').innerHTML=plz_text;
//		iBox.showURL('#alert_ibox');
		result=false;
	} else {
            document.getElementById('zipcode_error').style.display = "none";
            document.getElementById('zipcode').style.backgroundColor = "#F7FAF2";
        }
        
//	if(result2==false) {
//		document.getElementById('alert_ibox').innerHTML=plz_text;
//		iBox.showURL('#alert_ibox');
//		result=false;
//	}

        if(document.getElementById("answer_by_mail").checked == true && document.getElementById("email").value == "") {
            massage += badEmail_text+"\n";
//            document.getElementById('email_error').innerHTML=badEmail_text;
//            document.getElementById('email_error').style.display = "";
            document.getElementById('email').style.backgroundColor = "#ED9A9A";
    //                document.getElementById('alert_ibox').innerHTML=badEmail_text;
    //                iBox.showURL('#alert_ibox');
            result=false;
        } else {
            document.getElementById('email_error').style.display = "none";
            if(document.getElementById('email').value != "") document.getElementById('email').style.backgroundColor = "#F7FAF2";
        }

        if(document.getElementById("answer_by_telefon").checked == true && (document.getElementById("telephone1").value == "" || document.getElementById("email").value == "")) {
            requiredError = true;
//            document.getElementById('telephone1_error').innerHTML=warning_text;
//            document.getElementById('telephone1_error').style.display = "";
            if(document.getElementById("telephone1").value == "") document.getElementById('telephone1').style.backgroundColor = "#ED9A9A";
            if(document.getElementById("email").value == "") document.getElementById('email').style.backgroundColor = "#ED9A9A";
//            document.getElementById('alert_ibox').innerHTML=warning_text;
//            iBox.showURL('#alert_ibox');
            result=false;
        } else {
            document.getElementById('telephone1_error').style.display = "none";
            document.getElementById('telephone1').style.backgroundColor = "#F7FAF2";
            if(document.getElementById("answer_by_mail").checked == false) document.getElementById('email_error').style.display = "none";
            if(document.getElementById("answer_by_mail").checked == false && document.getElementById('email').value != "") document.getElementById('email').style.backgroundColor = "#F7FAF2";
        }

        if(document.getElementById("answer_by_mail").checked == true) {
            document.getElementById('telephone1_error').style.display = "none";
            document.getElementById('telephone1').style.backgroundColor = "#F7FAF2";
        }
//        } else if(document.getElementById("answer_by_telefon").checked == true) {
//            document.getElementById('email_error').style.display = "none";
//            document.getElementById('email').style.backgroundColor = "#F7FAF2";
//        }
        
        if(document.getElementById("answer_by_mail").checked == false && document.getElementById("answer_by_telefon").checked == false) {
            requiredError = true;
            result=false;
        }

//  if(document.getElementById('email').value!=document.getElementById('verify_email').value) {
//		document.getElementById('alert_ibox').innerHTML=difEmail_text;
//		iBox.showURL('#alert_ibox');
//		result=false;
//	}
  //alert(email_txt);
  //emailCheck(email_txt);
  
  /*if (email_txt.indexOf("@")=='-1')  {
    document.getElementById('alert_ibox').innerHTML=badEmail_text;
    iBox.showURL('#alert_ibox');     
    result=false;
  }*/
  if(requiredError) massage += warning_text+"\n";
  if(!result) {
        alert(massage);
    }
  if(result == true) {
    return document.location.href='/index.php?page=1569&p=3';
  }
}

function ChangeZipCode_3() {
    iBox.showURL('#changeZipCode');
}

function sprawdzKod(){
  var result;
  var zipcode = "zipcode";
  if(document.getElementById('zipcodeChange') != null) zipcode = 'zipcodeChange';
  //if(document.getElementById('country') != null)
  if(document.getElementById('country').value=='D') {
    if(isEmpty(document.getElementById(zipcode).value) || document.getElementById(zipcode).value.length<5 || document.getElementById(zipcode).value.length>5) {
      //if(!isEmpty(document.getElementById('zipcode').value)) {
		document.getElementById('warenkorb_alert').innerHTML='Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!';
	  //}
      document.getElementById('warenkorb_alert').style.display='block';
      result=false;
    } else {
      document.getElementById('warenkorb_alert').style.display='';
      result=true;
    }
  } else {
    if(isEmpty(document.getElementById(zipcode).value) || document.getElementById(zipcode).value.length<4 || document.getElementById(zipcode).value.length>4) {
      document.getElementById('warenkorb_alert').innerHTML='Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!';
      document.getElementById('warenkorb_alert').style.display='block';
      result=false;
    } else {
      document.getElementById('warenkorb_alert').style.display='';
      result=true;
    }
  }
  return result;
}

function checkNewsletter() {
	var radiobutton=document.getElementsByName("select_option");
	var email_txt;
	var result=false;
	
	email_txt=document.getElementById('news_mail').value;

	for (var i = 0; i < radiobutton.length; i++) { 
		if (radiobutton[0].checked == true) {
			result=true;
			if(email_txt!='' && email_txt.indexOf("@")!='-1') {
				if(document.getElementById('token').value!='') {
					result=true;	
				} else {
					result=false;
				}
				result=true;
			} else {
				result=false;
			}
			break;
		} else {
			result=false;
			break;
		}
    }
	
	if(result==false) {
		iBox.showURL('#newsletter_alert');
		result=false;
	} else {
		result=true;
	}
	return result;
}
function nwin(page, x)
{
 sx = screen.availWidth;
 sy = screen.availHeight;
 
 y = screen.availHeight;
 
 px = (sx/2)-(x/2);
 py = (sy/2)-(y/2);
 var nwi = window.open(page,'mwin','top='+py+',left='+px+',width='+x+',height='+y+',resizable=no,scrollbars=yes,status=yes', true);
 nwi.focus();
 return;
}

function changeArrow(id) {
	if(document.getElementById(id) != null) {
		elementHdl=document.getElementById(id);
		if(elementHdl.style.backgroundImage=="" || elementHdl.style.backgroundImage=='url("/images/hauptebene_right.gif")') {
			elementHdl.style.backgroundImage="url('/images/hauptebene.gif')";
			elementHdl.style.paddingBottom="13px";
		} else {
			elementHdl.style.backgroundImage="url('/images/hauptebene_right.gif')";
			elementHdl.style.paddingBottom="0px";
		}
	}
}

function notNull(el) {
 if(el!=null && el!=undefined) return true;
 else return false;
}

function isNull(el) {
 if(el==null && el==undefined) return true;
 else return false;
}

var cleaning;

function clearRows(activeRow) {
    for(var i=1; i<arrPos.length; i++) {
        if(activeRow != arrPos[i]) changeBorder("hover_"+arrPos[i], 0, arrPos[i]);
    }
}

//function ChangeBorderClass() {
//    this.finished = true;
//}
//ChangeBorderClass.prototype = {
//    changeBorder : function changeBorder(el,action,rowId,id) {
//    if(rowId != activeRow && this.finished) {
//        this.finished = false;
//        var bild = "bild_"+rowId;
//        var desc = "desc_"+rowId;
//	if(document.getElementById(el) != null) {
//                var nodes=document.getElementById(el).childNodes;
//                if(action == 1) {
////                    document.getElementById(bild).style.display="";
////                    document.getElementById(desc).style.display="";
//                } else {
//                    document.getElementById(bild).style.display="none";
//                    document.getElementById(desc).style.display="none";
////                    $("#bild_"+rowId).hide('normal');
////                    $("#desc_"+rowId).hide('normal');
//                }
//		for(var i=0; i<nodes.length; i++) {
//				if(action==1) {
//                                        nodes[i].style.borderBottom='0px';
////					if(i==0) {
////                                                nodes[i].rowSpan="2";
////					}
//                                        nodes[i].style.backgroundColor='#E3F2DB';
//				} else {
////					if(i==0) {
////                                                nodes[i].rowSpan="1";
////					}
//                                        nodes[i].style.borderBottom = '1px solid #CDCDCD';
//				}
//		}
//
//	}
//        if(action == 1) {
//            if(id > 0) {
//
//            } else {
//                alert(id+' RowId:'+rowId);
//            }
//            changeProduct(rowId,id);
//        }
//        this.finished = true;
//    }
//
//    }
//}
function changeBorder(el,action,rowId,id) {
    if(rowId != activeRow) {
        var bild = "bild_"+rowId;
        var desc = "desc_"+rowId;
	if(document.getElementById(el) != null) {
                var nodes=document.getElementById(el).childNodes;
                if(action == 1) {
//                    document.getElementById(bild).style.display="";
//                    document.getElementById(desc).style.display="";
                } else {

                    document.getElementById(bild).style.display="none";
                    document.getElementById(desc).style.display="none";
                }
		for(var i=0; i<nodes.length; i++) {
				if(action==1) {
                                        nodes[i].style.borderBottom='0px';
//					if(i==0) {
//                                                nodes[i].rowSpan="2";
//					}
                                        nodes[i].style.backgroundColor='#E3F2DB';
				} else {
//					if(i==0) {
//                                                nodes[i].rowSpan="1";
//					}
                                        nodes[i].style.borderBottom = '1px solid #CDCDCD';
				}
		}

	}
        if(action == 1) {
            if(id > 0) {

            } else {
                alert(id+' RowId:'+rowId);
            }
            changeProduct(rowId,id);
        }
    }

}

function checkIfIE() {
    var testBrowser = false;
    
    if(window.navigator.appName=="Microsoft Internet Explorer") {
        testBrowser = true;
    }

    return testBrowser;
}

function newWindow(url,title,width,height) {
	window.open(url,title,'width='+width+',height='+height+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no');
}

function onLoadHandler() {
	//var delivery1 = document.getElementById('type_lieferung1');
	//var delivery2 = document.getElementById('type_lieferung2');
	//var delivery3 = document.getElementById('type_lieferung3');
	////debugger;
	//if(notNull(delivery3)) {
	//	delivery3.checked=true;
	//} else if(notNull(delivery2)) {
	//	if(!notNull(delivery3) && delivery2.checked==false) {
	//		delivery1.checked=true;
	//	}
	//}
}

function mask(parameter) {
	if(parameter=='hide') var display='none';
	else if(parameter=='show') var display='block';
	
	var loaderDiv=document.getElementById('loader');
	if(notNull(loaderDiv)) {
		loaderDiv.style.display=display;
	}
}

function showPopup(e, s, info) {
    if(!document.getElementById('popupInfo')) {
        var b=document.createElement('div');
        b.id = 'popupBackground'
        b.style.height = '100%';
        b.style.width = '100%';
        b.style.position = 'absolute';
        b.style.left=0;
        b.style.top=0;
        b.style.zIndex=1;
        document.body.appendChild(b);
        b.onclick=function(e){
            document.body.removeChild(t);
            document.body.removeChild(b);
        }
        var t=document.createElement('div');
        t.className = 'showPopup';
        t.id = 'popupInfo';
//        t.zIndex = '1000';
        t.innerHTML = popupInfo[info];
        s.move=function(e){
            e=e||event;
            t.style.left=e.clientX+15+(document.documentElement.scrollLeft||document.body.scrollLeft)+'px'
            t.style.top=e.clientY+22+(document.documentElement.scrollTop||document.body.scrollTop)+'px'
        }
        s.move(e);
        document.body.appendChild(t);
        t.onclick=function(e){
            document.body.removeChild(t);
            document.body.removeChild(b);
        }
    }
}

function anfrageNextStep() {
    document.location.href='/index.php?page=1569&p=3';
}

function showBox(BoxId, IconToChange, warenkorb) {
    if(document.getElementById(BoxId).style.display == "none") {
        document.getElementById(BoxId).style.display = "";
        if(warenkorb == 0) {
            document.getElementById(IconToChange).style.backgroundImage = "url(/images/hauptebene.png)";
        } else {
            document.getElementById(IconToChange).style.backgroundImage = "url(/images/merkzettel-open.png)";
        }
    } else {
        document.getElementById(BoxId).style.display = "none";
        if(warenkorb == 0) {
            document.getElementById(IconToChange).style.backgroundImage = "url(/images/menu-closed.png)";
        } else {
            document.getElementById(IconToChange).style.backgroundImage = "url(/images/merkzettel-closed.png)";
        }
    }
}

function chInfo() {
  if(document.getElementById('country').value == "CH") {
      document.getElementById('ch_info').style.display='';
  } else {
      document.getElementById('ch_info').style.display='none';
  }
}

function changeInfo(nr, adress) {
    var message = new Array;

    message[0] = "<span id='warenkorb_head_title' style='padding: 0px!important;'>Bitte geben Sie Ihren E-Mail Adresse ein</span>";
    message[0] += "<br>";
    message[0] += "<br>";
    message[0] += "<table cellspacing='0' cellpadding='0' style='width: 380px; border: 0px;'>";
    message[0] += "<tr>";
    message[0] += "<td style='vertical-align: middle; text-align: left; width: 300px; color: #444444;'>";
    message[0] += "E-Mail-Adresse&nbsp;<input type='text' name='orderToMail' id='orderToMail' value='' style='width: 150px; color: #444444;'>";
    message[0] += "</td>";
    message[0] += "<td style='vertical-align: middle; text-align: right; width: 80px; height: 30px; padding-bottom: 15px;'>";
    message[0] += "&nbsp;<img src='/images/button-e-mail-senden.png' onClick=\"sendMail();\" style='border: 0px;'>";
    message[0] += "</td>";
    message[0] += "</tr>";
    message[0] += "</table>";

    message[1] = "<span id='warenkorb_head_title' style='padding: 0px!important;'>Der Versand des Merkzettels war erfolgreich</span>";
    message[1] += "<br>";
    message[1] += "<br>";
    message[1] += "<table cellspacing='0' cellpadding='0' style='width: 100%; border: 0px;'>";
    message[1] += "<tr>";
    message[1] += "<td style='vertical-align: middle; text-align: left; width: 75%; color: #444444;'>";
    message[1] += "Ihr Merkzettel wurde erfolgreich an "+adress+" versendet";
    message[1] += "</td>";
    message[1] += "<td style='vertical-align: middle; text-align: right; width: 25%;'>";
    message[1] += "&nbsp;<img src='/images/button_ok.png' onClick=\"iBox.hide(); hideFooter(0);\" style='border: 0px; cursor: pointer;'>";
    message[1] += "</td>";
    message[1] += "</tr>";
    message[1] += "</table>";

    return message[nr];
}

function hideFooter(act) {
    if(act == 0) {
        document.getElementById('ibox_footer_wrapper').style.display = "";
    } else {
        document.getElementById('ibox_footer_wrapper').style.display = "none";
    }
}

function checkKontaktFormular() {
        var massage = "";
	var result;
	var result1;
	var result2;
	result=true;
	result2=true;
	var warning_text="Alle Felder mit * müssen ausgefüllt werden.";
	var difEmail_text="Die eingegebenen E-Mail-Adressen sind unterschiedlich. Bitte geben Sie Ihre E-Mail-Adresse nochmal ein.";
	var badEmail_text="Ungültige E-Mail Adresse";
	var plz_text="Die eingegebene PLZ ist nicht gültig. Bitte korrigieren Sie Ihre Eingabe!";

	var arrRequired = new Array("title", "name", "surname", "country","zipcode","city", "comment", "code");

        var requiredError = false;
	for(i=0;i<arrRequired.length;i++) {
		if (document.getElementById(arrRequired[i]) != null && isEmpty(document.getElementById(arrRequired[i]).value)) {
                        requiredError = true;
//                        document.getElementById(arrRequired[i]+'_error').innerHTML=warning_text;
//                        document.getElementById(arrRequired[i]+'_error').style.display = "";
                        document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//			document.getElementById('alert_ibox').innerHTML=warning_text;
//			iBox.showURL('#alert_ibox');
			result=false;
		} else {
                    document.getElementById(arrRequired[i]+'_error').style.display = "none";
                    document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                }
    }
    

	if(document.getElementById('address_for_documents2') != null && document.getElementById('address_for_documents2').checked==true){
		var arrRequired = new Array("title_billing","name_billing","surname_billing","street_billing","str_nr_billing","country_billing","zipcode_billing","city_billing");
//
		for(i=0;i<arrRequired.length;i++) {
			if (document.getElementById(arrRequired[i]) != null && isEmpty(document.getElementById(arrRequired[i]).value)) {
                            requiredError = true;
                                document.getElementById(arrRequired[i]).style.backgroundColor = "#ED9A9A";
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
				result=false;
			} else {
                            document.getElementById(arrRequired[i]+'_error').style.display = "none";
                            document.getElementById(arrRequired[i]).style.backgroundColor = "#F7FAF2";
                        }
		}
//		result2=checkZipCode('zipcode_billing','country_billing','zipcode_alert2');
	}
        if(requiredError) massage += warning_text+"\n";

//	if(document.getElementById('sms_button_yes').checked==true){
//		var arrRequired = new Array("cell_phone");
//
//		for(i=0;i<arrRequired.length;i++) {
//			if (isEmpty(document.getElementById(arrRequired[i]).value)) {
//				document.getElementById('alert_ibox').innerHTML=warning_text;
//				iBox.showURL('#alert_ibox');
//				result=false;
//			}
//		}
//	}

	result1=checkZipCode('zipcode','country','zipcode_error');
	if(result1==false) {
                massage += plz_text+"\n";
                document.getElementById('zipcode_error').style.display = "none";
//                document.getElementById('zipcode_error').innerHTML=plz_text;
//                document.getElementById('zipcode_error').style.display = "";
                document.getElementById('zipcode').style.backgroundColor = "#ED9A9A";
//		document.getElementById('alert_ibox').innerHTML=plz_text;
//		iBox.showURL('#alert_ibox');
		result=false;
	} else {
            document.getElementById('zipcode').style.backgroundColor = "#F7FAF2";
            document.getElementById('zipcode_error').style.display = "none";
        }

//	if(result2==false) {
//		document.getElementById('alert_ibox').innerHTML=plz_text;
//		iBox.showURL('#alert_ibox');
//		result=false;
//	}

        if((document.getElementById("answer_by_mail").checked == true && document.getElementById("email").value == "")) {
            massage += badEmail_text+"\n";
//            document.getElementById('email_error').innerHTML=badEmail_text;
//            document.getElementById('email_error').style.display = "";
            document.getElementById('email').style.backgroundColor = "#ED9A9A";
    //                document.getElementById('alert_ibox').innerHTML=badEmail_text;
    //                iBox.showURL('#alert_ibox');
            result=false;
        } else {
            document.getElementById('email_error').style.display = "none";
            document.getElementById('email').style.backgroundColor = "#F7FAF2";
        }

        if(document.getElementById("answer_by_telefon").checked == true && document.getElementById("telephone1").value == "") {
            massage += warning_text+"\n";
//            document.getElementById('telephone1_error').innerHTML=warning_text;
//            document.getElementById('telephone1_error').style.display = "";
            document.getElementById('telephone1').style.backgroundColor = "#ED9A9A";
//            document.getElementById('alert_ibox').innerHTML=warning_text;
//            iBox.showURL('#alert_ibox');
            result=false;
        } else {
//            document.getElementById('telephone1_error').style.display = "none";
            document.getElementById('telephone1').style.backgroundColor = "#F7FAF2";
        }

        if(document.getElementById("answer_by_mail").checked == true) {
//            document.getElementById('telephone1_error').style.display = "none";
            document.getElementById('telephone1').style.backgroundColor = "#F7FAF2";
        } else if(document.getElementById("answer_by_telefon").checked == true) {
//            document.getElementById('email_error').style.display = "none";
            document.getElementById('email').style.backgroundColor = "#F7FAF2";
        }


  if(document.getElementById('email').value!=document.getElementById('verify_email').value) {
      massage += difEmail_text+"\n";
                document.getElementById('verify_email').style.backgroundColor = "#ED9A9A";
//		document.getElementById('alert_ibox').innerHTML=difEmail_text;
//		iBox.showURL('#alert_ibox');
		result=false;
	} else {
                document.getElementById('verify_email').style.backgroundColor = "#F7FAF2";
        }
  //alert(email_txt);
  //emailCheck(email_txt);

  /*if (email_txt.indexOf("@")=='-1')  {
    document.getElementById('alert_ibox').innerHTML=badEmail_text;
    iBox.showURL('#alert_ibox');
    result=false;
  }*/
    if(!result) {
        alert(massage);
    }
    return result;
}

function closePopupBasket() {
    document.getElementById("close_info").style.display = "";
}

