<!--
var myWin = null;

function openWin(m,sb,h,w) 
{
	myWin = window.open (m,"newWin1","toolbar=no,menubar=no,scrollbars="+sb+",resizable=yes,height="+h+",width="+w);

	myWin.focus();
	if (!myWin || myWin.closed )
	{
      	myWin=window.open(theURL,winName,features);
       	myWin.focus()
      }
	else
	{
        	myWin.focus();
	}
}
function closeWin()
{
	opener.location="http://localhost/oasis/timeout.htm?site=admin";
	top.close();	
}



function goToPage(myString,mySite)
{

	if ( (myString == 'logout') && (mySite != null) )
	{
		document.location="http://localhost/oasis/timeout.htm?site="+mySite;				
	}	
	else if ( myString == 'continue' )
		document.location="http://localhost/oasis/admin/addSet.cfm";
	else if ( myString == 'exit' )
		document.location="http://localhost/oasis/admin/OasisAdmin.cfm";

}

function getYears(earliestDate,latestDate)
{
	
	var earliestYear = earliestDate.substring(0,4);
	var latestYear = latestDate.substring(0,4);
	var myYearVal =  earliestYear;
	
	
	//set select boxes for years
	for (i=0;i<=(latestYear-earliestYear);i++)
	{	
		var myOption = new Option(myYearVal, myYearVal);
		document.myForm.Year.options[i+1] = eval(myOption);

		myYearVal++;
	}
	//reset myYearVal
	myYearVal =  earliestYear;
	
		for (i=0;i<=(latestYear-earliestYear);i++)
		{	
			var myOption = new Option(myYearVal, myYearVal);
			document.myForm.YearA.options[i+1] = eval(myOption);
	
			myYearVal++;
		}
}

function getDays(month,year,mySelect)
{
 if ( (month != "NONE") && (year !="NONE") )
 {
   if (mySelect.options.length > 1)
   {
		mySelect.options.length = 1;
   }
	var days = getDaysofMonth(month,year);
		if (days)
		{
 			for (i=1;i<=days;i++)
			{	
				var myOption = new Option(i, i);
				mySelect.options[i] = eval(myOption);
			}
		}
 }
}
function checkParameters(month,year)
{

if ( (month == "NONE") || (year =="NONE") )
	alert("Please specify a year and month first.");
}

function getDaysofMonth(month,year)  
   { 
	/*the following commented out assignment/declaration for month and year object
	 *line works in Netscape 6 and IE? but not in Netscape 4.7*(ContactId would be null)
	 *var myMonth=document.theform.month.value;
	 *so I used a more complex assignment statement taken from deja.com
	 *myMonth =(month.value==null)?month.options[month.selectedIndex].value:month.value; 
	 */
	
	myMonth =(month.value==null)?month.options[month.selectedIndex].value:month.value; 
	myYear=(year.value==null)?year.options[year.selectedIndex].value:year.value;

    var days;
    if (myMonth ==1 || myMonth ==3 || myMonth ==5 || myMonth ==7 || myMonth ==8 ||
        myMonth==10 || myMonth==12)  days=31;
    else if (myMonth ==4 || myMonth ==6 || myMonth ==9 || myMonth==11) days=30;
    else if (myMonth==2)  {
        if (isLeapYear(myYear)) {
            days=29;
        }
        else {
            days=28;
        }
    }
	
	 return (days);
}


// CHECK TO SEE IF YEAR IS A LEAP YEAR
function isLeapYear (Year) {
    if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) {
        return (true);
    }
    else {
        return (false);
    }
}

function checkFirstName(myForm)
{

    if (myForm.firstName.value == "")
    {
        alert("The First Name field is blank. \n\nPlease enter your first name to continue. ");
        myForm.firstName.focus();
         return false;
    }
    else
    {
        return true;
    }
}
function checkLastName(myForm)
{

    if (myForm.lastName.value == "")
    {
        alert("The Last Name field is blank. \n\nPlease enter your last name to continue. ");
        myForm.lastName.focus();
        return false;
    }
    else
    {
        return true;
    }
}


function checkEmail(myForm)
{
	var myEmail = new String(myForm.email.value);

	
	//check to see if email has . and @
	if ( myEmail != "")
	{
		if ( myEmail.search(".") == -1 || myEmail.search("@") == -1)
		{
			alert("Your email address is incorrect.\n\nPossibly, you left out . or @");
            myForm.email.focus();
			return false;
		}
		else
		{	
			return true;
		}
	}
	else
	{
		alert("The Email field is blank.\n\nPlease enter your email address to continue.");
        myForm.email.focus();
		return false;
	}

	
}

function checkPhone(myField)
{
	size = document.myForm.myField.length ;
	alert(size); 
	
}
//-->
