// Zoombild anzeigen			
function popup(file){
	var zentrierenX = (screen.width/2)-235; 
	var zentrierenY = (screen.height/2)-210;
	var pos = "left="+zentrierenX+",top="+zentrierenY; 
	window.open(file,"help","width=502, height=398, resizable=no, scrollbars=no, menubar=no, toolbar=no, directories=no, location=no, status=no, " + pos);
}


// Flash Film schreiben
function writeFlash(Path,Width,Height,Parameter,Transparent) {

	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + Width + "' height='" + Height + "' id='" + Path + Parameter + "' align='middle'>");
	document.write("<param name='movie' value='" + Path + Parameter + "' />");
	document.write("<param name='quality' value='high' />");
	
	if(Transparent == 'Ja'){
		document.write("<param name='wmode' value='transparent' />");
	} else {
		document.write("<param name='wmode' value='window' />");
	}
	
	document.write("<param name='scale' value='showall' />");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<param name='allowFullScreen' value='true' />");
	document.write("<!--[if !IE]>-->");
	document.write("<object type='application/x-shockwave-flash' data='" + Path + Parameter + "' width='" + Width + "' height='" + Height + "'>");
	document.write("<param name='movie' value='" + Path + Parameter + "' />");
	document.write("<param name='quality' value='high' />");
	
	if(Transparent == 'Ja'){
		document.write("<param name='wmode' value='transparent' />");
	} else {
		document.write("<param name='wmode' value='window' />");
	}
	
	document.write("<param name='scale' value='showall' />");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<param name='allowFullScreen' value='true' />");
	document.write("<!--<![endif]-->");
	document.write("<a href='http://www.adobe.com/go/getflash'>");
	document.write("<img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash Player' border='0' />");
	document.write("</a>");
	document.write("<!--[if !IE]>-->");
	document.write("</object>");
	document.write("<!--<![endif]-->");
	document.write("</object>");
	
}

// Windows Film schreiben 
function writeMediaplayer(Path,Width,Height,Autoplay) {

	document.write("<object id='MediaPlayer' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'   height='" + Height + "' width='" + Width + "'>");
	document.write("<param name='filename' value='"+ Path + "'>");
	document.write("<param name='autostart' value='" + Autoplay + "'>");
	document.write("<embed src='" + Path + "' width='" + Width + "' height='" + Height + "' autostart='" + Autoplay + "' />");
	document.write("</object>");

}

// Quicktime Film schreiben
function writeQuicktime(Path,Width,Height,Autoplay) {

	document.write("<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab' type='video/quicktime' height='" + Height + "' width='" + Width + "'>");
	document.write("<param name='src' value='" + Path + "'>");
	document.write("<param name='autoplay' value='" + Autoplay + "'>");
	document.write("<param name='controller' value=''>");						
	document.write("<embed height='" + Height + "' pluginspage='http://www.apple.com/quicktime/download/' src='" + Path + "' type='video/quicktime' width='" + Width + "' autoplay='" + Autoplay + "'>");
	document.write("</object>");
	
}

// Funktion zum Löschen unerwünschter Ränder in der Lightbox
function cleanborder(){
 for(var i=0; i<document.links.length; i++) {
    document.links[i].onfocus = function() {this.blur();};
 }
}

// Kalender Funktionen
function setdate(feld){
	
	document.getElementById("cms_Field" + feld).value = document.getElementById("Feld_Tag" + feld).value + "." + document.getElementById("Feld_Monat" + feld).value + "." + document.getElementById("Feld_Jahr" + feld).value;

}

Date.prototype.addDays = function(days) {
	this.setDate(this.getDate()+days);
}


function quickdate(){
	
	document.getElementById("anreise").value = document.getElementById("Feld_QuickTag").value + "." + document.getElementById("Feld_QuickMonat").value + "." + document.getElementById("Feld_QuickJahr").value;
	
	var datum=new Date();
	datum.setDate(Number(document.getElementById("Feld_QuickTag").value));
	datum.setMonth(Number(document.getElementById("Feld_QuickMonat").value)-1);
	datum.setFullYear(Number(document.getElementById("Feld_QuickJahr").value));

	var plus=Number(document.getElementById("Feld_QuickNacht").value);
	datum.setDate(Number(document.getElementById("Feld_QuickTag").value)+plus);

	document.getElementById("abreise").value = datum.getDate()+"."+(datum.getMonth()+1)+"."+datum.getFullYear();
}

// Drop-down für Anhänge
function togglecmsblock(id) {				
	
	if (document.getElementById(id).style.display == 'block'){
		document.getElementById(id + "_link").style.backgroundImage = "url(images/dropdown.png)";
		jQuery('#' + id).hide();

	}
	else {
		jQuery('#' + id).slideDown('fast',function(){  if (jQuery.browser.msie) { this.style.removeAttribute("filter");}});	
		document.getElementById(id + "_link").style.backgroundImage = "url(images/dropup.png)";
	}	
			
}

// Objekt erstellen (Browserweiche) //
function http() {
	var http;
		if (window.XMLHttpRequest) { 
			http = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			http = new ActiveXObject("Microsoft.XMLHTTP");
		}
	return http;
}

// Formular per Post senden //
var xhttpreq;
	function sendhttp(adresse, felder){
		xhttpreq = http();
		xhttpreq.open("POST", adresse, true);
		xhttpreq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xhttpreq.send(felder);
	};
