
$(document).ready(function(){
	var tTxt;
	$( "#ctgMenu li").hover(
		function(btn) {
			var hoverd = $(btn.target);
			var ctgId = hoverd.attr("id");
			var parent = hoverd.parent();
			//easType:easeOutElastic,easeOutCirc,easeOutBack,easeOutQuint
			var easTypeH ="easeOutBack";
			var easTypeW ="easeInCirc";
			var pId = parent.attr("id");
			pId = "#"+ pId;
			ctgId = ctgId.replace(/\w{3}/,"");
			tTxt = hoverd.attr("title");
			hoverd.attr("title","");
			var infTab = '<div id="tInfWeb"><div id="acd"><p id="l"></p><p id="c"><span id="ctgTxt"></span>';
			infTab += '</p><p id="r"></p></div><p id="dot"></p></div>';
			var leftP = -67 + (ctgId-1)*166;
			leftP += "px";

			$(pId).animate({
				    opacity: 0.6,
				    marginTop: "15px"
				}, 
				{
					duration:800,
					easing:'easeOutElastic',
					complete:function(){
				}
			});
					
			$("#ctgMenu").append(infTab);
			$("#tInfWeb").css("left",leftP);
			p2g("#tInfWeb p");
			/*
			var ua = navigator.userAgent;
			if(ua.match(/MSIE 6.0/)){
				$("#tInfWeb p").each(function(){
					var img_path = $(this).css("backgroundImage");
					img_path = img_path.replace(/\.png/gi, ".gif");
					var cssSettings = {
						backgroundImage:img_path
					};
					$(this).css(cssSettings);
				});
			}
			*/			
			$("#tInfWeb").animate(
				{
					top: "-88px"
				}, 
				600,
				easTypeH
			);
			$("#tInfWeb p#dot").animate(
				{height: "72px"}, 
				{
					duration:600,
					easing:easTypeH,
					complete:function(){
					
						$("#acd").animate(
							{width: "300px"}, 
							600,
							easTypeW
						);
						$("#tInfWeb p#c").animate(
							{
								width: "250px"
							}, 
							{
								duration:600,
								easing:easTypeW,
								complete:function(){
									$("#ctgTxt").text(tTxt).show();
								}
							}
						);
					
					}
				}
			);
					function p2g(ellem){
			var ua = navigator.userAgent;
			if(ua.match(/MSIE 6.0/)){
				$(ellem).each(function(){
					var img_path = $(this).css("backgroundImage");
					img_path = img_path.replace(/\.png/gi, ".gif");
					var cssSettings = {
						backgroundImage:img_path
					};
					$(this).css(cssSettings);
				});
			}
		}

		},
		//mouseout
		function(btn) {
			var hoverd = $(btn.target);
			var parent = hoverd.parent();
			var pId = parent.attr("id");
			hoverd.attr("title",tTxt);
			pId = "#"+ pId;
			$("#ctgTxt").hide();
			$("#tInfWeb").remove();
			$(pId).animate(
				{
				    opacity: 1,
				    marginTop: "0"
				}, 
				1000,
				'easeOutElastic'
			);
		}
	);
});



