//(c) Alexander Barnard 2009/2010
function _locateFixture($number){
	if(!document.getElementsByTagName)return
	var o=d.getElementsByTagName('b')
	if(!o)return
	for(var i=0;i<o.length;i++)
		if(o[i].innerHTML==$number){
			o[i].scrollIntoView()
			break
		}	
}
function _loadFixture(it){
	return __fixturesLoader('Fixtures','_load'+it.action.match(/\w+\.\w+$/),'data',it)
}
function _loadCompetitions(it){
	return __fixturesLoader('Competition List','_teams_competitions.asp','competitionlist',it)
}
function _linkToPage(){
	var oP=new _clsPOP("popuplink")
	var oT=d.getElementsByTagName("H3"),title=''
	var url=document.location.toString().replace(/\&season=\d+/i,'')
	if(oT.length)title=' title=\"Follow the progress of '+oT[0].innerHTML+' teams competing in ESFA competitions\"'
	oP.setElement("title:=Webpage Link",
	"content:=<form><p>The web site address to this page is:<br><input type='text' style='width:320px' value='"+url+"' "+title+"' onfocus='this.select()'></p><p>To link to this page from your web site, copy the HTML code below and paste it into your web page."+
	"<br><textarea onfocus=\"this.select()\"><a href=&quot;"+url+"&quot;"+title+">ESFA Competition Fixtures and Results</a></textarea></p></form>",
	"buttonbar:=[OK]"
	)
	oP.display(POS_SHOW)
}
function __fixturesLoader(title,url,id,frm){
	if(!_getObject(id))return
	setTimeout(
		function(){
			var oP=new _clsPOP("loading")
			oP.setElement("title:=Loading "+title,'content:=<div class="wait"><span>Please Wait...</span></div>')
			oP.div.className+=" minipop"
			oP.display(POS_SHOW)
			var oA=new _clsAJAX()
			oA.loadData(frm)
			setTimeout(
				function(){
					oA.sendReceive(url,function(html){
							var o=_getObject(id)
							if(o)o.innerHTML=html
							if(window._ie6_init)_ie6_init()
							setTimeout(function(){oP.display(POS_HIDE)},1000)
							return false
						}
					)
				}
				,250)//pause to load
		}
	,50)//pause to stop form processing
	return false
}

