// JavaScript Document
$(document).ready(function(){ 
							//顶上导航菜单
							var  aamypointcenter;
							$("#mypointcenter").hover(
												 function(){
													 var offsetLeft=$(this).offset().left;
													 var offsetTop=$(this).offset().top+$(this).innerHeight()-1;
													 var innerWidth=$(this).innerWidth()-14;
													 //显示我的积分中心菜单
													 var popwinstr="<div id=\"popwinmypointcenter\"></div>";
													 
													 if ($("#popwinmypointcenter").length==0){
														 $("#container").before(popwinstr);
														 }else{
														 $("#popwinmypointcenter").show();
														 }
													 $("#popwinmypointcenter").css({width:innerWidth+"px",top:offsetTop+"px",left:offsetLeft+"px"})
													 $("#popwinmypointcenter").bind("mouseover",function(){$(this).show()}).bind("mouseout",function(){$(this).hide()});
													
													 $("#popwinmypointcenter").load("jsp/common/mypointcentermenu.jsp");
													 
													 
													 },
												 function(){
													 //隐藏我的积分中心菜单
													 //$.msgbox.closemsgbox();
													 $("#popwinmypointcenter").hide();
													 }
												 )
							$("ul.mainmenu > li").each(function(i){//顶上导航菜单
								if ($(this).attr("class").indexOf("menuon")<0 && $(this).attr("class")!=="point"){
									$(this).hover(
										function(){
											$(this).toggleClass("menuon");
											$(this).find("a").toggleClass("current");
										},
										function(){
											$(this).toggleClass("menuon");
											$(this).find("a").toggleClass("current");
										}	
									)
								}
							})
})

;(function($){
		   $.fn.jClassMenu=function(options){
			   var settings={
				   actionType:"click",
				   defaultOpenMenu:"_"
				   };
			   var oldobj=null;
			   var op = $.extend(settings, options);
			   var defaultOpenMenuArray=op.defaultOpenMenu.split('_');
			   function showHidden(obj){
					if ($(obj).parent().attr("title")!=defaultOpenMenuArray[0]){//如果不等于默认显示菜单 就开闭菜单
						$(obj).parent().find("ul").toggle();
						$(obj).toggleClass("noborder-bottom");	
					}
				   }
			   return $(this).find("li > div").each(function(i){
															 
															 if (defaultOpenMenuArray[0]==$(this).parent().attr("title")){ //设置一级菜单开闭
																 oldobj=this;
																 $(this).parent().find("ul").toggle();
																 $(this).toggleClass("noborder-bottom");
																 $(this).parent().find("ul > li").each(function(){//设置二级菜单指示
																												if ($(this).attr("title")==defaultOpenMenuArray[1]){
																													$(this).toggleClass("current");
																													}
																												}) 
																 }
															 

															 $(this).bind(op.actionType,function(){//设置鼠标点击开闭菜单
																								 if (oldobj==null){
																									 oldobj=this;
																									 }else{
																									 if ($(oldobj).parent().attr("title")!=defaultOpenMenuArray[0]){//如果不等于默认显示菜单 就开闭菜单
																									 	showHidden(oldobj);
																									 }
																									 oldobj=this;
																									 }
																									 
																								 if ($(this).parent().attr("title")!=defaultOpenMenuArray[0]){//如果不等于默认显示菜单 就开闭菜单
																									 showHidden(this);
																									 }
																								 })
//															 $(this).mouseover(function(){//设置鼠标点击开闭菜单
//																					if (oldobj==null){
//																						oldobj=this;
//																						}else{
//																						if ($(oldobj).parent().attr("title")!=defaultOpenMenuArray[0]){//如果不等于默认显示菜单 就开闭菜单
//																							showHidden(oldobj);
////																							$(oldobj).parent().find("ul").toggle();
////																							$(oldobj).toggleClass("noborder-bottom");	
//																						}
//																						oldobj=this;
//																						}
//																					$("#textfield").val($(this).parent().attr("title"));
//																					if ($(this).parent().attr("title")!=defaultOpenMenuArray[0]){//如果不等于默认显示菜单 就开闭菜单
//																						showHidden(this);
////																						$(this).toggleClass("noborder-bottom");
////																						$(this).parent().find("ul").toggle();
//																						}
//																					
//																																								
////																					if ($(this).parent().find("ul").css("display")=="none"){
////																						$(this).toggleClass("noborder-bottom");
////																						$(this).parent().find("ul").toggle();
////																						}
//																					//$(this).parent().find("ul").stop();
////																					if ($(this).parent().find("ul").css("display")=="none"){//显示
////																						$(this).toggleClass("noborder-bottom");
////																						$(this).parent().find("ul")//.slideDown(1500)
////																						}else{//隐藏
////																						$(this).parent().find("ul").slideToggle(1500,function(){$(this).parent().find("div").toggleClass("noborder-bottom");});																						
////																						}
//																					
//																					})
															 
															 
															 })
			   
			   }
		   
})( jQuery );


//$(document).ready(function(){ //分类菜单
//							var oldobj=null;
//							$("#dotredsolid > li > div").each(function(i){
//																	 if ("其它"==$(this).parent().attr("title")){ //设置一级菜单开闭
//																		 $(this).parent().find("ul").toggle();
//																		 $(this).parent().toggleClass("noborder-bottom");
//																		 $(this).parent().find("ul > li").each(function(){ //设置二级菜单指示
//																														if ($(this).attr("title")=="好网站"){
//																															$(this).toggleClass("current");
//																															}
//																														})																			
//																		 }
// 
//																	 $(this).click(function(){ //设置鼠标点击开闭菜单
////																							if (oldobj==null){
////																								oldobj=this;
////																								}else{
////																								$(oldobj).parent().find("ul").toggle();
////																								$(oldobj).parent().toggleClass("noborder-bottom");
////																								oldobj=this;
////																								}
//																							$(this).parent().find("ul").toggle();
//																							$(this).parent().toggleClass("noborder-bottom");
//																							})
//																	 
//																	 })
//})

