/*function check_add_menu() 
{
	if (document.forms['add_menu'].fsitenameD.value == '' || 
		document.forms['add_menu'].fsitenameF.value == '' || 
		document.forms['add_menu'].fsitenameE.value == '' || 
		document.forms['add_menu'].fsitenameS.value == '')
	{
	alert('Bitte fuellen Sie alle noetigen Felder aus!');
	return false;
	}
}*/

function check_contact(lang,formindex){
	if(document.forms[formindex].name.value == "" || 
		document.forms[formindex].email.value == "" || 
		document.forms[formindex].tel.value == "" || 
		document.forms[formindex].text.value == ""){
		if (lang == 'f')
			x = 'Remplir correctement les champs';
		else
			x = 'Bitte alle Felder korrekt angeben';
			
		alert(x);
		return false;
	}
	else
		return true;
}


function checkform(langs,schritt,anzahl){
	if(schritt == '1'){
		alert('sdsds');
		
		if(document.forms['buchen1'].datumvon.type == 'text' && document.forms['buchen1'].datumvon.value == ''){
			if (langs == 'f')
				x = 'Choississez correctement la date';
			else
				x = 'Bitte wählen Sie das Datum';
				
			alert(x);
			return false;
				
		}
		
		if (document.forms['buchen1'].anzahl.value == '' || isNaN(document.forms['buchen1'].anzahl.value)){
			if (langs == 'f')
				x = 'Choississez correctement le nombre de personnes';
			else
				x = 'Bitte geben Sie die korrekte Anzahl Personen an';
				
			alert(x);
			return false;
					
		}
		
		// individual reise
		if (document.forms['buchen1'].datumindividuell && document.forms['buchen1'].datumvon.value == ''){
			if (langs == 'f')
				x = 'Choississez correctement la date';
			else
				x = 'Bitte wählen Sie das Datum';
				
			alert(x);
			return false;	
		}	
		
		return true;
	}
	
	if(schritt == '1a'){
		var err = 0;
		for(i=1;i<=anzahl;i++){
			str1 = 'document.forms["buchenaa"].akv_name'+i+'.value';
			str2 = 'document.forms["buchenaa"].akv_vorname'+i+'.value';
			str3 = 'document.forms["buchenaa"].akv_gebdatum'+i+'.value';
			str4 = 'document.forms["buchenaa"].akv_reisebeginn'+i+'.value';
			str5 = 'document.forms["buchenaa"].akv_reiseende'+i+'.value';
			
			if(eval(str1)==''){
			var err = 1	
			}
			if(eval(str2)==''){
			var err = 1	
			}
			if(eval(str3)==''){
			var err = 1	
			}
			if(eval(str4)==''){
			var err = 1	
			}
			if(eval(str5)==''){
			var err = 1	
			}
		}
		
		if(err == 1){
			if(langs=='d'){
				alert('Bitte alle Felder ausfuellen');
			}
			else{
				alert('Remplissez tous les champs sil vous plait');
			}
			return false;
		}
		else
			document.forms['buchenaa'].submit();
	}
	
	if(schritt == '2'){
		
		for(i=1;i<=anzahl;i++){
			str1 = 'document.forms["buchen2"].name'+i+'.value';
			str2 = 'document.forms["buchen2"].vorname'+i+'.value';
			str3 = 'document.forms["buchen2"].alter'+i+'.value';
			
			
			
			if(eval(str1)==''){
				if (langs == 'f')
					x = 'Indiquez correctement le nom du personne '+i;
				else
					x = 'Bitte geben Sie den Namen der Person '+i+' an';
			
				alert(x);
				return false;
			}
			if(eval(str2)==''){
				if (langs == 'f')
					x = 'Indiquez correctement le prénom du personne '+i;
				else
					x = 'Bitte geben Sie den Vornamen der Person '+i+' an';
			
				alert(x);
				return false;
			}
			if(eval(str3)=='' || isNaN(eval(str3))){
				if (langs == 'f')
					x = "Indiquez correctement l'age du personne "+i;
				else
					x = 'Bitte geben Sie das Alter der Person '+i+' korrekt an';
			
				alert(x);
				return false;
			}
		}
		
		/* if(document.forms["buchen2"].einzel.value=='' && 
			document.forms["buchen2"].zweier.value=='' && 
			document.forms["buchen2"].dreier.value=='' && 
			document.forms["buchen2"].vierer.value=='' && 
			document.forms["buchen2"].fuenfer.value=='')
			{
			if (langs == 'f')
					x = 'Indiquez la combinaison des chambres que vous désirez';
				else
					x = 'Bitte geben Sie Ihre gewünschte Zimmerkombination an';
			
				alert(x);
				return false;
			}*/
		
		return true;
			
	}
	
	
	if(schritt == '6'){
		if(document.forms['buchen'].name.value == ""){
			if (langs == 'f')
				x = 'Remplir correctement votre Nom';
			else
				x = 'Bitte geben Sie Ihren Namen an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].vorname.value == ""){
			if (langs == 'f')
				x = 'Remplissez correctement votre prénom';
			else
				x = 'Bitte geben Sie Ihren Vornamen an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].str.value == ""){
			if (langs == 'f')
				x = 'Remplissez correctement votre adresse';
			else
				x = 'Bitte geben Sie Ihre Adresse an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].nr.value == ""){
			if (langs == 'f')
				x = 'Remplissez correctement le no. de la rue';
			else
				x = 'Bitte geben Sie Ihre Hausnummer an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].plz.value == "" || isNaN(document.forms['buchen'].plz.value)){
			if (langs == 'f')
				x = 'Remplissez correctement votre NPA';
			else
				x = 'Bitte geben Sie Ihre PLZ korrekt an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].ort.value == ""){
			if (langs == 'f')
				x = 'Remplir correctement votre lieu';
			else
				x = 'Bitte geben Sie Ihren Wohnort an';
				
			alert(x);
			return false;
			}
		}
		//isNaN(document.forms['buchen'].telp.value)
		if(document.forms['buchen'].telp.value == ""){
			if (langs == 'f')
				x = 'Remplissez correctement le no. téléfon';
			else
				x = 'Bitte geben Sie Ihre korrekte Tel.-Nummer an';
				
			alert(x);
			return false;
			}
		if(document.forms['buchen'].emailp.value == ""){
			if (langs == 'f')
				x = 'Remplissez correctement votre adresse e-mail';
			else
				x = 'Bitte geben Sie Ihre korrekte E-Mail Adresse an';
				
			alert(x);
			return false;
			}
		
		return true
}



