function einUndAusblenden(x) {
    if ( document.getElementById('group'+x).style.display == 'none') {
        document.getElementById('group'+x).style.display='block';
    } else {
        document.getElementById('group'+x).style.display='none';
    };
};

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=730,height=560,left = 200,top = 150');");
};

var win=null;
onerror = stopError;
function stopError(){
    return true;
}
function popup(){
    myleft=20;
    mytop=20;
    settings="width=880,height=690,top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,dependent=no";
    win=window.open("/cms/upload/bilder/ehotelier_gr.gif","DereHotelierDieKraftdieIhrAngebotbraucht",settings);
    win.focus();
}

function bildwechsel() {
var jetzt = new Date();
var Std = jetzt.getHours();
if (Std >= 8 && Std < 18) {
    document.write("upload/header/agbs.jpg");
} else {
    document.write("upload/header/home_PDFdownload.jpg");
};
};
// -------------------------------------------------------------------------------
// Name: Aggiorna select data attuale (data.js, JQuery, HTML)
// Author: Altea Software S.r.l.
// Version: 1.0.0
// Description: Quesot script aggiorna i campi della select con la data attuale
// Required: Jquery 1.21+, Form HTML
//
// Devel Date: 10/03/2009
// Last Modify: 10/03/2009
// CacheLog:
//
// -------------------------------------------------------------------------------

$(document).ready(function() {
    //selectedDate.setTime(selectedDate.getTime() + (1000*3600*24));
    selectedDate = new Date();
    var d = selectedDate.getDate();
    var m = selectedDate.getMonth();
    var y = selectedDate.getFullYear();
    
    //var y2 = y - 2000;
    //alert(y2.length);
    var y2 = new String(y);
    y2 = y2.substring(2,4); 
    ydos = parseFloat(y2); 
    var ydos0 = new String(y2);
    
    // aggiorno giorno e mese arrivo a oggi
    ($('#gg')[0]).selectedIndex = d - 1;
    ($('#mm')[0]).selectedIndex = m;
    
    // sostituisco il contenuto della select dell'anno di arrivo con l'anno corrente + altri 3 anni
    $('#aa').html("<option value=\"" + y + "\" selected>" + ydos0 + "</option>");
    $('#aa').append("<option value=\"" + (y+1) + "\">" + (ydos+1) + "</option>");
    $('#aa').append("<option value=\"" + (y+2) + "\">" + (ydos+2) + "</option>");
    $('#aa').append("<option value=\"" + (y+3) + "\">" + (ydos+3) + "</option>");
    
    // Giorno Successivo
    var selectedDate = new Date();
    selectedDate.setTime(selectedDate.getTime() + (1000*3600*24));
    var d = selectedDate.getDate();
    var m = selectedDate.getMonth();
    var y = selectedDate.getFullYear();
    
    var y2 = new String(y);
    y2 = y2.substring(2,4); 
    ydos = parseFloat(y2); 
    var ydos0 = new String(y2);
    
    // aggiorno giorno e mese arrivo a oggi
    ($('#ggf')[0]).selectedIndex = d - 1;
    ($('#mmf')[0]).selectedIndex = m;
    
    // sostituisco il contenuto della select dell'anno di arrivo con l'anno corrente + altri 3 anni
    $('#aaf').html("<option value=\"" + y + "\" selected>" + ydos0 + "</option>");
    $('#aaf').append("<option value=\"" + (y+1) + "\">" + (ydos+1) + "</option>");
    $('#aaf').append("<option value=\"" + (y+2) + "\">" + (ydos+2) + "</option>");
    $('#aaf').append("<option value=\"" + (y+3) + "\">" + (ydos+3) + "</option>");  
    
    
    $("#credit").click(function(){
     var creditVal = $(this).attr("value");

     if($(this).attr('checked')){
      $("#mfree").attr("value","");  
     }                                      
     else{
      $("#mfree").attr("value",creditVal);   
     }
    });

});