;(function($){$.fn.wpFeatured=function(options){var opts=$.extend({},$.fn.wpFeatured.defaults,options);var wrapper=opts.featuredWrapper;var ajaxcount=opts.ajaxCount;var offset=0;var new_prev=opts.prev.replace(/\./g,"");var new_next=opts.next.replace(/\./g,"");var prev_link='<a href="JavaScript:void(0);" class="'+new_prev+'">Prev</a> ';var next_link='<a href="JavaScript:void(0);" class="'+new_next+'">Next</a> ';$(wrapper).append(prev_link+next_link);var toolTip="a[rel=external] img";var toolTipWrap="#tip";var imageTip=function(e){($(toolTip))?$("<div>").html("<span>External Link<\/span><span class='arrow'><\/span>").attr("id","tip").css({left:e.pageX- 40,top:e.pageY- 40}).appendTo("body").fadeIn(200):null;};function show_next(offset){$(wrapper).fadeOut(400);$(wrapper).load(opts.url+'?offset='+offset,function(){$(toolTip).bind("mouseenter",imageTip);$(toolTip).mousemove(function(e){$(toolTipWrap).css({left:e.pageX- 40,top:e.pageY- 40});});$(toolTip).mouseleave(function(){$(toolTipWrap).remove();});$(function(){$('a[rel=external]').attr('target','blank');});$(wrapper).append(prev_link+next_link);}).hide();$(wrapper).fadeIn(800);}
$.listen('click',opts.prev,function(){if(offset>0){offset--;}else{offset=ajaxcount- 1;}
show_next(offset);});$.listen('click',opts.next,function(){if(offset<ajaxcount- 1){offset++}else{offset=0;}
show_next(offset);});};$.fn.wpFeatured.defaults={featuredWrapper:"#featured-content",ajaxCount:1,prev:".ajax-prev",next:".ajax-next",url:'featured-loop.php'};})(jQuery);/**
 * jQuery.Listen
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/7/2008
 *
 * @projectDescription Light and fast event handling, using event delegation.
 * Homepage: http://flesler.blogspot.com/2007/10/jquerylisten.html
 * Requires jQuery 1.2.3 or higher. Tested on FF 2|IE 6/7|Safari 3|Opera 9, Windows XP.
 *
 * @author Ariel Flesler
 * @version 1.0.3
 *
 * @id jQuery.listen
 * @param {String} name Name of the event to listen (f.e: click, mouseover, etc).
 * @param {DOM Element} listener optional: The DOM element to listen from, the document element by default.
 * @param {String|Boolean} selector A simple selector in one of this formats: "#id", "tagname", ".class", or "tagname.class".
 * @param {Function} handler The event handler to register.
 *
 * Notes:
 *	-The selectors support is low in order to mantain scalability. You can use comma-separated selectors.
 *	  I consider these 4 options, the most useful and I believe they are enough for many cases.
 *	-This plugin can't handle non-bubbling events. It handles focus & blur thanks to the focusin/focusout approach.
 */;(function($){$.fn.indexer=function(name){return this[0]&&indexer(this[0],name)||null;};$.indexer=function(name){return indexer(document,name);};var $event=$.event,$special=$event.special,$listen=$.listen=function(name,listener,selector,handler){if(typeof listener!='object'){handler=selector;selector=listener;listener=document;}
each(name.split(/\s+/),function(ev){ev=$listen.fixes[ev]||ev;var idxer=indexer(listener,ev)||indexer(listener,ev,new Indexer(ev,listener));idxer.append(selector,handler);idxer.start();});},indexer=function(elem,name,val){return $.data(elem,name+'.indexer',val);};$.extend($listen,{regex:/^((?:\w*?|\*))(?:([#.])([\w-]+))?$/,fixes:{focus:'focusin',blur:'focusout'},cache:function(on){this.caching=on;}});$.each($listen.fixes,function(original,fix){$special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$special[fix].handler,true);},handler:function(e){arguments[0]=e=$event.fix(e);e.type=fix;return $event.handle.apply(this,arguments);}};});$.fn.listen=function(name,selector,handler){return this.each(function(){$listen(name,this,selector,handler);});};function Indexer(name,listener){$.extend(this,{ids:{},tags:{},listener:listener,event:name});this.id=Indexer.instances.push(this);};Indexer.instances=[];Indexer.prototype={constructor:Indexer,handle:function(e){var sp=e.stopPropagation;e.stopPropagation=function(){e.stopped=true;sp.apply(this,arguments);};indexer(this,e.type).parse(e);e.stopPropagation=sp;sp=e.data=null;},on:false,bubbles:false,start:function(){if(!this.on){$event.add(this.listener,this.event,this.handle);this.on=true;}},stop:function(){if(this.on){$event.remove(this.listener,this.event,this.handle);this.on=false;}},cache:function(node,handlers){return $.data(node,'listenCache_'+ this.id,handlers);},parse:function(e){var node=e.data||e.target,args=arguments,handlers;if(!$listen.caching||!(handlers=this.cache(node))){handlers=[];if(node.id&&this.ids[node.id])
push(handlers,this.ids[node.id]);each([node.nodeName,'*'],function(tag){var klasses=this.tags[tag];if(klasses)
each((node.className+' *').split(' '),function(klass){if(klass&&klasses[klass])
push(handlers,klasses[klass]);});},this);if($listen.caching)
this.cache(node,handlers);}
if(handlers[0]){each(handlers,function(handler){if(handler.apply(node,args)===false){e.preventDefault();e.stopPropagation();}});}
if(!e.stopped&&(node=node.parentNode)&&(node.nodeName=='A'||this.bubbles&&node!=this.listener)){e.data=node;this.parse(e);}
handlers=args=node=null;},append:function(selector,handler){each(selector.split(/\s*,\s*/),function(selector){var match=$listen.regex.exec(selector);if(!match)
throw'$.listen > "'+ selector+'" is not a supported selector.';var
id=match[2]=='#'&&match[3],tag=match[1].toUpperCase()||'*',klass=match[3]||'*';if(id)
(this.ids[id]||(this.ids[id]=[])).push(handler);else if(tag){tag=this.tags[tag]=this.tags[tag]||{};(tag[klass]||(tag[klass]=[])).push(handler);}},this);}};function each(arr,fn,scope){for(var i=0,l=arr.length;i<l;i++)
fn.call(scope,arr[i],i);};function push(arr,elems){arr.push.apply(arr,elems);return arr;};$(window).unload(function(){if(typeof Indexer=='function')
each(Indexer.instances,function(idxer){idxer.stop();$.removeData(idxer.listener,idxer.event+'.indexer');idxer.ids=idxer.names=idxer.listener=null;});});})(jQuery);
