
//-----


function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"

dayNames = new MakeArray(7)
dayNames[1] = "Sunday"
dayNames[2] = "Monday"
dayNames[3] = "Tuesday"
dayNames[4] = "Wednesday"
dayNames[5] = "Thursday"
dayNames[6] = "Friday"
dayNames[7] = "Saturday"

//-----
//-----


function customDateString(oneDate) {
	var theDay = dayNames[oneDate.getDay() + 1]
	var theMonth = monthNames[oneDate.getMonth() + 1]

if (parseInt(navigator.appVersion) > 3) {
	var theYear = oneDate.getYear() + 1900

if (parseInt(navigator.appName.indexOf("N")) > -1) {
	var theYear = oneDate.getYear() + 1900
} else {
	var theYear = oneDate.getYear()
}
}
return theDay + " - " + theMonth + " " + oneDate.getDate() + ", " + theYear
}

//-----
//-----

function shortDateString(oneDate) {
	var theDay = dayNames[oneDate.getDay() + 1]
	var theMonth = monthNames[oneDate.getMonth() + 1]

if (parseInt(navigator.appVersion) > 3) {
	var theYear = oneDate.getYear() + 1900

if (parseInt(navigator.appName.indexOf("N")) > -1) {
	var theYear = oneDate.getYear() + 1900
} else {
	var theYear = oneDate.getYear()
}
}
return theMonth + " " + oneDate.getDate() + ", " + theYear
}


//-----
//-----


function TheYearNow(oneDate) {
if (parseInt(navigator.appVersion) > 3) {
	var theYear = oneDate.getYear() + 1900
 
if (parseInt(navigator.appName.indexOf("N")) > -1) {
	var theYear = oneDate.getYear() + 1900
} else {
	var theYear = oneDate.getYear()
}
}
return theYear
}
 

//-----
//-----


function TheTimeNow(oneDate) {
if (parseInt(navigator.appVersion) > 3) {
var theHour = oneDate.getHours()
var theMinute = oneDate.getMinutes()
var theTime = ((theHour > 12) ? theHour - 12 : theHour)
theTime += " " + ((theMinute < 10) ? ":0" : ":" ) + theMinute
theTime += (theHour > 12) ? " pm" : " am"
return theTime
}
} 

//-----
//----- 

var narrowWindow
function makeNarrowWindow(where){
	if (!narrowWindow || narrowWindow.closed){
	narrowWindow = parent.window.open(where,"narrowWindow","scrollbars,height=460,width=300")
	narrowWindow.focus()
		if (!narrowWindow.opener){
			narrowWindow.opener = window
		}
	} else {
		narrowWindow.focus()
		narrowWindow.location=where
		}
	}


//-----
//-----


var helpWindow
function makeHelpWindow(where){
	if (!helpWindow || helpWindow.closed){
	helpWindow = parent.window.open(where,"helpWindow","scrollbars,height=300,width=540")
		if (!helpWindow.opener){
			helpWindow.opener = window
		}
	} else {
		helpWindow.focus()
		helpWindow.location=where
		}
	}

//-----
//-----

	
function reloadControlPanel(){
	window.parent.Status.location.reload()
	window.parent.LeftNav.location.reload()
}

//-----
//-----


