// f�r Mausaktionen
mouseAction = 1;

/* zeigt das Gebietsbild sowohl f�r mouseover und mouseout sowie bei select-Auswahl an und setzt bei select die mouseAction */
function showAreaImage(area, modus) {
	if(modus == "select") {
		if(area == 0) {
			document.getElementById('landkarte').src = '/images/landkarte.png';
			mouseAction = 1;
		} else {
			document.getElementById('landkarte').src = '/images/'+area+'.png';
			mouseAction = 0;
		}
	} else {
		if(mouseAction == 1) {
			if(area == 0) {
				document.getElementById('landkarte').src = '/images/landkarte.png';
			} else {
				document.getElementById('landkarte').src = '/images/'+area+'.png';
			}
		}
	}
}

/* setzt ein Gebietsbild und den Ort im select-Feld und verhindert die mouseover- und mousout-Aktionen  */
function setArea(area) {
	document.getElementById('landkarte').src = '/images/'+area+'.png';
	// Mausaktionen deaktivieren
	mouseAction = 0;
	document.getElementById('holidayWhere').value = area;
}

function referToHolidayAim(holidayWhereValue, holidayHowValue, url) {
	if(document.getElementById("holidayWhere").value != 0 && document.getElementById("holidayHow").value != 0) {
		window.location.href = url+holidayHowValue+"?ort="+holidayWhereValue;
	} else if (document.getElementById("holidayWhere").value != 0) {
		window.location.href = url.substring(0, url.length - 1)+"?ort="+holidayWhereValue;
	} else {
		document.getElementById("errorField").innerHTML = "Bitte treffen Sie eine Auswahl.<br/>";
		if(document.getElementById("holidayWhere").value == 0) {
			document.getElementById("errorField").innerHTML += "<br/>Wo m&ouml;chten Sie besser urlauben?";
		}
//		if(document.getElementById("holidayHow").value == 0) {
//			document.getElementById("errorField").innerHTML += "<br/>Wie m&ouml;chten Sie besser urlauben?";
//		}
	}
}

function showPic(imagePath) {
    jQuery("#bigImage").attr("src", imagePath);
    jQuery("#showBigImage").overlay({      				 
		// disable this for modal dialog-type of overlays 
		closeOnClick: false, 
		// we want to use the programming API 
		api: true 
		// load it immediately after the construction
	}).load();
}

//define function that opens the overlay 
function openCalendarOverlay(page) {
	var api = jQuery("#calendarOverlay").overlay({api:true}); 
    api.load(); 
    
    // grab wrapper element inside content 
    var wrap = api.getContent().find("div.wrap"); 

    // load only for the first time it is opened 
    wrap.load(page);
}

