/*
 *浣滆€咃細鎳掍汉寤虹珯 http://www.51xuediannao.com/
*/
$(function(){
	
	$("input[placeholder]").placeholder();
	//鑿滃崟椤甸潰
	var $menuDt = $("#menu > dl > dt"),
		$menuLi = $("#menu > dl > dd > ul > li");
		$dl2cola = $("#menu > dl.dl2col > dd > div > a");
	$menuDt.click(function(){
		var $this = $(this),$thisparent = $this.parent("dl");
		if($thisparent.hasClass("hidemenu")){
			$thisparent.removeClass("hidemenu");
		}else{
			$thisparent.addClass("hidemenu");
		}
	});
	$menuLi.click(function(){
		$menuLi.removeClass("cur");
		$(this).addClass("cur");
	});
	$dl2cola.click(function(){
		$dl2cola.removeClass("cur");
		$(this).addClass("cur");
	});
	
	
});

//placeholder鎻掍欢 寮€濮?	寤鸿鏀惧埌涓€涓崟鐙殑js鏂囦欢涓?
;(function ($) {
	$.fn.placeholder = function (options) {
		var opts={
			focusclass:'inputfocus'	//榛樿鑾峰緱鐒︾偣鏃剁殑鏍峰紡锛屽湪鍐欐牱寮忕殑鏃跺€欑敤input:focus,.inputfocus{鏍峰紡}缁勫悎浣跨敤
		};
		$.extend(opts,options);
		if(!isPlaceholder()){
			this.each(function(){
				var $this = $(this),$thisplaceholder = $this.attr("placeholder");
				$this.val($thisplaceholder);
				$this.focus(function(){ 
					if($this.val()==$thisplaceholder){
						$this.val("");
					}
					$this.addClass(opts.focusclass);
				}).blur(function(){
					if ($this.val() == ''){ 
						$this.val($thisplaceholder); 
					}
					$this.removeClass(opts.focusclass);
				});
			 });//each end
		}//if end
	};
	function isPlaceholder(){ 
		return 'placeholder' in document.createElement('input');  
	} 	
})(jQuery);
//placeholder鎻掍欢 缁撴潫