//------------------------------------------------------------------------------------------------
//            JavaScript Document 
//            该脚本代码智和网络工作室编写
//            智和网络工作室网址：www.zhihee.com    QQ：81146566
//------------------------------------------------------------------------------------------------
<!--

function SetHome(obj,vrl){
	try{
			obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
	}
	catch(e){
			if(window.netscape) {
					try {
							netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
					}  
					catch (e) 
{ 
							alert("抱歉！您的浏览器不支持直接设为首页。\n请在浏览器地址栏输入“about:config”并回车，\n然后将[signed.applets.codebase_principal_support]设置为“true”，\n点击“加入收藏”后忽略安全提示，即可设置成功。");  
					}
					var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
					prefs.setCharPref('browser.startup.homepage',vrl);
			 }
	}
}

function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}

var flag=false;
function setImgSizeSize(ImgD,width,height){    
    var areaWidth = width;  //你放置图片区域的宽度。   
    var areaHeight = height; //你放置图片区域的高度。   
    var image=new Image();    
    image.src=ImgD.src;    
    if(image.width>0 && image.height>0){    
        flag=true;    
        if(image.width/image.height>= areaWidth/areaHeight){    
            if(image.width>areaWidth){    
                ImgD.width=areaWidth;    
                ImgD.height=(image.height*areaWidth)/image.width;    
            }else{    
                ImgD.width=image.width;    
                ImgD.height=image.height;    
            }    
            //ImgD.alt=image.width+"×"+image.height;    
        }else{    
            if(image.height>areaHeight){    
                ImgD.height=areaHeight;    
                ImgD.width=(image.width*areaHeight)/image.height;    
            }else{    
                ImgD.width=image.width;    
                ImgD.height=image.height;    
            }    
            //ImgD.alt=image.width+"×"+image.height;    
        }    
    }    
}  


function setImgSize(img,width,height){   
        img.onload = null;   
        //img.onreadystatechange = setImgSizeSize(img,width,height); 
		setImgSizeSize(img,width,height); 
}

//-->
