// JavaScript Document

	$(window).load(function() {
		current_banner = 0;
		total_banner = $('#slider > img').length;
			
    	$('#slider').nivoSlider({
			effect: 'boxRain',	
			boxCols: 10, // For box animations
	        boxRows: 5, // For box animations
    	    animSpeed: 600, // Slide transition speed
        	pauseTime: 5000, // How long each slide will show
			controlNav: false, // 1,2,3... navigation
			pauseOnHover: false, // Stop animation while hovering
			prevText: '&laquo;', // Prev directionNav text
	        nextText: '&raquo;', // Next directionNav text
			beforeChange: function(){

									}, // Triggers before a slide transition
	        afterChange: function(element){
					current_slide = $('#slider').data('nivo:vars').currentSlide;
					$('.explore_links').removeClass('visible');
					$('.explore_links:eq('+current_slide+')').addClass('visible');/*.css({'opacity':0}).animate({'opacity':1}, 100);*/
			} // Triggers after a slide transition
			});
			
		$('#nav_div').hover(function() {
			$('#slider').data('nivoslider').stop();
		}, function() {
			$('#slider').data('nivoslider').start();			
		});
		correct_screensize();
	});
	
$(document).ready(function() {
		$('#testimonial_div').jCarouselLite({
		    btnNext: "#a_next",
		    btnPrev: "#a_prev",
            circular: false,
			visible: 1
		});
			
		var total_testimon = $('#testimonial_div ul li').length;
		$('#total_testimon_num').text(total_testimon);
		
		var starting_testimon = 1;
	
		$('#a_prev').click(function() {
			if(starting_testimon > 1) {
				starting_testimon--;	
				$('#current_testimon_num').text(starting_testimon);
			}
		});
		$('#a_next').click(function() {
			if(starting_testimon < total_testimon ) {
				starting_testimon++;	
				$('#current_testimon_num').text(starting_testimon);
			}	
		});
		
		$('.txt_input').each(function() {
		$(this).data('default',$(this).val())
		.addClass('inactive')
		.focus(function(){
			$(this).removeClass('inactive');
			if($(this).val() == $(this).data('default') || ''){
			$(this).select();
		}
		})
		.blur(function(){
			var default_val = $(this).data('default');
			if ($(this).val() == ''){
			$(this).addClass('inactive');
			$(this).val($(this).data('default'));
		}
		});					 
	});
	
	$(".txt_input").mouseup(function(e){
        e.preventDefault();
	});
	
});
