(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) div', this).css('overflow', 'hidden'), $slider = $wrapper.find('> ul'), $items = $slider.find('> li'), $single = $items.filter(':first'), singleWidth = $single.outerWidth(true), visible = Math.ceil($wrapper.innerWidth() / singleWidth), // note: doesn't include padding or border currentPage = 1, pages = Math.ceil($items.length / visible); // 1. Pad so that 'visible' number will always be seen, otherwise create empty items if (($items.length % visible) != 0) { $slider.append(repeat('
  • ', visible - ($items.length % visible))); $items = $slider.find('> li'); } // 2. Top and tail the list with 'visible' number of items, top has the last section, and tail has the first $items.filter(':first').before($items.slice(- visible).clone().addClass('cloned')); $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned')); $items = $slider.find('> li'); // reselect // 3. Set the left position to the first 'real' item $wrapper.scrollLeft(singleWidth * visible); // 4. paging function function gotoPage(page) { var dir = page < currentPage ? -1 : 1, n = Math.abs(currentPage - page), left = singleWidth * dir * visible * n; $wrapper.filter(':not(:animated)').animate({ scrollLeft : '+=' + left }, 1000, function () { if (page == 0) { $wrapper.scrollLeft(singleWidth * visible * pages); page = pages; } else if (page > pages) { $wrapper.scrollLeft(singleWidth * visible); // reset back to start position page = 1; } currentPage = page; }); return false; } $wrapper.after('<>'); // 5. Bind to the forward and back buttons $('a.back', this).click( function () { return gotoPage(currentPage - 1); }); $('a.forward', this).click( function () { return gotoPage(currentPage + 1); }); // create a public interface to move to a specific page $(this).bind('goto', function (event, page) { gotoPage(page); }); }); }; // SWFObject embed var flashvars = { xmlFilePath: escape("/gallery/images/rss/slideshow.rss"), colorCorrection: "On", videoAutoStart: "Off", panZoom: "On", navLinkAppearance: "Numbers", transitionStyle: "Blur", feedbackPreloaderAppearance: "Spinner", contentScale: "Crop to Fit", captionAppearance: "Inline", captionTextSize: "12", captionTitleSize: "14", captionBackgroundAlpha: ".8" } var params = { bgcolor: "#121212", allowfullscreen: "true" } var attributes = {} swfobject.embedSWF("/gallery/images/flash/slideshowpro.swf", "flashgallery", "550", "400", "10.0.0", false, flashvars, params, attributes); $( function() { if($('#search_photos > input:text')) { $searchTxtBx = $('#search_photos > input:text'); $searchTxtBx.val($searchTxtBx.attr('title')); $searchTxtBx.focus( function() { if ($searchTxtBx.val() == $searchTxtBx.attr('title')) { $searchTxtBx.val(''); } }); $searchTxtBx.blur( function() { if ($searchTxtBx.val() == '') { $searchTxtBx.val($searchTxtBx.attr('title')); } }); } $('.scroll_container').infiniteCarousel(); }); $('#cat_menu').change( function() { window.location = "/gallery/images/category/"+$(this).val(); }); $('#result_container a').hoverIntent( function() { var $item = $(this).attr('title'); $('#src_img .ajax-wait').show(); $('#l_image').fadeOut(600, function() { $('#l_image').attr('src', $item); $('#l_image').load(function() { $('#l_image').fadeIn(600, function() { $('#src_img .ajax-wait').hide(); }); }); }); }, function(){}); $('#search_res #pagination a').live('click',function(e) { e.preventDefault(); var linkedPage = $(this).attr('href'); $('#result_container').fadeOut(600, function() { $('#search_res .ajax-wait').show(); $('#pagination').hide $('#search_res').load(linkedPage +' #search_res', function() { $('#result_container').hide(); $('#result_container').fadeIn(600, function() { $('#search_res .ajax-wait').hide(); $('#result_container a').hoverIntent( function() { var $item = $(this).attr('title'); $('#src_img .ajax-wait').show(); $('#l_image').fadeOut(600, function() { $('#l_image').attr('src', $item); $('#l_image').fadeIn(600, function() { $('#src_img .ajax-wait').hide(); }); }); }, function(){}); }); }); }); });