var popupStatus = 0; function initH(domain_start){ var affichage = $.cookie(domain_start + '_first'); if (affichage == null) { centerPopup(); loadPopup(); $.cookie(domain_start + '_first', 'OK', { domain: 'horaires.tv'}); } }function loadPopup(){ if(popupStatus==0){ $("#backgroundPopup").css({ "opacity": "0.7" }); $("#backgroundPopup").fadeIn("slow"); $("#viewgb").fadeIn("slow"); popupStatus = 1; } }function disablePopup(){ if(popupStatus==1){ $("#backgroundPopup").fadeOut("slow"); $("#viewgb").fadeOut("slow"); popupStatus = 0; } }function centerPopup(){ var windowWidth = document.documentElement.clientWidth; var windowHeight = document.documentElement.clientHeight; var popupHeight = $("#viewgb").height(); var popupWidth = $("#viewgb").width(); $("#viewgb").css({ "position": "absolute", "top": windowHeight/2-popupHeight/2, "left": windowWidth/2-popupWidth/2, "text-align": "center" }); $("#backgroundPopup").css({ "height": "2000px" }); }$(document).ready(function(){ $("#viewgbClose").click(function(){ disablePopup(); }); });jQuery.cookie = function(name, value, options) { if (typeof value != 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); } var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } };$(document).ready(function() { var docHeight = $(window).height()/2-300; var offsetEightsky = 220; $("#spnsky").append("
"); if($(window).width() > 1050) { offsetHorGrey = $(window).width()/2-(945/2)-160-5; $("#sky").css("display", "block").css("left", offsetHorGrey + "px").css("top", offsetEightsky + "px"); }; }); var cloudMaxHeight = 600; $(document).scroll( function() { offsetscroll = $(document).scrollTop() + $(window).height()/2-300; offsetscrollGrey = $(document).scrollTop() + $(window).height()/2-$("#viewgb").height()/2; $("#viewgb").css("top", offsetscrollGrey + "px"); }); $(window).resize(function() { $(document).scroll(); if($(window).width() > 1100) { $("#sky").css("display", "block"); offsetHorGrey = $(window).width()/2-(945/2)-160-5; $("#sky").css("left", offsetHorGrey + "px"); } else { $("#sky").css("display", "none"); } });