
jQuery(document).ready(function($){var noSlide=false;$.address.init(function(event){});$.address.change(function(event){});$.address.externalChange(function(event){requestContent(sitePath+event.value);});$('.postthumb a, .newsthumb a, .featured-item a, .ajaxPage').click(function(event){event.preventDefault();$.address.value($(this).attr('href').substring(sitePath.length));requestContent($(this).attr('href'));$(this).next('.postloader').show();});function requestContent(url){if(url.substring(sitePath.length)==='/'||url.substring(sitePath.length)===''){if($("#loader > div").length>0){removeContent();if(showSlideShow){resumeSlideShow();}}
return;}
$.get(url,function(data){removeContent();goToByScroll('.navBorder');$('#loader').css("display","none");$('#loader').addClass('ajax-content');var newPage=$(data);$('#loader').append($('#post',newPage).html());var totalSlides=$('.post-item').length;$(document).attr('title',newPage.filter('title').text());if(ogTags){$('meta[property=og\\:title]').attr("content",$('.post-title').text());$('meta[property=og\\:url]').attr("content",url);$('meta[property=og\\:description]').attr("content",$('.item-1 p:eq(0)').text());}
if(addThisKey!==''&&$("#loader .contactJs").length===0){if(Modernizr.mq('only screen and (min-width : 320px) and (max-width : 480px)')){$('.addThis .addthis_toolbox a').remove();$('.addThis .addthis_toolbox').append('<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;pubid='+addThisKey+'"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>');}else{var ajxUrl='http://s7.addthis.com/js/250/addthis_widget.js#pubid='+addThisKey+'&domready=1#async=1';$.ajax({type:"GET",url:ajxUrl,success:function(){addthis.init();},dataType:"script",cache:false});}}
$('.prev').fadeTo(200,0.2);$("#closeWidget").show();$(".post-item:first").css("display","block");if(($("#loader > div").length>0)){touchslider.createSlidePanel('#post-wrapper','.post-item',360,10);}
$('#loader').fadeIn('slow',function(){$("'.postloader':visible").hide();if(showSlideShow){pauseSlideShow();}});if($("#loader .contactJs").length>0){$.getScript(tempUrl+'/js/jquery.form.min.js',function(data,textStatus){$.getScript(tempUrl+'/js/jquery.validate.min.js',function(data,textStatus){$.getScript(tempUrl+'/js/userforms.min.js');});});}});}
function removeContent(){if($('#loader').hasClass('ajax-content')){$('#loader').removeClass('ajax-content');}
$('#loader').empty();$("#closeWidget").hide();}
$("#closeWidget a").click(function(event){event.preventDefault();removeContent();$.address.value('');if(showSlideShow){resumeSlideShow();}});$("body").delegate("#image-controls a","click",function(event){event.preventDefault();var slideDirection=$(this).hasClass('prev');if(slideDirection===true){if(touchslider.cursor==1){$(this).fadeTo(200,0.2);}
if($('.next').css("opacity")!="1"){$('.next').fadeTo(200,1);}
touchslider.doClickSlide('right');}else{if(touchslider.cursor==touchslider.items-2){$(this).fadeTo(200,0.2);}
if($('.prev').css("opacity")!="1"){$('.prev').fadeTo(200,1);}
touchslider.doClickSlide('left');}});function goToByScroll(id){$('html,body').animate({scrollTop:$(id).offset().top},'slow');}
function scrollWindow(){$('html, body').animate({scrollTop:$("html").offset().top},2000);}});