function setTheType(TheType){
	if (TheType=="Add") {
	newHtml+="You can <b>Add a Core User</b> and <b>multiple profiles</b> at the same time. "
	newHtml+="Check each profile, select position/Team and complete any Required Fields. "
	newHtml+="Leave profile fields blank to use same information as core."
	}
	if (TheType=="AddProfile") {
	newHtml+="<b>Select the User</b> that needs the need profile. "
	newHtml+="Check each profile, select position/Team and complete any Required Fields. "
	newHtml+="Leave profile fields blank to use same information as core."
	}
	if (TheType=="Current") {
	newHtml+="<b>Select the User</b> from the list of <b>Current</b> Users. "
	newHtml+="<br><br><font size=1>Click the <b>profile</b> you wish to edit: "
	newHtml+="<b><u>U</u></b> for <i>User Core</i>, <b><u>A</u></b> for <i>Admins</i>, <b><u>C</u></b> for <i>Coaches</i>, <b><u>R</u></b> for <i>Refs</i>, <b><u>P</u></b> for <i>Players</i>"		
	}
	if (TheType=="Expired") {
	newHtml+="<b>Select the User</b> from the list of <b>Expired</b> Users. "
	newHtml+="<br><br><font size=1>Click the <b>profile</b> you wish to edit: "
	newHtml+="<b><u>U</u></b> for <i>User Core</i>, <b><u>A</u></b> for <i>Admins</i>, <b><u>C</u></b> for <i>Coaches</i>, <b><u>R</u></b> for <i>Refs</i>, <b><u>P</u></b> for <i>Players</i>"		
	}
	if (TheType=="Criteria") {
	newHtml+="<b>Selection controls</b> will display so that you can set the criteria for the list of users. "
	newHtml+="<br><br><font size=1>Click the <b>profile</b> you wish to edit: "
	newHtml+="<b><u>U</u></b> for <i>User Core</i>, <b><u>A</u></b> for <i>Admins</i>, <b><u>C</u></b> for <i>Coaches</i>, <b><u>R</u></b> for <i>Refs</i>, <b><u>P</u></b> for <i>Players</i>"		
	}
	if (TheType=="Batch") {
	newHtml+="Selection controls set the <b>users affected</b>, and the changes will be <b><i>Batch</i></b> updated to the entire selection list. "
	newHtml+="<br><br><font size=1>Click the <b>profile</b> you wish to edit: "
	newHtml+="<b><u>U</u></b> for <i>User Core</i>, <b><u>A</u></b> for <i>Admins</i>, <b><u>C</u></b> for <i>Coaches</i>, <b><u>R</u></b> for <i>Refs</i>, <b><u>P</u></b> for <i>Players</i>"		
	}
	if (TheType=="NoPositions") {
	newHtml+="<b>NONE</b>: The search will not be limited by Authority level position. "
	newHtml+="To narrow the search click <b>All</b>, for users that <i><b>have or ever held</i></b> that authority level, "
	newHtml+="<b>Current</b> for those who <b><i>have</b></i>, or <b>Expired</b> for those who <b><i>had</b></i> that authority level."
	}
	if (TheType=="NoCore") {
	newHtml+="If <font color=blue><b>Core Users</font></b> <b>NONE</b> is selected the search will <font color=red><i>not look at <font color=blue>core</font> information</i></font>: "
	newHtml+=" <b>ONLY</b> the <font color=red><i>others tables</i></font> that are <b><font color=red><i>NOT</font></i> NONE</b> will be searched. "
	newHtml+="<br><br><b>NOTE:</b> If Core and ALL authority levels are <b>NONE</b>, then <font color=red><b><i>No Records</font></i></b> will result. "
	}
	if (TheType=="AllCurrentExpired") {
	newHtml+="<b>All</b> means, do not restrict. Here it refers to <b><i>Date Expires</i></b>. "
	newHtml+="<br><br>Use <b>All</b>, for users that <i><b>have or ever held</i></b> that authority level, "
	newHtml+="<b>Current</b> for those who <b><i>have</b></i>, or <b>Expired</b> for those who <b><i>had</b></i> that authority level."
	}
	if (TheType=="LastNameLike") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>The search will be limited to those <font color=blue>core users</font> with a <b>Last Name</b> the same as or  "
	newHtml+="<i>LIKE</i> whatever text you place in the box."
	}
	if (TheType=="NumberProfiles") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>Search is limited to <font color=blue>core users</font> where the sum of all <b><i>Current & Expired</b></i> profiles are "
	newHtml+="= or > or < to the number entered."
	}
	if (TheType=="Authority") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>The search will be limited to those <font color=blue>core users</font> with the <b><i>Highest level of Authority</b></i> "
	newHtml+=" = or > or < the number (1 - 10) you enter in the box. "
	}
	if (TheType=="ThisTeam") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>The search will be limited by the team selected. For any team "
	newHtml+="use <b>ALL</b>. Example: for CURRENT COACHES on any team: pick CURRENT, Teams:ALL Position:COACH"
	}
	if (TheType=="ThisPosition") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>The search will be limited by the position selected. For any position "
	newHtml+="use <b>ALL</b>. Example: for CURRENT COACHES on any team: pick CURRENT, Teams:ALL Position:COACH"
	}
	if (TheType=="NoneDisplayed") {
	newHtml+="All Users are selected internally, but <b>NONE</b> are displayed. "
	newHtml+="<br><b>Example:</b>. you just wanted to see <i>Current Traveling Assitant Coaches</i> and <b>BUT NOT</b> the Core User info for each coach. "
	}
	if (TheType=="UserName") {
	newHtml+="<b>All or Current or Expired</b> must be selected. "
	newHtml+="<br><br>The search results will be limited to an <b><i>EXACT MATCH</b></i> to the UserName Entered. "
	}
	if (TheType=="Standby") {
	newHtml+="<b><font color=red size=4><div align=center>Please Standby</font></B><br><font size=2><br><b>While Page Loads.</b></div>"
	}
	if (TheType=="NonAdult") {
	newHtml+="If you expect to permit your non-Adult player <i><b>Log On</b></i> Access it is <font color=red><B>STRONGLY</b></font>. "
	newHtml+="recommended that you use a <b><i>different Username and Password</b></i> for the Player Profile."
	}
	if (TheType=="AllLocations") {
	newHtml+="<font color=red><b>Before Adding</b></font>: Always check <b>ALL</b> for the <i>SAME PHYSICAL "
	newHtml+="LOCATION</i>. If the Location you were about to add is listed as &quot;Expired&quot;, then re-activate the "
	newHtml+="Expired Location rather than Adding a New one."
	}
	if (TheType=="LocationLeague") {
	newHtml+="You may <font color=blue><i>omit this selection</i></font> or <font color=blue><i>optionally associate</i></font> a location with a league (<i>primary area of interest</i>). This permits a list of "
	newHtml+="locations to be limited by area of interest. If more than one applies, chose the <i>primary</i> association."
	}
	if (TheType=="CFC") {
	newHtml+="<font color=blue>FUNDRAISER: Charity gets 8% commission from your phone bill"
	newHtml+="<br>--> LOW RATES" 
    newHtml+="<br>--> NO ANNUAL CONTRACTS" 
    newHtml+="<br>--> NO SWITCHING FEE"
	}
	if (TheType=="TeamPageTemplate") {
	newHtml+="You can select not only what text to add, but you can chose to include images, and select the "
	newHtml+="layout of your pages from templates. Edit the page to change content, delete the page to change the Template."
	}
	if (TheType=="HowManyRows") {
	newHtml+="This sets how many rows will be wiewed on your web page. Set the page to view up to the row number entered here. "
	newHtml+="You can hide them from view, and you will not lose your text or images."
	}
	if (TheType=="SGChangeShirtText") {
	newHtml+="<div align=center><b><font size=3>How to Change Text</font></b></div><ol><li>Click a <b><i>Radio</i></b> button to select Line</li><li>Enter text in boxes below</li>"
	newHtml+="<li>Click <font color=red><b>&quot;Save Line&quot;</b></font></li><li>Click <i>Preview</i> button</li></ol>"
	}
	if (TheType=="SGClickRadio4Line") {
	newHtml+="Click a <b><i>Radio</i></b> button to select a Line to work on. Then click <font color=red><b>&quot;Save Line&quot;</b></font>"
	newHtml+="<br><br>Make sure you enter the <i><b>number of lines for the Front and Back</i></b> or you will lose your work."
	}
	
}

