$(document).ready(function(){
	
		$('.txtBox').each(function(){

			var currentId = $(this).attr('id');

			switch(currentId){
				case "name":

					if($(this).val() == ""){
						$(this).attr('value', 'Name');
					}

					break;
				case "phone":

					if($(this).val() == ""){
						$(this).attr('value', 'Phone');
					}
					
					break;
				case "email":

					if($(this).val() == ""){
						$(this).attr('value', 'Email');
					}
				
					break;
				default:
					break;
			}
		});

	$('.rotateImages').innerfade({speed:'slow', timeout: 3500, containerheight:'383px'});  

	
	$('.txtBox').focus(
		function(){
			
			var currentId = $(this).attr('id');
			$('#'+currentId).css({'color':'#000'});
			
			switch(currentId){
				case "name":

					if($(this).val() == "Name"){
						$(this).attr('value', '');
					}
					
					$('#formWrapper').css({'background-position':'center -60px'});
					break;
				case "phone":

					if($(this).val() == "Phone"){
						$(this).attr('value', '');
					}
					
					$('#formWrapper').css({'background-position':'center -120px'});
					break;
				case "email":

					if($(this).val() == "Email"){
						$(this).attr('value', '');
					}
				
					$('#formWrapper').css({'background-position':'center -180px'});
					break;
				default:
					break;
			}
			
		}
	);
	
	$('.txtBox').blur(
		function(){
		
			var currentId = $(this).attr('id');
			$('#'+currentId).css({'color':'#999'});
			
			$('#formWrapper').css({'background-position':'center 0px'});

			switch(currentId){
				case "name":

					if($(this).val() == ""){
						$(this).attr('value', 'Name');
					}

					break;
				case "phone":

					if($(this).val() == ""){
						$(this).attr('value', 'Phone');
					}
					
					break;
				case "email":

					if($(this).val() == ""){
						$(this).attr('value', 'Email');
					}
				
					break;
				default:
					break;
			}
			
		}				  
	);
	
	

$('#submit').click(
		function(){

		$('.txtBox').each(function(){

			var currentId = $(this).attr('id');

			switch(currentId){
				case "name":

					if($(this).val() == "Name"){
						$(this).attr('value', '');
					}

					break;
				case "phone":

					if($(this).val() == "Phone"){
						$(this).attr('value', '');
					}
					
					break;
				case "email":

					if($(this).val() == "Email"){
						$(this).attr('value', '');
					}
				
					break;
				default:
					break;
			}
		});
	
	});
	
});

	$('#submit').hover(

			function(){
				$('.txtBox').css({'color':'#999'});
				
				$('#formWrapper').css({'background-position':'center -240px'});
				$(this).focus();
			},	
			function(){
				$('#formWrapper').css({'background-position':'center 0px'});
			}
	);



