
$(document).ready(function() {
	
	// Billboard Slider
	var number = $('#slider-wrapper li').length;
	var width = -(number - 1) * 990;
	
	$('#prev-img').click(function (e) { e.preventDefault()
	
		if ( !$('#slider-wrapper').is(':animated') ) {
		
		if (parseInt( $('#slider-wrapper').css('marginLeft'))>=0 ) {
		
		$('#slider-wrapper').animate({marginLeft: 0}, 500, "linear");
		
		} else {
	
		$('#slider-wrapper').animate({marginLeft: "+=990px"}, 500, "linear");
		
		}}
	});
	
	$('#next-img').click(function (e) { e.preventDefault()
	
		if ( !$('#slider-wrapper').is(':animated') ) {
		
		if (parseInt( $('#slider-wrapper').css('marginLeft'))<=width ) {
		
		$('#slider-wrapper').animate({marginLeft: 0}, 500, "linear");
		
		} else {
	
		$('#slider-wrapper').animate({marginLeft: "-=990px"}, 500, "linear");
		
		}}
	
	});
	
	// Subscribe input switch
	$('#newsletter-email').click(function () {
		$(this).addClass("newsletter-email-active"); 
	});
	
	$('#sing-up-email').click(function () {
		$(this).addClass("sing-up-email-active"); 
	});
	
	// Pretty Photo
	$(".lightbox").prettyPhoto({
				animation_speed: 'fast', /* fast/slow/normal */
				slideshow: 5000, /* false OR interval time in ms */
				autoplay_slideshow: false, /* true/false */
				opacity: 0.4, /* Value between 0 and 1 */
				show_title: false, /* true/false */
				allow_resize: true, /* Resize the photos bigger than viewport. true/false */
				default_width: 500,
				default_height: 344,
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
				horizontal_padding: 20, /* The padding on each side of the picture */
				modal: false, /* If set to true, only the close button will close the window */
				deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */
				overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
				keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
				ie6_fallback: true
			});

// end doc ready	
});
