// JavaScript Document
object={
	y_ul:function(){
		document.getElementById("ul_a").getElementsByTagName("li")[0].style.background="url('')";
	},
	time:function(){
		var day="";
		var month="";
		var ampm="";
		var ampmhour="";
		var myweekday="";
		var year="";
		mydate=new Date();
		myweekday=mydate.getDay();
		mymonth=mydate.getMonth()+1;
		myday= mydate.getDate();
		myyear= mydate.getYear();
		year=(myyear > 200) ? myyear : 1900 + myyear;
		if(myweekday == 0)
		weekday=" 星期日 ";
		else if(myweekday == 1)
		weekday=" 星期一 ";
		else if(myweekday == 2)
		weekday=" 星期二 ";
		else if(myweekday == 3)
		weekday=" 星期三 ";
		else if(myweekday == 4)
		weekday=" 星期四 ";
		else if(myweekday == 5)
		weekday=" 星期五 ";
		else if(myweekday == 6)
		weekday=" 星期六 ";
		return year+"年"+mymonth+"月"+myday+"日 "+weekday;
	},
	kg:function(id,id_,gd){
		var $=function(i_d){return document.getElementById(i_d)}
		var id_a=$(id).offsetHeight;
		var id_b=$(id_).offsetHeight;
		if(id_a<id_b+gd){
			$(id).style.height=id_b+gd+"px";
		}
	}
}

function SetHome(obj){
try{
   obj.style.behavior='url(#default#homepage)';
   obj.setHomePage('http://');
}catch(e){
   if(window.netscape){
    try{
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    }catch(e){
     alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入'about:config'并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
    }
   }else{
    alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动设置为首页。");
   }
}
}

function AddFavorite(sURL, sTitle) 
{ 
    try 
    { 
        window.external.addFavorite(sURL, sTitle); 
    } 
    catch (e) 
    { 
        try 
        { 
            window.sidebar.addPanel(sTitle, sURL, ""); 
        } 
        catch (e) 
        { 
            alert("加入收藏失败，请使用Ctrl+D进行添加"); 
        } 
    } 
} 

  
jQuery.fn.autoResize = function(options)
{
    var opts = {
        'width' : 214,
        'height': 118
    }
    var opt = $.extend(true, {},opts,options || {});
    width = opt.width;
    height = opt.height;
    $('img',this).each(function(){
        var image = new Image();
        image.src = $(this).attr('src');   if(image.width > 0 && image.height > 0 ){
            var image_rate = 1;
            if( (width / image.width) < (height / image.height)){
                image_rate = width / image.width ;
            }else{
                image_rate = height / image.height ;
            }
            if ( image_rate <= 1){
                $(this).width(image.width * image_rate);
                $(this).height(image.height * image_rate);
            }
        }
    });
	//其他方法
}
jQuery.fn.autoResize_ = function(options)
{
    var opts = {
        'width' : 301,
        'height': 169
    }
    var opt = $.extend(true, {},opts,options || {});
    width = opt.width;
    height = opt.height;
    $('img',this).each(function(){
        var image = new Image();
        image.src = $(this).attr('src');   if(image.width > 0 && image.height > 0 ){
            var image_rate = 1;
            if( (width / image.width) < (height / image.height)){
                image_rate = width / image.width ;
            }else{
                image_rate = height / image.height ;
            }
            if ( image_rate <= 1){
                $(this).width(image.width * image_rate);
                $(this).height(image.height * image_rate);
            }
        }
    });
	//其他方法
}

