//global vars
var inputBoxes = $(".textinputs");
var inputBox1 = $("#inputnews");
var inputBox2 = $("#inputsearch");
var inputBox1Default = "Vaše e-mailová adresa...";
var inputBox2Default = "Hledaný text...";

//Effects for both searchbox
inputBoxes.hover(
	function(e){
		$(this).addClass("active");
	},
	function(e){
		if ($(this).is(':not(.focused)')) $(this).removeClass("active");
	}
);
inputBoxes.focus(function(e){
	$(this).addClass("focused");
});
inputBoxes.blur(function(e){
	$(this).removeClass("focused");
	$(this).removeClass("active");
});

//Inputbox1 show/hide default text if needed
inputBox1.focus(function(){
	if($(this).attr("value") == inputBox1Default) $(this).attr("value", "");
});
inputBox1.blur(function(){
	if($(this).attr("value") == "") $(this).attr("value", inputBox1Default);
});
//Inputbox2 show/hide default text if needed
inputBox2.focus(function(){
	if($(this).attr("value") == inputBox2Default) $(this).attr("value", "");
});
inputBox2.blur(function(){
	if($(this).attr("value") == "") $(this).attr("value", inputBox2Default);
});

