var OA700 = {
    /**
    * 设为首页
    * @method setHome
    * @public
    */
    setHome: function(o,r){
		o.target="_self";
		if(document.all&&!external.max_version){
			o.style.behavior='url(#default#homepage)';
			o.setHomePage(r?r:location.href);
		}else window.open("?page-helpcenter.html");
	},

	/** 
	 * @brief 对input显示/隐藏 默认提示
	 * 
	 * @param el 要处理的元素标签
	 */
	iptDef: function(el){
		$each( $$(el), function(D){
			$chk( D.get('rel') ) || D.set('rel', D.get('value'));
			D.addEvents({
				focus: function(){
					D.get('value') == D.get('rel') && D.set('value', '');
				},
				blur: function(){
					D.get('value') == '' && D.set('value', D.get('rel')); 
				}
			});
		});
	}
};

/**
 * 图片轮循效果
 **/
var roundRobin = new Class({
	options: {
		mousetype: 'mouseenter', //触发类型
		meta: false, //是否带切换效果
		sD_css: '',
		hD_css: 'show',
		duration: 500, //meta为true时有效，设置动画执行时间
		time: 3000	//轮循间隔时间		
	},
	Implements: [Options],
	initialize: function(sDs,hDs,parent,options) { 
		var _t = this;
		_t.sDs = $$(sDs);/* 触发的元素集 */
		_t.hDs = $$(hDs);/* 隐藏的元素集 */
		_t.parent = $$(parent);/* 父元素 */
		_t.setOptions(options);
		_t.currentIndex = 1;
		_t.show(0); 
		_t.sDs.each(function(el,i){
			el.addEvent(_t.options.mousetype, function() { this.show(i); }.bind(this)); 
		}, _t);
		_t.parent.addEvents({
			mouseenter: function(){ this.stop(); }.bind(this),
			mouseleave: function(){ this.start(); }.bind(this)
		});
		return _t;
	},
	show: function(to) {
		var opT = this.options;
		var oldI = this.currentIndex;
		var newI = this.currentIndex = ($defined(to) ? to : (oldI < (this.sDs.length - 1) ? oldI + 1 : 0));
		if(oldI == newI) return;
		if(opT.meta){
			this.hDs[newI].setStyle('z-index', 1).fade('hide').addClass(opT.hD_css);
			this.hDs[oldI].removeClass(opT.hD_css);
			this.hDs[newI].set('tween', {duration: opT.duration}).fade('in');
		}else{
			this.hDs[oldI].removeClass(opT.hD_css);
			this.hDs[newI].addClass(opT.hD_css);
		}
		if(opT.sD_css != ''){
			this.sDs[oldI].removeClass(opT.sD_css);
			this.sDs[newI].addClass(opT.sD_css);
		}
	},
	start: function() {
		this.interval = this.show.periodical(this.options.time,this);
	},
	stop: function() {
		$clear(this.interval);
	}
});

