$(document).ready(function() {
	
	$('#navigation ul li').hover(
	function(){
		$(this).find('ul').css({'display':'block','left':'0'});
	},
	function(){
		$(this).find('ul').css({'display':'none','left':'9999px'});
	});
	
 if($('ul.serviceList').length){
 	$('ul.sl1 li').each(function(i){
 		if(i % 2 === 0){
 			$(this).addClass('alt');
 		}
 	});
 	$('ul.sl2 li').each(function(i){
 		if(i % 2 != 0){
 			$(this).addClass('alt');
 		}
 	});
 }
 if($('#contactUs').length){
 	$('.reset').click(function(){
 		$('#contactUs')[0].reset();
 		return false;
 	});
	if($('#qDate').length){
		$("#qDate").datepicker();
	}
  	$('input[type=text], textarea').each(function(){
  		enhanceInput($(this));
  	});
  	$('input[type=radio]').each(function(){
  		$(this).css({'border':'none'});
  	});
  	$('input[type=submit]').click(function(){
  		 		
	 		$('input[type=text], textarea').each(function(){
	 			var el = $(this);
	 			if(el.attr('data-original') == el.val()){
	 			el.val('');
	 			}
	 			
	 		});
	 		
		});	
	}
	
});
 function enhanceInput(theInput) {
 		var orig = theInput.attr('placeholder');	
 		if(theInput.val() == ""){
 			theInput.val(orig);
 		}
 		else{
 			$(theInput).css({'color':'#1b1b1b'});
 		}
 	     theInput.focus(function() {
 	     	$(this).css({'color':'#1b1b1b'});
 	        if($(this).val() == orig) {
 	            $(this).val('');
 	            $(this).css({'color':'#1b1b1b'});
 	        } 
 	     }).blur(function() {
 	         if($(this).val() == "") {
 	             $(this).val(orig);
 	             var color = $('input').css("color");
 	             $(this).css({'color':color});
 	         }
 	     });
 	
 	theInput.attr('data-original', orig);
 
 }
 /*
function enhanceInput(theInput) {
	
	if(!theInput.is('textarea')) {
		var orig = theInput.attr('value');	
			
	     theInput.focus(function() {
	        if($(this).val() == orig) {
	            $(this).val('');
	            $(this).css({'color':'#1b1b1b'});
	        } 
	     }).blur(function() {
	         if($(this).val() == "") {
	             $(this).val(orig);
	             var color = $('textarea').css("color");
	              $(this).css({'color':color});
	         }
	     });
	} else {
		var orig = theInput.html();
		 theInput.focus(function() {
	        if($(this).html() == orig) {
	            $(this).html('');
	             $(this).css({'color':'#1b1b1b'});
	        } 
	     }).blur(function() {
	         if($(this).html() == "") {
	             $(this).html(orig);
	             var color = $('input').css("color");
	              $(this).css({'color':color});
	         }
	     });
	}
	theInput.attr('data-original', orig);

}*/
