function addFavorite(){
	var title = "飘渺西游", url = "http://www.wooduan.com/";
	if(document.all){
		try{
			window.external.addFavorite(url, title);
		}catch (e1){
			try{
				window.external.addToFavoritesBar(url, title);
			}catch (e2){
				alert('您使用的浏览器不支持此功能，请手工加入收藏');
				return false;
			}
		}
	}else if(window.sidebar){
		window.sidebar.addPanel(title,url,"");
	}else{
		alert('您使用的浏览器不支持此功能，请手工加入收藏');
		return false;
	}
}
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("抱歉！您的浏览器不支持直接设为首页。如果想启用该功能，请在地址栏内输入 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',vrl);
		}
	}
}
var scrollAction = function(options){
	var _this = this,t,opts;
	var defaults = {
	interval: 3000,
	w: 958
	};
	opts = $.extend(defaults, options);
	this.len = parseInt($("#flash li").size());
	this.last = opts.w*(this.len-1);
	this.c = 1;
	this.prev = function(){
		$("#prev").unbind("click");
		if(_this.c>1){
			$("#flash").animate({"left":"+="+opts.w},"slow",function(){
				$("#prev").bind("click",_this.prev);
			});
			_this.c--;
		}else{
			$("#flash").animate({"left":"-"+_this.last+"px"},"slow",function(){
				$("#prev").bind("click",_this.prev);
			});
			_this.c = _this.len;
		}
	}
	this.next = function(){
		$("#next").unbind("click");
		if(_this.c < _this.len){
			$("#flash").animate({"left":"-="+opts.w},"slow",function(){
				$("#next").bind("click",_this.next);
			});
			_this.c++;
		}else{
			$("#flash").animate({"left":"0px"},"slow",function(){
				$("#next").bind("click",_this.next);
			});
			_this.c = 1;
		}
	}
	this.move = function(){
		$("#next").trigger("click");
	}
	if (this.len<2){
		return;
	}
	$("#prev").unbind("click").bind("click",_this.prev);
	$("#next").unbind("click").bind("click",_this.next);
	$('#flash,#prev,#next').mouseover(function(){
			clearInterval(t);
	});
	$('#flash,#prev,#next').mouseout(function(){
		t = setInterval(_this.move, opts.interval);
	});
	if ((t!=undefined) && (t!=null)) clearInterval(t);
	t = setInterval(_this.move, opts.interval);
}
