$(document).ready(function(){

slide("#Navigation li.slide-elem", 10, 0, 150, .8 );
//slide("#Container #PopTop img", 25, 0, 150, .8);
$().ready(function() {
 $('#latest-shout').jTruncate({
  length:100,
  minTrail: 0,
  moreText: "[more]",
  lessText: "",
  ellipsisText: "...",
  moreAni: "slow",
  lessAni: "slow"
 });
});

    // How to find us slider
   $(".latest-slider").click(function(){
	  
if ($("#Latest").is(":hidden")) 
{ 
 $("#Latest").slideDown("slow");   
 // $(this).addClass("active");   
 $.cookie('showTop', 'opened');   
 return false;   
  
} 
else {   
  $("#Latest").slideUp("slow");   
  $.cookie('showTop', 'closed');   
  return false;   
 } 

		 });
    
$('#PopTop_Inner').hover(function(){
$('#PopTop_Inner').vibrate("ud","10");
});

    
});
function slide(navigation_id, pad_out, pad_in, time, multiplier) 
{ 
 // creates the target paths 
 var list_elements = navigation_id // + " li.slide-elem"; 
 var link_elements = list_elements + " a"; 
 
 // initiates the timer used for the sliding animation 
 var timer = 0; 
 /*
//HIDE THIS
 // creates the slide animation for all list elements 
 $(list_elements).each(function(i) 
 { 
 // margin left = - ([width of element] + [total vertical padding of element]) 
// $(this).css("margin-left","-180px"); 
 // updates timer 
 timer = (timer*multiplier + time); 
 $(this).animate({ marginLeft: "0" }, timer); 
 $(this).animate({ marginLeft: "15px" }, timer); 
 $(this).animate({ marginLeft: "0" }, timer); 
 }); 
 //HIDE THIS
*/
 // creates the hover-slide effect for all link elements 
 $(list_elements).each(function(i) 
 { 
 $(this).hover( 
 function() 
 { 
 //$(this).animate({ top: pad_out }, 150); 
 $(this).animate({ marginLeft: pad_out }, 150); 
 }, 
 function() 
 { 
// $(this).animate({ top: pad_in }, 150); 
 $(this).animate({ marginLeft: pad_in }, 150); 
 }); 
 }); 
}
$(function() {
	$('ul.hover_block li').hover(function(){
	$(this).find('img').animate({top:'216px'},{queue:false,duration:500});
	}, 
	function(){
	$(this).find('img').animate({top:'0px'},{queue:false,duration:500});
	});
});
jQuery.fn.vibrate = function(direction,size) {
	if(direction == "ud") {
		$(this).animate({ marginTop:size }, 150);
		$(this).animate({ marginTop:"-"+size+"px" }, 150);
		$(this).animate({ marginTop:size }, 150);
		$(this).animate({ marginTop:"-"+size+"px" }, 150);;
		$(this).animate({ marginTop:size }, 150);
		$(this).animate({ marginTop:"-"+size+"px" }, 150);
		$(this).animate({ marginTop:"0px" }, 150);
		}
	    		
	};
