﻿/*
Powered By: Tony Tong;
Last Update: 2011/12/4;
*/

var mask=new Image(); mask.src="images/mask.gif";
var pic1=new Image(); pic1.src="images/pic1-h.gif";
var pic2=new Image(); pic2.src="images/pic2-h.gif";
var pic3=new Image(); pic3.src="images/pic3-h.gif";
var pic4=new Image(); pic4.src="images/pic4-h.gif";
var pic5=new Image(); pic5.src="images/pic5-h.gif";
var pic6=new Image(); pic6.src="images/pic6-h.gif";

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25165138-5']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

$(document).ready(function(){

try
{
	var pn=$("body").attr("id");
	var x=$("div.nav").eq(pn).css("left");
	$("#Mask").css({left:x,display:"block"});
}
catch(err)
{
	///
}

$("#Menu").mouseleave
(
	function()
	{	
		var pn=$("body").attr("id");
		var x=$("div.nav").eq(pn).position().left;
		var t=$("#Mask").position().left-x;
		if (t<0) t=-t;
		$("#Mask").stop().animate({left:x,top:0},t);
	}
);

$("#Menu a:eq(0)").hover(function(){$(this).text("首页")},function(){$(this).text("HOME")});
$("#Menu a:eq(1)").hover(function(){$(this).text("关于我们")},function(){$(this).text("ABOUT")});
$("#Menu a:eq(2)").hover(function(){$(this).text("展览计划")},function(){$(this).text("EVENTS")});
$("#Menu a:eq(3)").hover(function(){$(this).text("联系我们")},function(){$(this).text("CONTACT")});

$("div.nav").mouseover
(
	function()
	{   
		var x=$(this).position().left;
		$("#Mask").stop().animate({left:x,top:0},240);
	}
);

$("#Index img").hover
(

	function()
	{
		var button=$(this).attr("src").split(".")[0]+"-h.gif";
		$(this).attr("src",button);
	},
	function()
	{
		var button=$(this).attr("src").split("-")[0]+".gif";
		$(this).attr("src",button);
	}
);

});

