// changes <TD> state for menu rollovers
function navColour (ThisCell,ChangeCellID,CellState) {

var CellHighlightOn = "#000033"; // white over state
var CellHighlightOff = "#CC9900"; // gold out state
var CellColour = "";

if (CellState == "On") {
	CellColour = CellHighlightOn;
	}
else {
	CellColour = CellHighlightOff;
	}

ThisCell.style.cursor='Hand';
ChangeCellID.style.background=CellColour;

}

//----------------------------------------------------------------------------------------------				 
// Frame Breakout Function
function framebreakout()
{
  // Generated by thesitewizard Frame Breakout JavaScript Wizard 1.01
  // Visit http://www.thesitewizard.com/ to get your own
  // frame breakout script FREE!
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}


//Other javascript functions
//----------------------------------------------------------------------------------------------				 

function Popup(title, url, height, width) {
properties = "title=0,toolbar=0,location=0,scrollbars=1,height=" + height;
properties = properties + ",width=" + width;
properties = properties + ",left=25,top=150";
popupHandle = open(url, title, properties);
} 
				 
//----------------------------------------------------------------------------------------------				 

function RefreshThumbnail() {
	var ImgSrc = document.Thumbnail.src;
	document.Thumbnail.src = "";
	document.Thumbnail.src = ImgSrc;
}
				 
//----------------------------------------------------------------------------------------------				 

function doNothing(){
	// do nothing!
}

				 
//----------------------------------------------------------------------------------------------				 

ie = (navigator.appName.indexOf("Microsoft")!=-1);
ns = (navigator.appName.indexOf("Netscape") != -1);

ns4= (ns && navigator.appVersion.indexOf("5") == -1);
ns6= (ns && navigator.appVersion.indexOf("5") != -1);
ns6X = 0;
ns6Y = 0;
				 
//----------------------------------------------------------------------------------------------				 

function validate(theForm)
{
var FormFields = theForm.elements;

	// Loop through the form fields looking for those marked as required (Required="True")
        for (var i = 0; i < FormFields.length; i++) 
		{
			if (FormFields[i].Required ==  'True') 
			{
			// Found one, now test it
				if (FormFields[i].value  == "") 
				{
					alert( "The field '" + FormFields[i].FriendlyName + "' cannot be blank.");
					FormFields[i].focus();
					return false;
				}
			}
        }
				 
			 

//Now test email validity
        for (var i = 0; i < FormFields.length; i++) 
		{
			if (FormFields[i].name.indexOf("Email")  != -1 && FormFields[i].Required ==  'True') 
			{
				if (isEmail(FormFields[i].value) == false) 
				{
					alert( "The email address appears to be invalid" );
					FormFields[i].focus();
					return false ;
				}			
			}
        }
	return true;
}
				 
//----------------------------------------------------------------------------------------------				 

// tests if a field is empty
function isEmpty(strInput)
                {            
				//alert(strInput)                                      
                         if(strInput==null || strInput=="")
                         {
                                return true
                         }
                         else
                         {
                                return false
                         }
                 }
				 
//----------------------------------------------------------------------------------------------				 
//checks if email is valid
	function checkEmail(strInput) 
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strInput))
		{
			return (true)
		}
			return (false)
	}
	
//----------------------------------------------------------------------------------------------				 
//checks if default option is selected
	
	function isSelected(selInput)
			{
				if (selInput==0)
					{
					return true
					}
					return false
    		}

//----------------------------------------------------------------------------------------------				 
//checks if checkbox is checked
function isCheckbox(strInput)
                 {
						if(strInput==(true))
							{return (true)}
						else
							return (false)
                 }

//----------------------------------------------------------------------------------------------				 
//checks if radio button is checked
function isRadChecked(strInput)
                 {
						if(strInput==(true))
							{return (true)}
						else
							return (false)
                 }				
				 
//----------------------------------------------------------------------------------------------				 
//checks to see if number is a number
function isNumber(strInput)	
				{
						if (isNaN(strInput))
							{
								return false
							}
						else
							{
								return true
							}
				}
		
//----------------------------------------------------------------------------------------------				 
//checks for leap year		
function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}

