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

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openWindow(theURL,winName,launchWin,features) { //v1.0
	if (launchWin == ''){
		window.open(theURL,winName,features);
	}else{
		var controller = window.open(theURL,winName,features);
		if(controller.opener == null){
			controller.opener = self;
		}
		controller.opener.name = launchWin;
		return controller;
	}
}

function changegallery(file){
	document.galleryimg.src = 'include/resize_gallery.php?img='+file+'&size=2';
	document.getElementById('gallery_lightbox').href = 'include/resize_gallery.php?img='+file+'&size=3';	
}

function checksearch(){
	if(document.suchen.searchthis.value==''){
		alert('Geben Sie einen Suchbegriff ein!');
	}else{
		document.suchen.submit();	
	}
}

function openESBprint(theURL,winName,launchWin,features) { //v1.1
	if (launchWin == ''){
		window.open(theURL,winName,features);
	}else{
		var controller = window.open(theURL,winName,features); 
		if (controller.opener == null){
			controller.opener = self;
		}
		controller.opener.name = launchWin;
		return controller;
	}
}

function change_reiter(id_div){
	if (id_div == 'preise'){
		document.getElementById('whg_detail_detail').style.display='none';	
		document.getElementById('whg_detail_konditionen').style.display='none';
		document.getElementById('whg_detail_preise').style.display='block';
	}
	if (id_div == 'detail'){
		document.getElementById('whg_detail_detail').style.display='block';	
		document.getElementById('whg_detail_konditionen').style.display='none';
		document.getElementById('whg_detail_preise').style.display='none';
	}
	if (id_div == 'konditionen'){
		document.getElementById('whg_detail_konditionen').style.display='block';	
		document.getElementById('whg_detail_detail').style.display='none';	
		document.getElementById('whg_detail_preise').style.display='none';
	}
	/**************************************************************************/
	if (id_div == 'preise_standard'){
		document.getElementById('preise_standard').style.display='block';	
		document.getElementById('preise_superior').style.display='none';	
		document.getElementById('preise_panorama').style.display='none';
		document.getElementById('preise_konditionen').style.display='none';
	}
	if (id_div == 'preise_superior'){
		document.getElementById('preise_superior').style.display='block';	
		document.getElementById('preise_standard').style.display='none';	
		document.getElementById('preise_panorama').style.display='none';
		document.getElementById('preise_konditionen').style.display='none';
	}
	if (id_div == 'preise_panorama'){
		document.getElementById('preise_panorama').style.display='block';	
		document.getElementById('preise_standard').style.display='none';	
		document.getElementById('preise_superior').style.display='none';
		document.getElementById('preise_konditionen').style.display='none';
	}
	if (id_div == 'preise_konditionen'){
		document.getElementById('preise_konditionen').style.display='block';	
		document.getElementById('preise_standard').style.display='none';	
		document.getElementById('preise_superior').style.display='none';
		document.getElementById('preise_panorama').style.display='none';
	}
	/**************************************************************************/
	if (id_div == 'anfahrt_zug'){
		document.getElementById('anfahrt_zug').style.display='block';	
		document.getElementById('anfahrt_flugzeug').style.display='none';	
		document.getElementById('anfahrt_auto').style.display='none';
	}
	if (id_div == 'anfahrt_flugzeug'){
		document.getElementById('anfahrt_flugzeug').style.display='block';	
		document.getElementById('anfahrt_zug').style.display='none';	
		document.getElementById('anfahrt_auto').style.display='none';
	}
	if (id_div == 'anfahrt_auto'){
		document.getElementById('anfahrt_auto').style.display='block';	
		document.getElementById('anfahrt_zug').style.display='none';	
		document.getElementById('anfahrt_flugzeug').style.display='none';
	}
	/**************************************************************************/
	if (id_div == 'hcheck'){
		document.getElementById('holidaycheck').style.display='none';	
		document.getElementById('trip_advisor').style.display='block';
	}
	if (id_div == 'tradv'){
		document.getElementById('holidaycheck').style.display='block';	
		document.getElementById('trip_advisor').style.display='none';
	}
	
}

function CreaOggetto(){
	var richiesta;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
		richiesta = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		richiesta = new XMLHttpRequest();
	}
	return richiesta;
}

var http = CreaOggetto();

function notice(whg_id,lang){
	http.open('get','wohnungen_output/notice_box.php?whg_id='+whg_id+'&lang='+lang+'');
	http.onreadystatechange = notice_result;
	http.send(null);
}

function notice_result(){
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('whg_notice_box').innerHTML = response;
		document.getElementById('whg_notice_box').style.display='block';
		
		if (document.getElementById('notice_description_whg_id')){
			var whg_id = document.getElementById('notice_description_whg_id').value;
			if (whg_id != '' && whg_id != '0'){
				document.getElementById('notice_description_box').style.display='block';
			}
		}
	}
}

/*Reservationsanfrage*/
function whg_select(wohnung, lang){
	//alert(wohnung);
	if (lang != 'de' && lang != 'en'){
		var lang = 'de';
	}
	
	var whg_kat = document.form.whg_kat.options[document.form.whg_kat.selectedIndex].value;
	http.open('get','wohnungen_select.php?kat_id='+whg_kat+'&wohnung='+wohnung+'&lang='+lang+'');
	http.onreadystatechange = whg_select_result;
	http.send(null);
}

