$(document.ready=function(){ 	 		
			$("#txtsearch").keydown(
				function(){
					$("#searchassist").slideDown(100); $("#gtbtnsearch").addClass('btnsearch');
					$(".btnsearch").hover(
							function(){$(this).animate({opacity: 0}, 500);},
							function(){$(this).animate({opacity: 1.0}, 500);}
					);
				}				
			);
			$("#txtsearch").blur(
				function(){$("#searchassist").slideUp(100); /*$("#gtbtnsearch").removeClass('btnsearch');*/}				
			);
			
			$(".stamplinkul li, .gtawardlinks li").filter(":has(.wbox)").hover(
				function(){$(this).children(".wbox").show(0);},
				function(){$(this).children(".wbox").slideUp(500);}					 
			 );
			
			$(".stampoptionul .linkbox").hover(
				function(){$(this).children(".wbox").show(0);},
				function(){$(this).children(".wbox").slideUp(450);}					 
			 );
			
			$(".loginwithfb").hover(
				function(){$(this).children("li").show(0);},
				function(){$(this).children("li.second,li.third").slideUp(200);}					 
			 );
			
			$("#catlistul li").filter(":has(.boxt)").hover(
				function(){ 
					var offset1 = $("#catlistul").offset(); 
					var offset2 = $(this).offset(); 
					offset2=offset2.top-offset1.top;
					offset2=$("#catlistul").height() - offset2;					
					if(offset2<$(this).children(".boxt").height()){offset1=$(this).children(".boxt").height()-offset2; $(this).children(".boxt").css("top",-offset1);}
					$(this).children(".boxt").show(0);
					},
				function(){/*$(this).children(".boxt").animate({opacity: 1.0}, 400);*/ $(this).children(".boxt").hide(0);}					 
			 );
			
			$(".searchmenul li").click(
				function(){							
							$(".searchmenul li.active").removeClass('active'); 
							$(this).addClass('active');
							var lival = $(this).attr("value");
							switch(lival){
								case 0:								  
									$("#searchcat").css("display","block"); $("#nosearchcat").css("display","none");
									$("#searchprodcats").css("display","block"); $("#searchstampcats").css("display","none");									
								  break;								
								case 6:	
									$("#searchcat").css("display","block"); $("#nosearchcat").css("display","none");
									$("#searchprodcats").css("display","none"); $("#searchstampcats").css("display","block");
								  break;
								default:
									$("#searchcat").css("display","none"); $("#nosearchcat").css("display","block");
							}
						  }					 
			 );
			var searchsubcatvar=0;
			$("#searchcat").click(			
				function(){if(searchsubcatvar==0) {$("#searchsubcat").slideDown(100); searchsubcatvar=1;} 
						   else if(searchsubcatvar==1) {$("#searchsubcat").slideUp(100); searchsubcatvar=0}
						  }				
			  );
			/*$("body").click(function(){if($(searchsubcatvar==1)) {$("#searchsubcat").slideUp(150); searchsubcatvar=0}});*/
			$(".searchcatul li").click(
					function(){$(this).parents().children("li.active").removeClass("active"); $(this).addClass("active");}				   
			   );
			
			$("#gjoin .joinnow").hover(
				function(){$(this).animate({opacity: 0.6}, 1000);},
				function(){$(this).animate({opacity: 1.0}, 1000);}
			);	
			$(".popout").hover(
				function(){$(this).children(".wbox").show(50);},
				function(){$(this).children(".wbox").hide(150);}
			);
			$("#statustxtmsg").click(function(){$("#statustxt").hide(0); $("#statusinput").show(0); $("#statusinput .inputbox").focus();});
			$("#statusinput .inputbutton").click(function(){$("#statustxt").show(0); $("#statusinput").hide(0);});
			
			$(".gttraybaseul li a.norm, .gttraybaseulr li a.norm").click(
				function(){if($(this).parents().filter(":has(.wbox)")) $(this).parents().children(".wbox").toggle(50);}				
		   	);
			$(".gtchatname").click(
				function(){$(".gtchatdiv").toggle(50); $(this).toggleClass('act', 1000);}										   
		   	);
			$(".gtchatfoot li").filter(":has(.gtchatfootsubul)").hover(
				function(){$(this).children(".gtchatfootsubul").show(50);},
				function(){$(this).children(".gtchatfootsubul").animate({opacity: 1.0}, 500); $(this).children(".gtchatfootsubul").hide(50);}														    		  );
			$(".inploginbtn,.btnsearch,.ygaucholayer").hover(
				function(){$(this).animate({opacity: 0}, 500);},
				function(){$(this).animate({opacity: 1.0}, 500);}
			);	
});