
function previousOnload() {}

function loadReport(url,section,params) {
	datareport = "";
	var rnnum = Math.random();
	var turl = params+'&rand='+rnnum;
	if(!section) {report = "formdata";} 
	else{report = section;}
	$(report).innerHTML = "<table bgcolor=#ffffff width=150><tr><td align=center><img src=/images/progress.gif><img src=/images/progress.gif><img src=/images/progress.gif></td></tr></table>";
	var myAjax = new Ajax.Updater(report, url, {method: 'get',parameters: turl,evalScripts:true});
}

function loadChat(url,section,params) {
	reportd = section;
	var rnnum = Math.random();
	var turl = params+'&rand='+rnnum;
	$(reportd).innerHTML = "<table bgcolor=#ffffff width=150><tr><td align=center><img src=/images/progress.gif><img src=/images/progress.gif><img src=/images/progress.gif></td></tr></table>";	
	myChat = new Ajax.Updater(reportd, url, {method: 'get',parameters: turl,evalScripts:true});
}


function loadSetup() {
	var flist = "";
	var sport = document.forms['online'].sport.value;
	if(!sport) {alert("Please Choose A Sport");}
	else{
	if(sport == "nascar") {
		if(document.forms['online'].position.value == "CR" && document.forms['online'].lgstyle.value != "groups") {
			flist+="&pos1=CR";
		}
		else if(document.forms['online'].position.value == "WC" && document.forms['online'].lgstyle.value != "groups") {
			flist+="&pos1=WC";
		}
		else if(document.forms['online'].lgstyle.value == "groups") {flist+="&pos1=A&pos2=B&pos3=C";
			if(document.forms['online'].position.value == "CR") {flist+="&pos4=CR";}
			else{flist+="&pos4=WC";}
		}
		if(document.forms['online'].salarycap.value >= 1) {
			var scap = document.forms['online'].lgstyle.value;
			flist+="&scap="+scap;
		}
		if(document.forms['online'].survivor.value >= 1) {
			var scap = document.forms['online'].survivor.value;
			flist+="&surv="+scap;
		}
		if(document.forms['online'].rostlimit.value >= 1) {
			var scap = document.forms['online'].rostlimit.value;
			flist+="&rost="+scap;
		}
	}
	if(sport == "baseball") {
		if(document.forms['online'].lgtype.value) {
			var lgtype = document.forms['online'].lgtype.value;
			flist+="&type="+lgtype;
		}
		if(document.forms['online'].playlist.value) {
			var playlist = document.forms['online'].playlist.value;
			flist+="&list="+playlist;
		}
		if(document.forms['online'].draft.value) {
			var draft = document.forms['online'].draft.value;
			flist+="&draft="+draft;
		}
		if(document.forms['online'].chlineup.value) {
			var chlineup = document.forms['online'].chlineup.value;
			flist+="&chlineup="+chlineup;
		}
	}
	var numteams = document.forms['online'].numteams.value;
	var email = document.forms['online'].email.value;
	var lgname = document.forms['online'].lgname.value;
	lgname =  encodeURIComponent(lgname);
	var name = document.forms['online'].name.value;
	name =  encodeURIComponent(name);
	var pass1 = document.forms['online'].pass1.value;
	pass1 = encodeURIComponent(pass1);
	var pass2 = document.forms['online'].pass2.value;
	pass2 =  encodeURIComponent(pass2);
	var sport =  document.forms['online'].sport.value;
	if(sport == "hockey") {siteaddress = "http://www.fantasyhockeysite.com";}
	else if(sport == "basketball") {siteaddress = "http://www.fblmanager.com";}
	else if(sport == "nascar") {siteaddress = "http://www.fantasyleaguemanager.com";}
	else if(sport == "baseball") {siteaddress = "http://www.fanstarbaseball.com";}
	else if(sport == "football") {siteaddress = "http://www.fanstarfootball.com";}
	else{sport == "football"; siteaddress = "http://www.fanstarfootball.com";}
	var purl = '&sport='+sport+'&email='+email+'&newleague=YES&remote=YES&numteams='+numteams+'&lgname='+lgname+'&name='+name+'&pass1='+pass1+'&pass2='+pass1+flist;
	alert(siteaddress+'/newleague.php');
	loadReport(siteaddress+'/newleague.php','formdata','purl');
	}
}

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='The customer service you guys give is amazing. Were telling everyone about this site for the leagues next year....Thank you for all your help all year. - Stephen Smith'
pausecontent[1]='Thanks for the quick response and all your help throughout the year. Your site is by far the best on the internet. - Diane Forsythe'
pausecontent[12]='And thank you for a top notch site.  This was our 2nd year, and we have renewed for next year.  Keep up the good work. - Bill Tito'
pausecontent[5]='You guys rock! I must say, the customer service that FanStar provides is far and away better than any Ive received anywhere else. And you can quote me on that! (and we did) - Daivd Nihsen'
pausecontent[4]='Thank you, I look forward to my 10th year using Fanstar, you guys still continue to impress me every year.  Thanks for being the best in the business. - Wayne Masters'
pausecontent[11]='Let me congratulate you for a fantastic season and a superb site design. Most of all, I want to thank you for your excellent customer service. - Daniel Ames'
pausecontent[6]='I have recommended this site to many people and know of at least 2 from Oswego NY that run their leagues through you because of me. I recommended you because of your EXCELLENT SERVICE and this is just another example. - John Bugow'
pausecontent[7]='Again, great work! One coach in my league is so impressed by this "fanster site you picked" that he hopes -- "The guys who created it deserve to make a million dollars!" - Robert Dean'
pausecontent[8]='I just wanted to thank you and your staff for making this the best FF year ever for SmashnThrash. Since bring our league online in 1999, it was always a disaster to deal w/ the tech support from CBS. Could never get any useful help. Now that we have found FanStar we are very happy and this has been a bitch free yr. - Todd Thompson'
pausecontent[9]='Thanks a ton. I also have a team on ESPN but your service is far more fun and effective plus, I appreciate your willingness to help. - Michael Bacon'
pausecontent[10]='I must say that once I have gotten a feel for this web site this is by far the BEST one I have ever used.......it is so cool.......Many thanks! - David Gaudreau'
pausecontent[13]='Your service this year has been outstanding. Ive used 3-4 different services prior to this year and was never happy with any of them. I renewed my subscription with you for next year and look forward to using it for many years to come. - Kyle Johnston'
pausecontent[14]='I have been with your company since 1999 and have never been disappointed. I have never said thanks but I need to.  Your product makes it so very easy and effortless to run our league.  Any issues I may have had, you responded immediately to my questions.  I always recommend your product and you will never see our league with any other company - Ken Reynolds'
pausecontent[3]='All three of us loved your site compared to NFL and the price difference was amazing. It only cost $7 more person to go on line, (and have you do all the work) and it keep everybody involved in the league and it was our highest transaction pot ever, because of how easy it was to find which players were avaliable and how many points they have scored in our scoring system.. - Scott Williamson'
pausecontent[2]='It was a big step to get our league fully automated, and your assistance was key in accomplishing that goal. There were a lot of tweaks to accommodate our scoring system, and you attended to them with patience and speed. I cannot thank you enough. - Veronnica Johnson'



/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}