$(document).ready(function () {
	$(".toggle").click(function() {
		if ($(this).hasClass("minus"))
		{
			var element = this;
			$(this).parent().parent().children("li[class!='first'][class!='last']").fadeOut("fast",
					function () {
				$(element).removeClass("minus").addClass("plus");
			});
		}
		
		if ($(this).hasClass("plus"))
		{
			var element = this;
			$(this).parent().parent().children("li[class!='first'][class!='last']").fadeIn("fast",
					function () {
				$(element).removeClass("plus").addClass("minus");
			});
		}
	});
});

var clear='';

try{
send_request('part-right-menu.php', 'mob');
}
catch(temp)
{}

document.onkeydown = checkKeycode
var searchable=0;
var url='';
var temp_var_search;

function checkKeycode(e) 
{
	if(searchable==1)
	{
		var temp = document.getElementById('search');
		var keycode;
		
		if (window.event) keycode = window.event.keyCode;
		else if (e) keycode = e.which;
		
			if(keycode==13) 
			{
			window.location='search-'+escape(temp.value)+".html";
			}
			
	}	
searchable=0;
}

function search_product()
{
clearTimeout(temp_var_search);
temp_var_search=setTimeout("send_request2form()", 400);
}

function send_request2form()
{

	var search_container = document.getElementById('search_container');
	var temp = document.getElementById('search');
	var indicator = document.getElementById('srchloading');

	if((temp.value).length+1>3)
	{
		indicator.className='x';
		evaluate_string='document.getElementById("srchloading").className="srchloadoff";clearTimeout(temp_var_search);';
		send_request('search-mini-'+temp.value+'.html', 'search_container');
		search_container.style.display='';
	}
	else
	{
		search_container.style.display='none';
	}
}

function hs()
{
	var search_container = document.getElementById('search_container');
	search_container.style.display='none';
}

function hla(name)
{
document.getElementsByName(name)[0].className='bgs';
}

function dhl(name)
{
document.getElementsByName(name)[0].className='x';
}

function st(text)
{
Tip(text, BALLOON, true, ABOVE, true, OFFSETX, -10);
}

function ut()
{
UnTip();
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=450');");
}

function hide_result()
{
clearTimeout(clear);
	var temp = document.getElementById('search_container');
	temp.style.display='none';
}

function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : event.keyCode
   if (charCode > 31 && (charCode < 48 || charCode > 57))
      return false;

   return true;
}