function whg_select_result(){
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('wohnungen_select').innerHTML = response;
		window.document.form.selected_whg.value = document.form.wohnung.value;
		if (document.getElementById('brötchen')){
			document.getElementById('wohnung').style.width = '322px';	
		}
	}
}

function whg_form_info(){
	var loading = '<table cellpadding="1" cellspacing="0" border="0" class="bg_blau_4"><tr><td><table cellpadding="10" cellspacing="0" border="0" width="240" class="bg_blau_1"><tr><td><img src="images/clear.gif" height="40" width="40" border="0"></td></tr><tr><td class="text" align="center"><img src="images/layout/loading.gif" width="32" height="32" border="0"></td></tr><tr><td><img src="images/clear.gif" height="40" width="40" border="0"></td></tr></table></td></tr></table>';
	document.getElementById('resform_whg_info').innerHTML = loading;
	document.getElementById('resform_whg_info').style.visibility='visible';
	http.open('get','wohnungen_output/wohnung_info.php?whg_id='+document.form.selected_whg.value+'&lang='+document.form.lang.value+'&saison='+document.idseasonform.saison.value+'');
	http.onreadystatechange = whg_form_info_result;
	http.send(null);
}

function whg_form_info_result(){
	if(http.readyState == 4){
		var response = http.responseText;
		document.getElementById('resform_whg_info').innerHTML = response;
		document.getElementById('resform_whg_info').style.visibility='visible';
	}
}

function fill_out_max_personen(){
	var act_whg_id = document.form.wohnung.options[document.form.wohnung.selectedIndex].value;
	if (document.form.max_personen_new){
		document.form.max_personen_new.value='';
	}
	eval("document.form.max_personen.value = document.form.max_personen_"+act_whg_id+".value;");
}

//----------------------------------------------------------------------------------------------------
// TOOLTIP
//----------------------------------------------------------------------------------------------------
function TOOLTIP() {
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------
	this.borderColor = '#335064';         // border color
	this.bgColor = '#E1EAF2';             // background color	

    this.width = 100;                     // width (pixels)
    this.textColor = '#1c1c18';           // text color

    this.opacity = 80;                    // opacity (percent) - doesn't work with all browsers
    this.cursorDistance = 5;              // distance from cursor (pixels)

    // don't change
    this.text = '';
    this.obj = 0;
    this.sobj = 0;
    this.active = false;

// -------------------------------------------------------------------------------------------------------
// Functions
// -------------------------------------------------------------------------------------------------------
    this.create = function() {
      if(!this.sobj) this.init();

      var t = '<table border=0 cellspacing=0 cellpadding=4 width=' + this.width + ' bgcolor=' + this.bgColor + '><tr>' +
              '<td align=center class="dsk_texts"><strong><font color=' + this.textColor + '>' + this.text + '</font></strong></td></tr></table>';

      if(document.layers) {
        t = '<table border=0 cellspacing=0 cellpadding=1><tr><td bgcolor=' + this.borderColor + '>' + t + '</td></tr></table>';
        this.sobj.document.write(t);
        this.sobj.document.close();
      }
      else {
        this.sobj.border = '1px solid ' + this.borderColor;
        this.setOpacity();
        if(document.getElementById) document.getElementById('ToolTip').innerHTML = t;
        else document.all.ToolTip.innerHTML = t;
      }
      this.show();
    }

    this.init = function() {
      if(document.getElementById) {
        this.obj = document.getElementById('ToolTip');
        this.sobj = this.obj.style;
      }
      else if(document.all) {
        this.obj = document.all.ToolTip;
        this.sobj = this.obj.style;
      }
      else if(document.layers) {
        this.obj = document.ToolTip;
        this.sobj = this.obj;
      }
    }

    this.show = function() {
      var ext = (document.layers ? '' : 'px');
      var left = mouseX;

      if(left + this.width + this.cursorDistance > winX) left -= this.width + this.cursorDistance;
      else left += this.cursorDistance;

      this.sobj.left = left + ext;
      this.sobj.top = mouseY + this.cursorDistance + ext;

      if(!this.active) {
        this.sobj.visibility = 'visible';
        this.active = true;
      }
    }

    this.hide = function() {
      if(this.sobj) this.sobj.visibility = 'hidden';
      this.active = false;
    }

    this.setOpacity = function() {
      this.sobj.filter = 'alpha(opacity=' + this.opacity + ')';
      this.sobj.mozOpacity = '.1';
      if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;
      if(!document.all && this.sobj.setProperty) this.sobj.setProperty('-moz-opacity', this.opacity / 100, '');
    }
}

//----------------------------------------------------------------------------------------------------
// Build layer, get mouse coordinates and window width, create tooltip-object
//----------------------------------------------------------------------------------------------------
  var tooltip = mouseX = mouseY = winX = 0;

  if(document.layers) {
    document.write('<layer id="ToolTip"></layer>');
    document.captureEvents(Event.MOUSEMOVE);
  }
  else document.write('<div id="ToolTip" style="position:absolute; z-index:99"></div>');
  document.onmousemove = getMouseXY;

