<!--
function mmLoadMenus() {
  if (window.mm_menu_1214131836_0) return;
      window.mm_menu_1214131836_0 = new Menu("root",69,20,"Verdana, Arial, Helvetica, sans-serif",10,"#FFFFFF","#FFFFFF","#6366AF","#1F1F4F","center","middle",5,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_1214131836_0.addMenuItem("Ballet","location='ballet.html'");
  mm_menu_1214131836_0.addMenuItem("Modern","location='modern.html'");
  mm_menu_1214131836_0.addMenuItem("Tap","location='tap.html'");
   mm_menu_1214131836_0.fontWeight="bold";
   mm_menu_1214131836_0.hideOnMouseOut=true;
   mm_menu_1214131836_0.bgColor='#FFFFFF';
   mm_menu_1214131836_0.menuBorder=1;
   mm_menu_1214131836_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1214131836_0.menuBorderBgColor='#FFFFFF';

mm_menu_1214131836_0.writeMenus();
} // mmLoadMenus()

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->



function isNumeric(pccharinput) {  // 1) this allows the numbers 0-9
	return(pccharinput>="0" && pccharinput<="9")
}

function isQty(pccharinput) {
	return (pccharinput=="-" || pccharinput=="-1" || pccharinput=="-2" || pccharinput=="-3" || pccharinput=="-4" || pccharinput=="-5" || pccharinput=="-6" || pccharinput=="-7" || pccharinput=="-8" || pccharinput=="-9" )
}

function isAlphabetic(pccharinput) { // 2) this allows the letters A-Z & a-z
	return((pccharinput>="A" && pccharinput<="Z") || 
		(pccharinput>="a" && pccharinput<="z"))
}

function isAlphaNumeric(pccharinput) { //  3) this allows 1) & 2) from above to be put together
	return (isAlphabetic(pccharinput) || isNumeric(pccharinput))
}

function isEmpty(pccharinput) { // checks for any empty fields in the HTML form
	if (pccharinput=="" || pccharinput==" ")
		return true;
	else 
		return false;
	}
	
function isAddressChar(pccharInput) {  // allows numbers, alphabets and the special name characters from line 34.
	if (isAlphaNumeric(pccharInput) || isNameSpecialChar(pccharInput))
	return true
	else
	return false
}

function isNameChar(pccharinput) {  // this is all the alphabet and the special characters for the name
	return (isAlphabetic(pccharinput) || isNameSpecialChar(pccharinput))
}

//alert(isNameChar("michelle'hgf"))
function isNameSpecialChar(pccharinput) {  // these are the special characters allowed for the name
	return (pccharinput=="'" || pccharinput=="-" || pccharinput==" ")
}




function isNameString(pcstrInput) {  

	var w, lvintapostrophepos, lvintdashpos, lvintspacepos
	
	lvintapostrophepos=pcstrInput.indexOf("'")
	lvintdashpos=pcstrInput.indexOf("-")
	lvintspacepos=pcstrInput.indexOf(" ")
	
	for (w=0; w<pcstrInput.length; w++) {
	
		if (!isNameChar (pcstrInput.charAt(w)))
		{ 
			return false
		}
	}
	
	if (lvintapostrophepos==0)  // if ' is at postion 0 it's false
		return false
	if (lvintdashpos==0) // if - is at postion 0 it's false
		return false
	if (lvintspacepos==0) // if there is a space at 0 it's wrong
		return false
	if (isEmpty(pcstrInput))  // if the text field is empty it will return false
		return false
	return true
} 

//alert(isNameString("'kjgf"))
//alert(isNameString(" "))
//alert(isNameString("-hgd"))
//alert(isNameString("hgfd's"))

///////////////////////////////////////////////////////////

function isEmailSpecialChar(pccharinput) {
	return (pccharinput=="@" || pccharinput=="-" || pccharinput=="_" || pccharinput==".")
}

function isEmailChar(pccharinput) {  // allows numbers, alphabets and the special email characters from above.
	return (isAlphaNumeric(pccharinput) || isEmailSpecialChar(pccharinput))
}

//alert(isEmailChar("michelle@.com"))


function isEmailString (pcstrInput) { 

	var w, lvintlength, lvintlastpos, lvintatpos, lvintatlastpos, lvintfirstpos

	lvintlength=pcstrInput.length
	lvintlastpos=pcstrInput.lastIndexOf(".")
	lvintatpos=pcstrInput.indexOf("@")
	lvintfirstpos=pcstrInput.indexOf(".")
	lvintatlastpos=pcstrInput.lastIndexOf("@")
	
	
	for (w=0; w<pcstrInput.length; w++) 
	{ 
		if (!isEmailChar (pcstrInput.charAt(w)))
		{ 
			return false
		} 
	} 	

	if(lvintatpos==0) // if @ is = 0 it's false.
		return false

	if (lvintlastpos==0) // if last . is = 0 it's wrong
		return false

	if (lvintfirstpos==0) // if . is = to 0 it's wrong
		return false

	if (lvintatlastpos==-1) // there is no @ in the email address
		return false

	if (lvintfirstpos==-1) // there is no . in the email address
		return false

	if (pcstrInput.indexOf("@.")!=-1) // this means the @. are not = to -1 (basically if there is @ and. together it returns false.)
		return false
		
	if (pcstrInput.indexOf(".@")!=-1) //there are .@ together
		return false
		
	if (pcstrInput.indexOf("@@")!=-1) // two @@ together
		return false
		
	if (pcstrInput.indexOf("..")!=-1) // this means the two .. are not = to -1 (basically if there are 2 .. it returns false.)
		return false

	if(lvintlength-lvintlastpos<3) // there are not two letters after the last .
		return false
	 
	return true
} 

 



///////////////////////////////////////////////////////////////////////////////////

function isDateChar(pccharinput) { // checks that only numbers and the - can be used
	return (isNumeric(pccharinput) || pccharinput=="-")
}


function isDateString(pcstrInput) {  

	var i, lvintlength, lvintdashpos, lvintlastdashpos, lvintSpacepos
	
	lvintlength=pcstrInput.length
	lvintdashpos=pcstrInput.indexOf("-")
	lvintlastdashpos=pcstrInput.lastIndexOf("-")
	lvintSpacepos=pcstrInput.indexOf(" ")
	
	for (i=0; i<pcstrInput.length; i++) 
	{  
		if (!isDateChar (pcstrInput.charAt(i)))
		{  
			return false
			
	if(lvintdashpos==-1) {  //there is no - in the text field
		//alert("There is no dash in the feild. Please enter again.")
		return false
		}
	else if (lvintSpacepos!=-1) {  // no spaces are allowed
		//alert("No spaces are allowed. Please try again")
		return false
		}
	
	else if(lvintlastdashpos!=5) {  //There's no - in No. 5 of the date
		return false
		}
		
	else if(lvintdashpos!=2) {  //There's no - in No. 2 of the date
		return false
		}
	}  
} 
	return true
}  				



function isLeapYear(yyyy) {  
	return (yyyy%100!=0 && yyyy%4==0 || yyyy%400==0)
}
	
function isValidDate(pcstrDate) {  
	
	var dd=pcstrDate.substr(0, 2)
	var mm=pcstrDate.substr(3, 2)
	var yyyy=pcstrDate.substr(6, 4)
	var monthAmountArray=new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
	var monthArray=new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
	//var monthNoArray=new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12") 
	
if (!((mm>=1) && (mm<=12))){  
		alert("There are only 12 months in a year.")						
		return false
		}
else if ((mm==04 || mm==06 || mm==09 || mm==11) && !(dd>=1 && dd<=30)) { 
		alert("There are only 30 days in " + monthArray[mm-1])
		return false
		}
else if ((mm==01 || mm==03 || mm==05 || mm==07 || mm==08 || mm==10 || mm==12) && !(dd>=1 && dd<=31)) {
		alert("There are only 31 days in " + monthArray[mm-1])
		return false
		}
else if (mm==02){
		if (isLeapYear(yyyy)) {
			if(!(dd>=1 && dd<=29)) {
				alert("Feburary has 29 days in the year " + yyyy)
				return false
				}
		}
		else if(!(dd>=1 && dd<=28)) {
			alert("Feburary has 28 days in the year " + yyyy)
			return false
		}
	}
 return true
} 
	
function isDate(pcstrDate) {   // if the text field is empty, is not the datestring and is not the vaild date it's wrong
	
	if (isEmpty(pcstrDate)) {
		return false
	}
	
	else if (!isDateString(pcstrDate)) {
		return false
		}
			
	else if (!isValidDate(pcstrDate)) {
		return false
		}	
	
	else return true
}

//////////////////////////////////////////////////////////////////


function isSubmit() {  // 
	
	if (document.validation.username.value=="") {
		alert("Please enter a username")
		document.validation.username.focus();
		return false;
		}
		
	if (document.validation.username.value!="MKSchool") {
		alert("Please enter a valid username")
		document.validation.username.focus();
		document.validation.username.select();
		return false;
		}
		
	if (document.validation.password.value=="") {
		alert("Please enter a password")
		document.validation.password.focus();
		return false;
		}
		
	if (document.validation.password.value!="mkel22") {
		alert("The infomation you have supplied is incorrect. \n\nPlease try again")
		document.validation.password.focus();
		document.validation.password.select();
		return false;
		}
		
	
		
}





