// JavaScript Document// JavaScript Document
	$(document).ready(function() { 
		
		$("#hirebutton").click(function() {
			
			$("#contact_box").animate({
				height: "340px"
			})
			.animate({
				height: "360px"
			}, "fast");
		});
		
		$("#contact_close_button").click(function() {
			
			$("#contact_box").animate({
				height: "360px"
			})
			.animate({
				height: "0px"
			}, "fast");
		});
		
		$('#contactForm').ajaxForm({ 
			target:'#alert'
		}); 
		
		$(".frmfield").focus(function(){
			$(this).css("background-color","#65799b").css("color","#fff");			  
		});
		
		$(".frmfield").blur(function(){
			$(this).css("background-color","#ccc").css("color","#777");			  
		});
		
		
	   $('a[href*=#]').click(function() {
		 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		 && location.hostname == this.hostname) {
		   var $target = $(this.hash);
		   $target = $target.length && $target
		   || $('[name=' + this.hash.slice(1) +']');
		   if ($target.length) {
		  var targetOffset = $target.offset().top;
		  $('html,body')
		  .animate({scrollTop: targetOffset}, 1000);
			return false;
		   }
		 }
		});
		
		
	}); 

$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
			
			$("#contact_box").animate({
				height: "500px"
			})
			.animate({
				height: "0px"
			}, "fast");
};
	
