function pointsCalc()   {
	window.open('functions/calculator.htm','calc','height=450, width=550, scrollbars=0,resizable=0');
}

function clearLogin()  {
	document.loginform.name.value="";
	document.loginform.password.value="";
	document.loginform.remember.checked=false;
	return false;
}

function showImage(url)  {
	window.open("viewimage.php?img="+url,"_blank","resizable=0,height=300,width=300,scrollbars=1");
}

function getNextTeam()  {
	var choice=document.allteams.team.options[document.allteams.team.selectedIndex].value;
	var theref=document.allteams.url.value;
	this.location.href=theref+"&team="+choice;
}

function openIt(theOne,week)  {
	if (theOne == "rosters")  {
		window.open("printrosters.php","_blank");
	}
	if (theOne == "oldrosters")  {
		window.open("printoldrosters.php?week="+week,"_blank");
	}
	if (theOne == "scores")  {
		window.open("printscores.php?week="+week,"_blank");
	}
	if (theOne == "oldrosterswide")  {
		window.open("printoldrosterswide.php?week="+week,"_blank");
	}
	if (theOne == "rosterswide")  {
		window.open("printrosterswide.php","_blank");
	}
	if (theOne == "lineups")  {
		window.open("printlineups.php?week="+week,"_blank");
	}
}

function showStand(week,year)  {
  document.getElementById("printJob").src="printstand.php?week="+week+"&year="+year;
}

function checkTeamNames()  {
	if (document.teamname.newname.value == "")  {
		if (document.teamname.end0.options[document.teamname.end0.selectedIndex].value != "0000")  {
			alert("Please have the current team name end year to be 0000!");
			return false;
		}
	} else {
		if (document.teamname.end0.options[document.teamname.end0.selectedIndex].value == "0000")  {
			alert("Please set end year of current team name to not be 0000!");
			return false;
		}
		if (document.teamname.start0.options[document.teamname.start0.selectedIndex].value > document.teamname.end0.options[document.teamname.end0.selectedIndex].value)  {
			alert("Please set current team name end year to be equal to or higher than the start year!");
			return false;
		}
		if (document.teamname.newyear.options[document.teamname.newyear.selectedIndex].value < document.teamname.end0.options[document.teamname.end0.selectedIndex].value)  {
			alert("Please set new name start year to the current year!");
			return false;
		}
	}
	return true;
}


function showPreview(week)  {
	window.open("showpreview.php?week="+week,"_blank","resizable=1,height=650,width=550,scrollbars=1");
}


function showMovie(movie)  {
  window.open('showmovie.php?movie='+movie,'movie','height=430, width=550, scrollbars=0,resizable=0');
}


function getQuoteLength()  {
	var maxLength=100;
	var minLength=0;
    var theMessage = document.ownerinfo.quoteArea.value;
	var theLength = document.ownerinfo.quoteArea.value.length;
    var messageSize = maxLength - theLength;
    var leftSize = document.ownerinfo.quotesize.value;
    if  (messageSize != leftSize)  {
		document.ownerinfo.quotesize.value = messageSize; 
    }
    if (messageSize < minLength)  {
		document.ownerinfo.quoteArea.value = theMessage.substring(0,maxLength);
		alert ("Maximum message length reached.");
		document.ownerinfo.quotesize.value = minLength;
     }
}


function checkDraftCommentForm()  {
	if (document.ownercomments.comment.value.length==0)  {
		alert("Please enter a comment");
		return false;
	} else {
		return true;
	}
}


function iePrint() {
  document.printJob.focus();
  document.printJob.print();
}



function printPage(theOne,week)  {
	if (theOne == "rosters")  {
        document.getElementById("printJob").src="printrosters.php";
		<!--window.open("printrosters.php","_blank");-->
	}
	if (theOne == "oldrosters")  {
        document.getElementById("printJob").src="printoldrosters.php?week="+week;
		<!--window.open("printoldrosters.php?week="+week,"_blank");-->
	}
	if (theOne == "scores")  {
        document.getElementById("printJob").src="printscores.php?week="+week;
		<!--window.open("printscores.php?week="+week,"_blank");-->
	}
	if (theOne == "oldrosterswide")  {
        document.getElementById("printJob").src="printoldrosterswide.php?week="+week;
		<!--window.open("printoldrosterswide.php?week="+week,"_blank");-->
	}
	if (theOne == "rosterswide")  {
        document.getElementById("printJob").src="printrosterswide.php";
		<!--window.open("printrosterswide.php","_blank");-->
	}
	if (theOne == "lineups")  {
        document.getElementById("printJob").src="printlineups.php?week="+week;
		<!--window.open("printlineups.php?week="+week,"_blank");-->
	}
}


function printScoringSystem()  {
  document.getElementById("printJob").src="printScoringPoints.php";
}



/* info div for players on team info page */
function hideContent(d) {
	if(d.length < 1)  {
		return;
	}
	document.getElementById(d).style.display = "none";
}
function showContent(d,week) {
	if(d.length < 1)  {
		return;
	}
	var dd = document.getElementById(d);
	<!--AssignPosition(dd);-->
	dd.style.marginTop = "-"+(9*week)+"px";
	dd.style.display = "inline";
}


/* check blog comment isn't blank */
function checkBlogComment()  {
	if (document.getElementById("xComment").value.length == 0)  {
		alert("Blank comments not allowed");
		return false;
	} else {
		return true;
	}
}

