﻿// JScript File
function GetPath()
{
    var sPath = document.location.toString();
    sPath = sPath.replace("http://","");
    var i = sPath.indexOf("/");
    sPath = sPath.substring(i, sPath.length );
    return sPath;
}
function WriteHtml(divName)
{
    var sHtml;
    var sPath = GetPath();
    switch(divName)
    {
        case "logo_banner":
            sHtml="<form method='get' action='http://www.google.cn/custom' target='google_window'>";
            sHtml+="<div class='logo'>";
            sHtml+="<a href='/'>";
			sHtml+="<img border='0' src='/images/MaxdigestTitle.gif' alt='MaxDigest.com，集大家智慧'>";
			sHtml+="</a>";
		    sHtml+="</div>";
		    sHtml+="<div class='banner'>";
			//sHtml+="<div class='empty'>";
            //sHtml+="打倒万恶的电信和网通，请选择&nbsp;";
			//sHtml+="<a href='http://www.maxdigest.com" + sPath + "'>网通</a>";
			//sHtml+="&nbsp;|&nbsp;";
			//sHtml+="<a href='http://ctc.maxdigest.com" + sPath + "'>电信</a>";
			//sHtml+="&nbsp;线路。";
			//sHtml+="</div>";
			sHtml+="<div class='form'>";
			sHtml+="<div class='form_line_1'>";
			sHtml+="<input type='hidden' value='UTF-8' name='ie'>";
			sHtml+="<input type='hidden' value='UTF-8' name='oe'>";
			sHtml+="<input class='searchbox' maxLength='255' name='q' size='18'>";
			sHtml+="<input type='hidden' value='www.maxdigest.com' name='domains'>";
			sHtml+="&nbsp;&nbsp;<input class='submit' type='image' alt='使用Google搜索所有文章' src='/images/search.png' name='I1'>";
			sHtml+="</div>";
			sHtml+="<div class='form_line_2'>";
			sHtml+="<input id='google_site_Search' type='radio' CHECKED value='www.maxdigest.com' name='sitesearch'><label class='search_range' title='搜索 www.maxdigest.com' for='google_site_Search'>MAXDIGEST.COM</label>";
			sHtml+="<input id='googleSearch' type='radio' value='' name='sitesearch'><label class='search_range' title='搜索网络' for='googleSearch'>GOOGLE</label> ";
			sHtml+="</div>";
			sHtml+="</div>";
		    sHtml+="</div>";
		    sHtml+="</form>";
		    break;
		case "category_nav_title":
		    sHtml="该分类其他文章：";
		    break;
		case "site_nav_title":
		    sHtml="站内其他文章：";
		    break;
		case "random_nav_head_title":
		    sHtml="随机文章列表";
		    break;
		case "random_nav_head_ad":
		    sHtml="Google广告";
		    break;
		case "footer":
		    sHtml="<a href='/2007-01/T-blog.html' title='本站的来历以及作者的联系方式'>关于</a> | NO &copy; RIGHTS 2007 MAXDIGEST | <a href='http://www.miibeian.gov.cn'>京ICP备06063805号</a>";
		    sHtml+="<p style='text-indent:0em'><a href='http://cyberpolice.hangzhou.com.cn/'>";
		    sHtml+="<img src='/images/hangzhou.gif' width='25px' height='40px' style='border:0px' /></a></p>";
		    sHtml+="<div style='display:none'><script language='javascript' type='text/javascript' src='http://js.users.51.la/863183.js'></script></div>";
            break;
		default:
		    sHtml = "";
	}
	if(divName)
	{
	    document.getElementById(divName).innerHTML=sHtml;
	}
}

function WriteArticleInfo(created, category, source)
{
    var sHtml
    sHtml="<span class='article_info'>发表日期：" + created + "</span>&nbsp;";
	sHtml+="<span class='article_info'>文章分类：" + category + "</span>&nbsp;";
	sHtml+="<span class='article_info'>来源：" + source + "</span>";
	document.getElementById("article_info").innerHTML=sHtml;
}

function WriteRandomLink(arrLink)
{
    var sHtml;
    sHtml = "";
    if (!arrLink)
        return;
    if (arrLink.length > 0)
    {
        for(i=0;i<arrLink.length;i++)
        {
            if (arrLink[i].length==3)
            {
                sHtml+=MakeLinkHtml(arrLink[i][0],arrLink[i][1],arrLink[i][2]);
            }
            else
                return;
        }
    }
	document.getElementById("random_nav_list_link").innerHTML=sHtml;
}

function MakeLinkHtml(url,text,date)
{
    var sHtml;
    sHtml="<div class='list_item'><a href='";
    sHtml+=url;
    sHtml+="'>" + text + "</a>";
    //sHtml+="&nbsp;" + date;
    sHtml+="</div>";
    return sHtml;
}
