$(document).ready(function(){   

	$('ul.menu ul').hide();
	
	$('a.btnSearchMenu').click(function(){
		$('ul.menu ul').slideUp('normal');
		$(this).next().slideToggle('normal');
		return false;
	});
	
	$('a.btnSearch').click(function(){
		qValue = urlencode($('#query').val());
		
		if(qValue == '')
		{
			$('#inst').removeClass("HiLightOff");
			$('#inst').addClass("HiLightOn");
			return false;		
		}
		else
		{
			$('#inst').removeClass("HiLightOn");
			$('#inst').addClass("HiLightOff");	
			$(this).attr("target", "_blank");
			orgurl  = $(this).attr("href");
			$(this).attr("href", orgurl + "&query="+qValue);
			//refreshme(qValue);
		}
	});	
});
function refreshme(q)
{
	window.location.href = "/index.php?query="+q;
}
function popcontact()
{
	window.open('contact.php', 'Contact us',
	'scrollbars=1,statusbar=1,resizable=1,width=500,height=500');
}
function urlencode(str) 
{
    str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}