$(document).ready(function(){
			
	//Subscribe Form	
	$(function(){
		$('#subscribe').val('');
	});		
	$('#subscriber').click(function() {
		if ($(this).val() == 'Enter your email') $(this).val('');
	});		
	$('#subscriber').blur(function() {
		if ($(this).val() == '') $(this).val('Enter your email');
	});		
	
	//Project List
	$('#project-list li:nth-child(4n)').css('margin-right','0');
	
	//People List
	$('#people-list li:nth-child(4n)').css('margin-right','0');	
	
	//Slideshow List
	$('#slide-ctrl li:nth-child(6n)').css('margin-right','0');	
	
	$('#slide').cycle({ 
		fx:     'fade', 
		speed:  500, 
		timeout: 6000, 
		next:   '#slide-next', 
		prev:   '#slide-prev',
		pager:  '#slide-ctrl', 
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#slide-ctrl li:eq(' + idx + ') a'; 
    }     
	});
	
	$('#conform').submit(function(){
		var error = 0;
		var errormsg = 'Please fix the following errors and try again:\n\n';
		
		if ($('#conform #name').val() == '') { 
			error = 1;
			msg = 'Name cannot be blank\n';
			errormsg += msg;
		}	
		if ($('#conform #phone').val() == '') { 
			error = 1;
			msg = 'Mobile number cannot be blank\n';
			errormsg += msg;
		}			
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($('#conform #from').val()) == false) {  
			error = 1;
			msg = 'Email must be valid\n';
			errormsg += msg;
		}	
		if ($('#conform #budget').val() == '') { 
			error = 1;
			msg = 'Project budget cannot be blank\n';
			errormsg += msg;
		}				
	
		// To Proceeding?
		if (error == 1) {
			alert(errormsg);
			return false;			
		}
		else {
			return true;				
		}		
	});	
		
 
	
});
