		$(function()
		{
			//$("a.b1").hover(function(){ $(this).css({'background-position':'0 -17px'}); },function(){ $(this).css({'background-position':'0 0'}); });
//			$("a.b2").hover(function(){ $(this).css({'background-position':'0 -52px'}); },function(){ $(this).css({'background-position':'0 -35px'}); });
//			$("a.b3").hover(function(){ $(this).css({'background-position':'0 -86px'}); },function(){ $(this).css({'background-position':'0 -69px'}); });
//			$("a.b4").hover(function(){ $(this).css({'background-position':'0 -121px'}); },function(){ $(this).css({'background-position':'0 -104px'}); });
//			$("a.b5").hover(function(){ $(this).css({'background-position':'0 -155px'}); },function(){ $(this).css({'background-position':'0 -138px'}); });
//			$("a.b6").hover(function(){ $(this).css({'background-position':'0 -188px'}); },function(){ $(this).css({'background-position':'0 -171px'}); });
//			
//			$("a.b7").hover(function(){ $(this).css({'background-position':'0 -222px'}); },function(){ $(this).css({'background-position':'0 -205px'}); });
//			$("a.b8").hover(function(){ $(this).css({'background-position':'0 -256px'}); },function(){ $(this).css({'background-position':'0 -239px'}); });
			
			$("a.parent").live('click',function(event)
			{
				 

				if($(this).siblings("ul.submenu").length>0 && !$(this).hasClass('hold') && $(this).hasClass('selected'))
				{
					event.preventDefault();
					//$(this).css({'margin-bottom':'10px'});
					
					if($(this).siblings("ul.submenu").css("display") == 'block'){
						$(this).siblings("ul.submenu").css({'display':''});
					} else {
						$(this).siblings("ul.submenu").css({'display':'block'});
					}
				}
			});
			
//			$("ul.submenu a:not('.display')").live('click',function()
//			{
//				if($(this).siblings("ul.submenu2").length>0)
//				{
//					$(this).addClass('checked');
//					$(this).siblings("ul.submenu2").css({'display':'block'});
//				}
//			});
			
			$("a.parent02").live('click',function()
			{
				
				if($(this).siblings("ul.submenu2").length>0)
				{
					//$(this).css({'margin-bottom':'10px'});
					if($(this).siblings("ul.submenu2").css("display") == 'block'){
						$(this).siblings("ul.submenu2").css({'display':'none'});
					} else {
						$(this).siblings("ul.submenu2").css({'display':'block'});
					}
				}
			});
			
			
			$("ul.submenu2 a").live('click',function()
			{
				if($(this).siblings("ul.submenu3").length>0)
				{
					$(this).addClass('checked');
					$(this).siblings("ul.submenu3").css({'display':'block'});
				}
			});
			
			$(".checkparent").click(function()
			{
				$(".checkchild").attr({"checked":$(this).attr('checked')});
			});
			
			$("table.search tbody tr").hover(function()
			{
				//$(this).css({'cursor':'pointer'});
			});
			
			$("table.search tbody tr").click(function()
			{
				//location.href=$(this).attr('url');
			});
			
			$("table.shells tbody tr td").hover(function()
			{
				//$(this).css({'cursor':'pointer'});
			});
			
			$("table.shells tbody tr td").click(function()
			{
				//location.href=$(this).parent().attr('url');
			});
			
			$("input#btn_login").hover(function()
			{
				$(this).attr({'src':'imgs/btn-login-over.png'});
			},function()
			{
				$(this).attr({'src':'imgs/btn-login.png'});
			});
			
			$("input#btn_search").hover(function()
			{
				$(this).attr({'src':'imgs/btn-search-over.png'});
			},function()
			{
				$(this).attr({'src':'imgs/btn-search.png'});
			});
			
			$("form#product_search input.img").hover(function()
			{
				$(this).attr({'src':'imgs/btn-search-over.png'});
			},function()
			{
				$(this).attr({'src':'imgs/btn-search.png'});
			});
			
			var timer;
			$("div#slider .ban img:first-child").addClass('active').fadeIn(1000);
			var totalimg=$("div#slider .ban img").length;
			for(var i=1;i<=totalimg;i++)
			{
				$('<li><a href="#">&nbsp;</a></li>').appendTo('ul.controller');
			}
			$("ul.controller a").css({'background':'url(imgs/slider-btn.png) top left no-repeat'});
			$("ul.controller a").eq(0).css({'background-position':'0 -12px'});
			timer=setInterval(function()
			{	
				var curr=$(".ban img.active").prevAll().length;
				var go=curr+1;
				if(go>=totalimg) go=0;
				$(".ban img.active").removeClass('active').fadeOut(1000);
				$("ul.controller a").css({'background-position':'0 0'});
				$("div#slider .ban img").eq(go).addClass('active').fadeIn(1000);
				$("ul.controller a").eq(go).css({'background-position':'0 -12px'});
				
			},3000);
			$("ul.controller a").click(function()
			{
				var curritem=$(this).parent().prevAll().length;
				clearInterval(timer);
				$(this).css({'background-position':'0 -12px'});
				$("div#slider .ban img.active").removeClass('active').fadeOut(1000);
				$("div#slider .ban img").eq(curritem).addClass('active').fadeIn(1000);
				$("ul.controller a").css({'background-position':'0 0'});
				$(this).css({'background-position':'0 -12px'});
			});
			
			var inputemail=false;
			$("input#username").focus(function()
			{
				if(inputemail==false) $(this).val('');
				inputemail=true;
			});
			var inputpw=false;
			$("input#password").focus(function()
			{
				$(this).remove();
				$('<input type="password" name="password" id="password" class="text" value="" />').appendTo("#login");
				$("input#password").focus();
				inputpw=true;
			});
			var inputkw=false;
			$("input#keywords").focus(function()
			{
				if(inputkw==false) $(this).val('');
				inputkw=true;
			});
			var inputkw2=false;
			$("#product_search input#keywords").focus(function()
			{
				if(inputkw2==false) $(this).val('');
				inputkw2=true;
			});
			var inputkw3=false;
			$("#search_inv input#keywords").focus(function()
			{
				if(inputkw3==false) $(this).val('');
				inputkw3=true;
			});
			
			$("table.invoice tbody tr td:not('.ischeck')").hover(function()
			{
				$(this).css({'cursor':'pointer'});
			});
			$("table.invoice tbody tr td:not('.ischeck')").live('click',function()
			{
				if($(this).parent().attr('url')!='')
				{
					window.open($(this).parent().attr('url'));
					//location.href=$(this).attr('url');
				}
			});
		});
