// JavaScript Document
function Email(adCrpt) {
	var key = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var email = adCrpt.replace(/ziz/,'@');
	var email2 = new String();
	
	for(var i = 0; i < email.length; i++) {
	var codechar	= email.substring(i, i + 1);
	var pos = key.indexOf(codechar.toUpperCase());

if(pos >= 0) {
	pos = (pos + key.length / 2) % key.length;
	codechar	= (codechar == codechar.toUpperCase()) ?
	key.substring(pos, pos + 1) :
	key.substring(pos, pos + 1).toLowerCase();
}
	email2	= email2 + codechar;
}
	window.location = 'mailto:'+email2;
}

function Bild(source) {
	document.getElementById('pic_big').src = source;
}

function Anfrage(angebot, reisegebiet, id) {
	if(!id) {
		id = 20;
	}
	
	if(!reisegebiet) {
		reisegebiet = '';
	}
	document.open('http://www.breadreloaded.de/anfrage/?id='+id+'&angebot='+angebot+'&reisegebiet='+reisegebiet,'anfrage','scrollbars=yes,resizable=yes,width=640,height=800');
}

function SELECT_VON()
{
document.write("<select class='kategorie' name='VON' size=1 onChange=TCHECK(0)>")
for (var i=2; i<=100;i++)
{
document.write('<option value='+i+'>'+GetDatum(i)+'')
}
document.write("</select>")
}

function SELECT_BIS()
{
document.write("<select class='kategorie' name='BIS' size=1 >")
//document.write('<option value=-14>max. 14 Tage später')
for (var i=5; i<=120;i++)
{
if (i==16) document.write('<option selected ');  else document.write('<option ');
document.write('value='+i+'>'+GetDatum(i)+'')
}
document.write('</select>')
}

function GetDatum(offset)
{ 
DatArray = new Array("So.","Mo.","Di.","Mi.","Do.","Fr.","Sa.","??" )
var time = new Date()
time.setTime( time.getTime()+offset*86400000);

tag     = time.getDate();
monat   = time.getMonth()+1;
jahr    = time.getYear() % 100;
if (tag   < 10)   tag   = "0"+tag;
if (monat < 10)   monat = "0"+monat;
if (jahr  < 10)   jahr  = "0"+jahr;
return tag+'.'+monat+'.'+jahr+' - '+DatArray[time.getDay()]
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// check multi checkboxes based on the name passed in.
function CheckMultiple(name) 
{
theFrm = document.frmSS;
for (var i=0; i < theFrm.length; i++) 
{
fldObj = theFrm.elements[i];
var fieldnamecheck=fldObj.name.indexOf(name);
if (fieldnamecheck != -1) {
if (fldObj.checked) {
return true;
}
}
}
return false;
}


function CheckSS()
{
theFrm = document.frmSS;

hasDot = theFrm.Email.value.indexOf(".");
hasAt = theFrm.Email.value.indexOf("@");

if (hasDot == -1 || hasAt == -1)
{
alert("Bitte geben Sie eine gültige eMail-Adresse ein.");
theFrm.Email.focus();
theFrm.Email.select();
return false;
}


valcheck = document.getElementById("Fields[1]");
if (valcheck.value == "") {
alert("Bitte geben Sie Ihren Namen ein (Vorname Nachname).");
valcheck.focus();
valcheck.select();
return false;
} else {
var minsize_1 = 0;
var maxsize_1 = 100;
var fieldlength = 0;
fieldlength = valcheck.value.length;
if (fieldlength < minsize_1) {
alert("You must enter a value for the 'Name' field longer than " + minsize_1 + " characters");
valcheck.focus();
return false;
}
if (fieldlength > maxsize_1) {
alert("You must enter a value for the 'Name' field no longer than " + maxsize_1 + " characters");
valcheck.focus();
return false;
}
}

return true;
}

function ChangeImage(image) {
	document.getElementById('fahne').src = image;
}
//-->
<!--
function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine gültige E-Mailadresse sein.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' muss aus Zahlen bestehen.\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+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist erforderlich.\n'; }
  } if (errors) alert('Folgende Fehler traten auf:\n'+errors);
  document.MM_returnValue = (errors == '');
}


function PopupRedirectELB() {
	MM_openBrWindow('popup_elb.html','Beauty Wellness Health','scrollbars=no,width=250,height=300');
}

//-->
