/* Image Hover */
$(function(){
  $('#cbody .box a').hover(function(){
		$('img',$(this)).stop().animate({opacity:"0.75"}, 150)
	},function(){
		{
			$('img',$(this)).stop().animate({opacity:"1"}, 150)
		}
	})
});

/* Rate Tooltip */
$(document).ready(function(){
  $('a.tip_trigger').hover(function(){
		$('.tip',$(this)).stop().animate({top:"-85", opacity:"1"}, 150)
	},function(){
		{
			$('.tip',$(this)).stop().animate({top:"-75", opacity:"0"}, 300)
		}
	})
});

/* Sub Menu Current State */
$(document).ready(function(){
     $("li a").each(function() { 
  if(this.href == window.location.href.split("#")[0]) {
        $(this).parent().addClass("current");
  }
     });
});

/* Shorten Special Text */
function shorten(n, l) {
     var str = document.getElementById(n).innerHTML;
     
     if(str.length > l){  
         var s = str.substr(0, l);
         var words = s.split(' '); 
         words[words.length-1] = '';
         str = words.join(' ') + '...'
     }
     
     document.getElementById(n).innerHTML = str;
}
