$(function(){ 
	//链接虚线框
//	$("a").bind("focus",function(){
//		if(this.blur){ //如果支持 this.blur
//			this.blur();
//		}
//	});
	
	//用户名输入状态
	$("input.username").focus(function(){
		$(this).removeClass().addClass("nusernameImg");
	}).blur(function(){
		if($(this).val()=="")
			$(this).removeClass().addClass("username");
	})
	
	//密码输入状态
	$("input.password").focus(function(){
		$(this).removeClass().addClass("passwordImg");
	}).blur(function(){
		if($(this).val()=="")
			$(this).removeClass().addClass("password");
	})
	
	//设置搜索输入框状态
	$("input.textInput").focus(function(){
		tmptxt = $(this).attr("value");
		if(this.value == tmptxt){
			this.value = '';
		}
	}).blur(function(){
		if(this.value == '')
			this.value = tmptxt;
	})
	
	// IE下 按钮 3px Bug
	if ( $.browser.msie )
		$('.selectGender').css({"margin-right":"3px"});
	
	// 性别选择
	$('.selectGender').click(function(){
			$('.genderList').show();			
	})
	$(".genderList li:last-child").css({"margin-bottom":"0"});
	$(".genderList li a").click(function(){			
		$(".genderList").hide();
		$(".genderList_current").removeClass("genderList_current");
		$(this).parent().addClass("genderList_current");
		var gender = $.trim($(this).text());
		$(".selectGender").val(gender);
	})	
	
	// 搜索条件Tab
	$(".searchTab li a").click(function(){
		$(".searchTab li a.current").removeClass("current");
		$(this).addClass("current");
		$(".searchInput .textInput").val( "请输入" + $(this).text() );
	})		
	
	//兴趣相投Tab
	$(".assort li a").click(function(){
		$(".assort li a.current").removeClass("current");
		$(this).addClass("current");
	})	
	
	//最新圈子Tab
	$(".innerLeft .tabNav li a").click(function(){
		$(".innerLeft .tabNav li a.current").removeClass("current");
		$(this).addClass("current");
	})
	
	//发表回复Tab
	$(".innerRight .tabNav li a").click(function(){
		$(".innerRight .tabNav li a.current").removeClass("current");
		$(this).addClass("current");
	})

	//居民排行	
	var firstLi = $(".toptenbox li.num").eq(0);
	firstLi.addClass("big");
	$(".toptenbox li.num").mouseover(function(){
		$(".big").removeClass('big');
		$(this).addClass('big');
	})

	// 集市 
	$(".commodityList li").hover(function(){
		$(".hover").removeClass('hover');
		$(this).addClass('hover');
	},function(){
		$(".hover").removeClass('hover');
	})
	
	//半透明层
	var teamH = $('.teamsGallery').innerHeight();
	$('.teamsNavBg').height(teamH);
	
	//关闭层
	$('span.close[title=关闭]').click(function(){
		$('.orderDiv').hide();
	})
	
	//ie6 下 页脚错位修正
	if($.browser.version = 6.0){
		$(window).resize(function() {
			$('.footer').css({
					"position":"relative"
					
				});
			$('.content').css({
					"padding-bottom":"0"
			});
		})
	}
	
	//播放、暂停
	$('a.bt_pause').hide();
	$('a.bt_play').click(function(){
		$(this).hide();
		$('a.bt_pause').show()
	})
	$('a.bt_pause').click(function(){
		$(this).hide();
		$('a.bt_play').show();
	})
	  
});

function handleSliderChange(e, ui)
{
  var maxScroll = $(".moreGroup").attr("scrollWidth") - $(".moreGroup").width();
  $(".moreGroup").animate({scrollLeft: ui.value * (maxScroll / 114)});
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $(".moreGroup").attr("scrollWidth") - $(".moreGroup").width();
  $(".moreGroup").attr({scrollLeft: ui.value * (maxScroll / 114) });
}
