
/*tooltip for top navigation*/

this.vtip = function() {
	$("#navi li a").unbind().hover( 
		function() {
			//this.t = this.title;
			this.title = '';
			var navileft = $("#navi").offset().left;
			var navinum =$("#navi li a").index(this);
			$('#navi').append( '<div id="vtip"><img src="/img/tip'+(navinum +1)+'.gif"></div>' );
			this.top = 88;
switch(navinum) {
case 0:this.left=navileft+40; break;
case 1:this.left=navileft+170; break;
case 2:this.left=navileft+270; break;
case 3:this.left=navileft+390; break;
case 4:this.left=navileft+470; break;
case 5:this.left=navileft+600; break;
}			//var linkhalf = $(this).width()/2;
			//var tiphalf = $("#vtip").width()/2;
			//this.left = ($(this).offset().left) - (tiphalf - linkhalf);
			$('#vtip').css("top", this.top+"px").css("left", this.left  +"px");
			$('#vtip').fadeTo("fast", 1); 
		},
		function() {
			//this.title = this.t;
			$("#vtip").fadeOut("fast").remove();
		}
	);
};



//accordion for sidemenu

function sidemenuready() {
	$("#sidemenu dd").css("display","none");
	$("#sidemenu dl dt.cate a").click(function() {
		var imgsrc = $("img", this).attr("src").split(".");
		if(imgsrc[0].indexOf("_on")!=-1) {
			var motosrc = imgsrc[0].split("_on");
			$("img", this).attr("src", motosrc[0]+".gif");
		} else {
			$("img", this).attr("src", imgsrc[0]+"_on.gif");
		}
		$($(this).parent().next()).slideToggle(100);
		return false;
	});
}

jQuery(document).ready(function($){vtip();sidemenuready();})
