

$(document).ready(function()
{
    $(".keresoDoboz input[type=text]").focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            $(this).removeClass("keresoDobozSzovegInActive");
            $(this).val("");
        }
    });
    
    $(".keresoDoboz input[type=text]").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).addClass("keresoDobozSzovegInActive");
            $(this).val($(this)[0].title);
        }
    });
    
    $(".keresoDoboz input[type=text]").blur(); 
    

	$('.keresoDoboz input[type=text]').keyup(function(e) {
	   	 if(e.keyCode == 13) {
	     	 sendSrc();
	     }
	});
     
	
});

function sendSrc() {
	
	
	 if ($('.keresoDoboz input[type=text]').val().length<2 || ($(".keresoDoboz input[type=text]").val() == $(".keresoDoboz input[type=text]")[0].title))  {
		alert('A keresés minimum 2 karakter hosszú legyen!');
	} else {
		if (srcWhere!='') {
			location.href = "/"+srcTarget+'/srcWhere/'+srcWhere+'/srcStr/'+$('.keresoDoboz input[type=text]').val();
		} else if (typeof($('.keresoDoboz select').val())!='undefined' && $('.keresoDoboz select').val()!='') {
			location.href = "/"+srcTarget+'/srcWhere/'+$('.keresoDoboz select').val()+'/srcStr/'+$('.keresoDoboz input[type=text]').val();
		} else {
			location.href = "/"+srcTarget+'/srcStr/'+$('.keresoDoboz input[type=text]').val();
		}
	}
}