//-----
//-----

var TheType
var miniWindow
var newHtml
function miniHelp(TheType){
	if (!miniWindow||miniWindow.closed){
		miniWindow=window.open("","miniWindow","width=300,height=150")
		miniWindow.moveTo(300,100)
		
	}else{
	miniWindow.document.write(" ")
	miniWindow.document.close()
	miniWindow.focus()
	}

newHtml=""
newHtml="<html><head><title>Mini Help Window</title></head><form><table align=center width=100%><tr><td valign=middle>"
newHtml+="<p align=justify><font face=arial size=2>"

	setTheType(TheType)
	
newHtml+="<br><br><div align=center>"
newHtml+="<input value='Close Window' type=button onClick='self.window.close()' language='javascript' id=button1 name=button1>"
newHtml+="</div></td><tr></table></form></html>"
	
miniWindow.document.write(newHtml)
miniWindow.document.close

	if (TheType=="Standby"|TheType=="CFC") {
	setTimeout("miniWindow.close()",8000)	
	}
}

//-----
//-----

function miniWindowclose(){

miniWindow.close()
}


function clickCheckBox(formAndFieldName){
	formAndFieldName.checked = true	
}

//-----
//-----

function showStatusHelp(msg){
	window.status=msg
	return true
}

//-----
//-----


