function executeSearch(){
	var query = $('input#searchInput').val();
	if(query.length >0)
		window.location = '/apex/Web_Search?universId=' + UTILS.universId + '&q=' + query;
}

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

$(function(){
	
	$('input#searchInput').val(getParameterByName('q'));
	
	$('input#searchInput').keypress(function(event) {
		var p = event.which;
		if(p==13){
			executeSearch();
			event.preventDefault();
		}
	});

});