if (top.frames.length > 0) { top.location.href = self.location; }

function mail(xname){
var xendung = "fleuryfleury.com";
document.write('\<a class="email" href=\"mailto:' + xname + '@' + xendung + '">');
document.write(xname + '@' + xendung + '</a>');
}

function mailnolink(xname){
var xendung = "fleuryfleury.com";
document.write(xname + '@' + xendung);
}

function an(feld){
document.getElementById([feld]).style.border="1px solid #FF4C00";
document.getElementById([feld]).style.color='#000000';
}

function aus(feld){
document.getElementById([feld]).style.border="1px solid #E7E5E6";
document.getElementById([feld]).style.color='#000000';
}

function findObj(n, d) {
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=findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function validateForm_de() {
var i,p,q,nm,test,num,min,max,errors='',args=validateForm_de.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$');
if (p.test(val) == false) { errors+='- '+nm+' (eine gültige Adresse)   \n'; }
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' (nur Ziffern)   \n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' (eine Zahl zwischen '+min+' und '+max+')   \n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' \n'; }
} if (errors) alert('Bitte ausfüllen:                   \n\n'+errors);
document.returnValue = (errors == '');
}

function validateForm_en() {
var i,p,q,nm,test,num,min,max,errors='',args=validateForm_en.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$');
if (p.test(val) == false) { errors+='- '+nm+' (a valid address)   \n'; }
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' (numbers only)\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' (a number between '+min+' and '+max+')   \n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' \n'; }
} if (errors) alert('Please fill in:                   \n\n'+errors);
document.returnValue = (errors == '');
}

function validateForm_fr() {
var i,p,q,nm,test,num,min,max,errors='',args=validateForm_fr.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$');
if (p.test(val) == false) { errors+='- '+nm+' (une adresse valide)   \n'; }
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' (seulement des chiffres)   \n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' (une nombre entre '+min+' et '+max+')   \n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' \n'; }
} if (errors) alert('Veuillez compléter:                  \n\n'+errors);
document.returnValue = (errors == '');
}

function valForm_de() {
validateForm_de('E-Mail','','RisEmail','Name','','R','Ihre Nachricht','','R');
return document.returnValue;
}

function valForm_en() {
validateForm_en('E-mail','','RisEmail','Name','','R','Your message','','R');
return document.returnValue;
}

function valForm_fr() {
validateForm_fr('Courriel','','RisEmail','Nom','','R','Votre message','','R');
return document.returnValue;
}

function valGS_de() {
validateForm_de('Loesung','','R','Name','','R','Vorname','','R','Unternehmen','','R','Telefon','','RinNAN','E-Mail','','RisEmail');
return document.returnValue;
}

function preloadImages() {
var d=document; if(d.images){ if(!d.im_p) d.im_p=new Array();
var i,j=d.im_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.im_p[j]=new Image; d.im_p[j++].src=a[i];}}
}

