$(document).ready( function() { /* $("#recipe_1").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' }); $("#recipe_2").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' }); $("#recipe_3").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' }); $("#recipe_4").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' }); $("#recipe_5").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' }); $("#recipe_6").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'hideOnContentClick' : 'false' });*/ $("#heuler").click(function(){ $("#heuler").slideUp(); }); var candleglow = false; $('#inner.close').click(function () { if($('#inner').hasClass("close")){ $('#inner').fadeOut('fast', function(){ $('#inner').removeClass("close"); $('#inner').addClass("open"); $('#inner.open').fadeIn('fast'); $('.day#start').fadeIn('fast'); }); } }); $('#wand').draggable({ }); //containment: 'parent' $( "#wand" ).bind( "dragstart", function(event, ui) { $('#glow').fadeIn(); }); $( "#wand" ).bind( "dragstop", function(event, ui) { $('#glow').fadeOut(); }); $( "#wand" ).bind( "drag", function(event, ui) { var y = parseInt($(this).css('top')); var x = parseInt($(this).css('left')); if((x >= 490 && x <= 570) && (y >= 330 && y <= 470)) { $(".active .hidehint").fadeOut('slow'); } if((y <= 40 || y >= 85) && (x <= 635 || x >= 685)){ if($('#kerze .glow').css('display')=='none'){ candleglow=false; } else { candleglow = true; } } if(y >= 40 && y <= 85 && x >= 635 && x <= 685){ if (candleglow==false && $('#kerze .glow').css('display')=='none'){ $("#kerze .glow").fadeIn(); } else if (candleglow==true && $('#kerze .glow').css('display')!='none'){ $("#kerze .glow").fadeOut(); } } }); $('#lupe').draggable({ containment: 'parent' }); }); function gotoDay(number){ var calendar_obj = new get_calendar(); calendar_obj.day = number; calendar_obj.get_calendar(); } function gotoPage(number,page){ $('.day#day').removeClass("active"); $('.day#day').fadeOut('fast', function(){ var calendar_obj = new get_calendar(); calendar_obj.day = number; calendar_obj.page = page; calendar_obj.get_calendar(); }); } function gotoStart(){ $('.day#day').removeClass("active"); $('.day#day').fadeOut('fast', function(){ $('.day#day').removeClass("active"); $('.day#start').fadeIn('fast'); }); } function gotoStartFromPage(number, from){ $('.day#day'+number+'_'+from).removeClass("active"); $('.day#day'+number+'_'+from).fadeOut('fast', function(){ $('.day#start').fadeIn('fast'); }); } var div_opacity = 100; function autotab(field,nextfield){ if(field.value.length >= field.maxLength){ document.getElementById(nextfield).focus(); } } function change_opacity(factor) { div_opacity = div_opacity + (factor * 5); if ((div_opacity >= 30) && ((div_opacity <= 100))) { document.getElementById('outer').style.opacity = (div_opacity / 100); document.getElementById('outer').style.filter = 'Alpha(opacity = ' + div_opacity + ')'; window.setTimeout("change_opacity(" + factor + ")", 10); } else div_opacity = div_opacity - (factor * 5); } function get_calendar() { this.day = 0; this.page = 0; this.box = 0; var req = null; function calendar_received_data() { switch(req.readyState) { case 4: if (req.status == 200) { if (req.responseText != "") { if (!box) { document.getElementById('day').innerHTML = req.responseText; $('.day#start').fadeOut('fast', function(){ $('.day#day').fadeIn('fast'); $('.day#day').addClass("active"); }); } else { document.getElementById('div_iframe_content').innerHTML = req.responseText; } } else { alert('Ein Fehler ist aufgetreten. Bitte überprüfe, ob du einen aktuellen Browser verwendest.'); } } else { alert('Ein Fehler ist aufgetreten. Bitte überprüfe, ob du einen aktuellen Browser verwendest.'); } break; default: return false; break; } } this.get_calendar = function() { try { req = new XMLHttpRequest(); } catch(ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(failed) { req = null; } } } if (req != null) { box = this.box; req.open("GET", '/ajax.php?action=g_adventskalender2011&day=' + this.day + '&page=' + this.page + '&box=' + this.box, true); req.setRequestHeader("Pragma", "no-cache"); req.setRequestHeader("Cache-Control", "must-revalidate"); req.setRequestHeader("If-Modified-Since", document.lastModified); req.onreadystatechange = calendar_received_data; req.send(null); return true; } else { return false; } } } function openBox(day, box, width, height) { document.getElementById('div_iframe_content').innerHTML = '
Bitte warten...'; var calendar_obj = new get_calendar(); calendar_obj.day = day; calendar_obj.box = box; calendar_obj.get_calendar(); document.getElementById('div_iframe_content').style.height = height + 'px'; height = height + 30; document.getElementById('div_iframe').style.width = width + 'px'; document.getElementById('div_iframe').style.height = height + 'px'; document.getElementById('div_iframe').style.top = ((screen.availHeight - height) / 2) + 'px'; document.getElementById('div_iframe').style.left = ((screen.availWidth - width) / 2) + 'px'; document.getElementById('div_iframe').style.display = ''; window.setTimeout("change_opacity(-1)", 10); } function closeIFrame() { document.getElementById('div_iframe').style.display = 'none'; window.setTimeout("change_opacity(1)", 10); }