$(document).ready(function() {
/* Examples - images */
    $("a#example1").fancybox();
    $("a#example2").fancybox({
'overlayShow'   : false,
'transitionIn'  : 'elastic',
'transitionOut' : 'elastic'
   });
   $("a#example3").fancybox({
'transitionIn'  : 'none',
'transitionOut' : 'none'
   });
   $("a#example4").fancybox({
'opacity'       : true,
'overlayShow'   : false,
'transitionIn'  : 'elastic',
'transitionOut' : 'none'
   });
   $("a#example5").fancybox();
   $("a#example6").fancybox({
'titlePosition'  : 'outside',
'overlayColor'   : '#000',
'overlayOpacity' : 0.9
   });
   $("a#example7").fancybox({
'titlePosition' : 'inside'
   });
   $("a#example8").fancybox({
'titlePosition' : 'over'
   });
   $("a[rel=example_group]").fancybox({
'transitionIn'  : 'none',
'transitionOut' : 'none',
'titlePosition' : 'over',
'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) {
                  return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';}
   });
/*  Examples - various  */
   $("#various1").fancybox({
'titlePosition' : 'inside',
'transitionIn'  : 'none',
'transitionOut' : 'none'
   });
   $("#various2").fancybox();
   $("#various3").fancybox({
'width'         : '90%',
'height'        : '100%',
'autoScale'     : false,
'transitionIn'  : 'none',
'transitionOut' : 'none',
'type'          : 'iframe'
   });
   $("#various4").fancybox({
'padding'       : 0,
'autoScale'     : false,
'transitionIn'  : 'none',
'transitionOut' : 'none'
   });
});
/*  Beginn Formular Abreise und Anreise Datum Funktion  */
function GetDatum(offset) {
  var DatArray = new Array("So","Mo","Di","Mi","Do","Fr","Sa","??" );
  var time = new Date();
  time.setTime( time.getTime()+offset*86400000);
  tag     = time.getDate();
  monat   = time.getMonth()+1;
  jahr    = time.getYear();
  if (tag   < 10)   tag   = "0"+tag;
  if (monat < 10)   monat = "0"+monat;
  if (jahr  < 2000) jahr += 1900;
  return tag+'.'+monat+'.'+jahr+' - '+DatArray[time.getDay()];
}

function sel_von() {
    document.write('<select id="vnd" name="vnd">');
    for (var i=1; i<=364; i++) {
        var sel='';
        if (i==7) sel=' selected';
        document.write('<option'+sel+' value='+i+'>'+GetDatum(i)+'</option>')
    }
    document.write('</select>');
}

function sel_bis() {
    document.write('<select id="bsd" name="bsd">');
    for (var i=3; i<=365; i++) {
        var sel='';
        if (i==21) sel=' selected';
        document.write('<option'+sel+' value='+i+'>'+GetDatum(i)+'</option>')
    }
    document.write('</select>');
}
function ToDo() {
    var ixp = document.getElementById('ixp').value;
    var typ='P';
    if (ixp == 'katalog')       typ='P';
    if (ixp == 'pauschal')      typ='P';
    if (ixp == 'charter')       typ='N';
    if (ixp == 'auto')          typ='R';
    if (ixp == 'hotel')         typ='H';
    if (ixp == 'pauschal_s')    typ='P';
    if (ixp == 'charter_s')     typ='N';
    if (ixp == 'auto_s')        typ='R';
    document.tibet_form.typ.value=typ;
    document.tibet_form.submit();
}
/*  Ende Formular Abreise und Anreise Datum Funktion  */
/*  Beginn Formular Zusatzoptionen öffnen */
function collapse(obj) {
        var element = document.getElementById('box-'+obj);
        var status        = document.getElementById('status-box-'+obj);

        if (element.style.display == '') {
                element.style.display = 'none';
                status.src = '../design/close.png';

        } else {
                element.style.display = '';
                status.src = '../design/open.png';
        }
}
/*  Ende Formular Zusatzoptionen öffnen */
/*  Beginn Formular Parameter Übergabe */
$(document).ready(function() {
$("#tibet_form").submit(function () {
var url = $(this).attr("action") + "&ixp=" + $("#ixp").val() + "&epc=" + $("#epc").val() + "&ka1=" + $("#ka1").val() + "&ka2=" + $("#ka2").val() + "&ka3=" + $("#ka3").val() + "&mmc=" + $("#mmc").val() + "&dsi=" + $("#dsi").val() + "&opi=" + $("#opi").val() + "&stc=" + $("#stc").val() + "&zac=" + $("#zac").val() + "&vpc=" + $("#vpc").val() + "&ixp=" + $("#ixp").val() + "&vnd=" + $("#vnd").val() + "&bsd=" + $("#bsd").val() + "&hmi=" + $("#hmi").val() + "&mpo=" + $("#mpo").val();
$.fancybox({
'href'   :  url,
'width'  : '92%',
'height' : '100%',
'type'   : 'iframe'
});
return false;
});
});
/*  Ende Formular Parameter Übergabe */
/*  Beginn Fenster Popup öffnen */
function popup(url)
{
 var width  = 750;
 var height = 550;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=no';
 params += ', scrollbars=yes';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open(url,'windowname5', params);
 if (window.focus) {newwin.focus()}
 return false;
}
/*  Ende Fenster Popup öffnen */
