Friday, February 27, 2015

Oversleeping may increase your risk of stroke - The Week Magazine

'); var litebg = jQuery(''); var rightBtn = jQuery(''); var closeBtn = jQuery(''); // add lightbox first image jQuery('body').append(litebg).append(lightbox); jQuery('#lightbox').css({"background": "url(/bundles/twsite/images/tour/tour-1.jpg) no-repeat", 'width': '100%', 'background-size':' cover'}); jQuery('#lightbox').append(rightBtn).append(closeBtn); jQuery('#right-btn').wrap("<a href="javascript:rightBtn();"/>"); jQuery('#close-btn').wrap("<a href="javascript:closeBtn();"/>"); } jQuery('#lightbox-bg').click(function(e){ jQuery('#lightbox').hide(); jQuery('#lightbox-bg').hide(); jQuery('.tour-btn').hide(); console.log('iwork'); }); jQuery('#lightbox').show(); jQuery('#lightbox-bg').show(); jQuery('.tour-btn').show(); } function buttonSet(){} // light box left button function leftBtn(){ if (imgIndex === 2) { //jQuery('#lightbox img').remove(); jQuery('#lightbox').css({"background": "url(/bundles/twsite/images/tour/tour-1.jpg) no-repeat", 'width': '100%', 'background-size':' cover'}); //jQuery('#lightbox').prepend(''); jQuery('#left-btn').remove(); imgIndex = 1; console.log(imgIndex); } else if (imgIndex === 3) { //jQuery('#lightbox img').remove(); jQuery('.3-btn').remove(); jQuery('#lightbox').css({"background": "url(/bundles/twsite/images/tour/tour-2.jpg) no-repeat", 'width': '100%', 'background-size':' cover'}); //jQuery('#lightbox').prepend(''); jQuery('#lightbox').append(''); jQuery('#right-btn').wrap("<a href="javascript:rightBtn();"/>"); imgIndex = 2; console.log(imgIndex); } } // light box right button function rightBtn(){ if (imgIndex === 1) { //jQuery('#lightbox img').remove(); jQuery('#lightbox').css({"background": "url(/bundles/twsite/images/tour/tour-2.jpg) no-repeat", 'width': '100%', 'background-size':' cover'}); //jQuery('#lightbox').prepend(''); jQuery('#lightbox').append(''); jQuery('#left-btn').wrap("<a href="javascript:leftBtn();"/>"); imgIndex = 2; console.log(imgIndex); //document.getElementById("lightbox").style.backgroundSize="100% auto"; } else if (imgIndex === 2) { //jQuery('#lightbox img').remove(); jQuery('#lightbox').css({"background": "url(/bundles/twsite/images/tour/tour-3.jpg) no-repeat", 'width': '100%', 'background-size':' cover'}); //jQuery('#lightbox').prepend(''); jQuery('#lightbox').append(''); jQuery('#select-box').append(''); jQuery('#close-btn2').wrap("<a href="http://ift.tt/1zohmt6;); jQuery('#select-box').append(''); jQuery('#editor-btn').wrap("<a href="http://ift.tt/1zohmJm;); jQuery('#select-box').append(''); jQuery('#msg-btn').wrap("<a href="http://ift.tt/16pjGUM;); jQuery('#right-btn').remove(); imgIndex = 3; console.log(imgIndex); document.getElementById("lightbox").style.backgroundSize="100% auto"; } } // close lightbox function closeBtn(){ jQuery('#lightbox').hide(); jQuery('#lightbox-bg').hide(); jQuery('.tour-btn').hide(); } jQuery('#lightbox-bg').click(function(){ jQuery(this).closeBtn(); }) //End code for the lightbox //Show Geico function showGeico(){ if( TheWeek.getCurrentDevice() == 'desktop'){ //get the currentDate var fullDate = new Date(); var twoDigitMonth = fullDate.getMonth()+1+"";if(twoDigitMonth.length==1) twoDigitMonth="0" +twoDigitMonth; var twoDigitDate = fullDate.getDate()+"";if(twoDigitDate.length==1) twoDigitDate="0" +twoDigitDate; var currentDate = fullDate.getFullYear()+"-"+ twoDigitMonth +"-"+ twoDigitDate; //Dates when Geico shouldn't show up var geicoCalendar= [ '2015-01-15', '2015-01-16', '2015-01-20', '2015-01-22', '2015-01-26', '2015-02-03', '2015-02-11', '2015-02-12',] //if it's homepage show it only if it's not one of those days if(jQuery('.homepage-articles').length){ if( (jQuery.inArray( currentDate, geicoCalendar)) == -1 ){ var Geicopixel = new Image(); Geicopixel.src="http://ift.tt/16pjEw9;; Geicopixel.width="1px"; Geicopixel.height="1px"; Geicopixel.alt="Advertisement"; jQuery('#tour-container').append(' '); jQuery('#tour-container').show(); } } //the rest of the pages else{ var Geicopixel = new Image(); Geicopixel.src="http://ift.tt/16pjEw9;; Geicopixel.width="1px"; Geicopixel.height="1px"; Geicopixel.alt="Advertisement"; jQuery('#tour-container').append(' '); jQuery('#tour-container').show(); } } } //set a cookie for the Geico tour jQuery(function(){ if ( (jQuery.cookie("t_cookie") ) == null) { jQuery.cookie("t_cookie", "first_time", { path: '/', expires: 365 }); showGeico(); }else{ if( jQuery.cookie("t_cookie") == "first_time"){ jQuery.cookie("t_cookie", "second_time", {expires: 365, path: '/' }); showGeico(); }else if( jQuery.cookie("t_cookie") == "second_time"){ jQuery.cookie("t_cookie", "third_time", { expires: 365, path: '/' }); showGeico(); }else if( jQuery.cookie("t_cookie") == "third_time"){ jQuery('#tour-container').hide(); } } });

', }); }); function activateLeftbarSR(){ if((TheWeek.getCurrentDevice() == 'desktop') || (TheWeek.getCurrentDevice() == 'tablet') ){ var cutoff_top = ( (jQuery(window).scrollTop()+1) + jQuery('#header').height()+ 33 ); var cutoff_bottom = (jQuery(window).scrollTop()+1 + jQuery(window).height()); jQuery('.sp-article').removeClass('top').each(function() { if ( ( (jQuery(this).offset().top + (jQuery(this).height() - 100 )) > ( (jQuery(window).scrollTop()+1) + jQuery('#header').height()+ 33 ))) { //console.log('The new id is' + jQuery(this).attr('id')); jQuery(this).addClass('top'); id=jQuery(this).attr('id'); // console.log(id); jQuery('.scroller li').removeClass('active').each(function() { if(jQuery(this).attr('id') == 'sr-'+id){ jQuery(this).prevUntil('.first-ad').css('display', 'none'); jQuery('.first-ad').css('display', 'block'); jQuery(this).addClass('active'); jQuery(this).nextAll().css('display', 'block'); } }); return false; } }); } }





via Smart Health Shop Forum http://ift.tt/1JUiFa1

No comments: