$(function(){
	//**********图库展示**********\\
	$(".photo_body a img").fadeTo(0,1);
	$(".photo_body a").each(function(){
		var widthSpan=parseInt($(this).css("width"));
		$(this).find("span").css("width",widthSpan+"px");
		$(this).find("u").css("width",widthSpan-20+"px");
	})
	$(".photo_body a").mouseover(function(){
		$(".photo_body a  img").fadeTo(0,1);
		if($(this).attr("rel")!=10){
			$(this).find("img").fadeTo(0,0.8);
		}
		$(this).find("span").animate({height:"toggle"},"slow");
	})
	$(".photo_body a").mouseout(function(){
		$(this).find("span").animate({height:'toggle'},"slow");
	})
	
	//**********婚姻情感左侧**********\\
	$("#hyqg_leftshow li").mouseover(function(){
		for(var i=1;i<=$("#hyqg_leftshow li").length;i++){
			$("#hyqg_leftshow").find(".topicimg"+i+"").hide();
		}
		$("#hyqg_leftshow").find(".topicimg"+$(this).attr("rel")+"").show();
		$("#hyqg_leftshow li").attr("class","");
		$(this).attr("class","topic_current");
	})
	//**********婚姻情感右侧**********\\
	$("#hyqg_righttit li").mouseover(function(){
		$("#hyqg_righttit li").attr("class","");
		$(this).attr("class","titlistli_current");
		$(".hyqg_rightshow").hide();
		var rel=$(this).attr("rel");
		$("#hyqg_rightshow"+rel+"").show();
	})
	$("#hyqg_rightbotli li").mouseover(function(){
		$("#hyqg_rightbotli li").attr("class","");
		$(this).attr("class","qgzkbd_current");
		$(".hyqg_rightbot").hide();
		$("#hyqg_rightbot"+$(this).text()+"").show();
	})
	
	//**********美容美体左侧**********\\
	$("#mrmt_leftshow li").mouseover(function(){
		for(var i=1;i<=$("#mrmt_leftshow li").length;i++){
			$("#mrmt_leftshow").find(".topicimg"+i+"").hide();
		}
		$("#mrmt_leftshow").find(".topicimg"+$(this).attr("rel")+"").show();
		$("#mrmt_leftshow li").attr("class","");
		$(this).attr("class","topic_current");
	})
	//**********美容美体右侧**********\\
	$("#mrmt_righttit li").mouseover(function(){
		$("#mrmt_righttit li").attr("class","");
		$(this).attr("class","titlistli_current");
		$(".mrmt_rightshow").hide();
		var rel=$(this).attr("rel");
		$("#mrmt_rightshow"+rel+"").show();
	})
	$("#mrmt_rightbotli li").mouseover(function(){
		$("#mrmt_rightbotli li").attr("class","");
		$(this).attr("class","qgzkbd_current");
		$(".mrmt_rightbot").hide();
		$("#mrmt_rightbot"+$(this).text()+"").show();
	})
	
	//**********时尚服饰左侧**********\\
	$("#ssfs_leftshow li").mouseover(function(){
		for(var i=1;i<=$("#ssfs_leftshow li").length;i++){
			$("#ssfs_leftshow").find(".topicimg"+i+"").hide();
		}
		$("#ssfs_leftshow").find(".topicimg"+$(this).attr("rel")+"").show();
		$("#ssfs_leftshow li").attr("class","");
		$(this).attr("class","topic_current");
	})
	//**********时尚服饰右侧**********\\
	$("#ssfs_righttit li").mouseover(function(){
		$("#ssfs_righttit li").attr("class","");
		$(this).attr("class","titlistli_current");
		$(".ssfs_rightshow").hide();
		var rel=$(this).attr("rel");
		$("#ssfs_rightshow"+rel+"").show();
	})
	$("#ssfs_rightbotli li").mouseover(function(){
		$("#ssfs_rightbotli li").attr("class","");
		$(this).attr("class","qgzkbd_current");
		$(".ssfs_rightbot").hide();
		$("#ssfs_rightbot"+$(this).text()+"").show();
	})
	
	//**********娱乐星座左侧**********\\
	$("#ylxz_leftshow li").mouseover(function(){
		for(var i=1;i<=$("#ylxz_leftshow li").length;i++){
			$("#ylxz_leftshow").find(".topicimg"+i+"").hide();
		}
		$("#ylxz_leftshow").find(".topicimg"+$(this).attr("rel")+"").show();
		$("#ylxz_leftshow li").attr("class","");
		$(this).attr("class","topic_current");
	})
	//**********娱乐星座右侧**********\\
	$("#ylxz_righttit li").mouseover(function(){
		$("#ylxz_righttit li").attr("class","");
		$(this).attr("class","titlistli_current");
		$(".ylxz_rightshow").hide();
		var rel=$(this).attr("rel");
		$("#ylxz_rightshow"+rel+"").show();
	})
	$("#ylxz_rightbotli li").mouseover(function(){
		$("#ylxz_rightbotli li").attr("class","");
		$(this).attr("class","qgzkbd_current");
		$(".ylxz_rightbot").hide();
		$("#ylxz_rightbot"+$(this).text()+"").show();
	})
})

