(function($){ 
	$(function(){
	
	
		//Read more
		$('.content-extended').each(function() {
			$(this).hide().after('<a class="clickMore">Continue Reading</a>');											
		});
		
		$('.clickMore:not(.link)').click(function(){
			$(this).hide().prev('.content-extended').show();
			return false;
		});			
	
	
		//Start Quotes cycle
	    $('.cc-quotebox').each(function(){		    
	    	if($('.cc-quote').length > 1) {
		     	$('.slideshow').cycle({
		     		fx: 	'scrollHorz',
		     		timeout: 10000
		     	});
		    } 
		    else {
		    	$('.qarrow').hide();
		    }		    
		    
	     });
	     
		//Add special click handlers
		$('.qleft').click(function(){
			$(this).prev().prev('.slideshow').cycle('prev');
		});
		
		$('.qright').click(function(){
			$(this).prev('.slideshow').cycle('next');
		});
					
					
		/* homepage slider parameters */						   
		$('.home-slider').after('<div id="nav">').cycle({ 
			fx:     'fade', 
			speed:  2000, 
			timeout: 5000, 
			pager:  '#nav' 
		});
		
		
		//Toggle active quick link
		$('#jumpTo li').click(function(){
				$(this).toggleClass('bl-active');
		});
	
		/* entire block clickable for latest news */						   
		$(".ln-list li").click(function(){
	    	window.location=$(this).find("a").attr("href");
			return false;
		});
	
		$(".ln-list li").mouseover(function(){
			$(this).addClass('ln-active');
			$(this).find("a").attr("class", "ln-link");
		 
	    }).mouseout(function(){
		    $(this).removeClass('ln-active');
			$(this).find("a").attr("class", "");
	    });
		
		
		/* entire block clickable for header contact box(present in all interior pages) */	
		$(".header-contact").click(function(){
	    	window.location=$(this).find("a").attr("href");
			return false;
		});	
		
		//Comments hint box
			$('#commentsform #rules-toggle').show(0);
			$('#commentsform .comment-rules').hide(0);
			$('#commentsform #rules-toggle a').toggle(
				function(){
					$('#commentsform #rules-toggle a').html("hide" );
					$('#commentsform .comment-rules').stop(true,true).slideDown(140);
					return false;
				},
				function(){
					$('#commentsform #rules-toggle a').html("show allowed tags" );
					$('#commentsform .comment-rules').stop(true,true).slideUp(130);
					return false;
				}
			);	
	});
})(jQuery);
