﻿/***************************/
//@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 = $("#search");
	var searchBox2 = $("#search");
	var searchBox2Default = "search...";
	var searchBox3 = $("#name");
	var searchBox3Default = "Name";
	var searchBox4 = $("#mail");
	var searchBox4Default = "E-mail";
	var searchBox5 = $("#name-c");
	var searchBox5Default = "Name";
	var searchBox6 = $("#mail-c");
	var searchBox6Default = "E-mail";
	var searchBox7 = $("#name-r");
	var searchBox7Default = "Name";
	var searchBox8 = $("#mail-r");
	var searchBox8Default = "E-mail";
	
	//Effects for both searchbox
	searchBoxes.focus(function(e){
		$(this).addClass("active");
	});
	searchBoxes.blur(function(e){
		$(this).removeClass("active");
	});
	searchBox2.focus(function(){
		if($(this).attr("value") == searchBox2Default) $(this).attr("value", "");
	});
	searchBox2.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox2Default);
	});
	searchBox3.focus(function(){
		if($(this).attr("value") == searchBox3Default) $(this).attr("value", "");
	});
	searchBox3.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox3Default);
	});
	searchBox4.focus(function(){
		if($(this).attr("value") == searchBox4Default) $(this).attr("value", "");
	});
	searchBox4.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox4Default);
	});
	searchBox5.focus(function(){
		if($(this).attr("value") == searchBox5Default) $(this).attr("value", "");
	});
	searchBox5.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox5Default);
	});
	searchBox6.focus(function(){
		if($(this).attr("value") == searchBox6Default) $(this).attr("value", "");
	});
	searchBox6.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox6Default);
	});
	searchBox7.focus(function(){
		if($(this).attr("value") == searchBox7Default) $(this).attr("value", "");
	});
	searchBox7.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox7Default);
	});
	searchBox8.focus(function(){
		if($(this).attr("value") == searchBox8Default) $(this).attr("value", "");
	});
	searchBox8.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", searchBox8Default);
	});
});
