function print_footer_mail(typepage){
	var domain = 'hotelmisani.ch';
	var mail = 'info';
	if(typepage=='home'){
		document.write('<a href="mailto:'+mail+'@'+domain+'" onmouseover="MM_swapImage(\'email\',\'\',\'img/adresse_email_o.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="img/adresse_email.gif" name="email" border="0" id="email" /></a>');
	}else{
		document.write('<a href="mailto:'+mail+'@'+domain+'" onmouseover="MM_swapImage(\'email\',\'\',\'img/adresse_email2_o.gif\',1)" onmouseout="MM_swapImgRestore()"><img src="img/adresse_email2.gif" name="email" border="0" id="email" /></a>');
	}
}

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];}}
  return true;
}

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

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];}
}

MM_preloadImages('/img/box/tv_switch.gif','/img/blitz.gif','/img/box/de/box_navi01_o.gif','/img/box/de/box_navi02_o.gif','/img/box/de/box_navi03_o.gif','img/box/bg1.jpg','img/box/bg2.jpg','img/box/bg3.jpg');


function deblur(mylink){
	mylink.blur();
}




function check_active_channel(lang){
	var channel = parseInt(document.tabform.count_tab.value);
	if(channel == 1){
		document.getElementById("tab1").src="/img/box/"+lang+"/box_navi01_o.gif";
		document.getElementById("tab2").src="/img/box/"+lang+"/box_navi02.gif";
		document.getElementById("tab3").src="/img/box/"+lang+"/box_navi03.gif";
		document.getElementById("tab4").src="/img/box/"+lang+"/box_navi04.gif";
	}
	if(channel == 2){
		document.getElementById("tab1").src="/img/box/"+lang+"/box_navi01.gif";
		document.getElementById("tab2").src="/img/box/"+lang+"/box_navi02_o.gif";
		document.getElementById("tab3").src="/img/box/"+lang+"/box_navi03.gif";
		document.getElementById("tab4").src="/img/box/"+lang+"/box_navi04.gif";
	}
	if(channel == 3){
		document.getElementById("tab1").src="/img/box/"+lang+"/box_navi01.gif";
		document.getElementById("tab2").src="/img/box/"+lang+"/box_navi02.gif";
		document.getElementById("tab3").src="/img/box/"+lang+"/box_navi03_o.gif";
		document.getElementById("tab4").src="/img/box/"+lang+"/box_navi04.gif";
	}
	if(channel == 4){
		document.getElementById("tab1").src="/img/box/"+lang+"/box_navi01.gif";
		document.getElementById("tab2").src="/img/box/"+lang+"/box_navi02.gif";
		document.getElementById("tab3").src="/img/box/"+lang+"/box_navi03.gif";
		document.getElementById("tab4").src="/img/box/"+lang+"/box_navi04_o.gif";
	}
	
}


function time_channel(channel, nextchannel, lang){
	document.getElementById("tab"+channel+"").src="/img/box/"+lang+"/box_navi0"+channel+".gif";
	document.getElementById("tab"+nextchannel+"").src="/img/box/"+lang+"/box_navi0"+nextchannel+"_o.gif";
	document.getElementById('info_loading').style.display='none';
	document.getElementById('bg_tab').style.backgroundImage='url(/img/box/bg'+nextchannel+'.jpg)';
	document.getElementById('info_tab'+nextchannel+'').style.display='block';
	document.getElementById("blicon").src="/img/clear.gif";
}

function change_channel(lang){
	var maxchannel = 4;
	var channel = parseInt(document.tabform.count_tab.value);
	if(channel==maxchannel){
		channel = 4;
		nextchannel = 1;
	}else{
		var nextchannel = channel+1;
	}
	document.getElementById('info_loading').style.display='block';
	document.tabform.count_tab.value = nextchannel;
	document.getElementById("blicon").src="/img/blitz.gif";
	document.getElementById('info_tab'+channel+'').style.display='none';
	setTimeout("time_channel("+channel+", "+nextchannel+", '"+lang+"')",400);
}

function time_set_channel(channel){
	document.getElementById('info_loading').style.display='none';
	document.getElementById('bg_tab').style.backgroundImage='url(/img/box/bg'+channel+'.jpg)';
	document.getElementById('info_tab'+channel+'').style.display='block';
	document.getElementById("blicon").src="/img/clear.gif";
}

function set_channel(id){
	document.tabform.count_tab.value = id;
	document.getElementById('info_loading').style.display='block';
	document.getElementById("blicon").src="/img/blitz.gif";
	document.getElementById('info_tab1').style.display='none';
	document.getElementById('info_tab2').style.display='none';
	document.getElementById('info_tab3').style.display='none';
	document.getElementById('info_tab4').style.display='none';
	setTimeout("time_set_channel("+id+")",400);
}

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

//----------------------------------------------------------------------------------------------------
// TOOLTIP
//----------------------------------------------------------------------------------------------------
function TOOLTIP() {
//----------------------------------------------------------------------------------------------------
// Configuration
//----------------------------------------------------------------------------------------------------

	this.borderColor = '#E85521';         // border color
	this.bgColor = '#7B7A7A';             // background color			
    this.width = 100;                     // width (pixels)
    this.textColor = '#FFFFFF';           // text color

    this.opacity = 99;                    // opacity (percent) - doesn't work with all browsers
    this.cursorDistance = 3;              // 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="dbt_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();
	}
