//***********************************设为首页,收藏开始*********************************************
function addtofavorite()
{
if (document.all){
window.external.addfavorite(document.url,document.title);
}else if (window.sidebar){
window.sidebar.addpanel(document.title, document.url, "");
}
}
//设为首页
function sethomepage(){
if (document.all){
document.body.style.behavior='url(#default#homepage)';
document.body.sethomepage(document.url);
}else if (window.sidebar){
if(window.netscape){
try{
netscape.security.privilegemanager.enableprivilege("universalxpconnect");
}catch (e){
alert( "该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" );
}
}
var prefs = components.classes['@mozilla.org/preferences-service;1'].getservice(components. interfaces.nsiprefbranch);
prefs.setcharpref('browser.startup.homepage',document.url);
}
}
//***********************************设为首页,收藏结束*********************************************
if(typeof(htmlelement)!="undefined" && !window.opera)
{
htmlelement.prototype.__definegetter__("outerhtml",function()
{
var a=this.attributes, str="<"+this.tagname, i=0;for(;i";
return str+">"+this.innerhtml+""+this.tagname+">";
});
htmlelement.prototype.__definesetter__("outerhtml",function(s)
{
var r = this.ownerdocument.createrange();
r.setstartbefore(this);
var df = r.createcontextualfragment(s);
this.parentnode.replacechild(df, this);
return s;
});
htmlelement.prototype.__definegetter__("canhavechildren",function()
{
return !/^(area|base|basefont|col|frame|hr|img|br|input|isindex|link|meta|param)$/.test(this.tagname.tolowercase());
});
}
// 图片大小控制
function reimgsize(){
var obj =document.getelementbyid("content").getelementsbytagname("img");
if(!obj) obj = document.images;
for (i=0; i450){
obj[i].width = 450;
obj[i].style.width = 450;
obj[i].title = "在新窗口打开图片!";
obj[i].style.cursor = "pointer";
obj[i].border = 0;
obj[i].outerhtml=''+obj[i].outerhtml+''
}
}
}
}