
jQuery(window).load(function(){

  // Lazy Load images below the fold
  jQuery(".content img.thumbnail").lazyload();

  // The magic sliding panels
	jQuery('.entry-content a span.slide-title').css({
		opacity : '0.0'
	}).parent('a').append('<span class="cover-up"></span>');
	jQuery('.entry-content a').mouseover(function(e){
      jQuery(this).find('img.thumbnail').stop().animate({
	  	marginTop : '-25px'
	  }, 100).parent('a').find('span.slide-title').stop().fadeTo("slow",1.0);
	});
	jQuery('.entry-content a').mouseout(function(e){
      jQuery(this).find('img.thumbnail').stop().animate({
	  	marginTop : '0'
	  }, 100).parent('a').find('span.slide-title').stop().fadeTo("slow",0.0);
	});
  
  preview_url = jQuery('.preview').html();
  jQuery('.preview').html('<a href="'+preview_url+'" target="_blank">Preview</a>');
  
  // Comment Author URL hover effect
  jQuery('.comment-author a.url').mouseover(function(e){
  	var url = jQuery(this).attr('href');
	jQuery(this).parent('span').append('<span class="hover-url">'+url+'</span>');
  })
  jQuery('.comment-author a.url').mouseout(function(e){
	jQuery(this).parent('span').find('.hover-url').remove();
  })
  
  jQuery('a.postpopup').click(function(){
		id = jQuery(this).attr('rel');
		jQuery('<div id="ajax-popup"></div>').hide().appendTo('body').load('http://wordpressthemescollection.com/ajax-handler/?id='+id).modal();
		return false;
	});
	
	jQuery('.masoneryWrapper').masonry({
		singleMode: true,
		itemSelector: '.entry-content',
	});
  
  jQuery('#footer .widgetcontainer:nth-child(3n+1)').addClass('reset');
  /*jQuery('.ie6 #footer .widgetcontainer:nth-child(3n+1),.ie7 #footer .widgetcontainer:nth-child(3n+1)').style({
    clear : 'left'
  });*/

});

/*
 * SimpleModal 1.3 - jQuery Plugin
 * http://www.ericmmartin.com/projects/simplemodal/
 * Copyright (c) 2009 Eric Martin
 * Dual licensed under the MIT and GPL licenses
 * Revision: jQueryId: jquery.simplemodal.js 205 2009-06-12 13:29:21Z emartin24 jQuery
 */
