//加入收藏
functionAddFavorite(){
if(document.all){
addToBookMark(window.location.href,document.title);
}elseif(window.sidebar){
addToBookMark(document.title,window.location.href);
}
}
functionaddToBookMark(url,title){
varua=navigator.userAgent.toLowerCase();
if(ua.indexOf("msie8")>-1){
external.AddToFavoritesBar(url,title);//IE8
}else{
try{
window.external.addFavorite(url,title);
}catch(e){
try{
window.sidebar.addPanel(title,url);//firefox
}catch(e){
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
}
returnfalse;
}