//**********精彩专题**********\\
var g_aLis = [];
var g_aBtns = [];
var g_oTimer = null;
var hotLi=[];
var rtitA1=[];
var rtitA2=[];
var g_minWidth = 22;
window.onload = function() {
	var a = document.getElementById('show1');
	var i = 0;
	g_aLis = a.getElementsByTagName('li');
	g_aBtns = a.getElementsByTagName('span');
	for (i = 0; i < g_aBtns.length; i++) {
		g_aBtns[i].index=g_aLis[i].index = i;
		g_aBtns[i].onmouseover = function() {
			gotoImg(this.index);
			for (var j= 0;j< g_aLis.length;j++) {
			    g_aLis[j].className="";
			}
			g_aLis[this.index].className="showbox_current";
		}
	}
	//热门话题数据
	var hotShow=document.getElementById("hotshow");
	hotLi=hotShow.getElementsByTagName("li");
	for(i=0;i<hotLi.length;i++){
		hotLi[i].index=i;
		hotLi[i].onmouseover=function(){
			for (var j=0;j<hotLi.length;j++){
				hotLi[j].className="";
				var ii=j+1;
				document.getElementById("topic"+ii+"").style.display="none";
			}
			hotLi[this.index].className="hotbd_current";
			var ii=this.index+1;
			document.getElementById("topic"+ii+"").style.display="block";
		}
	}
	//第一模块右侧1数据
	var first_rtit1=document.getElementById("first_rtit1");
	rtitA1=first_rtit1.getElementsByTagName("a");
	for(i=0;i<rtitA1.length;i++){
		rtitA1[i].index=i;
		rtitA1[i].onmouseover=function(){
			if(this.index==0){
				first_rtit1.style.backgroundImage="url("+imagesPath+"img2/revision_094.gif)";
				document.getElementById("first_rtbd1").style.display="block";
				document.getElementById("first_rtbd2").style.display="none";
			}else{
				first_rtit1.style.backgroundImage="url("+imagesPath+"img2/revision_095.gif)";
				document.getElementById("first_rtbd1").style.display="none";
				document.getElementById("first_rtbd2").style.display="block";	
			}
		}
	}
	//第一模块右侧2数据
	var first_rtit2=document.getElementById("first_rtit2");
	rtitA2=first_rtit2.getElementsByTagName("a");
	for(i=0;i<rtitA2.length;i++){
		rtitA2[i].index=i;
		rtitA2[i].onmouseover=function(){
			if(this.index==0){
				first_rtit2.style.backgroundImage="url("+imagesPath+"img2/revision_094.gif)";
				document.getElementById("first_rbbd1").style.display="block";
				document.getElementById("first_rbbd2").style.display="none";
			}else{
				first_rtit2.style.backgroundImage="url("+imagesPath+"img2/revision_095.gif)";
				document.getElementById("first_rbbd1").style.display="none";
				document.getElementById("first_rbbd2").style.display="block";	
			}
		}
	}
};
function gotoImg(a) {
	if (g_oTimer) {
		clearInterval(g_oTimer)
	}
	g_oTimer = setInterval("changeWidthInner(" + a + ")", 35)
}
function changeWidthInner(a) {
	var b = document.getElementById('show1');
	var c = 288;
	var w = 0;
	var d = true;
	var i = 0;
	for (i = 0; i < g_aLis.length; i++) {
		if (i == a) {
			continue
		}
		if (g_minWidth == g_aLis[i].offsetWidth) {
			c -= g_aLis[i].offsetWidth;
			continue
		}
		d = false;
		speed = Math.ceil((g_aLis[i].offsetWidth - g_minWidth) / 10);
		w = g_aLis[i].offsetWidth - speed;
		if (w <= g_minWidth) {
			w = g_minWidth
		}
		g_aLis[i].style.width = w + 'px';
		c -= w
	}
	g_aLis[a].style.width = c + 'px';
	if (d) {
		clearInterval(g_oTimer);
		g_oTimer = null
	}
}

//**********热门话题**********\\


//基于jquery之上的应用 婚姻情感首页轮播图
var turnSpeed=3000,//speed是设置图片切换速度
turnobjImg="#first_maximg",//大图对象
selectorintPic=".first_turn ul li:first",//初始化选择器
objImglink="#first_turnlink",//大图链接地址对象
objText=".first_turn a span",//大图说明对象.atlas_turnimg span
selectorPic=".first_turn ul li",//小图片的选择器
objcurrentPic="first_current",//小图片的当前对象
playType=1;//播放类型，0是点击播放；1是鼠标经过播放