//投票
function fnVoteGirl(id){
		   document.form_globle_vote.member_id.value=id
		   document.form_globle_vote.submit();
}
//拉票
function fnRecommendGirl(id){
		   document.form_globle_recommend.member_id.value=id
		   document.form_globle_recommend.submit();
}
//升级为探险女孩
function fnSubmitUpgradeForm(){
		document.form_upgrade.submit();	
}
//登录
function fnLogin(){
		document.form_login.submit();
}
//设为主页
function fnSetHomePage(){
		document.getElementById("setHomePage").style.behavior='url(#default#homepage)';
		document.getElementById("setHomePage").setHomePage('http://www.lixianji.com/');	
}
//加入收藏
function fnAddFavorite(){
   if (document.all)  {
      window.external.addFavorite("http://www.lixianji.com","丽险记");
   }else if (window.sidebar){
      window.sidebar.addPanel("丽险记","http://www.lixianji.com", "");
   }
} 
//首页自动换图广告
function fnGoodsMove_Type1() {
	this.GoodsSetTime = null;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		//alert(this.DivName);
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;
		
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		
		this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame('" + this.BannerNextLeft + "','next')" , 3000 );
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime)
		
		if ( Math.abs(val - this.BannerCurrent) > 5 ) {
			this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
		} else {
			this.BannerCurrent = val;
		}
		
		this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
		
		if ( this.BannerCurrent != val ) {
			this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
		} else {
			this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
			
			this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
			this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
			
			if ( this.BannerCurrent == 0 ) {
				this.BannerPrevLeft = this.BannerEnd;
			} else if ( this.BannerCurrent == this.BannerEnd ) {
				this.BannerNextLeft = 0;
			}
			this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
			this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		}
		
		this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame('" + this.BannerNextLeft + "','next')" , 3000 );
	}
}