function setTyp(formular)
{
	if(document.forms[formular].fparent.options[0].selected!=true && document.forms[formular].ftyp.length == 2)
	   	{
		document.forms[formular].ftyp.options[document.forms[formular].ftyp.length - 1] = null;	
		}
	   	
	else if(document.forms[formular].fparent.options[0].selected==true && document.forms[formular].ftyp.length == 1)
	{
		NeuerEintrag = new Option('Reisen', 2, false);
  		document.forms[formular].ftyp.options[document.forms[formular].ftyp.length] = NeuerEintrag;
	}

}

function search_check(lang)
{
	if(document.forms['suche'].keyword.value == '')
	{
		if(lang == 'd')
			x = 'Bitte ein Stichwort angeben';
		else
			x = 'Veuillez indiquer le mot clé';
		alert(x)	
		return false;
	}
	else
		return true;
}

function changeImage(id,pic,status)
{
if (status == 1) 
	{
	pic_add = '-over.gif';
	}
	else
	{
	pic_add = '.gif';
	}
picture = pic + pic_add;
document.images[id].src='images/content/'+picture;
}

function correctPNG() 
{
	for(var i=0; i<document.images.length; i++)
	{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle                        
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
//window.attachEvent("onload", correctPNG);


/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Visit http://www.dynamicdrive.com/ for full script
* This notice must stay intact for use
******************************************/

adTime=5;  // seconds ad reminder is shown
chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
	if(!ns && !ie && !w3) return;
	if(ie)		adDiv=eval('document.all.sponsorAdDiv.style');
	else if(ns)	adDiv=eval('document.layers["sponsorAdDiv"]');
	else if(w3)	adDiv=eval('document.getElementById("sponsorAdDiv").style');
	randAd=Math.ceil(Math.random()*chanceAd);
        if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
	if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*100){adCount+=1;
	if (ie){documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
	documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;}	
	else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
	documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
	else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
	documentHeight=self.innerHeight/2+window.pageYOffset-20;} 
	adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
	setTimeout("showAd()",1000);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


/***********************************************
* Ultimate Fade-In Slideshow (v1.5): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=obj.degree/100
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}


function topen(fid){
	if(document.getElementById(fid).style.display=='none')
	document.getElementById(fid).style.display='block';
	else
	document.getElementById(fid).style.display='none';
}


function changeCurrency(cur,pid,tid,eid,hid,gid){
	
	pidstring = 'pid/'+pid;
	currstring = '/curr/'+cur;
	
	if(tid!='')
		tidstring = '/tid/'+tid+'/';
	else
		tidstring = '';
		
		
	if(eid!='')
		eidstring = '/eid/'+eid+'/';
	else
		eidstring = '';
	
	
	if(hid!='')
		hidstring = '/hid/'+hid+'/';
	else
		hidstring = ''; 
	
	
	if(gid!='')
		gidstring = '/gid/'+gid+'/';
	else
		gidstring = '';
	
	location.href='/index.cfm/'+pidstring+tidstring+eidstring+hidstring+gidstring+currstring;
	}



function unScramble(eMail1,eMail2,linkText,subjectText,statusText){
	var a,b,c,d,e;a=eMail1;c=linkText;b=eMail2.substring(0,eMail2.length-5);
	if(subjectText!=""){d="?subject="+escape(subjectText);}else{d="";}
	if(statusText!=""){e=" onMouseOver=\"top.status=\'"+statusText+ 
	"\'\;return true\;\" onMouseOut=\"top.status=\'\'\;return true\;\"";}else{e="";}
	document.write("<A HREF=\"mai"+"lto:"+a+"@"+b+d+"\""+e+">"+c+"</A>");
}
 

function redirect(url,pid,adid){
	location.href='/logAd.cfm/url/'+url+'/pid/'+pid+'/adid/'+adid;
	}
	
function getselection(ort,url){
	if(ort=='')
		location.href=url+'/hotels.cfm';
	else
		location.href=url+'/selection/'+ort+'/nid/'+ort+'/hotels.cfm';
}