;(function(jQuery){var ie6=jQuery.browser.msie&&parseInt(jQuery.browser.version)==6&&typeof window['XMLHttpRequest']!="object",ieQuirks=null,w=[];jQuery.modal=function(data,options){return jQuery.modal.impl.init(data,options);};jQuery.modal.close=function(){jQuery.modal.impl.close();};jQuery.fn.modal=function(options){return jQuery.modal.impl.init(this,options);};jQuery.modal.defaults={appendTo:'body',focus:true,opacity:50,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataId:'simplemodal-data',dataCss:{},minHeight:200,minWidth:300,maxHeight:null,maxWidth:null,autoResize:false,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:'simplemodal-close',escClose:true,overlayClose:false,position:null,persist:false,onOpen:null,onShow:null,onClose:null};jQuery.modal.impl={opts:null,dialog:{},init:function(data,options){if(this.dialog.data){return false;}ieQuirks=jQuery.browser.msie&&!jQuery.boxModel;this.opts=jQuery.extend({},jQuery.modal.defaults,options);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:jQuery(data);if(data.parent().parent().size()>0){this.dialog.parentNode=data.parent();if(!this.opts.persist){this.dialog.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=jQuery('<div/>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return false;}this.create(data);data=null;this.open();if(jQuery.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog]);}return this;},create:function(data){w=this.getDimensions();if(ie6){this.dialog.iframe=jQuery('<iframe src="javascript:false;"/>').css(jQuery.extend(this.opts.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:this.opts.zIndex,top:0,left:0})).appendTo(this.opts.appendTo);}this.dialog.overlay=jQuery('<div/>').attr('id',this.opts.overlayId).addClass('simplemodal-overlay').css(jQuery.extend(this.opts.overlayCss,{display:'none',opacity:this.opts.opacity/100,height:w[0],width:w[1],position:'fixed',left:0,top:0,zIndex:this.opts.zIndex+1})).appendTo(this.opts.appendTo);this.dialog.container=jQuery('<div/>').attr('id',this.opts.containerId).addClass('simplemodal-container').css(jQuery.extend(this.opts.containerCss,{display:'none',position:'fixed',zIndex:this.opts.zIndex+2})).append(this.opts.close&&this.opts.closeHTML?jQuery(this.opts.closeHTML).addClass(this.opts.closeClass):'').appendTo(this.opts.appendTo);this.dialog.wrap=jQuery('<div/>').attr('tabIndex',-1).addClass('simplemodal-wrap').css().appendTo(this.dialog.container);this.dialog.data=data.attr('id',data.attr('id')||this.opts.dataId).addClass('simplemodal-data').css(jQuery.extend(this.opts.dataCss,{display:'none'}));data=null;this.setContainerDimensions();this.dialog.data.appendTo(this.dialog.wrap);if(ie6||ieQuirks){this.fixIE();}},bindEvents:function(){var self=this;jQuery('.'+self.opts.closeClass).bind('click.simplemodal',function(e){e.preventDefault();self.close();});if(self.opts.close&&self.opts.overlayClose){self.dialog.overlay.bind('click.simplemodal',function(e){e.preventDefault();self.close();});}jQuery(document).bind('keydown.simplemodal',function(e){if(self.opts.focus&&e.keyCode==9){self.watchTab(e);}else if((self.opts.close&&self.opts.escClose)&&e.keyCode==27){e.preventDefault();self.close();}});jQuery(window).bind('resize.simplemodal',function(){w=self.getDimensions();self.opts.autoResize?self.setContainerDimensions():self.setPosition();if(ie6||ieQuirks){self.fixIE();}else{self.dialog.iframe&&self.dialog.iframe.css({height:w[0],width:w[1]});self.dialog.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){jQuery('.'+this.opts.closeClass).unbind('click.simplemodal');jQuery(document).unbind('keydown.simplemodal');jQuery(window).unbind('resize.simplemodal');this.dialog.overlay.unbind('click.simplemodal');},fixIE:function(){var p=this.opts.position;jQuery.each([this.dialog.iframe||null,this.dialog.overlay,this.dialog.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');}else{var te,le;if(p&&p.constructor==Array){var top=p[0]?typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,''):el.css('top').replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + "px"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + "px"';if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + "px"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},focus:function(pos){var self=this,p=pos||'first';var input=jQuery(':input:enabled:visible:'+p,self.dialog.wrap);input.length>0?input.focus():self.dialog.wrap.focus();},getDimensions:function(){var el=jQuery(window);var h=jQuery.browser.opera&&jQuery.browser.version>'9.5'&&jQuery.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:jQuery.browser.opera&&jQuery.browser.version<'9.5'&&jQuery.fn.jquery>'1.2.6'?window.innerHeight:el.height();return[h,el.width()];},getVal:function(v){return v=='auto'?0:parseInt(v.replace(/px/,''));},setContainerDimensions:function(){var ch=this.getVal(this.dialog.container.css('height')),cw=this.dialog.container.width(),dh=this.dialog.data.height(),dw=this.dialog.data.width();var mh=this.opts.maxHeight&&this.opts.maxHeight<w[0]?this.opts.maxHeight:w[0],mw=this.opts.maxWidth&&this.opts.maxWidth<w[1]?this.opts.maxWidth:w[1];if(!ch){if(!dh){ch=this.opts.minHeight;}else{if(dh>mh){ch=mh;}else if(dh<this.opts.minHeight){ch=this.opts.minHeight;}else{ch=dh;}}}else{ch=ch>mh?mh:ch;}if(!cw){if(!dw){cw=this.opts.minWidth;}else{if(dw>mw){cw=mw;}else if(dw<this.opts.minWidth){cw=this.opts.minWidth;}else{cw=dw;}}}else{cw=cw>mw?mw:cw;}this.dialog.container.css({height:ch,width:cw});if(dh>ch||dw>cw){this.dialog.wrap.css({overflow:'auto'});}this.setPosition();},setPosition:function(){var top,left,hc=(w[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),vc=(w[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){top=this.opts.position[0]||hc;left=this.opts.position[1]||vc;}else{top=hc;left=vc;}this.dialog.container.css({left:left,top:top});},watchTab:function(e){var self=this;if(jQuery(e.target).parents('.simplemodal-container').length>0){self.inputs=jQuery(':input:enabled:visible:first, :input:enabled:visible:last',self.dialog.data);if(!e.shiftKey&&e.target==self.inputs[self.inputs.length-1]||e.shiftKey&&e.target==self.inputs[0]||self.inputs.length==0){e.preventDefault();var pos=e.shiftKey?'last':'first';setTimeout(function(){self.focus(pos);},10);}}else{e.preventDefault();setTimeout(function(){self.focus();},10);}},open:function(){this.dialog.iframe&&this.dialog.iframe.show();if(jQuery.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog]);}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show();}this.focus();this.bindEvents();},close:function(){if(!this.dialog.data){return false;}this.unbindEvents();if(jQuery.isFunction(this.opts.onClose)&&!this.occb){this.occb=true;this.opts.onClose.apply(this,[this.dialog]);}else{if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode);}else{this.dialog.data.hide().remove();this.dialog.orig.appendTo(this.dialog.parentNode);}}else{this.dialog.data.hide().remove();}this.dialog.container.hide().remove();this.dialog.overlay.hide().remove();this.dialog.iframe&&this.dialog.iframe.hide().remove();this.dialog={};}}};})(jQuery);



/*************************************************
**  jQuery Masonry version 1.0.1
**  copyright David DeSandro, licensed GPL & MIT
**  http://desandro.com/resources/jquery-masonry
**************************************************/
;(function($){$.fn.masonry=function(options,callback){function placeBrick($brick,setCount,setY,setSpan,props){var shortCol=0;for(i=0;i<setCount;i++){if(setY[i]<setY[shortCol])shortCol=i}$brick.css({top:setY[shortCol],left:props.colW*shortCol+props.posLeft});for(i=0;i<setSpan;i++){props.colY[shortCol+i]=setY[shortCol]+$brick.outerHeight(true)}}function masonrySetup($wall,opts,props){props.$bricks=opts.itemSelector==undefined?opts.$brickParent.children():opts.$brickParent.find(opts.itemSelector);if(opts.columnWidth==undefined){props.colW=props.masoned?$wall.data('masonry').colW:props.$bricks.outerWidth(true)}else{props.colW=opts.columnWidth}props.colCount=Math.floor($wall.width()/props.colW);props.colCount=Math.max(props.colCount,1)}function masonryArrange($wall,opts,props){if(!props.masoned)$wall.css('position','relative');if(!props.masoned||opts.appendedContent!=undefined){props.$bricks.css('position','absolute')}var cursor=$('<div />');$wall.prepend(cursor);props.posTop=Math.round(cursor.position().top);props.posLeft=Math.round(cursor.position().left);cursor.remove();if(props.masoned&&opts.appendedContent!=undefined){props.colY=$wall.data('masonry').colY;for(i=$wall.data('masonry').colCount;i<props.colCount;i++){props.colY[i]=props.posTop}}else{props.colY=[];for(i=0;i<props.colCount;i++){props.colY[i]=props.posTop}}if(opts.singleMode){props.$bricks.each(function(){var $brick=$(this);placeBrick($brick,props.colCount,props.colY,1,props)})}else{props.$bricks.each(function(){var $brick=$(this);var colSpan=Math.ceil($brick.outerWidth(true)/props.colW);colSpan=Math.min(colSpan,props.colCount);if(colSpan==1){placeBrick($brick,props.colCount,props.colY,1,props)}else{var groupCount=props.colCount+1-colSpan;var groupY=[0];for(i=0;i<groupCount;i++){groupY[i]=0;for(j=0;j<colSpan;j++){groupY[i]=Math.max(groupY[i],props.colY[i+j])}}placeBrick($brick,groupCount,groupY,colSpan,props)}})}props.wallH=0;for(i=0;i<props.colCount;i++){props.wallH=Math.max(props.wallH,props.colY[i])}$wall.height(props.wallH-props.posTop);callback.call(props.$bricks);$wall.data('masonry',props)}function masonryResize($wall,opts,props){var prevColCount=$wall.data('masonry').colCount;masonrySetup($wall,opts,props);if(props.colCount!=prevColCount)masonryArrange($wall,opts,props)}return this.each(function(){var $wall=$(this);var props=$.extend({},$.masonry);props.masoned=$wall.data('masonry')!=undefined;var previousOptions=props.masoned?$wall.data('masonry').options:{};var opts=$.extend({},props.defaults,previousOptions,options);props.options=opts.saveOptions?opts:previousOptions;callback=callback||function(){};if(props.masoned&&opts.appendedContent!=undefined){opts.$brickParent=opts.appendedContent}else{opts.$brickParent=$wall}if(opts.$brickParent.children().length>0){masonrySetup($wall,opts,props);masonryArrange($wall,opts,props);var resizeOn=previousOptions.resizeable;if(!resizeOn&&opts.resizeable){$(window).bind('resize.masonry',function(){masonryResize($wall,opts,props)})}if(resizeOn&&!opts.resizeable)$(window).unbind('resize.masonry')}else{return this}})};$.masonry={defaults:{singleMode:false,columnWidth:undefined,itemSelector:undefined,appendedContent:undefined,saveOptions:true,resizeable:true},colW:undefined,colCount:undefined,colY:undefined,wallH:undefined,masoned:undefined,posTop:0,posLeft:0,options:undefined,$bricks:undefined,$brickParent:undefined}})(jQuery);

/* Lazyload */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.J.L=5(r){8 1={d:0,A:0,b:"h",v:"N",3:4};6(r){$.D(1,r)}8 m=9;6("h"==1.b){$(1.3).p("h",5(b){8 C=0;m.t(5(){6(!$.k(9,1)&&!$.l(9,1)){$(9).z("o")}j{6(C++>1.A){g B}}});8 w=$.M(m,5(f){g!f.e});m=$(w)})}g 9.t(5(){8 2=9;$(2).c("s",$(2).c("i"));6("h"!=1.b||$.k(2,1)||$.l(2,1)){6(1.u){$(2).c("i",1.u)}j{$(2).K("i")}2.e=B}j{2.e=x}$(2).T("o",5(){6(!9.e){$("<V />").p("X",5(){$(2).Y().c("i",$(2).c("s"))[1.v](1.Z);2.e=x}).c("i",$(2).c("s"))}});6("h"!=1.b){$(2).p(1.b,5(b){6(!2.e){$(2).z("o")}})}})};$.k=5(f,1){6(1.3===E||1.3===4){8 7=$(4).F()+$(4).O()}j{8 7=$(1.3).n().G+$(1.3).F()}g 7<=$(f).n().G-1.d};$.l=5(f,1){6(1.3===E||1.3===4){8 7=$(4).I()+$(4).U()}j{8 7=$(1.3).n().q+$(1.3).I()}g 7<=$(f).n().q-1.d};$.D($.P[\':\'],{"Q-H-7":"$.k(a, {d : 0, 3: 4})","R-H-7":"!$.k(a, {d : 0, 3: 4})","S-y-7":"$.l(a, {d : 0, 3: 4})","q-y-7":"!$.l(a, {d : 0, 3: 4})"})})(W);',62,62,'|settings|self|container|window|function|if|fold|var|this||event|attr|threshold|loaded|element|return|scroll|src|else|belowthefold|rightoffold|elements|offset|appear|bind|left|options|original|each|placeholder|effect|temp|true|of|trigger|failurelimit|false|counter|extend|undefined|height|top|the|width|fn|removeAttr|lazyload|grep|show|scrollTop|expr|below|above|right|one|scrollLeft|img|jQuery|load|hide|effectspeed'.split('|'),0,{}))

var post_id=0;var post_rating=0;var is_being_rated=false;ratingsL10n.custom=parseInt(ratingsL10n.custom);ratingsL10n.max=parseInt(ratingsL10n.max);ratingsL10n.show_loading=parseInt(ratingsL10n.show_loading);ratingsL10n.show_fading=parseInt(ratingsL10n.show_fading);function current_rating(id,rating,rating_text){if(!is_being_rated){post_id=id;post_rating=rating;if(ratingsL10n.custom&&ratingsL10n.max==2){jQuery("#rating_"+post_id+"_"+rating).attr("src",eval("ratings_"+rating+"_mouseover_image.src"))}else{for(i=1;i<=rating;i++){if(ratingsL10n.custom){jQuery("#rating_"+post_id+"_"+i).attr("src",eval("ratings_"+i+"_mouseover_image.src"))}else{jQuery("#rating_"+post_id+"_"+i).attr("src",ratings_mouseover_image.src)}}}if(jQuery("#ratings_"+post_id+"_text").length){jQuery("#ratings_"+post_id+"_text").show();jQuery("#ratings_"+post_id+"_text").html(rating_text)}}}function ratings_off(b,c,a){if(!is_being_rated){for(i=1;i<=ratingsL10n.max;i++){if(i<=b){if(ratingsL10n.custom){jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_on."+ratingsL10n.image_ext)}else{jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_on."+ratingsL10n.image_ext)}}else{if(i==c){if(ratingsL10n.custom){jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_half"+(a?"-rtl":"")+"."+ratingsL10n.image_ext)}else{jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_half"+(a?"-rtl":"")+"."+ratingsL10n.image_ext)}}else{if(ratingsL10n.custom){jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_off."+ratingsL10n.image_ext)}else{jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_off."+ratingsL10n.image_ext)}}}}if(jQuery("#ratings_"+post_id+"_text").length){jQuery("#ratings_"+post_id+"_text").hide();jQuery("#ratings_"+post_id+"_text").empty()}}}function set_is_being_rated(a){is_being_rated=a}function rate_post_success(a){jQuery("#post-ratings-"+post_id).html(a);if(ratingsL10n.show_loading){jQuery("#post-ratings-"+post_id+"-loading").hide()}if(ratingsL10n.show_fading){jQuery("#post-ratings-"+post_id).fadeTo("def",1,function(){set_is_being_rated(false)})}else{set_is_being_rated(false)}}function rate_post(){if(!is_being_rated){set_is_being_rated(true);if(ratingsL10n.show_fading){jQuery("#post-ratings-"+post_id).fadeTo("def",0,function(){if(ratingsL10n.show_loading){jQuery("#post-ratings-"+post_id+"-loading").show()}jQuery.ajax({type:"GET",url:ratingsL10n.ajax_url,data:"pid="+post_id+"&rate="+post_rating,cache:false,success:rate_post_success})})}else{if(ratingsL10n.show_loading){jQuery("#post-ratings-"+post_id+"-loading").show()}jQuery.ajax({type:"GET",url:ratingsL10n.ajax_url,data:"pid="+post_id+"&rate="+post_rating,cache:false,success:rate_post_success})}}else{alert(ratingsL10n.text_wait)}};

