function jamp() {

    this.AjaxPath = 'ajax/';
    
    this.errorColor = '#AA000A';
    this.successColor = '#DCDDDE';

    this.settings = {
        ajaxPath: 'ajax/',
        errorColor: '#DB6400',
        successColor: '#006633',
        defaultColor: '#191919',
        success: function() {

        }
    };

    this.isValidEmail = function( field ){
        var str = jQuery( field ).val();
        var filter = /^.+@.+\..{2,3}$/;

        if( filter.test( str ) ) {
            return true;
        } else {
            return false;
        }
    };

   this.flur = function( j, text ) {
        if(jQuery(j).length>0) {
            this.searchText = text;

            jQuery(j).val(text);

            jQuery(j).focus(function() {
                if(jQuery(j).val()==text) {
                    jQuery(j).val('');
                }
            });

            jQuery(j).blur(function() {
                if(jQuery(j).val()=='') {
                    jQuery(j).val(text);
                }
            });
        }
    };

    this.search = function( j, jInput ) {
        if(jQuery(j).length>0) {
            jQuery(j+' input').each(function() {
                if(jQuery(this).attr('type')=='button') {
                    jQuery(this).click(function() {
                        if(jQuery(jInput).val()!='' && jQuery(jInput).val()!=self.searchText) {
                            jQuery(j).submit();
                        }
                    });
                }
            });
        }
    };

    this.toggleSlide = function( self, idElement ) {
        if( jQuery( self ).css('display')=='none' ){
            jQuery( self ).stop(true, true).slideDown('fast');
        } else {
            jQuery( self).stop(true, true).slideUp('fast');
        }

        if( jQuery( idElement ).css('display')=='none' ){
            jQuery( idElement ).stop(true, true).slideDown('fast');
        } else {
            jQuery( idElement ).stop(true, true).slideUp('fast');
        }
    };

    /*
     *  Formartiert einen Preis, in dem . durch , ersetzt wird.
     *  Ebenso wird der Preis anhand von precision aufgerundet.
     *  Ist precision nicht angegeben, wird er automatisch auf 2 gesetzt.
     */
    this.formatPrice = function(wert,precision) {
        var x,x1,x2;

        if(precision==undefined) {
            precision = 2;
        }

        wert = (wert.toFixed) ? wert.toFixed(precision) : Math.floor(wert)+"."+(100+Math.round((wert-Math.floor(wert))*100)+"").substr(1,2);

        nStr = wert;

        nStr += '';
        x = nStr.split('.');
        x1 = x[0];
        x2 = x.length >= 1 ? ',' + x[1] : '';

        var rgx = /(\d+)(\d{3})/;
        while (rgx.test(x1)) {
            x1 = x1.replace(rgx, '$1' + '.' + '$2');
        }

        return x1 + x2;

    };

    /* returns actual page size as an array [width|height] */
    this.getPageSize = function() {
        var xScroll, yScroll;
        if (window.innerHeight && window.scrollMaxY) {
            xScroll = window.innerWidth + window.scrollMaxX;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        var windowWidth, windowHeight;
        if (self.innerHeight) {	// all except Explorer
            if(document.documentElement.clientWidth){
                windowWidth = document.documentElement.clientWidth;
            } else {
                windowWidth = self.innerWidth;
            }
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }
        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
            pageHeight = windowHeight;
        } else {
            pageHeight = yScroll;
        }
        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
            pageWidth = xScroll;
        } else {
            pageWidth = windowWidth;
        }
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
        return arrayPageSize;
    };
}

var jamp = new jamp();





var saveImg; 
var saveImgNoActiv;
function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images){ 
  if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ 
	 d.MM_p[j]=new Image; 
	 d.MM_p[j++].src=a[i];
	}
   }
}

function MM_swapImgRestoreAll() { 
  //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i]);i++){ 
    x.src=x.oSrc;
}}
  
