// For Latest Project
$(document).ready(function(){
				$('.boxgrid.caption').hover(function(){				
					$(".cover", this).stop().animate({top:'0'},{queue:false,duration:200});
				}, function() {
					$(".cover", this).stop().animate({top:'158px'},{queue:false,duration:200});
				});
				$('.boxgrid1.caption1').hover(function(){				
					$(".cover1", this).stop().animate({top:'0'},{queue:false,duration:200});
				}, function() {
					$(".cover1", this).stop().animate({top:'70px'},{queue:false,duration:200});
				});
});


// Scroll UP and DOWN
$(document).ready(function(){
	
	//get the full url - like mysitecom/index.htm#home
		var full_url = window.location.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top - 170;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);

	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top - 170;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
});

jQuery(function(){
     jQuery("#contact_firstname").validate({
          expression: "if (VAL.length > 2 && VAL && VAL != 'Please fill in your First Name to submit') return true; else return false;"
     });
		 
		 
	jQuery("#email").validate({
   			 expression: "if ( VAL && VAL != 'Please fill in your Email to submit') return true; else return false;"
                    
                });
		 
    
     jQuery("#comments").validate({
          expression: "if (VAL.length > 5 && VAL && VAL != 'Please fill in your Message to submit') return true; else return false;"
     });				
});


function checkEmail(){	
    inputvalue=document.getElementById('email').value;	
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(inputvalue)){         
		return true;
    }else{   
		document.getElementById('email').value= "Please fill in your Email to submit"; 
		return false;
    }
}