function getMouseXY(e) {
    if(document.all) {
      mouseX = event.clientX + document.body.scrollLeft;
      mouseY = event.clientY + document.body.scrollTop;
    }
    else {
      mouseX = e.pageX;
      mouseY = e.pageY;
    }
    if(mouseX < 0) mouseX = 0;
    if(mouseY < 0) mouseY = 0;

    if(document.body && document.body.offsetWidth) winX = document.body.offsetWidth - 25;
    else if(window.innerWidth) winX = window.innerWidth - 25;
    else winX = screen.width - 25;

    if(tooltip && tooltip.active) tooltip.show();
}

function toolTip(text, width, opacity) {
    if(text) {
      tooltip = new TOOLTIP();
      tooltip.text = text;
      if(width) tooltip.width = width;
      if(opacity) tooltip.opacity = opacity;
      tooltip.create();
    }
    else if(tooltip) tooltip.hide();
}

function send_notice(){
	document.getElementById('send_notice_div').style.display='block';
}

function show_calendar(field, div, iframe, type, field_before, lang){
	if (type == '2'){
		document.getElementById(''+iframe+'').src='static_pgs/'+lang+'/calendar.php?dateField='+field+'&dateStart='+document.getElementById(''+field_before+'').value+'&cal_div='+div+'';
	}else{
		document.getElementById(''+iframe+'').src='static_pgs/'+lang+'/calendar.php?dateField='+field+'&cal_div='+div+'';
	}
	document.getElementById(''+div+'').style.display='block';
}


function webcodeCheck(formObj, lang){
	var code = document.getElementById("searchthis").value;
	code = code.toLowerCase();
	if(code=='w-11'){
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020305&lang=de&newsaction=details&ic=05112007%2Egra&ec=136&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-12'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020304&lang=de&newsaction=details&ic=05112007%2Egra&ec=99&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-13'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020304&lang=de&newsaction=details&ic=05112007%2Egra&ec=135&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-14'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020306&lang=de&newsaction=details&ic=05112007%2Egra&ec=95&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-15'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020302&lang=de&newsaction=details&ic=05112007%2Egra&ec=89&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-16'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020302&lang=de&newsaction=details&ic=05112007%2Egra&ec=91&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-17'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020302&lang=de&newsaction=details&ic=05112007%2Egra&ec=93&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-18'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020302&lang=de&newsaction=details&ic=05112007%2Egra&ec=134&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-19'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020303&lang=de&newsaction=details&ic=05112007%2Egra&ec=97&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='w-20'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020305&lang=de&newsaction=details&ic=Wintermaerchen&ec=150&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;	
	}else if(code=='w-21'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_0106&lang=de&newsaction=details&ic=SkipassGeschenkt&ec=169&lid=2&clientid=C09.008&home=ok';
		return false;	
	}else if(code=='s-11'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020206&lang=de&newsaction=details&ic=21062007%2Eewm&ec=137&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-12'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020304&lang=de&newsaction=details&ic=Jazz_at_Solaria&ec=124&lid=2&clientid=C09.008&home=ok';
		return false;
	}else if(code=='s-13'){	
		document.location.href = 'http://solaria.ch/008dav_010510_de.htm';
		return false;
	}else if(code=='s-14'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=20090410&ec=145&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-15'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=20090410&ec=146&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-16'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=21062007%2Eewm&ec=73&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-17'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020200&lang=de&newsaction=details&ic=20090410&ec=144&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-18'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020204&lang=de&newsaction=details&ic=youngArtists&ec=125&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-19'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020202&lang=de&newsaction=details&ic=20090410&ec=147&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec';
		return false;
	}else if(code=='s-20'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020202&lang=de&newsaction=details&ic=21062007%2Eewm&ec=80&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-21'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020207&lang=de&newsaction=details&ic=20090410&ec=148&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-22'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020200&lang=de&newsaction=details&ic=drei%5FGenerationen&ec=120&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-23'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020206&lang=de&newsaction=details&ic=FreundesSpecial&ec=107&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-24'){	
		document.location.href = 'http://solaria.ch/index.taf?id=008dav_020202&lang=de&newsaction=details&ic=20090410&ec=149&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-25'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020202&lang=de&newsaction=details&ic=21062007%2Eewm&ec=79&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-26'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020204&lang=de&newsaction=details&ic=Kirchner&ec=164&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-27'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=FylerRent&ec=132&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-28'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020202&lang=de&newsaction=details&ic=Pilzexkursion&ec=159&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-29'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=SportundGesundheit&ec=160&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-30'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020203&lang=de&newsaction=details&ic=SolariaBiker&ec=165&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;
	}else if(code=='s-31'){	
		document.location.href = 'http://www.solaria.ch/index.taf?id=008dav_020206&lang=de&newsaction=details&ic=SagenhaftesSchlafen&ec=166&lid=2&clientid=C09.008&cli_clientid=&cli_ic=&cli_ec=';
		return false;

	
	}else{
		return true;
	}
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