function MM_swapImgRestore() { 
  //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i]);i++){ 
    if (saveImg != x.name) x.src=x.oSrc;
}}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length){
    d=parent.frames[n.substring(p+1)].document; 
	n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 
  return x;
}
function MM_saveImg(im,img3){

if (saveImg && im != saveImg){ document.images[saveImg].src = saveImgNoActiv;

}
saveImg = im;
saveImgNoActiv = img3;
MM_swapImgRestore();

}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null)
   {
    document.MM_sr[j++]=x; 
    if(!x.oSrc) x.oSrc=x.src; 
    x.src=a[i+2];
   }
}
function restoreMenu(){
saveImg = "";
}
function getSavedNoactive(){
return saveImgNoActiv;
}

	function TurnOver(wenn)
{
    wenn.style.backgroundImage = "url(img/menue/buttonon.gif)"; }
	
	function TurnOut(wenn) {
    wenn.style.backgroundImage = "url(img/menue/buttonoff.gif)";
}

function checkmail(al){
	var str=document.frm.mail.value
	var filter=/^.+@.+\..{2,3}$/
	if (filter.test(str)) {
		if(str == "checkmail") {
			alert("Stop sending spam!");
			return false
		} else {
			return true;
		}
	} else {
		if(al) alert("Bitte geben Sie eine korrekte E-Mail ein!");
		return false
	}
}

function EmptyFormField() {

	if(document.getElementById('textfieldsearch').value == 'Bitte den Suchbegriff hier eingeben.' || document.getElementById('textfieldsearch').value == 'Please type in the search key.') {
		document.getElementById('textfieldsearch').value = '';	
	}

}

function EmptyFormField2() {

	if(document.getElementById('suche').value == 'Bitte den Suchbegriff hier eingeben.' || document.getElementById('suche').value == 'Please type in the search key.') {
		document.getElementById('suche').value = '';	
	}

}

function SubmitForm(errmsg) {

	if(document.getElementById('textfieldsearch').value != '') {
		document.forms['textsearch'].submit();	
	} else {
		alert(errmsg);
		return false;
	}

}

function SubmitForm2(errmsg) {

	if(document.getElementById('suche').value != '') {
		document.forms['markt'].submit();	
	} else {
		alert(errmsg);
		return false;
	}

}

function CheckFields(lang){
    
	var err_str = '';	
	
	if(lang == 'de') {
		if(document.frm.mail.value == "rfkpu@go2.pl") err_str += "Ihre E-Mailadresse wurde blockiert! Senden Sie uns keinen weiteren Spam!\n";
		if(!checkmail()) err_str += "Bitte geben Sie eine korrekte E-Mail ein!\n";
		if(document.frm.vorname.value == "") err_str += "Bitte geben Sie Ihren Vornamen an.\n";	
		if(document.frm.nachname.value == "") err_str += "Bitte geben Sie Ihren Nachnamen an.\n";
		if(document.frm.position.value == "") err_str += "Bitte geben Sie Ihre Position im Unternehmen an.\n";
		if(document.frm.strasse.value == "") err_str += "Bitte geben Sie Ihre Straße an.\n";
		if(document.frm.ort.value == "") err_str += "Bitte geben Sie Ihren Wohnort und die Postleitzahl an.\n";	
		if(document.frm.telefon.value == "") err_str += "Bitte geben Sie Ihre Telefonnummer an.\n";	
		if(document.frm.mail.value == "") err_str += "Bitte geben Sie Ihre E-Mail an.\n";	
		if(document.frm.nachricht.value == "") err_str += "Bitte geben Sie Ihre Nachricht an.\n";	
		if(isNaN(document.frm.telefon.value)) err_str += "Bitte geben Sie nur Ziffern ohne Leerzeichen als Telefonnummer an.\n";
		if(document.frm.antispam1.value != document.frm.antispam2.value) err_str += "Bitte lösen Sie die Aufgabe!\n";
	
	} else if(lang == 'en') {
		if(document.frm.mail.value == "rfkpu@go2.pl") err_str += "Your address has been blocked. Stop spam us!\n";
		if(!checkmail()) err_str += "Please type in a correct mail address!\n";	
		if(document.frm.vorname.value == "") err_str += "Please type in your first name.\n";	
		if(document.frm.nachname.value == "") err_str += "Please type in your surname.\n";
		if(document.frm.position.value == "") err_str += "Please type in your position.\n";
		if(document.frm.strasse.value == "") err_str += "Please type in your street.\n";
		if(document.frm.ort.value == "") err_str += "Please type in your zip code and location.\n";	
		if(document.frm.telefon.value == "") err_str += "Please type in you phone number.\n";	
		if(document.frm.mail.value == "") err_str += "Please type in your mail address.\n";		
		if(document.frm.nachricht.value == "") err_str += "Please type in a message.\n";	
		if(isNaN(document.frm.telefon.value)) err_str += "Please only type in numerics without any spaces.\n";
		if(document.frm.antispam1.value != document.frm.antispam2.value) err_str += "Please awnser the question!\n";
		
	}
		
	
	if(err_str != ""){
		alert(err_str);
		return false; 
	} else {
		return true;
	}
}

