﻿/// <reference path="jquery-1.3.2.min.js" />


var oScripts = document.getElementsByTagName("script");
var sEditorPath;
for (var i = 0; i < oScripts.length; i++) {
    var sSrc = oScripts[i].src.toLowerCase();
    if (sSrc.indexOf("javascript/index.js") != -1) sEditorPath = oScripts[i].src.replace(/index.js/, "");
}
document.write("<scr" + "ipt src='" + sEditorPath + "jquery.query.js'></scr" + "ipt>");
document.write("<scr" + "ipt src='" + sEditorPath + "common.js'></scr" + "ipt>");
document.write("<scr" + "ipt src='" + sEditorPath + "dialog.js'></scr" + "ipt>");
document.write("<scr" + "ipt src='" + sEditorPath + "AC_RunActiveContent.js'></scr" + "ipt>");
document.write("<scr" + "ipt src='" + sEditorPath + "nav.js'></scr" + "ipt>");

$(document).ready(function () {
	//showflash(295, 220, "ImgFocus");
	//	showflash(512, 250, "list_fla", "bcastrlist.xml");
	$("#GroupNewLog .Show ul li").eq(4).addClass("line");
	$("#GroupBestLog .Show ul li").eq(4).addClass("line");
	$("#WeeklyBest .Show ul li").eq(4).addClass("line");
	$("#TodayHot .Show ul li").eq(4).addClass("line");
	$("#TodayHot .Show ul li").eq(9).addClass("line");
	$("#EliteLog  ul li").eq(4).addClass("line");
	$("#EliteLog  ul li").eq(9).addClass("line");
	$("#EliteLog  ul li").eq(14).addClass("line");
	//    $("a").each(function(i) {
	//        if ($(this).attr("title") == '') {
	//            $(this).attr("title", $(this).html());
	//        }
	//    });
	if (typeof jsonclass == "object") {
		$("#classname").html(jsonclass[0].classname);
	}
	if (typeof jsonclass == "string") {
		$("#classname").html('所有分类');
	}
	var isbest = $.query.get("isbest");
	if (noquerystringurl.indexOf("blog.aspx") > 0) {
		if (isbest == "1") {
			var classname = $("#classname").html();
			$("#classname").html(classname + ("（精华日志）"))
		}
	}
	if (noquerystringurl.indexOf("blogger.aspx") > 0) {
		switch (isbest) {
			case 1: $("#bloggername").html("推荐用户"); break;
			case 2: $("#bloggername").html("名人博客"); break;

		}
	}
	$(".ShowIndexTag").each(function (i) {
		var usenum = $(this).attr("usenum");
		if (usenum > 1000) {
			$(this).addClass("ShowIndexTag" + 5);
		}
		else if (usenum > 500) {
			$(this).addClass("ShowIndexTag" + 4);
		}
		else if (usenum > 100) {
			$(this).addClass("ShowIndexTag" + 3);
		}
		else if (usenum > 50) {
			$(this).addClass("ShowIndexTag" + 2);
		}
		else if (usenum > 10) {
			$(this).addClass("ShowIndexTag" + 1);
		}
	});
	//	$("#HotComment  .Show ul").eq(1).addClass("CommentList");
	//   alert(noquerystringurl);

	// 首页幻灯
	$("#divSlide .imglist li").mouseover(function () {
		$(this).parent().find("li").removeClass("active");
		$(this).addClass("active");
		var imgurl = $("img", this).attr("src"), title = $("img", this).attr("alt"), link = $("a", this).attr("href");
		$("#divSlide .divimage img").attr("src", imgurl).attr("alt", title);
		$("#divSlide .divimage a").attr("href", link);
		$("#divSlide .divimage .slidetitle a").attr("title", title).attr("href", link).text(title);
	});

	$(".mytabs .mytabs_title li").mouseover(function () {
		var tabindex = $(this).parent().find("li").index($(this));
		$(this).parent().children("li").removeClass("active");
		$(this).addClass("active");
		var tabslist_div = $(this).parents(".mytabs").find(".mytabs_list div");
		$(tabslist_div).each(function (index, item) {
			$(item).hide();
		});
		$(tabslist_div).eq(tabindex).show();
	});
	$(".mytabs .mytabs_title_l li").mouseover(function () {
		var tabindex = $(this).parent().find("li").index($(this));
		$(this).parent().children("li").removeClass("active");
		$(this).addClass("active");
		var tabslist_div = $(this).parents(".mytabs").find(".mytabs_list_l div");
		$(tabslist_div).each(function (index, item) {
			$(item).hide();
		});
		$(tabslist_div).eq(tabindex).show();
	});
});

