$(window).load(
	function()
	{
		//alert('123');
		var params = new Object();
		params.wmode = "transparent";
		swfobject.embedSWF("home2.swf", "headerBanner", "641", "112", "9.0.0.0", "js/swfobject/swfobject/expressInstall.swf", params,params,params);
	
		var aryMenuName = ['','aboutus','info','member','teach','perform','ttcphoto'];
		jsMenuInit();
	
		if ($("html").width() > 1024)
		{
			$("body").addClass("cssLargeScreen");
			$("div.cssMasterPanel").addClass("cssLargeScreen");
			//$("div.cssMasterPanel").css("margin-left",0);
			//$("div.cssMasterPanel").css("margin","0");
		}
		else
		{
			//alert('123');
			//$("div.cssMasterPanel").addClass("cssSmallScreen");
			$("div.cssMasterPanel").css("margin","0 0 0 -99px");
		}
				
		$("ul.cssHeaderPanel li a").each(
			function(i)
			{
				if ($.browser.msie && ($.browser.version == '6.0' || $.browser.version == '5.5' ))
				{
					strPath = $(this).children("img:eq(0)").css('filter');	
					//aryTmp = strPath.split('"');
					//strPath = aryTmp[1];				
					aryPath = strPath.split("/");
					strNewPath = "";
					for (var j=0;j<aryPath.length;j++)
						if (j+1 == aryPath.length - 1)
							strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j]+"/over";
						else
							strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
			
					$(this).append($(this).html());
					$(this).children("img:eq(1)").css('filter',strNewPath);
				}	
				else
				{
					strPath = $(this).children("img:eq(0)").attr('src');
						
					aryPath = strPath.split("/");
					strNewPath = "";
					for (var j=0;j<aryPath.length;j++)
						if (j+1 == aryPath.length - 1)
							strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j]+"/over";
						else
							strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
			
					$(this).append("<img src='"+strNewPath+"'>");
				}
				$(this).children("img:eq(1)").css('display','none');

				$(this).mouseover(
					function()
					{
						$(this).children("img:eq(0)").css('display','none');
						$(this).children("img:eq(1)").css('display','block');	
/*
						if ($.browser.msie && ($.browser.version == '6.0' || $.browser.version == '5.5' ))
						{
							strPath = $(this).children("img:eq(0)").css('filter');
							aryPath = strPath.split("/");
							
							strNewPath = "";
							for (var j=0;j<aryPath.length;j++)
								if (j+1 == aryPath.length - 1)
									strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j]+"/over";
								else
									strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
							$(this).children("img:eq(0)").css('filter',strNewPath);
							
							//alert(strNewPath);
						}
						else
						{
						strPath = $(this).children("img:eq(0)").attr('src');
						aryPath = strPath.split("/");
						strNewPath = "";
						for (var j=0;j<aryPath.length;j++)
							if (j+1 == aryPath.length - 1)
								strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j]+"/over";
							else
								strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
						
						//alert(strNewPath);		
						$(this).children("img:eq(0)").attr('src',strNewPath);
						}
*/						
						if (aryMenuName[i] != "")
						{
							//alert($(this).position().left+" "+$("ul.cssHeaderPanel").parent().position().left);
							//alert($("ul.cssHeaderPanel").position().top+" "+$(this).parent().height());
							//alert($(this).parent().position().left);
							//jsMenuShow(aryMenuName[i],$(this).position().left,$(this).position().top,$(this).width(),$(this).height(),$(this));
							jsMenuShow(aryMenuName[i],$(this).offset().left,$("ul.cssHeaderPanel").position().top-6,$(this).width(),$(this).parent().height(),$(this));		
						}
						
					}
				);
				
				$(this).mouseout(
					function()
					{
						$(this).children("img:eq(1)").css('display','none');
						$(this).children("img:eq(0)").css('display','block');	
/*
						if ($.browser.msie && ($.browser.version == '6.0' || $.browser.version == '5.5' ))
						{
							strPath = $(this).children("img:eq(0)").css('filter');
							aryPath = strPath.split("/");
							
							strNewPath = "";
							for (var j=0;j<aryPath.length;j++)
								if (j+1 == aryPath.length - 1)
								{
								}
								else
					 				strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
							$(this).children("img:eq(0)").css('filter',strNewPath);
							
							//alert(strNewPath);
						}
						else
						{
						strPath = $(this).children("img:eq(0)").attr('src');
						aryPath = strPath.split("/");
						strNewPath = "";
						for (var j=0;j<aryPath.length;j++)
							if (j+1 == aryPath.length - 1)
							{
							}
							else
								strNewPath += (strNewPath != "" ? "/" : "" )+aryPath[j];
								
						$(this).children("img:eq(0)").attr('src',strNewPath);	
					   }
*/	
					}
				);
			}
		);
	}
);

