jQuery.noConflict();var currentTarget,currentExcerpt;cfct={};cfct.autoAlign=function(){jQuery("#allposts").masonry({columnWidth:230,itemSelector:"li.items"})};cfct.loading=function(){return'<div class="loading"><span></span></div>'};
cfct.ajax_post_content=function(){jQuery("ol.archive .excerpt .entry-title a").unbind().click(function(){var a=jQuery(this).attr("rev").replace("post-",""),h=jQuery("#post-excerpt-"+a),f=jQuery("#post-content-"+a+"-target");if(currentTarget!=null&&jQuery(currentTarget).is(":visible")){jQuery(currentTarget).hide();jQuery(currentExcerpt).show()}currentTarget=f;currentExcerpt=h;h.hide();f.html(cfct.loading()).show().load(CFCT_URL+"/index.php?cfct_action=post_content&id="+a,function(){cfct.autoAlign();
jQuery(this).parent().css("background-color","#000");jQuery("html, body").animate({scrollTop:f.offset().top-105},300);jQuery("#post_close_"+a+" a").click(function(){f.fadeOut(function(){h.show();cfct.autoAlign();jQuery("html, body").animate({scrollTop:h.offset().top-105},300)});return false});jQuery(this).hide().fadeIn()});return false})};
cfct.ajax_post_comments=function(){jQuery("p.comments-link a").unbind().click(function(){var a=jQuery(this),h=a.attr("rev").replace("post-",""),f=jQuery("#post-comments-"+h+"-target");f.html(cfct.loading()).show().load(CFCT_URL+"/index.php?cfct_action=post_comments&id="+h,function(){cfct.autoAlign();jQuery(this).hide().slideDown(function(){a.attr("rel",a.html()).html("Hide Comments").unbind().click(function(){f.slideUp(function(){a.html(a.attr("rel"));cfct.ajax_post_comments();cfct.autoAlign()});
return false})})});return false})};
addComment={moveForm:function(a,h,f,g){a=this.I(a);var m=this.I(f),l=this.I("cancel-comment-reply-link-p"+g),p=this.I("comment_parent_p"+g),n=this.I("comment_post_ID_p"+g);if(!(!a||!m||!l||!p)){this.respondId=f;g=g||false;if(!this.I("wp-temp-form-div-p"+g)){f=document.createElement("div");f.id="wp-temp-form-div-p"+g;f.style.display="none";m.parentNode.insertBefore(f,m)}a.parentNode.insertBefore(m,a.nextSibling);if(n&&g)n.value=g;p.value=h;l.style.display="";l.onclick=function(){var c=addComment,b=
c.I("wp-temp-form-div-p"+g),e=c.I(c.respondId);if(b&&e){c.I("comment_parent_p"+g).value="0";b.parentNode.insertBefore(e,b);b.parentNode.removeChild(b);this.style.display="none";this.onclick=null;return false}};try{this.I("comment-p"+g).focus()}catch(d){}return false}},I:function(a){return document.getElementById(a)}};random_background=function(){return Math.floor(Math.random()*11)};
jQuery(document).ready(function(a){if((!a.browser.msie||a.browser.version.substr(0,1)!="6")&&typeof CFCT_AJAX_LOAD!="undefined"&&CFCT_AJAX_LOAD){cfct.ajax_post_content();cfct.ajax_post_comments()}a("#hidden").hide();var h=random_background();a.backstretch("http://kamransamimi.com/wp-content/themes/cargo_custom/img/random_bg/"+h+".jpg",{hideUntilReady:true,speed:"normal"});cfct.autoAlign();a("#content ol.archive .excerpt").hover(function(){a(this).parent().css("background-color",
"#eee");a(this).find("h2.entry-title").css("color","#000")},function(){a(this).parent().css("background-color","#000");a(this).find("h2.entry-title").css("color","#fff")});a("#content ol.archive .excerpt").click(function(){a(this).parent().css("background-color","#000")});a("#allposts ol.archive > li.items").fadeIn();a("#infotop #closer").click(function(){a(this).parent().fadeOut(300)});a("a#showMore").click(function(){a(this).hide();a("#hidden").fadeIn(200)});a("a#showLess").click(function(){a("#hidden").fadeOut(200);
a("a#showMore").show()});a("#footer p").css("opacity",0.4).hover(function(){a(this).fadeTo(100,1)},function(){a(this).fadeTo(100,0.4)})});
(function(a){a.backstretch=function(h,f,g){function m(n){var d=a(window).width(),c=d/p;if(c<a(window).height()){c=a(window).height();d=c*p}a("#backstretch img").width(d).height(c);typeof n=="function"&&n()}var l={hideUntilReady:true,speed:0},p;f&&typeof f=="object"&&a.extend(l,f);a(document).ready(function(){if(h){var n={left:0,top:0},d=a("<div />").attr("id","backstretch-wrap").css(a.extend(n,{position:"absolute",zIndex:-1}));n=a("<div />").attr("id","backstretch").css(a.extend(n,{position:"fixed",
overflow:"hidden",zIndex:-1})).appendTo(d);var c=a("<img />").attr("src",h).bind("load",function(){var b=a(this);p=b.width()/b.height();m(function(){l.hideUntilReady&&b.fadeIn(l.speed,function(){typeof g=="function"&&g()})})});l.hideUntilReady&&c.hide();c.appendTo(n);a("body").prepend(d);a(window).resize(m)}});return this}})(jQuery);
(function(a){var h=a.event,f;h.special.smartresize={setup:function(){a(this).bind("resize",h.special.smartresize.handler)},teardown:function(){a(this).unbind("resize",h.special.smartresize.handler)},handler:function(g,m){var l=this,p=arguments;g.type="smartresize";f&&clearTimeout(f);f=setTimeout(function(){jQuery.event.handle.apply(l,p)},m==="execAsap"?0:100)}};a.fn.smartresize=function(g){return g?this.bind("smartresize",g):this.trigger("smartresize",["execAsap"])};a.fn.masonry=function(g,m){function l(d,
c,b,e,k){var o=0;for(i=0;i<c;i++)if(b[i]<b[o])o=i;c={left:k.colW*o+k.posLeft,top:b[o]};k.masoned&&k.options.animate?d.animate(c,k.options.duration,k.options.easing):d.css(c);for(i=0;i<e;i++)k.colY[o+i]=b[o]+d.outerHeight(true)}function p(d,c,b){b.$bricks=c.itemSelector==undefined?c.$brickParent.children():c.$brickParent.find(c.itemSelector);b.colW=c.columnWidth==undefined?b.masoned?d.data("masonry").colW:b.$bricks.outerWidth(true):c.columnWidth;b.colCount=Math.floor(d.width()/b.colW);b.colCount=Math.max(b.colCount,
1)}function n(d,c,b){b.masoned||d.css("position","relative");if(!b.masoned||c.appendedContent!=undefined)b.$bricks.css("position","absolute");var e=a("<div />");d.prepend(e);b.posTop=Math.round(e.position().top);b.posLeft=Math.round(e.position().left);e.remove();if(b.masoned&&c.appendedContent!=undefined){b.colY=d.data("masonry").colY;i=d.data("masonry").colCount}else{b.colY=[];i=0}for(;i<b.colCount;i++)b.colY[i]=b.posTop;c.singleMode?b.$bricks.each(function(){var k=a(this);l(k,b.colCount,b.colY,
1,b)}):b.$bricks.each(function(){var k=a(this),o=Math.ceil(k.outerWidth(true)/b.colW);o=Math.min(o,b.colCount);if(o==1)l(k,b.colCount,b.colY,1,b);else{var r=b.colCount+1-o,q=[0];for(i=0;i<r;i++)for(j=q[i]=0;j<o;j++)q[i]=Math.max(q[i],b.colY[i+j]);l(k,r,q,o,b)}});for(i=b.wallH=0;i<b.colCount;i++)b.wallH=Math.max(b.wallH,b.colY[i]);e={height:b.wallH-b.posTop};b.masoned&&c.animate?d.animate(e,c.duration,c.easing):d.css(e);m.call(b.$bricks);d.data("masonry",b)}return this.each(function(){var d=a(this),
c=a.extend({},a.masonry);c.masoned=d.data("masonry")!=undefined;var b=c.masoned?d.data("masonry").options:{},e=a.extend({},c.defaults,b,g);c.options=e.saveOptions?e:b;m=m||function(){};e.$brickParent=c.masoned&&e.appendedContent!=undefined?e.appendedContent:d;if(e.$brickParent.children().length>0){p(d,e,c);n(d,e,c);b=b.resizeable;!b&&e.resizeable&&a(window).bind("smartresize.masonry",function(){c.masoned=d.data("masonry")!=undefined;var k=d.data("masonry").colCount;p(d,e,c);c.colCount!=k&&n(d,e,c)});
b&&!e.resizeable&&a(window).unbind("smartresize.masonry")}else return this})};a.masonry={defaults:{singleMode:false,columnWidth:undefined,itemSelector:undefined,appendedContent:undefined,saveOptions:true,resizeable:true,animate:false,duration:"normal",easing:"swing"},colW:undefined,colCount:undefined,colY:undefined,wallH:undefined,masoned:undefined,posTop:0,posLeft:0,options:undefined,$bricks:undefined,$brickParent:undefined}})(jQuery);