/*var jamp = {

	AjaxPath:'ajax/',
	errorColor:'#AA000A',
	successColor:'#DCDDDE',

	isValidEmail: function(field) {
		var str=jQuery(field).val();
		var filter=/^.+@.+\..{2,3}$/;
		if (filter.test(str)) {
			return true;
		} else {
			return false;
		}
	},

	checkKey: function(e) {
		if(window.event) {
			key = window.event.keyCode;
		} else {
			key = e.keyCode;
		}
		if(key==13) {
			Suche.Do(jQuery('Suche').value);
		}
	},
	
	Window:function() {
		window.open('shop.php','Shop','width=200,height=100,scrollbars=no');	
	}

}*/
	
var Suche = {
	
	Do: function(value) {
		if(value!='') window.location.href='suche.php?suchbegriff='+value;	
	}
	
}

var Sprache = {
	
	Set: function(value) {
		if(value!='') {
			window.location.href='index.php?lang='+value;	
		}
	}
	
}

var Shop2 = {

    produktuebersicht:'shop.php',

	err:0,
	checked:0,
	fieldArr:[
				   {	File:'shop.php',
						SuccessText: '<div style="margin:25px 20px 0px 0px;">Die Bestellung wurde erfolgreich abgeschickt. Sie erhalten eine Bestätigungsemail und werden in Kürze von uns kontaktiert.</div>',
						Fields:	[
									{ Name:'Nachname', Required:true, Type:'text' },
									{ Name:'Vorname', Required:true, Type:'text' },
									{ Name:'Strasse', Required:true, Type:'text' },
									{ Name:'Hausnummer', Required:true, Type:'text' },
									{ Name:'PLZ', Required:true, Type:'text' },
									{ Name:'Ort', Required:true, Type:'text' },
									{ Name:'Telefon', Required:false, Type:'int' },
									{ Name:'Telefax', Required:false, Type:'int' },
									{ Name:'Email', Required:true, Type:'email' },

									/*{ Name:'Zahlungsmethode', Required:false, Type:'radio' },

									{ Name:'Kartentyp', Required:true, Type:'select' },
									{ Name:'Karteninhaber', Required:true, Type:'text' },
									{ Name:'Kartennummer', Required:true, Type:'int' },
									{ Name:'GueltigBis_Monat', Required:true, Type:'select' },
									{ Name:'GueltigBis_Jahr', Required:true, Type:'select' },

									{ Name:'Kontoinhaber', Required:true, Type:'text' },
									{ Name:'Kontonummer', Required:true, Type:'int' },
									{ Name:'BLZ', Required:true, Type:'int' },
									{ Name:'Bank', Required:true, Type:'text' },*/

									{ Name:'Submit', Required:false, Type:'button' }
								]
				   }
			],
	params:'',
	Text:'',
	i:0,
	u:0,
    arrowTop:'img/pfeiloben.gif',
    arrowBottom:'img/pfeilunten.gif',

    toggle: function(id,productNo,word) {
        if(jQuery('#produktbox_'+id).css('display')=='none') {
            jQuery('#produktbox_'+id).slideDown('fast');
            jQuery('#toggle_'+id+'_'+productNo).html('<img src="'+this.arrowTop+'" border="0" width="16" height="16" title="'+word+' ausblenden" alt="'+word+' ausblenden" align="absmiddle" />'+word+' ausblenden');
        } else {
            jQuery('#produktbox_'+id).slideUp('fast');
            jQuery('#toggle_'+id+'_'+productNo).html('<img src="'+this.arrowBottom+'" border="0" width="16" height="16" title="'+word+' anzeigen" alt="'+word+' anzeigen" align="absmiddle" />'+word+' anzeigen');
        }
    },

    setZahlungsmethode: function(id) {
		if(id=='Lastschrift') {
			jQuery('#div_'+id).css('display','block');
			jQuery('#div_Kreditkarte').css('display','none');
		} else {
			jQuery('#div_'+id).css('display','block');
			jQuery('#div_Lastschrift').css('display','none');
		}
	},

	add: function(id,productNo) {
		var t = this;

		//var intVal = parseInt(jQuery('#preis_'+id+'_'+productNo).val());
                var intVal = 1;

		//if(jQuery('#preis_'+id+'_'+productNo).val()!='') {
			//if(intVal>0 || !isNaN(jQuery('#preis_'+id+'_'+productNo).val())) {
                            if(intVal>0) {
				jQuery.ajax({
                                type:'POST',
                                data:'Mode=add&id='+id+'&anzahl='+intVal+'&productNo='+productNo,
                                url:jamp.AjaxPath+'shop.php',
                                success:function(html) {
                                    if(intVal>0){
                                        //jQuery('#preis_'+id+'_'+productNo).css('border','1px green solid');
                                        jQuery('#preis_'+id+'_'+productNo).fadeOut('fast',function(){
                                            jQuery('#link_del_'+id+'_'+productNo).fadeIn('fast');
                                        });

                                    } else {
                                        //jQuery('#preis_'+id+'_'+productNo).css('border','1px green solid');

                                        jQuery('#link_del_'+id+'_'+productNo).fadeOut('fast',function(){
                                            jQuery('#preis_'+id+'_'+productNo).fadeIn('fast');
                                        });
                                    }
                                }
                            });
			} else {
				jQuery('#preis_'+id+'_'+productNo).css('border','1px #E40B20 solid');
			}
		/*} else {
			jQuery('#preis_'+id+'_'+productNo).css('border','1px #DCDDDE solid');
		}*/
	},

    del: function(id,productNo) {
        var t = this;

        jQuery.ajax({
                type:'POST',
                data:'Mode=del&id='+id+'&productNo='+productNo,
                url:jamp.AjaxPath+'shop.php',
                success:function(html) {
                    
                    if(html>0) {
                        jQuery('#produkte_'+id+' #produkt_item_'+productNo).slideUp('fast');
                    } else {
                        t.delAll(id);
                    }
                }
        });
    },

    delAll: function(id) {
        var t = this;
        
        jQuery.ajax({
                type:'POST',
                data:'Mode=delAll&id='+id,
                url:jamp.AjaxPath+'shop.php',
                success:function(html) {
                    if(html>0) {
                        jQuery('#produktbox_'+id).slideUp('fast',function() {
                            window.location.reload();
                        });
                    } else {
                        jQuery('#produktbox_'+id).slideUp('fast',function() {
                            window.location.href=t.produktuebersicht;
                        });
                    }
                }
        });
    },

    delQuantity: function(id,productNo) {
        var t = this;

        jQuery.ajax({
                type:'POST',
                data:'Mode=del&id='+id+'&productNo='+productNo,
                url:jamp.AjaxPath+'shop.php',
                success:function(html) {
                    

                    //jQuery('#preis_'+id+'_'+productNo).val('');
                    //jQuery('#preis_'+id+'_'+productNo).css('border','1px #DCDDDE solid');
                    //jQuery('#produkte_'+id+' #produkt_item_'+productNo).slideUp('fast');
                    Shop2.toggle(id,productNo);
                    
                    jQuery('#link_del_'+id+'_'+productNo).fadeOut('fast',function(){
                        jQuery('#preis_'+id+'_'+productNo).fadeIn('fast');
                    });
                    
                    if(html<=0) {
                        t.delAll(id);
                    }
                }
        });
    },

	description: function(id) {
		if(jQuery('#Hinweis_'+id).css('display')=='block') {
			jQuery('#Hinweis_'+id).css('display','none');
		} else {
			jQuery('#Hinweis_'+id).css('display','block');
		}
	},

	send: function() {
		var t = this;

		t.err = 0;
		t.i = 0;
		t.u = 0;

		/*jQuery('#formShop input').each(function() {
                    if( isNaN(jQuery(this).val()) || parseInt(jQuery(this).val())<=0 ) {
                            t.err = 1;
                    }
                    if(jQuery(this).val()=='' || parseInt(jQuery(this).val())<=0) {
                            t.i++;
                    }
                    t.u++;
		});

		if(t.i == t.u) {
			jQuery('#errorEmpty').css('display','block');
		} else {
			jQuery('#errorEmpty').css('display','none');
		}

		if(t.err==0 && t.i < t.u) {
			window.location.href='shopformular.php';
		}*/
            
                jQuery.ajax({
                    url:jamp.AjaxPath+'shop.php',
                    data:'Mode=count&',
                    type:'post',
                    success:function(html){
                        if( html>0 ){
                            jQuery('#errorEmpty').css('display','none');
                            window.location.href='shopformular.php';
                        } else {
                            jQuery('#errorEmpty').css('display','block');
                        }
                    }
                });
	},

	sendForm: function(File) {
		t = Shop2;
		t.Text ='';
		t.err = 0;
		this.params = '';
		var Zahlungsmethode = '';

		for(i=0;i<t.fieldArr.length;i++) {
			if(t.fieldArr[i].File==File) {
                
				t.Text=t.fieldArr[i].SuccessText;

				for(k=0;k<t.fieldArr[i].Fields.length;k++) {
					var Arr = t.fieldArr[i].Fields[k];


					/*if(jQuery('#Kreditkarte:checked').val()=='Kreditkarte') {
						if(Arr.Name=='Kartentyp') Arr.Required=true;
						if(Arr.Name=='Karteninhaber') Arr.Required=true;
						if(Arr.Name=='Kartennummer') Arr.Required=true;
						if(Arr.Name=='GueltigBis_Monat') Arr.Required=true;
						if(Arr.Name=='GueltigBis_Jahr') Arr.Required=true;

						if(Arr.Name=='Kontoinhaber') Arr.Required=false;
						if(Arr.Name=='Kontonummer') Arr.Required=false;
						if(Arr.Name=='BLZ') Arr.Required=false;
						if(Arr.Name=='Bank') Arr.Required=false;
						Zahlungsmethode = jQuery('#Kreditkarte:checked').val();
					} else if(jQuery('#Lastschrift:checked').val()=='Lastschrift') {
						if(Arr.Name=='Kartentyp') Arr.Required=false;
						if(Arr.Name=='Karteninhaber') Arr.Required=false;
						if(Arr.Name=='Kartennummer') Arr.Required=false;
						if(Arr.Name=='GueltigBis_Monat') Arr.Required=false;
						if(Arr.Name=='GueltigBis_Jahr') Arr.Required=false;

						if(Arr.Name=='Kontoinhaber') Arr.Required=true;
						if(Arr.Name=='Kontonummer') Arr.Required=true;
						if(Arr.Name=='BLZ') Arr.Required=true;
						if(Arr.Name=='Bank') Arr.Required=true;
						Zahlungsmethode = jQuery('#Lastschrift:checked').val();
					}*/

					if(Arr.Required==true) {
						if(Arr.Type=='text') {
							if(jQuery('#Form_'+Arr.Name).val()=='') {
								t.err++;
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
							} else {
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
							}
						} else if(Arr.Type=='radio') {

						} else if(Arr.Type=='select') {
							if(jQuery("#Form_"+Arr.Name+" option:selected").val()=='') {
								t.err++;
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
							} else {
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
							}
						} else if(Arr.Type=='int') {
							if(jQuery('#Form_'+Arr.Name).val()=='' || isNaN(jQuery('#Form_'+Arr.Name).val())) {
								t.err++;
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
							} else {
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
							}
						} else if(Arr.Type=='checkbox') {
							if(jQuery('#Form_'+Arr.Name).checked==false) {
								t.err++;
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
							} else {
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
							}
						} else if(Arr.Type=='email') {
							if(!jamp.isValidEmail('#Form_'+Arr.Name)) {
								t.err++;
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
							} else {
								jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
								//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
							}
						}

						if(Arr.Type=='radio') {
							this.params+=Arr.Name+'='+Zahlungsmethode+'&';
						} else {
							this.params+=Arr.Name+'='+jQuery('#Form_'+Arr.Name).val()+'&';
						}
					} else {
						if(Arr.Type=='radio') {
							this.params+=Arr.Name+'='+Zahlungsmethode+'&';
						} else {
							this.params+=Arr.Name+'='+jQuery('#Form_'+Arr.Name).val()+'&';
						}
					}

				}
			}
		}

		if(t.err<=0) {
                    jQuery.ajax({
                        type:'post',
                        url:jamp.AjaxPath+'shop.php',
                        data:'Mode=send&'+this.params,
                        success:function(html) {
                            if(html=='done') {
                                jQuery('.fliesstextbox').html(t.Text);
                            } else {

                            }
                        }
                    });
		}
	}
}


