$(document).ready(function() { 
	
	$(function(){
		$('a.ext').click(function(){
			window.open(this.href);
			return false;
		});
	});
	
	$('#show1').click(function() {
		$('#extra1').show('slow');
		$('#extra2').hide('');
		return false;
	});
	
	$('#show2').click(function() {
		$('#extra2').show('slow');
		$('#extra1').hide('');
		return false;
	});
	
	$('ul.nav').superfish({
		delay:       300,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows 
	}); 
	
	$('#loading, #response, #extra1, #extra2').hide();	
	
	
	$("div.scrollable").scrollable({
		// items are auto-scrolled in 2 secnod interval 
        interval: 2000, 
         
        // when last item is encountered go back to first item 
        loop: true,  
         
        // make animation a little slower than the default 
        speed: 600 
	}); 
	
	$('#c_form').submit(function() {
		$('#loading').show();
		er=0;
		errorText = '';
		if($('#name').val() == '') {
			errorText += 'Name is required<br />';
			er++;
		}
		if($('#email').val() == '') {
			errorText += 'Email is required<br />';
			er++;
		}
		if(er>0) {
			$('#response').html('<div class="error"><h3>Error:</h3>' + errorText + '</div>');
			$('#response').show();
			$('#loading').hide();
			return false;
		}
	});
});