﻿//jQuey
	var userName = GetCookie("usernameJS");
	if (userName) {
		$(".head_member").html('您好，'+ userName +' <a href="/members/msgBox.asp" target="_blank">短信<span class="msgNewNum"></span></a> | <a href="/members/control.asp" target="_blank">会员中心</a> | <a href="/user/'+ userName +'/" target="_blank">个人主页</a>');
		$("#replyUsername").val(userName);
		$("#replyUserpass").val("******");
	} else {
		$(".head_member").html('<a href="/members/" target="_blank">登录</a>|<a href="/members/register.asp" target="_blank">注册</a>');
		$("#replyUsername").val("游客");
		$("#replyUserpass").val("");
	}
	//短信数量
	if (GetCookie("usernameJS")) {$.get("/include/ajax.asp?act=msgNewNum&username="+ GetCookie("usernameJS") +"&"+ Math.random() +"",function(data){
		if (data) {//alert(data);
			$(".msgNewNum").html(data);
		}
		});
	}
	
	//目录点击展开#category
	$(".list1 a:has(span), .list1 a:has(span)").click(function(){
		var j_catNext = $(this);
		if(j_catNext.siblings("div.list2").css("display")=='block'){
				j_catNext.siblings("div.list2").hide();
				j_catNext.children(".catNext").html("[+]");
			} else {
				j_catNext.siblings("div.list2").show();
				j_catNext.children(".catNext").html("[-]");	
			}
		return false;
	});
	
	$(".list1 a, .list2 a").click(function(){
		var j_catNext = $(this);
		if(j_catNext.attr("class")!="on"){$(".list1 a, .list2 a").attr("class",""); j_catNext.attr("class","on");}
	});
	//默认打开的子目录[-]
	$(".list1 a:contains('[-]')").each(function(){
		var j_catNext = $(this);
		j_catNext.siblings("div.list2").show();
		j_catNext.children(".catNext").html("[-]");
	});

	
	//卡片切换(.pt00)
	var plistN = $(".pt00_on").children("a").attr("rev");
	$.get("/include/ajax.asp?act=personList&listN="+plistN+"",function(data){
		if (data) {//alert(data);
			$(".leftPerson .personList").append(data);
			$(".leftPerson .personList0"+plistN+"").show();
		}
	});
	$(".leftPerson .pt00").click(function(){
		$(this).siblings(".pt00").css({margin:'2px 0 0 0', padding:'3px 6px', background:'#FFEBD0', 'border-bottom':'#EFC993 solid 1px', position:'relative', top:'1px', 'font-weight':'normal'});
		$(this).css({margin:'0', padding:'4px 8px', background:'#FFFFFF', 'border-bottom':'none', position:'relative', top:'2px', 'font-weight':'bold'});
		$(".leftPerson .personList00").hide();
		var plistN = $(this).children("a").attr("rev");
		var $pThisList = $(".leftPerson .personList0"+ plistN +""); 
		if ($pThisList.html()) { $pThisList.show();}
		else { 
			$.get("/include/ajax.asp?act=personList&listN="+ plistN +"",function(data){
				if (data) {//alert(data);
					$(".leftPerson .personList").append(data);
					$pThisList.show();
				}
			});
		}
		
		return false;
	}); 
	
	
	//内容默认卡片(.win_head)
	$(".win_head>a.on:not(:only-child)").append('<div class="onthis">&nbsp;</div>');
	//$(".ibodyNone").remove();
	$(".win_head:has(a.on)").each(function(){
   		$(this).siblings(".win_body").children(".ibody").hide();
		$(this).siblings(".win_body").children("."+$(this).children("a.on").attr("rel")).show();
   	});
	$(".winW2 .W2hide0, .winH2 .W2hide0").css("display","block");
	$(".winW2 .W2hide").css("display","inline");
	$(".winH2 .H2hide").css("display","block");
	//点击卡片.win_head>a
	$(".win_head>a").click(function(){
		$(this).attr("class","on");
		$(this).siblings("a").attr("class","");
		$(this).siblings().children("div.onthis").remove();
		$(this).append('<div class="onthis">&nbsp;</div>');
		var bodyN = "."+ $(this).attr("rel");
		var win_body = $(this).parent().siblings(".win_body");
		win_body.children(".ibody").hide();
		win_body.children(bodyN).show();
		return false;
	});
	var quotesUrl = {quote1:"http://quotes.cnfol.com/images/shzzs_s.jpg",
					quote2:"http://quotes.cnfol.com/images/szcz_s.jpg",
					quote3:"http://quotes.cnfol.com/images/shzbg_s.jpg",
					quote4:"http://quotes.cnfol.com/images/szbg_s.jpg",
					quote5:"http://chart.jrj.com.cn/htmdata/gifindex/Sznotitle_399300.png",
					quote6:"http://ichart.finance.yahoo.com/instrument/1.0/^HSI/chart;range=1d/image;size=184x110"
					};
	function quotesFlesh(){
			var n = parseInt(Math.random()*(9999-1+1)+1);
			var imgobj = $("."+$(".zsMenu li a.on").attr("rev")).find("img");
			var img = quotesUrl[$(".zsMenu li a.on").attr("rev")];
			if (img.indexOf("?")>0) {img = img.substring(0,img.indexOf("?"))+"?"+n;}
			else {img = img+"?"+n;}
			$(imgobj).attr("src",img);
		}
	if ($(".zsMenu").html()) {
		var MyMar_2=setInterval(quotesFlesh,30000);
		quotesFlesh();
		$(".quotes").children("."+$(".zsMenu li a.on").attr("rev")).show();
		$(".zsMenu li a").mouseover(function(){
			$(this).parent("li").siblings("li").children("a").removeClass("on");
			$(this).addClass("on");
			$(".quotes").children("div").hide();
			var n = parseInt(Math.random()*(9999-1+1)+1);
			var imgOn = $(".quotes").children("."+$(this).attr("rev")).show().find("img");
			var imgSrc = quotesUrl[$(this).attr("rev")];
			if (imgSrc.indexOf("?")>0) {imgSrc = imgSrc.substring(0,imgSrc.indexOf("?"))+"?"+n;}
			else {imgSrc = imgSrc+"?"+n;}
			imgOn.attr("src",imgSrc);
			var imgObj = $(".quotes").children("."+$(this).attr("rev")).find("img").get();
			clearInterval(MyMar_2);
			MyMar_2=setInterval(quotesFlesh,30000);
		});
	}
	
	var quotesFlesh3_obj = $("#gjIfr1");
	var quotesUrl3 = {gjIfr1:"http://www.kitco.cn/cn/live_charts/sohu_index_table.gif?1&1=1",
					gjIfr2:"http://quote.cnfol.com/web/index.php?web=W015&type=iframe&bgcolor=ffffff&bordercolor=cccccc&cellspacing=1&cellpadding=3&1=1"
					};
	function quotesFlesh3(){
			var n = parseInt(Math.random()*(9999-1+1)+1);
			var srcStr = quotesUrl3[$(".gjIndex a.on").attr("rev")];
			if (srcStr.indexOf("&1=1")>0) {srcStr = srcStr.substring(0,srcStr.indexOf("&1=1"))+"&1=1"+n;}
			else {srcStr = srcStr+"&1=1"+n;}
			quotesFlesh3_obj.attr("src",srcStr);
		}
	if (quotesFlesh3_obj.attr("src")) {
		var MyMar_3=setInterval(quotesFlesh3,18*1000);
		quotesFlesh3();
		$(".gjIndex>a").mouseover(function(){
			if ($(this).attr("class")!="on"){ 
				clearInterval(MyMar_3);
				$(this).siblings("a").removeClass("on");
				$(this).addClass("on");
				quotesFlesh3_obj.hide();
				quotesFlesh3_obj=$("#"+$(this).attr("rev"));
				quotesFlesh3_obj.attr("src",quotesUrl3[$(".gjIndex a.on").attr("rev")]);
				quotesFlesh3_obj.show();
				MyMar_3=setInterval(quotesFlesh3,18*1000);
			}
		});
	}
	
	//订阅按钮
	$("#rssMoreAct").toggle(function(){
			$(this).html("收起");
			$(".rssMore").prepend('<div id="rssMoreCont"><a href="http://www.xianguo.com/subscribe.php?url=http://www.365bull.com/rss/" rel="external"><img class="rsslist" alt="订阅到鲜果" src="/images/rss/xianguo.jpg" /></a><br /><a href="http://www.bloglines.com/sub/http://www.365bull.com/rss/" rel="external"><img class="rsslist" alt="订阅到bloglines" src="/images/rss/bloglines.gif" /></a><br /><a href="http://www.netvibes.com/subscribe.php?url=http://www.365bull.com/rss/" rel="external"><img class="rsslist" alt="订阅到netvibes" src="/images/rss/netvibes.gif" /></a><br /><a href="http://www.rojo.com/add-subscription?resource=http://www.365bull.com/rss/" rel="external"><img class="rsslist" alt="订阅到Rojo" src="/images/rss/rojo.gif" /></a><br /><a href="http://rss.hexun.com/sub/http://www.365bull.com/rss/" rel="external" title="订阅到和讯"><img class="rsslist" src="/images/rss/hexun.gif" /></a><br /><a href="http://www.live.com/?add=http://www.365bull.com/rss/" rel="external" title="订阅到Live.com"><img class="rsslist" src="/images/rss/live.gif" /></a><br /><a href="http://www.emailrss.cn/?rss=http://www.365bull.com/rss/" rel="external" title="使用RSS邮天下邮件订阅"><img class="rsslist" src="/images/rss/emailrss.gif" /></a><br /></div>');
			return false;
		},
		function(){
			$(this).html("更多");
			$("#rssMoreCont").remove();
			return false;
		}
	);
//alert("ok");
$(function(){
});//jQuey End