var Form = {
	// fieldArr beinhaltet alle Felder aus dem Formular:
	/*
	 *	KONFIGURIERT FÜR jQuery!!!	
	 *
	 *	File: Die Datei, von der aus die E-Mail versendet wird. Standardmäßig wohl "Mail.php" im "Ajax"-Verzeichnis
	 *	SuccessText: Der Text, der ausgegeben werden soll, wenn das Formular erfolgreich verschickt wurde.
	 *	Fields: Ein Array, mit den Feldname, dem Überprüfungsmodus und dem Feldtypen:
	 *		Name: Ist die ID des Feldes ohne (!) "Form_".
	 *		Required: Ist Required auf true gesetzt, wird es auf Gültigkeit überprüft, andernfalls rutscht es so durch
	 *		Type:
	 *				text: Ist ein ganz normales Textfeld oder Textareafeld. Wird dann auf leer geprüft
	 *				int: Ist ein numerisches Feld und prüft, ob nur gültige Zahlen verwendet wurden
	 *				email: Ist ein "Textfeld", jedoch wird geprüft, ob die eingebene E-Mail Adresse gültig ist
	 *				checkbox: Prüft, ob bei dem Checkboxfeld der Haken gesetzt wurde
	 *				button: Ist der Sende- bzw. Abbrech-button.
	 *
	*/
	fieldArr:[
			   {	File:'Mail.php',
			   		SuccessText: 'Die Kontaktanfrage wurde erfolgreich versendet.',
					Fields:	[
								{ Name:'Nachname', Required:true, Type:'text' },
								{ Name:'Vorname', Required:true, Type:'text' },
								{ Name:'Strasse', Required:false, Type:'text' },
								{ Name:'Hausnummer', Required:false, Type:'text' },
								{ Name:'Telefon', Required:false, Type:'int' },
								{ Name:'Telefax', Required:false, Type:'int' },
								{ Name:'Email', Required:true, Type:'email' },
								{ Name:'Mitteilung', Required:true, Type:'text' },
								{ Name:'Submit', Required:false, Type:'button' }
							]
			   }
			 ],
	
	err:0,
	i:0,
	params:'',
	Text:'',
	
	errorHandling: {
		init:function(File) {
			t = Form;
			t.Text='';
			t.err=0;
			this.params='';

			for(i=0;i<t.fieldArr.length;i++) {
				if(t.fieldArr[i].File==File) {
					t.Text=t.fieldArr[i].SuccessText;
					
					for(k=0;k<t.fieldArr[i].Fields.length;k++) {						
						var Arr = t.fieldArr[i].Fields[k];
						
						if(Arr.Required==true) {
							if(Arr.Type=='text') {
								if(jQuery('#Form_'+Arr.Name).val()=='') {
									t.err++;
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;	
								} else {
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
								}
							} else if(Arr.Type=='int') {
								if(jQuery('#Form_'+Arr.Name).val()=='' || isNaN(jQuery('#Form_'+Arr.Name).val())) {
									t.err++;
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
								} else {
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
								}
							} else if(Arr.Type=='checkbox') {
								if(jQuery('#Form_'+Arr.Name).checked==false) {
									t.err++;
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
								} else {
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
								}
							} else if(Arr.Type=='email') {
								if(!jamp.isValidEmail('#Form_'+Arr.Name)) {
									t.err++;
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.errorColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.errColor;
								} else {
									jQuery('#Form_'+Arr.Name).css('border','1px '+jamp.successColor+' solid');
									//jQuery('#Form_'+Arr.Name).style.borderColor=t.successColor;
								}
							}
						}
						
						this.params+=Arr.Name+'='+jQuery('#Form_'+Arr.Name).val()+'&'
					}
				}
			}
		
			if(t.err<=0) {
				jQuery.ajax({
							type:'post',
							url:jamp.AjaxPath+'Kontakt.php',
							data:this.params,
							success:function(html) {
								if(html=='done') {
								//	jQuery('.fliesstext').html(t.Text);
								window.location.href='kontaktbestaetigung';
								} else {
									
								}
							}
					   });
			}
		}
	},
	save:function(File) { this.errorHandling.init(File); }
}