function writeBanner(){
var today= new Date()
document.write("<div align=center><FONT face='Arial,Helvetica,Univers,Zurich BT,sans-serif' size=1>")
document.write("Designed and Maintained by <A href='http://Delello.com/Webdesign' TARGET='_top'>Delello.com</A>")
document.write(" © 2000 - " + TheYearNow(today) + " All Rights Reserved<br>")
document.write("ADA Compliant Web Sites with Hosting & Email from $395.00</FONT>")
}

//-----
//-----


function isNav() {
	return (navigator.appName == "Netscape")
}


//-----
//-----

function showPalette(PaletteName){
	if (!narrowWindow || narrowWindow.closed){
	narrowWindow = parent.window.open("../asp/ColorChart.asp?name="+PaletteName,"narrowWindow","scrollbars,height=460,width=375")
		if (!narrowWindow.opener){
			narrowWindow.opener = window
		}
	} else {
		narrowWindow.focus()
		narrowWindow.location="../asp/ColorChart.asp?name="+PaletteName
		}
}


//====================
//====================

function isPositiveInteger(inputVal)
{
var inputStr = inputVal.toString()
for (var i = 0; i < inputStr.length; i++)
	{
	var oneChar = inputStr.charAt(i)
	if (oneChar < "0" || oneChar > "9")
		{
		return false
		}
	}
	return true
}

//====================
//====================

function checkerboard(width,height)
{
document.write("<table width=525 border=0 cellpadding=0 cellspacing=0><tr><td><table align=center background=\"../assets/images/CheckerBoard.gif\" width='" + width + "' border=1><tr height='" + height + "' ><td></td></tr></table></td></tr></table>")
}

function numberFormat(expr, decplaces)
{
var str = "" + Math.round (eval(expr) * Math.pow(10,decplaces))
while (str.length <= decplaces)
	{
	var decpoint = str.length - decplaces
	return str.substring(0,decplaces) + "." + str.substring(decpoint,str.length);
	}
}

//====================
//====================

function dollarize (expr)
{
 return "$" + numberFormat(expr,2)
}

//====================
//====================

function popUp(URL,NAME) 
{
amznwin=window.open(URL,NAME,'location=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=380,height=450,screenX=10,screenY=10,top=10,left=10');
amznwin.focus();
}

//====================
//====================

function BuyBox(ISBN) 
{
ISBN='http://buybox.amazon.com/exec/obidos/redirect?tag=delello-20&link_code=qcb&creative=23424&camp=2025&path=/dt/assoc/tg/aa/xml/assoc/-/'+ISBN+'/delello-20/ref=ac_bb3_,_amazon'
BuyBoxWindow=window.open(ISBN,'WinBuyBox','scrollbars=yes,width=377,height=310,screenX=10,screenY=10,top=10,left=10');
BuyBoxWindow.focus();
}

//====================
//====================

