// JavaScript Document
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'");  
			}
			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("加入收藏失败，有劳您手动添加。");}
		}
} 

$(function(){
	
	//设置首页
	$(".sethome").click(function () {
	SetHome(this,window.location);
	});
	//加入收藏
	$(".addfav").click(function () {
	var addhref = window.location;
	var addtitle = window.document.title;
	AddFavorite(addhref,addtitle);
	return false;
	});
		
	
	$("#article_con img").each(function(){
		var imgWidth = $(this).width();
		var imgHasAlign = $(this).attr("align");
		if(imgHasAlign) {
			$(this).addClass("imghasalign");
		}
		if(imgWidth > 629){
			$(this).addClass("imgover");
		}
	})
});



