﻿/***************************/
//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

$(document).ready(function(){
	//global vars
	var searchBoxes = $("");
	var input1 = $("#name");
	var input2 = $("#email");
	var inputBox1Default = "Full Name";
	var inputBox2Default = "E-mail Address";
	
	//Effects for both searchbox
	searchBoxes.focus(function(e){
		$(this).addClass("active");
	});
	searchBoxes.blur(function(e){
		$(this).removeClass("active");
	});
	
	//Searchbox1, set focus when document is ready
	input1.focus(function(){
		if($(this).attr("value") == inputBox1Default) $(this).attr("value", "");
	});
	input1.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", inputBox1Default);
	});

	//Searchbox2 show/hide default text if needed
	input2.focus(function(){
		if($(this).attr("value") == inputBox2Default) $(this).attr("value", "");
	});
	input2.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", inputBox2Default);
	});
});
