/**
 *  Javascript Library
 */

$(document).ready(function(){
	
	$("ul#news").liScroll({travelocity: 0.05});
	
	// onBlur and onFocus listeners on inputs
	$('input[type="text"], textarea').focus( function() {
		if (this.value == this.defaultValue) {
			this.value = '';
		}
		if (this.value != this.defaultValue) {
			this.select();
		}
	});
	$('input[type="text"], textarea').blur( function() {
		if (this.value == '') {
			this.value = this.defaultValue;
		}
	});
	
	$('.slider-items').cycle({ 
	    fx:     'fade', 
	    speed:  '7000',
	    speedIn: 1000,
	    speedOut: 1000,
	    timeout: 1000, 
	    pager:  '#nav' 
	});
	
	$('#pause').click(function(){
		if($(this).hasClass('stopped') == true){
			$('.slider-items').cycle('resume');
			$(this).removeClass('stopped');
		}else{
			$('.slider-items').cycle('pause'); 
			$(this).addClass('stopped');
		}
		
	});
	
	$('.marketing-item:nth-child(even)').css('margin-right', '0');
	
	$('.article-container:last-child').css('border', 'none');
	
	$('.testimonials-item:last-child').css('border', 'none');
	
	$('.blog-comments-section .comments-item:last-child').css('border', 'none');
	
	
});
