﻿function text_focus(o)
{
	o.svlaue = o.value;
	o.value = '';
}
function text_blur(o)
{
	if (o.value=='') o.value = o.svlaue;
}

ad_rand = function (){
this.ads = new Array();
this.weights = new Array();
this.adadd = function(html,weight)
{
	this.ads[this.ads.length] = html;
	this.weights[this.weights.length] = weight;
};
this.adwrite = function(){
	if (this.ads.length<=0) return;
	var i = 0;
	var weights = 0;
	for (i=0;i<this.weights.length;i++)
	{
		weights += this.weights[i];
	}
	var r = Math.random();
	weights = r * weights;
	for (i=0;i<this.weights.length;i++)
	{
		weights -= this.weights[i];
		if (weights<=0)
		{
			break;
		}
	}
	if (i==this.weights.length) i = i - 1;
	
	document.writeln(this.ads[i]);

};
}

function ad_top()
{
document.writeln('<iframe src="/images/ad1.html" width="728" height="90" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>');
}

function ad_right()
{
document.writeln('<iframe src="/images/ad.html" width="250" height="508" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>');
}

function ad_foot()
{
}

function ad_index()
{
document.writeln('<iframe src="/images/ad1.html" width="728" height="90" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>');
}

function jumppage(o,index)
{
var href = o.href;
var maxpage = document.getElementById('$maxpage'+index).value;
var page = document.getElementById('$jumppage'+index).value;
page -= 1;
if (page<0 || page>=maxpage) return false;
if (href.indexOf('page')>0)
{
    href = href.replace('page',page);
    window.open(href,'_self');
}
return false;
}


function showDate()
{
    var d = new Date();
    var isIE = navigator.userAgent.indexOf('MSIE') != -1;
    document.write("<span>"+(isIE?d.getYear():(1900+d.getYear()))+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日  "+d.getHours()+":"+d.getMinutes()+"");
    switch(d.getDay())
    {
        case 0:
        document.write("  <font style='color:#f00;'>星期日");
        break;
        case 1:
        document.write("  <font style='color:#000;'>星期一");
        break;
        case 2:
        document.write("  <font style='color:#000;'>星期二");
        break;
        case 3:
        document.write("  <font style='color:#000;'>星期三");
        break;
        case 4:
        document.write("  <font style='color:#000;'>星期四");
        break;
        case 5:
        document.write("  <font style='color:#000;'>星期五");
        break;
        case 6:
        document.write("  <font style='color:#f00;'>星期六");
        break;
    }
    document.write("</font>  </span>");
}

function addBookmark() 
{
var title = document.title;
if(title == null){ 
    var t_titles = document.getElementByTagName("title") 
    if(t_titles && t_titles.length >0) 
    { 
       title = t_titles[0]; 
    }else{ 
       title = ""; 
    } 
}
var url = location.href;
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} 
else if( document.all ) {
window.external.AddFavorite( url, title);
} 
else if( window.opera && window.print ) {
return true;
}
}
