// Initiate the dropdown menu $(document).ready(function() { $('ul.sf-menu').superfish({ delay: 200, // delay on mouseout animation: {opacity:'show',height:'show'}, autoArrows: false, // disable generation of arrow mark-up dropShadows: false, // disable drop shadows speed: "fast" }); }); // Move dropdown links on hover $(document).ready(function(){ $(".sf-menu ul a").css({ paddingLeft: "15px", backgroundPosition: "0px 12px" }); $(".sf-menu ul a").hover(function() { $(this).stop().animate({ paddingLeft: "25px", backgroundPosition: "10px 12px" }, 'fast'); }, function() { $(this).stop().animate({ paddingLeft: "15px", backgroundPosition: "0px 12px" }, 'fast'); }); }); // Set background of dropdown to 90% opacity - fix for IE naturally. $(document).ready(function(){ $(".sf-menu li ul").css({ opacity: 0.9 }); }); // Start the slider $(document).ready(function() { $('.slides').cycle({ fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc... next: '.next', prev: '.previous', timeout: 7000, pager: '.pager', cleartype: true, cleartypeNoBg: true }); }); // Move footer posts on hover $(document).ready(function(){ $(".foot-posts a").css({ paddingLeft: "20px", backgroundPosition: "5px 9px" }); $(".foot-posts a").hover(function() { $(this).stop().animate({ paddingLeft: "30px", backgroundPosition: "15px 9px" }, 'fast'); }, function() { $(this).stop().animate({ paddingLeft: "20px", backgroundPosition: "5px 9px" }, 'fast'); }); }); // Start the Slide deck $(document).ready(function(){ $('dll').slidedeck({ /* was dl */ scroll: false, index: false }); }); // Give image links in Slidedeck hover effect $(document).ready(function(){ $(".slidedeck .panel .right img").css({ opacity: 0.6 }); $(".slidedeck .panel .right img").hover(function() { $(this).stop().animate({ opacity: 1.0 }, 'fast'); }, function() { $(this).stop().animate({ opacity: 0.6 }, 'fast'); }); }); $(document).ready(function(){ $('.cover').hover(function(){ $(".thumb", this).stop().animate({top:'-45px'},{queue:false,duration:160}); }, function() { $(".thumb", this).stop().animate({top:'0px'},{queue:false,duration:160}); }); }); //animate the sscroll to top $(document).ready(function() { function filterPath(string) { return string .replace(/^\//,'') .replace(/(index|default).[a-zA-Z]{3,4}$/,'') .replace(/\/$/,''); } var locationPath = filterPath(location.pathname); var scrollElem = scrollableElement('html', 'body'); $('.entry-meta a[href*=#], .top a[href*=#]').each(function() { var thisPath = filterPath(this.pathname) || locationPath; if ( locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && this.hash.replace(/#/,'') ) { var $target = $(this.hash), target = this.hash; if (target) { var targetOffset = $target.offset().top; $(this).click(function(event) { event.preventDefault(); $(scrollElem).animate({scrollTop: targetOffset}, 400, function() { location.hash = target; }); }); } } }); // use the first element that is "scrollable" function scrollableElement(els) { for (var i = 0, argLength = arguments.length; i 0) { return el; } else { $scrollElement.scrollTop(1); var isScrollable = $scrollElement.scrollTop()> 0; $scrollElement.scrollTop(0); if (isScrollable) { return el; } } } return []; } }); /* no flash */ function photofader(nm, mainDiv, imgArr){ this.name = nm; this.imgArr = imgArr; this.curImg = 0; this.curDiv = 1; var mainDv = document.getElementById(mainDiv); document.pfObj = this; document.write(""); this.initImages = function() { document.write("\n"); for(var i=0; i\n"); } this.start = function(){ var hldr1 = "pf_photo1"; var hldr2 = "pf_photo2"; var dv1 = document.createElement("div"); dv1.id = "pf_photo1"; dv1.innerHTML = ""; var dv2 = document.createElement("div"); dv2.id = "pf_photo2"; mainDv.appendChild(dv1); mainDv.appendChild(dv2); image1 = document.getElementById(hldr1).childNodes[0]; setOpacity(image1, 0); image1.style.visibility = 'visible'; fadeIn(hldr1,0); } this.initImages(); } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999:opacity; // IE/Win obj.style.filter = "alpha(opacity:"+opacity+")"; // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } function fadeIn(objId,opacity) { if (document.getElementById) { obj = document.getElementById(objId).childNodes[0]; if (opacity < 100) { speed = (speed < 2)?2:speed; setOpacity(obj, opacity); opacityDif = Math.ceil((100-opacity)/speed); opacity += opacityDif; //opacity += 2; window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100); } else setTimeout("swapImages()",delay*1000); } } function swapImages(){ // find out which if(document.pfObj.curImg == document.pfObj.imgArr.length-1) document.pfObj.curImg = 0; else ++document.pfObj.curImg; // now get the div to hld the new image var dvName = (document.pfObj.curDiv == 1)?"pf_photo2":"pf_photo1"; var eDivName = (document.pfObj.curDiv == 1)?"pf_photo1":"pf_photo2"; document.pfObj.curDiv = (document.pfObj.curDiv == 1)?2:1; var tgtDiv = document.getElementById(dvName); var eDiv = document.getElementById(eDivName); // now fill the target div tgtDiv.innerHTML = ""; //move the divs around in z-index eDiv.style.zIndex = 0; tgtDiv.style.zIndex = 1; // And finally fade in the image var img = tgtDiv.childNodes[0]; setOpacity(img, 0); img.style.visibility = 'visible'; fadeIn(tgtDiv.id,0); }