﻿//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;
	}); 
	
	
	//圈图片大小
	$(".QuanLogo2").each(function(i){
		if(this.complete || this.readyState =="complete") { DrawImage(this,100,100); }
		else {
			this.onreadystatechange = function(){ 
				if(this.readyState =="complete") { DrawImage(this,100,100); }
			} 
		}
	});
	
	//圈投票
	function quanVote(circleID){
		$.get("/include/ajax.asp?act=quanVote&circleID="+ circleID +"",function(data){
			if (data.indexOf("successful")>=0) {
				var cents2 = (parseInt($(".voteNum").html()) + 1).toString();
				$(".voteNum").html(cents2);
			}
		});
	}
	
	
	//内容默认卡片(.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;
	});
	
	//内容卡片
	$("ul.simpleHead li.card a").click(function(){
		var bodyId=$(this).attr("rel");
		$(this).parents("ul.simpleHead").find("li").removeClass("on");
		$(this).parent().addClass("on");
		$(this).parents("ul.simpleHead").siblings(".simpleBody").slideUp("fast");
		$(this).parents("ul.simpleHead").siblings("#"+bodyId).slideDown("normal");
		return false;
	});
	
	//订阅按钮
	$("#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


