/**
 * @author lin.sun
 */
	
$(function(){
	/**
	 * tips
	 * 标记：title="{xxxxxxxxxxx}width"
	 */
	$("[title^={]").each(function(){
		var title = $(this).attr("title");
		if(title.match(/\{(.*)\}(.*)/)){
			title = RegExp.$1;
			width = parseInt(RegExp.$2);
			$(this).attr("gtitle",title).mousemove(function(e){
				var title = $(this).attr("gtitle");
				var html = title.replace(/\\n/g, "<br/>");
				if ($("#vtips").length == 0) {
					$("<div id='vtips'>" + html + "</div>").appendTo(document.body).hide();
				}else{
					$("#vtips").html(html);
				}
				var top = e.clientY + document.documentElement.scrollTop;
				
				if(top+$("#vtips").height()+40 > document.documentElement.scrollTop+document.documentElement.clientHeight){
					top = top - $("#vtips").height() - 20;
				}else{
					top+=10;
				}

				//(e.clientY + 40 + document.documentElement.scrollTop+$("#vtips").height() > document.documentElement.clientHeight ? (e.clientY - 20 + document.documentElement.scrollTop-$("#vtips").height()) : (e.clientY + 20 + document.documentElement.scrollTop) )
								
				$("#vtips").css({
						"position": "absolute",
						"top": top + "px",
						"left": (e.clientX + 70 + width > document.documentElement.clientWidth ? e.clientX - width - 35 : e.clientX + 20) + "px",
						"width": width + "px",
						"border": "solid 3px #76B2DE",
						"backgroundColor": "#fff",
						"padding": "8px",
						"lineHeight": "18px",
						"fontSize": "12px"
					}).show();
				
			}).mouseout(function(){
				$("#vtips").remove();				
				
			});
		}
		$(this).attr("title","");
		
		$(".lev1>.lev2")
	});
	
	
	
	$(".tabDiv li").hover(function(){
		$(this).par(".tabDiv").find("li").css({
			"backgroundImage": "url(/resoure/images/tab_2.gif)",
			"fontWeight":		"normal"
		});
		var div = $(this).par(".tabDiv").par("div");
		div.find("[class^=tab_div_]").hide();
		$(this).css({
			"backgroundImage": "url(/resource/images/tab_1.gif)",
			"fontWeight":		"bold"
		});
		
		$("."+$(this).attr("tabfor")).show();
		
	},function(){
		
	});

	

	
});




   





