﻿
function flElement(o){
	return (document.getElementById)?document.getElementById(o):document.all[o];
}

function flFavorite(o){
	window.external.AddFavorite('http://www.flfll.com','免费友情链接交换，出售，求购平台');
	return false;
}
function flLabel(flNew){
	flElement('lb'+flOld).className = '';
	flElement('tb'+flOld).style.display = 'none';
	flElement('lb'+flNew).className = 'me';
	flElement('tb'+flNew).style.display = 'block';
	flOld = flNew;
}

flMarqueeLeft=function(){}
flMarqueeLeft.prototype={
	Init:function(n){
		this.Html(n);
		return setInterval("ml"+n+".Marquee("+n+")",10);
	},
	Clear:function(n){
		clearInterval(n);
	},
	Html:function(n){
		oMarqueeLeftA = flElement('oMarqueeLeftA'+n);
		oMarqueeLeftB = flElement('oMarqueeLeftB'+n);
		oMarqueeLeftB.innerHTML=oMarqueeLeftA.innerHTML;
	},
	Marquee:function(n){
		oMarqueeLeft = flElement('oMarqueeLeft'+n);
		oMarqueeLeftA = flElement('oMarqueeLeftA'+n);
		oMarqueeLeftB = flElement('oMarqueeLeftB'+n);
		if(oMarqueeLeftB.offsetWidth-oMarqueeLeft.scrollLeft<=0){
			oMarqueeLeft.scrollLeft-=oMarqueeLeftA.offsetWidth;
		}else{
			oMarqueeLeft.scrollLeft++;
		}
	}
}

flAjax=function(){}
flAjax.prototype={
	Xml:function(){
		var flXml;
		if(window.XMLHttpRequest){
			flXml = new XMLHttpRequest();
			if(flXml.overrideMimeType){
				flXml.overrideMimeType("text/xml");
			}
		}else if(window.ActiveXObject){
			try{
				flXml = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(e){
				try{
					flXml = new ActiveXObject("Microsoft.XMLHTTP");
				}catch(e){
					
				}
			}
		}
		return flXml;
	},
	Params:function(){
		var flParams = new Array();
		var flForm = document.forms[0];
		for (var i=0;i<flForm.elements.length;i++){
			var flParam = encodeURIComponent(flForm.elements[i].name);
			flParam += "=";
			flParam += encodeURIComponent(flForm.elements[i].value);
			flParams.push(flParam);
		}
		return flParams.join("&");
	},
	Get:function(flParam){
		var x = new this.Xml;
		x.open('get','/fl_ajax.asp?'+flParam,false);
		x.send('');
		if(x.status==200){
			return x.responseText;
		}
	}
}

var flVerifyConfig;
flVerify=function(){}
flVerify.prototype={
	Focus:function(o){
		this.Show(o.id,'xFocus');
	},
	Blur:function(o){
		if(o.value==''){
			if(flVerifyConfig[o.id].xNormal){
				this.Show(o.id,'xNormal');
			}else{
				this.Show(o.id,'');
			}
		}else{
			this.Test(o.id);
		}
	},
	Test:function(o){
		if(flElement(o).value==''){
			if(flVerifyConfig[o].xRequired){
				return this.Show(o,'xEmpty');
			}else{
				return this.Show(o,'');
			}
		}else{
			var c=flVerifyConfig[o].xCheck();
			return this.Show(o,c);
		}
	},
	Show:function(o,s){
		if(s!=''){
			flElement('c'+o).className=flVerifyConfig[o][s].cls;
			flElement('t'+o).innerHTML=flVerifyConfig[o][s].tip;
		}else{
			flElement('c'+o).className='';
			flElement('t'+o).innerHTML='';
		}
		if(s==''||s=='xOk') return true;
		return false;
	},
	Submit:function(o){
		var jResult=true;
		for(var i in flVerifyConfig){
			if(!this.Test(i)) jResult=false;
		}
		return jResult;
	}
}

dpFloatAll=function(){}
dpFloatAll.prototype={
	Float:function(n){
		faObj = flElement('dpFloatAll'+n);
		faTop = 150;
		if(n==1) faObj.style.posLeft = 2;
		if(n==2) faObj.style.posRight = 6;
		if(n==9){
			faObj.style.posLeft = (document.documentElement.clientWidth-faObj.offsetWidth)/2;
			faTop = 280;
		}
		faObj.style.posTop = faTop;
		setInterval("fa"+n+".Move("+n+","+faTop+")",30);
	},
	Move:function(n,faTop){
		faObj = flElement('dpFloatAll'+n);
		if(window.innerHeight){
			faPos = window.pageYOffset;
		}
		else if(document.documentElement && document.documentElement.scrollTop){
			faPos = document.documentElement.scrollTop;
		}
		else if(document.body){
			faPos = document.body.scrollTop;
		}
		faPos = faPos - faObj.offsetTop + faTop;
		faPos = faObj.offsetTop + faPos/10;
		if(faPos < faTop) faPos = faTop;
		faObj.style.top = faPos+"px";
	}
}

