

$('#filters a, a.filterlink').live('mousedown',function() {

	
	
	if ($('.specialfilter').length > 0){
	$('.specialfilter').removeClass('specialfilter');
	}

		$('.large').not(".exclude").not($(this).closest('.large')).each(function(){
		closeBox(this);
		});

	
	
        var selector = $(this).attr('data-filter');
        $container.isotope({ filter: selector, resizesContainer:true,
     transformsEnabled: false,
  visibleStyle: { opacity: 1, scale : 1 },
  hiddenStyle: { opacity: 0, scale : 0.001  }   });
        

  
  
  if (!($(this).hasClass('filterlink')))  { window.location.hash = selector.replace('.', ''); }
       
   if ($(this).hasClass('buynav'))  { 
		var toLoad = $('#buyonline').attr('data-href')+' .wrapper .inner';
        var buyonline = $('#buyonline');
        var scriptSrc ="/content/js/buyonline.js";
        buyonline.addClass('ontop')
        switchItem(buyonline,toLoad,scriptSrc);
    }

if ($(this).hasClass('takelessnav'))  { 
 		var toLoad = $('#takelessgeneral').attr('data-href')+' .wrapper .inner';
        var buyonline = $('#takelessgeneral');
        buyonline.addClass('ontop');
        var scriptSrc = $('#takelessgeneral').attr('data-externalscript');
        switchItem(buyonline,toLoad,scriptSrc);

        var toLoad2 = $('#takelesscommercial').attr('data-href')+' .wrapper .inner';
        var buyonline2 = $('#takelesscommercial')
        buyonline2.addClass('ontop')
        var scriptSrc2 = $('#takelesscommercial').attr('data-externalscript');
        switchItem(buyonline2,toLoad2,scriptSrc2);        
        // chrome general isnt loading
        $.getScript('/content/js/tlgeneral.js');
 }
     
     
     

	$('html,body').animate({ scrollTop: $('#container').offset(0).top -110 }, { duration: 'slow', easing: 'swing'});

        
        
              

      $('#container').isotope({
        itemSelector : '.element'
      });
$container.isotope('reLayout');
    
    
            eventResize();

    
        return false;
      });


    
    
    
    
    
    
    
    
    
    
//////SHARE button









$('.sharebutton').live('click', function(e){	



if(navigator.platform == 'iPad') //|| navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
var mousePos = e.pageY -530
$("#sharefloat").css("top", mousePos);
}






if ($('#sharefloat').hasClass('expanded'))
{



$('#sharefloat').fadeOut(500).removeClass('expanded');
} 
else {



if ($('body').hasClass('ie')){
$('.facebookbutton.inner,.twitterbutton.inner').animate({"opacity": "0"}, 300);

	var fillFacebook ='<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.helpineedhelp.com&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=90" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:90px; z-index:100000000000;visibility:visible;display:block;" allowTransparency="true"></iframe>';
	$('#facesite').empty().html(fillFacebook);
		var faceLoc = 'http%3A%2F%2Fwww.helpineedhelp.com/'+window.location.hash.replace('#', '')+'.html';
    var faceSrc = '//www.facebook.com/plugins/like.php?href='+faceLoc+'&amp;send=false&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=90'
	$('#faceFrame').attr("src", faceSrc);
	
	
	


}


$('#sharefloat').fadeIn(500).addClass('expanded');
//$('#sharefloat').delay(100).fadeIn(500).addClass('expanded');
}});

