  if(window!= top)   top.location.href=location.href;  if(pageName.toLowerCase() == 'yahoopage' || pageName.toLowerCase() == submitPage.toLowerCase()) {   } else {     if( isCompetitionPage() )  {}    else   {    document.write('<div style="text-align: center;"><img alt="SJSU Ballroom Dance Club"');  document.write(' src="images/' + sjsubdcMainTitle + '"></div>');  } }       if(pageName.toLowerCase() == 'yahoopage' || pageName.toLowerCase() == submitPage.toLowerCase()) {   }   else {     if( isCompetitionPage() )  {  writeCompetitionHeader();  }        else   {             function handleOut(imageNumber)   {  if (document.images)   document.images[buttonsMenuMain[imageNumber]].src = 'buttons/' + buttonsMenuMain[imageNumber] + '.' + imageExtension;  }      function handleOver(imageNumber)   {   if (document.images)   document.images[buttonsMenuMain[imageNumber]].src = 'buttons/' + buttonsMenuMain[imageNumber] + 'Over.' + imageExtension;  }      function handleClick(imageNumber)   {  if (document.images)   document.images[buttonsMenuMain[imageNumber]].src = 'buttons/' + buttonsMenuMain[imageNumber] + 'Click.' + imageExtension;  }              var midpoint = buttonsMenuMain.length/2;  if(buttonsMenuMain.length%2 == 1)  midpoint = (buttonsMenuMain.length - 1)/2;    if(buttonsMenuMain.length < 9)  midpoint = buttonsMenuMain.length;          document.write('<table style="width: 800px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="5">');   document.write('<tbody>');                       document.write('<tr>');  document.write('<td style="text-align: right;">');    document.write('<div style="text-align: right; height: 50px;"><small>');      document.write(dayarray[day]+", "+montharray[month]+" "+daym+", "+year);  document.write('<br>');      document.write('<span id="sjsubdclc" ></span>');  window.onload=show_clk;     document.write('</small></div>');    document.write('</td>');  document.write('</tr>');                      document.write('<tr align="left">');  document.write('<td>');    for(i = 0; i < midpoint; i++)  {  if(i == 0)  document.write('<a href="http://' + getRootName() + '" ');  else  document.write('<a href="' + buttonsMenuMain[i] + '.htm" ');      document.write('onmouseout="handleOut(' + i + ');" ');  document.write('onmouseover="handleOver(' + i + ');" ');  document.write('onmousedown="handleClick(' + i + ');">');  document.write('<img style="border: 0px solid ; width: 90px; height: 22px;" hspace="0" vspace="0" ');  document.write('src="buttons/' + buttonsMenuMain[i] + '.' + imageExtension + '" name="' + buttonsMenuMain[i] + '" ');  document.write('alt="' + buttonsMenuMain[i] + '"></a>');    }        document.write('</td>');  document.write('</tr>');          document.write('<tr>');  document.write('<td style="text-align: center;">');             document.write('</td>');  document.write('</tr>');            document.write('<tr align="right">');   document.write('<td>');              for(i = midpoint; i < buttonsMenuMain.length; i++)  {  document.write('<a href="' + buttonsMenuMain[i] + '.htm" ');  document.write('onmouseout="handleOut(' + i + ');" ');  document.write('onmouseover="handleOver(' + i + ');" ');  document.write('onmousedown="handleClick(' + i + ');">');  document.write('<img style="border: 0px solid ; width: 90px; height: 22px;" hspace="0" vspace="0" ');  document.write('src="buttons/' + buttonsMenuMain[i] + '.' + imageExtension + '" name="' + buttonsMenuMain[i] + '" ');  document.write('alt="' + buttonsMenuMain[i] + '"></a>');    }          document.write('</td>');  document.write('</tr>');               document.write('</tbody>');  document.write('</table>');              } }            if(pageName.toLowerCase() == 'index') 	writeIndex();  if(pageName.toLowerCase() == 'schedule') 	writeSchedule();  if(pageName.toLowerCase() == 'calendar') 	writeCalendar();  if(pageName.toLowerCase() == 'info') 	writeInfo();  if(pageName.toLowerCase() == 'events') 	writeEvents();  if(pageName.toLowerCase() == 'map') 	writeMap();  if(pageName.toLowerCase() == 'parking') 	writeParking(); 	 if(pageName.toLowerCase() == 'pictures') 	writePictures();  if(pageName.toLowerCase() == 'constitution') 	writeConstitution();  if(pageName.toLowerCase() == 'links') 	writeLinks();  if(pageName.toLowerCase() == 'competitions') 	writeCompetitions();  if(pageName.toLowerCase() == 'supplies') 	writeSupplies();  if(pageName.toLowerCase() == 'faq') 	writeFaq(); 	 if(pageName.toLowerCase() == 'feedback') 	writeFeedback();                function	writeIndex() {    document.write('<div style="text-align: center;">');  document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Welcome!</big></big></big>');  document.write('<br>');  document.write('<br>');  document.write(welcomePageMessage);  document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write(welcomePageSecondMessage);  document.write('<br>');  document.write('<br>');  document.write('<br>');    document.write(bdcMailAddress);  document.write(bdcPhoneNumber);   document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write('For more information contact BDC President ' + bdcPresidentName + ' at ');  document.write('<a href="feedback.htm">' + bdcPresidentEmail + '</a>');  document.write('<br>');  document.write('<br>');  document.write('Everyone welcome!');  document.write('<br>');  document.write('Don\'t need to be a college student to attend');  document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write('<br>');  document.write('The Ballroom Dance Club takes full responsibility for the information posted.<br>');  document.write('San Jos&eacute; State University has not reviewed or approved the contents of this page.<br>');  document.write('Any views and opinions expressed on this page are strictly those of the Ballroom Dance Club. <br>');  document.write('</div>');           }        function	writeSchedule() {  document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Schedule</big></big></big>');  document.write('<br>');  document.write('<br>');    var sched = " ";  var writeSched = 0;  var semester = " ";  var tentativeschedule = 0;  var lastupdated = " ";    	if(writespringschedule)  	{  document.write('<br><a name="springSchedule"></a>');  		sched = "bdcspringschedule";  		writeSched = writespringschedule;  		semester = "Spring";  		tentativeschedule = springtentativeschedule;  		lastupdated = springlastupdated;  		writeTableSchedule(sched, writeSched, semester, tentativeschedule, lastupdated);  document.write('<br><br><br><br><br>'); 		  	}        	if(writefallschedule)  	{  document.write('<br><a name="fallSchedule"></a>');  		sched = "bdcfallschedule";  		writeSched = writefallschedule;  		semester = "Fall";  		tentativeschedule = falltentativeschedule;  		lastupdated = falllastupdated;  		writeTableSchedule(sched, writeSched, semester, tentativeschedule, lastupdated);  document.write('<br><br><br><br><br>');  	}        	if(writesummerschedule)  	{  		document.write('<br><a name="summerSchedule"></a>');  sched = "bdcsummerschedule";  		writeSched = writesummerschedule;  		semester = "Summer";  		tentativeschedule = summertentativeschedule;  		lastupdated = summerlastupdated;  		writeTableSchedule(sched, writeSched, semester, tentativeschedule, lastupdated);  document.write('<br><br><br><br><br>');  	}     }   function writeTableSchedule(sched, writeSched, semester, tentativeschedule, lastupdated) {    var writefield = 0;  var oneset = numberofannouncements + 3;  var str2 = "";  var strheader = '<width="100" height="50" valign="middle" align="center"><font size="4"><b>';  var strheaderend = '</b></font>';  var spc = "&nbsp;";  var calpos = "";  var ok = 1;    function writecell(str,p)  {  	if((p)%oneset == 0)  		document.write('<tr>');    	if(str.length == 0)  		str = spc;    	document.write('<td align="center">'+str+'</td>');    	if((p+1)%oneset == 0)  		document.write('</tr>');    }    function writeheader()  {  writecell(strheader+"Date"+strheaderend,0);  writecell(strheader+"Lesson"+strheaderend,3);  writecell(strheader+"Time"+strheaderend,4);  writecell(strheader+"Location"+strheaderend,5);  writecell(strheader+"Instructor"+strheaderend,6);    }      for(p = 0; p < events.length; p++ )  {    	if(events[p] == sched && writeSched)  	{  		  		document.write('<p align="center"><b><font size="5">');  		document.write(semester + ' ' + events[p+numberofannouncements + 2]);  		document.write( '</font></b>');  		if(tentativeschedule)  			document.write('<br><font size="3">Tentative Schedule<br><br>');  		p = events.length + 1;  	document.write('<p align="center"><b><font size="3">'+'Last Updated: '+ lastupdated +'</font></b></p>');    	}    }      document.write('<table border="5" cellpadding="3" cellspacing="0" width="760" bordercolor="#FFFF66" color="#FFFF66"');  document.write('style="width: 800px; text-align: left; margin-left: auto; margin-right: auto;">');    for(p = 0; p < events.length; p++ )  {  	if(events[p] == sched && writeSched)  	{  		if(writefield == 0)  		{  			writefield = 1;  			p+= numberofannouncements;  			writeheader();  		}  		else  			writefield = 0;  	}    	if(writefield)  	{  		if(events[p+3] == sched)  			ok = 0;    		str2 = new String(events[p]);    		if(p != 0 && p%oneset == 0)  		{  			if(events[p+1] < 10)  				str2 = months[events[p] - 1] + spc + spc + events[p+1];  			else  				str2 = months[events[p] - 1] + spc + events[p+1];  			calpos = "#"+(events[p]-1)+events[p+2];  			p += 2;  		}        		if(ok)  			writecell(str2.replace(/schedule.htm/gi, "calendar.htm"+calpos),p);  	}  }          document.write('</table>');    document.write('</div>');    }            function	writeCalendar() {     document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Calendar</big></big></big>');  document.write('<br>');  document.write('<br>');     date = new Date();   datelinks = new Date();   datetoday = new Date();  days = new Array  ("Sun"  ,"Mon"  ,"Tue"  ,"Wed"  ,"Thu"  ,"Fri"  ,"Sat"  );    months = new Array  ("Jan"  ,"Feb"  ,"Mar"  ,"Apr"  ,"May"  ,"Jun"  ,"Jul"  ,"Aug"  ,"Sep"  ,"Oct"  ,"Nov"  ,"Dec"  );    space = "&nbsp;";  s1= space + space + space;  s2= space + space + space;  s3= space + space + space;  previousDay = new Array (0,0,0);    istitle = 0;   ismonthyear = 0;  eventindex = 0;  monthyear = "";  linksmonths = new Array();  templinksmonths = new Array();  var currentmonth = 99;  indexlinksmonths = 0;  prevlinkmonth = 0;  nextlinkmonth = 0;  oldday = 0;      function cleanarrays()  {  s1= space + space + space;  s2= space + space + space;  s3= space + space + space;  monthyear = "";  }      function dateOffset(date, i) {  date.setTime(date.getTime() + i*(1000*60*60*24));  }      function isevent()   {    	if(events.length >= 3 && !ismonthyear)  	{  		for(eventindex = 0; eventindex < events.length; eventindex += (numberofannouncements + 3) )  		{  			if(date.getMonth() == events[eventindex]-1 &&  	 			date.getDate() == events[eventindex+1] &&  	 			date.getFullYear() == events[eventindex+2])  	 			{  					 previousDay[0] = events[eventindex];  					 previousDay[1] = events[eventindex + 1];  					 previousDay[2] = events[eventindex + 2];  	 				eventindex +=3;  					s1 = events[eventindex];  					s2 = events[eventindex + 1];  					s3 = events[eventindex + 2];        	 			}  	 	}  	}    }        function putcell(s, rspan, cspan, color,day,istitle)   {  if( (previousDay[0] - 1) == date.getMonth() &&  previousDay[1] == date.getDate()&&  previousDay[2] == date.getFullYear())  	document.write('<br>'+'Hello');  else  {      document.write('<td align="center"');  	if (rspan != null)  	document.write(' rowspan="'+rspan+'"');    	if (cspan != null)  document.write(' colspan="'+cspan+'"');    	if (color != null)   	{  	 if(day == 0 || day == 6)  		color = weekendcolor;  	 if(day == datetoday.getDay() &&   	 date.getDate() == datetoday.getDate() &&  	 date.getMonth() == datetoday.getMonth() &&  	 date.getFullYear() == datetoday.getFullYear())  		color = todaycolor;    document.write(' bgcolor="'+color+'"');  }  	document.write('>');  }  	document.write(s);      if(!istitle){  isevent();  document.write('<br>'+s1+'<br>'+s2+'<br>'+s3);  cleanarrays();    }    document.write('</font></td>');      }    dateOffset(datelinks, -date.getDay());  document.write('<p align="center">');      for (p=1; p <= (show_weeks*7); p++)   {    	linkmonth = datelinks.getMonth();  	if(currentmonth != linkmonth)  	{  		document.write('<font size="'+daysfontsize+'" font color="'+fcolor+'" face="'+fface+'"><a href="#'+ datelinks.getMonth() + datelinks.getFullYear() +'">' + months[linkmonth] + ' ' + datelinks.getFullYear() + '</a></font>'+ space + space + space);  		currentmonth = linkmonth;      		templinksmonths[linksmonths.length];  		for(h = 0; h < linksmonths.length; h++)  			templinksmonths[h] = linksmonths[h];    		templinksmonths[linksmonths.length] = '<a href="#'+ datelinks.getMonth() + datelinks.getFullYear() +'">';  	  		linksmonths[templinksmonths.length];  		for(k = 0; k < templinksmonths.length; k++)  			linksmonths[k] = templinksmonths[k];  		if(linksmonths.length % 6 == 0)  		 document.write('<br>');  	}  	dateOffset(datelinks, 1);    }      document.write('</p>');      dateOffset(date, -date.getDay());  currentmonth = 99;    document.write('<table border="1" color="#FFFF66" style="width: 800px; text-align: left; margin-left: auto; margin-right: auto;">');    document.write('<tr>');    putcell('<font size='+ titlefontsize + ' font color=' + fcolor + ' face=' + fface + '><b>' + calendarTitle + '</b></size>',null,8,celltitlecolor,null,1);    document.write('</tr> <tr>');    putcell('<font size="'+fsize+'"font color="'+fcolor+'" face="'+fface+'">'+'Month Year',null,null,dayandyearcolor,null,1);    for (i=0; i < 7; i++)   {  	putcell('<font size="'+daysfontsize+'" font color="'+fcolor+'" face="'+fface+'"> <b>' + space + space + space + space + space + space + space + days[i]+ space + space + space + space + space + space + space + '</b>', null, null, dayandyearcolor, null, 1);  }    document.write('</tr>');    for (i=1; i <= show_weeks; i++)   {  	document.write('<tr>');  	m = date.getMonth();  	ismonthyear = 1;    	if(currentmonth != m)  	{  		  		monthyear = months[m]+ space +date.getFullYear();  		currentmonth = m;  		monthyear = '<a name="'+date.getMonth()+date.getFullYear()+'">' + monthyear + '</a>';  		if(indexlinksmonths == 0)  			prevlinkmonth = 0;  		else prevlinkmonth = indexlinksmonths-1;    		if(indexlinksmonths == linksmonths.length-1)  			nextlinmonth = indexlinksmonths;  		else nextlinkmonth = indexlinksmonths + 1;    		s2 = linksmonths[prevlinkmonth] + '<img border="0" style="rotation:270" src="'+ arrowup +'"></a>' + space + space + linksmonths[nextlinkmonth] + '<img border="0" src="'+ arrowdn +'"></a>';  		indexlinksmonths++;  	}      	putcell('<font size="'+fsize+'" font color="'+fcolor+'" face="'+fface+'">'+ monthyear, null, null, dayandyearcolor);      	ismonthyear = 0;  	for (j=0; j < 7; j++)   	{  		m = date.getMonth();    		if ((m % 2) == 0)  			color = evenmonthcolor;  		else   			color = oddmonthcolor;    	putcell('<font size="'+fsize+'" font color="'+fcolor+'" face="'+fface+'">' + date.getDate(), null, null ,color,date.getDay());    	oldday = date.getDate();      	dateOffset(date, 1);   	if(oldday == date.getDate())  		dateOffset(date,1);  	if( ( oldday == date.getDate()-2 ) || (oldday == 31 && date.getDate() == 2) )  		dateOffset(date,-.5);      	}    	document.write('</tr>');  }    document.write('</table>');      document.write('</div>');    }         function	writeInfo() {     document.write('<div style="text-align: center;">');    document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Info</big></big></big>');  document.write('<br>');  document.write('<br>');       document.write('<b><a href="map.htm">The club meets in SPX 89</a><br>');  document.write(beginningLesson);   document.write('<br>');  document.write(intermediateLesson);   document.write('<br>');  document.write(openDancingUntil);   document.write('<br>');    document.write('<br><br><br><br><br>');  document.write(welcomePageMessage);  document.write('<br><br><br><br><br>');  document.write(bdcMembershipDropin);   document.write('<br>Everyone welcome!<br>');  document.write('You don\'t need to be a college student to attend<br>');    document.write('<br><br><br>');      document.write('<a href="documents/bdc_info.pdf" target="_blank">');  document.write('<img style="border: 0px solid ;" alt="Download driving directions" src="images/downloaddrivingdirections.gif">');  document.write('</a>');     document.write('<br><br><br><br><br>');  document.write('*** Join our email list to receive more info about the club and its activities ***<br><br>');  document.write('Send an empty email with the subject \"subscribe\" to <a href="feedback.htm">bdc@email.sjsu.edu</a>');          document.write('<form method="get" action="http://groups.yahoo.com/subscribe/sjsubdc">');  document.write('<table style="width: 800px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="2">');     document.write('<tr>');    document.write('<td colspan="2" align="center">');  document.write('<b>or subscribe to our Yahoo group. Enter email address:</b>');  document.write('</td>');  document.write('</tr>');  document.write('<tr>');  document.write('<td style="text-align: right;">');  document.write('<input type="text" name="user" value="" size="20">');  document.write('</td>');  document.write('<td>');  document.write('<input type="image" border="0" alt="Click here to join sjsubdc" ');  document.write('name="Click here to join sjsubdc"');  document.write('src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif">');  document.write('</td>');  document.write('</tr>');  document.write('<tr align="center">');  document.write('<td colspan="2">');    document.write('</td>');  document.write('</tr>');  document.write('</table>');  document.write('</form>');                document.write('<br><br><br>');    document.write(bdcMailAddress);  document.write(bdcPhoneNumber);    document.write('<br><br><br>');    document.write('For more information contact BDC President ' + bdcPresidentName + ' at ');  document.write('<a href="feedback.htm">' + bdcPresidentEmail + '</a>');  document.write('<br>');     document.write('</div>');      }           function	writeEvents() {  document.write('<div style="text-align: center;">');    document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Events</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');     }          function	writeMap() {  document.write('<div style="text-align: center;">');    document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Map</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');   }          function	writeParking() {   document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Parking</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>'); }         function	writePictures() {    document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Pictures</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');     }          function	writeConstitution() {   document.write('<div style="text-align: center;">');    document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Constitution</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');     }         function	writeLinks() {   document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Links</big></big></big>');  document.write('<br>');  document.write('<br>');  document.write(linksDisclaimer);   document.write('<br>');  document.write('</div>');       }         function	writeCompetitions() {   document.write('<div style="text-align: center;">');       document.write('<br>');  document.write('<br>');    document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Competitions</big></big></big>');  document.write('<br>');  document.write(competitionsDisclaimer);     document.write('<br>');  document.write('<br>');  document.write('<br>');      advance = 0;  spc = "&nbsp;";  stop = 0;  datetoday = new Date();  start = -1;  function more(str,p)  {  	next = p + 3 + numberofannouncements;  	str2 = events[next+3] + ' ';  	for(w = 1; w < numberofannouncements; w++)  		str2 = str2 + events[next+3+w] + ' ';      	if(str == str2)  	{  		if(events[p+2] != events[next+2])  				document.write(' ' + events[p+2]);    		if(events[p] != events[next])  			document.write(' and ' + months[events[next]-1] + ' ');  		if(events[p+1] != events[next+1])  		{  			document.write(events[next+1] + ', ');  			  			more(str,next);  		}  		  	}  	advance = advance + 1;  }        for(p = 0; p < events.length; p++ )  {  	if(events[p] == "competitions" && writecompetitions)  	{  		document.write('<p align="center"><b><font size="3"><i>');  		document.write('Upcoming Competitions');  		document.write( '</i></font></b><br><br>');    		start = p + numberofannouncements;  		p = events.length + 1;  	}  }        for(p = start; p < events.length; )  {  	if( (writecompetitions && datetoday.getFullYear() < events[p+2] ) ||     	 ( writecompetitions &&  	 (datetoday.getFullYear() <= events[p+2] && datetoday.getMonth() < (events[p] - 1) ) ||   (datetoday.getFullYear() == events[p+2] && datetoday.getMonth() == (events[p] -1) && datetoday.getDate() < events[p+1]) ||  (datetoday.getFullYear() == events[p+2] && datetoday.getMonth() == (events[p] - 1) && datetoday.getDate() == events[p+1])    )  	 )  	{  		advance = 0;  		str = events[p+3] + ' ';  		for(i = 1; i < numberofannouncements; i++)  		str = str + events[p+3+i] + ' ';    		document.write(str + ' - ');  		document.write(months[events[p]-1] + ' ' + events[p+1] + ', ');  		more(str,p);  		p += ((numberofannouncements + 3)*advance);  		indexofyeartoprint = p - numberofannouncements - 1;  		document.write(events[indexofyeartoprint]);  		document.write('<br>');    		if(events[indexofyeartoprint + numberofannouncements + 4] == "competitions")  			p = events.length + 1;  	}  	else  		p += numberofannouncements + 3;  	if(events[p + 3] == "competitions")  		p = events.length + 1;  }      if(start != -1 && writepastcompetitions)  {  	document.write('<br><br><br><br><p align="center"><b><font size="3"><i>');  	document.write('Past Competitions');  	document.write( '</i></font></b><br><br>');    	for(p = start; p < events.length; )  	{  		if(  			writecompetitions && ( datetoday.getFullYear() > events[p+2] ||  					 (datetoday.getFullYear() == events[p+2] && datetoday.getMonth() > (events[p] - 1) ) ||  						(datetoday.getFullYear() == events[p+2] && datetoday.getMonth() == (events[p] - 1) && datetoday.getDate() > events[p+1])   					 )  		 )  		{  			advance = 0;  			str = events[p+3] + ' ';  			for(i = 1; i < numberofannouncements; i++)  			str = str + events[p+3+i] + ' ';    			document.write(str + ' - ');  			document.write(months[events[p]-1] + ' ' + events[p+1] + ', ');  			more(str,p);  			p += ((numberofannouncements + 3)*advance);  			indexofyeartoprint = p - numberofannouncements - 1;  			document.write(events[indexofyeartoprint]);  			document.write('<br>');  	  			if(events[indexofyeartoprint + numberofannouncements + 4] == "competitions")  				p = events.length + 1;	  		}  		else  			p += numberofannouncements + 3;  		if(events[p + 3] == "competitions")  			p = events.length + 1;  	}          }      document.write('</div>');     }           function	writeSupplies() {   document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Supplies</big></big></big>');  document.write('<br>');  document.write('<br>');  document.write(suppliesDisclaimer);   document.write('<br>');  document.write('</div>');       }         function	writeFaq() {   document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>FAQ</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');     }         function	writeFeedback() {   document.write('<div style="text-align: center;">');      document.write('<br>');  document.write('<br>');  document.write('<big style="font-style: italic; font-weight: bold;"><big><big>Feedback</big></big></big>');  document.write('<br>');  document.write('<br>');    document.write('</div>');     }  	 	 	 	 	     function require(names) {  if (checkNames(names)) 	 return true;    alert('Please fill in all required inputs marked with \"Required\"');  return false;  }      function checkNames(names) {  var anArray = names.split(",");  for (var i = 0; i < anArray.length; i++)  {  if (!checkName(anArray[i]))  return false;  }  return true; }  function checkName(name) {  if (name.length == 0)  return true;  var inputs = document.forms[0].elements;  for (var i = 0; i < inputs.length; i++)  {  var anInput = inputs[i];  if ( (anInput != null) && (anInput.name == name) )  {  if (checkInput(anInput))  return true;  }  }  return false; }  function checkInput(anInput) {  var type = anInput.type;  if ( (type == "text") || (type == "textarea") )  return checkText(anInput);  if (type == "radio")  return checkRadio(anInput);  if ( (type == "select-one") || (type == "select-multiple") )  return checkSelect(anInput);  alert("Unsupported type for required input: " + type);  return false; }  function checkText(anInput) {  var aString = anInput.value;  if (aString == null)  return false;  return (aString.length > 0); }  function checkRadio(anInput) {  var aBoolean = anInput.checked;  if (aBoolean == null)  return false;  return aBoolean; }  function checkSelect(anInput) {  if (anInput.selectedIndex < 0)  return false;  var option = anInput.options[anInput.selectedIndex];  var aString = option.value;  if ( (aString != null) && (aString.length > 0) )  return true;  aString = option.text;  if ( (aString != null) && (aString.length > 0) )  return true;  return false; }                          var fields = new Array( 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97);       function getHeats()  {  var currentHeats = new Array( '0','1','2','3','4','5','6','7','8','9','10',   'International Standard Newcomer Waltz',   'International Standard Newcomer Quickstep',   '',   'International Standard Bronze Waltz',    'International Standard Bronze Foxtrot',   'International Standard Bronze Quickstep',   'International Standard Silver Waltz',   'International Standard Silver Tango',   'International Standard Silver Foxtrot',   'International Standard Silver Quickstep',   '',   'International Standard Gold Waltz',   'International Standard Gold Tango',   'International Standard Gold Viennese Waltz',   'International Standard Gold Foxtrot',   'International Standard Gold Quickstep',   'International Standard Advanced Waltz/Tango/Foxtrot/Quickstep',   'International Standard Open Waltz/Tango/Viennese Waltz/Foxtrot/Quickstep',       'American Smooth Newcomer Waltz',   'American Smooth Newcomer Foxtrot',   '',   'American Smooth Bronze Waltz',   'American Smooth Bronze Tango',   'American Smooth Bronze Foxtrot',   'American Smooth Silver Waltz',   'American Smooth Silver Tango',   'American Smooth Silver Foxtrot',   'American Smooth Silver Viennese Waltz',   'American Smooth Gold Waltz',   'American Smooth Gold Tango',   'American Smooth Gold Foxtrot',   'American Smooth Gold Viennese Waltz',   'American Smooth Advanced Waltz/Tango/Foxtrot',   'American Smooth Open Waltz/Tango/Foxtrot/Viennese Waltz',       'Nightclub Style New./Beg. Salsa',   'Nightclub Style New./Beg. Two Step',   'Nightclub Style New./Beg. Hustle',   'Nightclub Style New./Beg. WC Swing',   'Nightclub Style New./Beg. Lindy',   'Nightclub Style New./Beg. Argentine Tango',   'Nightclub Style Int./Adv. Salsa',   'Nightclub Style Int./Adv. Two Step',   'Nightclub Style Int./Adv. Hustle',   'Nightclub Style Int./Adv. WC Swing',   'Nightclub Style Int./Adv. Lindy',   'Nightclub Style Int./Adv. Argentine Tango',       'American Rhythm Newcomer Cha Cha',   'American Rhythm Newcomer Rumba',    '',   'American Rhythm Bronze Cha Cha',   'American Rhythm Bronze Rumba',   'American Rhythm Bronze EC Swing',   'American Rhythm Silver Cha Cha',   'American Rhythm Silver Rumba',   'American Rhythm Silver EC Swing',   'American Rhythm Silver Bolero',   'American Rhythm Gold Cha Cha',   'American Rhythm Gold Rumba',   'American Rhythm Gold EC Swing',   'American Rhythm Gold Bolero',   'American Rhythm Gold Mambo',   'American Rhythm Advanced Cha Cha/Rumba/EC Swing/Bolero',   'American Rhythm Open Cha Cha/Rumba/EC Swing/Bolero/Mambo',       'International Latin Newcomer Cha Cha',   'International Latin Newcomer Rumba',   '',   'International Latin Bronze Cha Cha',   'International Latin Bronze Samba',   'International Latin Bronze Rumba',   'International Latin Silver Cha Cha',   'International Latin Silver Samba',   'International Latin Silver Rumba',   'International Latin Silver Jive',   'International Latin Gold Cha Cha',   'International Latin Gold Samba',   'International Latin Gold Rumba',   'International Latin Gold Paso Doble',   'International Latin Gold Jive',   'International Latin Advanced Cha Cha/Samba/Rumba/Jive',   'International Latin Open Cha Cha/Samba/Rumba/Paso Doble/Jive',       '91',   '92',   '93',   '94',   '95',   '96',   '97'  );    return currentHeats;  }              var row1 = new Array(11,13); var row2 = new Array(14,16); var row3 = new Array(17,21); var row4 = new Array(22,26); var row5 = new Array(27,27); var row6 = new Array(28,28); var row7 = new Array(29,31); var row8 = new Array(32,34); var row9 = new Array(35,38); var row10 = new Array(39,42); var row11 = new Array(43,43); var row12 = new Array(44,44); var row13 = new Array(45,50); var row14 = new Array(51,56); var row15 = new Array(57,59); var row16 = new Array(60,62); var row17 = new Array(63,66); var row18 = new Array(67,71); var row19 = new Array(72,72); var row20 = new Array(73,73); var row21 = new Array(74,76); var row22 = new Array(77,79); var row23 = new Array(80,83); var row24 = new Array(84,88); var row25 = new Array(89,89); var row26 = new Array(90,90);       var submitForm = 'contactForm';   var rowState = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);  var rowStateCookieName = 'rowState';  var formSubmittedOnceCookie = 'formSubmittedOnce';  var redirectToThnxPage = 'redirectThnxPage';  var formKidsRegCookie = 'formKidsRegCookie';      function writeCompetitionHeader() {   document.write('<div style="text-align: center;">');   document.write('<img alt="13th SJSU Ballroom Classic" src="CompButtons/compTitle.gif">');   document.write('</div>');   document.write('<br>');   document.write('<br>');       document.write('<center>');     document.write('<table style="text-align: center; width: 800px; height: 60px;"border="0">');  document.write('<tbody>');        document.write('<tr><td align="left">');      document.write('<a href="http://' + getRootName() + '" ');  document.write('onmouseout="handleOutCompButtons(4);" ');  document.write('onmouseover="handleOverCompButtons(4);" ');  document.write('onmousedown="handleClickCompButtons(4);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[4] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[4] + '" ');  document.write('alt="' + buttonsCompMenu[4] + '"></a>');    document.write('<a href="' + competitionPage + '.htm" ');  document.write('onmouseout="handleOutCompButtons(5);" ');  document.write('onmouseover="handleOverCompButtons(5);" ');  document.write('onmousedown="handleClickCompButtons(5);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[5] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[5] + '" ');  document.write('alt="' + buttonsCompMenu[5] + '"></a>');    document.write('<a href="' + infoPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(6);" ');  document.write('onmouseover="handleOverCompButtons(6);" ');  document.write('onmousedown="handleClickCompButtons(6);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[6] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[6] + '" ');  document.write('alt="' + buttonsCompMenu[6] + '"></a>');    document.write('<a href="' + schedulePage + '.html" ');  document.write('onmouseout="handleOutCompButtons(7);" ');  document.write('onmouseover="handleOverCompButtons(7);" ');  document.write('onmousedown="handleClickCompButtons(7);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[7] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[7] + '" ');  document.write('alt="' + buttonsCompMenu[7] + '"></a>');       document.write('</td></tr>');          document.write('<tr><td align="right">');      document.write('<a href="' + barrettBallroomPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(8);" ');  document.write('onmouseover="handleOverCompButtons(8);" ');  document.write('onmousedown="handleClickCompButtons(8);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[8] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[8] + '" ');  document.write('alt="' + buttonsCompMenu[8] + '"></a>');    document.write('<a href="' + parkingPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(9);" ');  document.write('onmouseover="handleOverCompButtons(9);" ');  document.write('onmousedown="handleClickCompButtons(9);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[9] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[9] + '" ');  document.write('alt="' + buttonsCompMenu[9] + '"></a>');    document.write('<a href="' + registrationPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(10);" ');  document.write('onmouseover="handleOverCompButtons(10);" ');  document.write('onmousedown="handleClickCompButtons(10);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[10] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[10] + '" ');  document.write('alt="' + buttonsCompMenu[10] + '"></a>');   document.write('<a href="' + registrationTeamsPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(11);" ');  document.write('onmouseover="handleOverCompButtons(11);" ');  document.write('onmousedown="handleClickCompButtons(11);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[11] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[11] + '" ');  document.write('alt="' + buttonsCompMenu[11] + '"></a>');    document.write('<a href="' + contactusPage + '.html" ');  document.write('onmouseout="handleOutCompButtons(12);" ');  document.write('onmouseover="handleOverCompButtons(12);" ');  document.write('onmousedown="handleClickCompButtons(12);">');  document.write('<img style="border: 0px solid ;" hspace="0" vspace="0" ');  document.write('src="CompButtons/' + buttonsCompMenu[12] + '.' + compButtonsImageExtension + '" name="' + buttonsCompMenu[12] + '" ');  document.write('alt="' + buttonsCompMenu[12] + '"></a>');      document.write('</td></tr>');               document.write('<tr><td align="center">');        document.write('</td></tr>');               document.write('<tr><td align="center">');    document.write('</td></tr>');               document.write('</tbody>');  document.write('</table>');      document.write('<center>');         }       function handleOutCompButtons(imageNumber)  {  if (document.images)   document.images[buttonsCompMenu[imageNumber]].src = 'CompButtons/' + buttonsCompMenu[imageNumber] + '.' + compButtonsImageExtension; }   function handleOverCompButtons(imageNumber)  {   if (document.images)   document.images[buttonsCompMenu[imageNumber]].src = 'CompButtons/' + buttonsCompMenu[imageNumber] + 'Over.' + compButtonsImageExtension; }   function handleClickCompButtons(imageNumber)  {  if (document.images)   document.images[buttonsCompMenu[imageNumber]].src = 'CompButtons/' + buttonsCompMenu[imageNumber] + 'Click.' + compButtonsImageExtension; }                 function check(value) {  var testing = '';  var isTextBoxChecked = document.contactForm.elements[value].checked;    var rowToModify = getRowNumber(value);  var blockOfRows = getBlockRows(value);  var i = 0;  var indexOfRowToModifyInBlockOfRows = '';  var isConsecutiveLevel = true;  var levels = 0;      for(i = 0; i < blockOfRows.length; i++)  {  if(blockOfRows[i] == rowToModify)  indexOfRowToModifyInBlockOfRows = i;  }           for(i = 0; i < blockOfRows.length; i++)  {      if(rowState[ blockOfRows[i] ] > 0)  {  levels = blockOfRows[i] - blockOfRows[indexOfRowToModifyInBlockOfRows];  if( Math.abs(levels) > 1)  isConsecutiveLevel = false;  }  }           if(isConsecutiveLevel)  {  var tempNumber = parseInt(rowState[rowToModify]);    if(isTextBoxChecked)  rowState[rowToModify] = tempNumber + 1;      if(!isTextBoxChecked)  rowState[rowToModify] = tempNumber - 1;        if(rowToModify == 13 && rowState[13] > 0)  disableRow(14);  if(rowToModify == 13 && rowState[13] == 0)  enableRow(14);        if(rowToModify == 14 && rowState[14] > 0)  disableRow(13);  if(rowToModify == 14 && rowState[14] == 0)  enableRow(13);              if( (blockOfRows[0] == rowToModify) || (blockOfRows[blockOfRows.length -1] == rowToModify) )  {    if(blockOfRows[0] == rowToModify)  {  if( rowState[rowToModify] > 0 && rowState[rowToModify+1] > 0 )  {  testing += ' blockRow 0 and blockRow 1 are not zero';  for(i = 2; i < blockOfRows.length; i++)  disableRow(blockOfRows[i]);  }      if( rowState[rowToModify] == 0 || rowState[rowToModify+1] == 0 )  {  testing += ' Either blockRow 0 or blockRow 1 are zero';  for(i = 2; i < blockOfRows.length; i++)  enableRow(blockOfRows[i]);  }  }            if(blockOfRows[blockOfRows.length -1] == rowToModify)  {  if( rowState[rowToModify] > 0 && rowState[rowToModify - 1] > 0 )  {  testing += ' last blockRow and blockRow last -1 are not zero';  for(i = 0; i < blockOfRows.length - 2; i++)  disableRow(blockOfRows[i]);  }      if( rowState[rowToModify] == 0 || rowState[rowToModify - 1] == 0 )  {  testing += ' Either last blockRow or last - 1 are zero';  for(i = 0; i < blockOfRows.length - 2; i++)  enableRow(blockOfRows[i]);  }  }    }     else  {    var upperChecked = false;      if( rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows] ] > 0 && rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows + 1] ] > 0 )  {   for(i = 0; i < blockOfRows.length; i++)  {  if( (i == indexOfRowToModifyInBlockOfRows) || (i == (indexOfRowToModifyInBlockOfRows + 1) ) )  {    }  else  disableRow(blockOfRows[i]);  }    upperChecked = true;  }      if( rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows] ] == 0 || rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows + 1] ] == 0 )  {   for(i = 0; i < blockOfRows.length; i++)  enableRow(blockOfRows[i]);  }            if(!upperChecked)  {  if( rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows] ] > 0 && rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows - 1] ] > 0 )  {   for(i = 0; i < blockOfRows.length; i++)  {  if( (i == indexOfRowToModifyInBlockOfRows) || (i == (indexOfRowToModifyInBlockOfRows - 1) ) )  {    }  else  disableRow(blockOfRows[i]);  }    }      if( rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows] ] == 0 || rowState[ blockOfRows[indexOfRowToModifyInBlockOfRows - 1] ] == 0 )  {   for(i = 0; i < blockOfRows.length; i++)  enableRow(blockOfRows[i]);  }  }              }    }  else  {  document.contactForm.elements[value].checked = false;  alert('You can only register to up two consecutive levels of the same dance style');  }   }         function disableRow(number) {     var rowToDisable = getRow(number);  var rowLength = rowToDisable.length;   for(i = 0; i < rowLength; i++)  disableField(rowToDisable[i]); }         function enableRow(number) {    var rowToEnable = getRow(number);  var rowLength = rowToEnable.length;   for(i = 0; i < rowLength; i++)  enableField(rowToEnable[i]); }        function disableField(fieldNumber) {  document.contactForm.elements[fieldNumber].disabled = true; }        function enableField(fieldNumber) {  document.contactForm.elements[fieldNumber].disabled = false; }          function resetForm()  {  enableAll();   clearAllFields();  rowState = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);  document.contactForm.reset;   if(pageName.toLowerCase() == registrationKidsPage.toLowerCase())  {  document.contactForm.elements[3].value = '';  document.contactForm.elements[8].value = '';  }  else  {  document.contactForm.elements[3].value = 'Optional';  document.contactForm.elements[8].value = 'Optional';  }    document.contactForm.elements[10].value = 'Optional';  }             function previewRegistration()  {       document.write('<CENTER>');    var undefined;  var i = 0;  var kidsRg = 0;      var formFields = getFields(submitForm);  var heats = getHeats();        if(formFields == undefined)  location.href = registrationPage + '.html';    var leaderFee = competitorFee[0];  var followerFee = competitorFee[0];    if(formFields[4] == '1')  leaderFee = competitorFee[1];   if(formFields[9] == '1')  followerFee = competitorFee[1];      var kidsAge = '';  if(getCookie(formKidsRegCookie) == '1' )  {  kidsAge = kidsMessage;  leaderFee = kidsFee;  followerFee = kidsFee;  kidsRg = 1;  }    document.write('<br>');  document.write('<big>Please verify the following is correct <i><b>before</b></i> submitting:</big>');  document.write('<br>');  document.write('<br>');        document.write('<table border="0">');  document.write('<tbody>');     document.write('<tr><td align="left">');  document.write('<span style="text-decoration: underline; font-weight: bold;">');  document.write('<b>Leader:</b>');  document.write('</span><br>');  document.write(formFields[0] + ' ' + formFields[1] );   document.write('<br>');   if(formFields[3] == 'Optional')  formFields[3] = '';  document.write(formFields[2] + ' &nbsp; &nbsp; &nbsp; &nbsp;' + formFields[3] + kidsAge);   document.write('<br>');   document.write(leaderFee);  document.write('<br><br>');   document.write('</td></tr>');       document.write('<tr><td align="left">');  document.write('<span style="text-decoration: underline; font-weight: bold;">');  document.write('<b>Follower:</b>');  document.write('</span><br>');  document.write(formFields[5] + ' ' + formFields[6] );   document.write('<br>');   if(formFields[8] == 'Optional')  formFields[8] = '';  document.write(formFields[7] + ' &nbsp; &nbsp; &nbsp; &nbsp;' + formFields[8] + kidsAge);   document.write('<br>');   document.write(followerFee);  document.write('<br><br>');   document.write('</td></tr>');      if(formFields[10] == 'Optional')  formFields[10] = '';      if( !isEmptyField(formFields[10]) )  {  document.write('<tr><td align="left">');  document.write('<span style="text-decoration: underline; font-weight: bold;">');  document.write('<b>Club/Organization/Studio/College:</b>');   document.write('</span><br>');   document.write(formFields[10]);   document.write('<br><br>');   document.write('</td></tr>');   }        if(kidsRg == 1)  {    document.write('<tr><td align="left">');   document.write('<span style="text-decoration: underline; font-weight: bold;">');  document.write('<b>Dances:</b>');   document.write('</span><br>');         if(formFields[11] == '1')  document.write(preteenstandard + '<br>');   if(formFields[12] == '1')  document.write(preteenlatin + '<br>');   if(formFields[27] == '1')  document.write(juniorstandard + '<br>');   if(formFields[87] == '1')  document.write(juniorlatin + '<br>');     document.write('</td></tr>');   }  else  {    document.write('<tr><td align="left">');   document.write('<span style="text-decoration: underline; font-weight: bold;">');  document.write('<b>Dances:</b>');   document.write('</span><br>');   for(i = 11; i < formFields.length; i++)  {  if(formFields[i] == '1')  document.write(heats[i] + '<br>');   }   document.write('</td></tr>');   }         document.write('</tbody>');  document.write('</table>');      document.write('</CENTER>');      }            function submitRevisedFields()  {   document.write('<br><br><br><br><br><br><br><br><br>');      document.write('<CENTER>');  document.write('<big><big><big>Please wait . . .</big></big></big><br><br>');  document.write('<big><big><big>Do not click the back button</big></big></big>');  document.write('</CENTER>');      document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');   document.write('<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>');        var finalFieldsToSubmit = new Array(   'email',    '&nbsp;',    '2',    '3',    '4',    '',    '&nbsp;',    '7',    '8',    '9',    '',    '',    '',    '',    '&nbsp;',    '',    '',    '',    '',    '',   '',    '',    '',    '',    '',    '',    '',    '',    '',    '',   '',    '',    '',    '',   '',   '',    '',   ''  );       var isKidsReg = false;  if(getCookie(formKidsRegCookie) == '1' )  isKidsReg = true;     var exp;   if( getCookie(formSubmittedOnceCookie) == '3' )  location.href = registrationPage + '.html';       if(getCookie(redirectToThnxPage) == '1')  {     setCookie(formSubmittedOnceCookie, '3', exp);  location.href = thankxPage + '.html';  }   else  {      var formFields = getFields(submitForm);      if(formFields == undefined)  location.href = registrationPage + '.html';          var emailTo = formFields[2];      var formID = '56534';        var submittingToFollower = false;      if(getCookie(formSubmittedOnceCookie) == '1')  {          emailTo = formFields[7];      formID = '62683';    submittingToFollower = true;      eraseAllCookies();       setCookie(redirectToThnxPage, '1', exp);    }          var heats = getHeats();    var undefined;  var i = 0;      var style = '';  var dances = '';          var leaderFee = competitorFee[0];  var followerFee = competitorFee[0];       if(formFields[4] == '1')  leaderFee = competitorFee[1];    if(formFields[9] == '1')  followerFee = competitorFee[1];              var kidsAge = '';  if(isKidsReg )  {  kidsAge = kidsMessage;  leaderFee = kidsFee;  followerFee = kidsFee;  subjectSubForm = subjectSubKidsForm;  }                          finalFieldsToSubmit[2] = formFields[1] + ', ' + formFields[0];  if(formFields[3] == 'Optional')  formFields[3] = '';  finalFieldsToSubmit[3] = formFields[2] + ' &nbsp; &nbsp; &nbsp;' + formFields[3] + kidsAge;   document.write('<br>');   finalFieldsToSubmit[4] = leaderFee;        finalFieldsToSubmit[7] = formFields[6] + ', ' + formFields[5];   if(formFields[8] == 'Optional')  formFields[8] = '';  finalFieldsToSubmit[8] = formFields[7] + ' &nbsp; &nbsp; &nbsp;' + formFields[8] + kidsAge;   document.write('<br>');   finalFieldsToSubmit[9] = followerFee;        if(formFields[10] == 'Optional')  formFields[10] = '';          if( !isEmptyField(formFields[10]))   {  finalFieldsToSubmit[11] = 'Club/Organization/Studio/College:';   finalFieldsToSubmit[12] = formFields[10];   }               var tempHeat = '';  var fieldToBeSubmitted = '';  var previousStyle = '';  var k =0;  var indx = 15;        if(isKidsReg )  {  if(formFields[11] == '1')  {  finalFieldsToSubmit[indx] = preteenstandard;   indx++;  }    if(formFields[12] == '1')  {  finalFieldsToSubmit[16] = preteenlatin;   indx++;  }    if(formFields[27] == '1')  {  finalFieldsToSubmit[17] = juniorstandard;   indx++;  }    if(formFields[87] == '1')  {  finalFieldsToSubmit[18] = juniorlatin;   indx++;  }      }  else  {  for(i = 11; i < formFields.length; i++)  {  if(formFields[i] == '1')  {    tempHeat = '';   style = '';  dances = '';      tempHeat = heats[i].split(' ');   style = tempHeat[0] + ' ' + tempHeat[1] + ' ' + tempHeat[2];      for(k = 3; k < tempHeat.length; k++)  dances += ' ' + tempHeat[k];    if(previousStyle == style)  {  fieldToBeSubmitted += ',' + dances;  finalFieldsToSubmit[indx] = fieldToBeSubmitted;  }  else  {  fieldToBeSubmitted = '';  previousStyle = '';  fieldToBeSubmitted = style + dances;  previousStyle = style;  indx++;  finalFieldsToSubmit[indx] = fieldToBeSubmitted;  }     }  }   }        indx+=2;  finalFieldsToSubmit[indx] = '---*---*---*---*---*---*---*---*---*---*---*---*---*---';   indx++;  finalFieldsToSubmit[indx] = 'SJSU Ballroom Dance Club';   indx++;  finalFieldsToSubmit[indx] = 'Student Involvement, Box # 10';  indx++;  finalFieldsToSubmit[indx] = 'One Washington Square, Clark Hall 140';   indx++;  finalFieldsToSubmit[indx] = 'San Jose, CA. 95192 - 0038';   indx++;  finalFieldsToSubmit[indx] = 'http://studentorgs.sjsu.edu/sjsubdc/';   indx++;  finalFieldsToSubmit[indx] = '---*---*---*---*---*---*---*---*---*---*---*---*---*---';            if( formFields[2] == formFields[7])  {  formID = '66850';  submittingToFollower = true;  setCookie(redirectToThnxPage, '1', exp);  }                  document.write('<form name="' + submitForm + '" method="post" action="http://www.mycontactform.com/sendform/sendform.php">');  document.write('<input name="user" id="user" value="sjsubdc" type="hidden">');  document.write('<input name="formid" id="formid" value="' + formID + '" type="hidden">');  document.write('<input name="subject" id="subject" value="' + subjectSubForm + '" type="hidden">');             document.write('<input name="email" id="email" value="' + emailTo + '" type="hidden"> ');       document.write('<input name="q[]" id="q[]" value="checkbox' + formID + '" type="hidden"><input name="checkbox[]" value="' + finalFieldsToSubmit[1] + '" type="checkbox"> ');        document.write('<input name="q[1]" id="q[1]" value="checkbox' + formID + '" type="hidden"><input name="checkbox1[]" value="' + finalFieldsToSubmit[2] + '" type="checkbox"> ');       document.write('<input name="q[2]" id="q[2]" value="checkbox' + formID + '" type="hidden"><input name="checkbox2[]" value="' + finalFieldsToSubmit[3] + '" type="checkbox"> ');       document.write('<input name="q[3]" id="q[3]" value="checkbox' + formID + '" type="hidden"><input name="checkbox3[]" value="' + finalFieldsToSubmit[4] + '" type="checkbox"> ');       document.write('<input name="q[4]" id="q[4]" value="checkbox' + formID + '" type="hidden"><input name="checkbox4[]" value="' + finalFieldsToSubmit[5] + '" type="checkbox"> ');       document.write('<input name="q[5]" id="q[5]" value="checkbox' + formID + '" type="hidden"><input name="checkbox5[]" value="' + finalFieldsToSubmit[6] + '" type="checkbox"> ');       document.write('<input name="q[6]" id="q[6]" value="checkbox' + formID + '" type="hidden"><input name="checkbox6[]" value="' + finalFieldsToSubmit[7] + '" type="checkbox"> ');       document.write('<input name="q[7]" id="q[7]" value="checkbox' + formID + '" type="hidden"><input name="checkbox7[]" value="' + finalFieldsToSubmit[8] + '" type="checkbox"> ');       document.write('<input name="q[8]" id="q[8]" value="checkbox' + formID + '" type="hidden"><input name="checkbox8[]" value="' + finalFieldsToSubmit[9] + '" type="checkbox"> ');       document.write('<input name="q[9]" id="q[9]" value="checkbox' + formID + '" type="hidden"><input name="checkbox9[]" value="' + finalFieldsToSubmit[10] + '" type="checkbox"> ');       document.write('<input name="q[10]" id="q[10]" value="checkbox' + formID + '" type="hidden"><input name="checkbox10[]" value="' + finalFieldsToSubmit[11] + '" type="checkbox"> ');       document.write('<input name="q[11]" id="q[11]" value="checkbox' + formID + '" type="hidden"><input name="checkbox11[]" value="' + finalFieldsToSubmit[12] + '" type="checkbox"> ');       document.write('<input name="q[12]" id="q[12]" value="checkbox' + formID + '" type="hidden"><input name="checkbox12[]" value="' + finalFieldsToSubmit[13] + '" type="checkbox"> ');       document.write('<input name="q[13]" id="q[13]" value="checkbox' + formID + '" type="hidden"><input name="checkbox13[]" value="' + finalFieldsToSubmit[14] + '" type="checkbox"> ');       document.write('<input name="q[14]" id="q[14]" value="checkbox' + formID + '" type="hidden"><input name="checkbox14[]" value="' + finalFieldsToSubmit[15] + '" type="checkbox"> ');       document.write('<input name="q[15]" id="q[15]" value="checkbox' + formID + '" type="hidden"><input name="checkbox15[]" value="' + finalFieldsToSubmit[16] + '" type="checkbox"> ');       document.write('<input name="q[16]" id="q[16]" value="checkbox' + formID + '" type="hidden"><input name="checkbox16[]" value="' + finalFieldsToSubmit[17] + '" type="checkbox"> ');       document.write('<input name="q[17]" id="q[17]" value="checkbox' + formID + '" type="hidden"><input name="checkbox17[]" value="' + finalFieldsToSubmit[18] + '" type="checkbox"> ');       document.write('<input name="q[18]" id="q[18]" value="checkbox' + formID + '" type="hidden"><input name="checkbox18[]" value="' + finalFieldsToSubmit[19] + '" type="checkbox"> ');       document.write('<input name="q[19]" id="q[19]" value="checkbox' + formID + '" type="hidden"><input name="checkbox19[]" value="' + finalFieldsToSubmit[20] + '" type="checkbox"> ');       document.write('<input name="q[20]" id="q[20]" value="checkbox' + formID + '" type="hidden"><input name="checkbox20[]" value="' + finalFieldsToSubmit[21] + '" type="checkbox"> ');       document.write('<input name="q[21]" id="q[21]" value="checkbox' + formID + '" type="hidden"><input name="checkbox21[]" value="' + finalFieldsToSubmit[22] + '" type="checkbox"> ');       document.write('<input name="q[22]" id="q[22]" value="checkbox' + formID + '" type="hidden"><input name="checkbox22[]" value="' + finalFieldsToSubmit[23] + '" type="checkbox"> ');       document.write('<input name="q[23]" id="q[23]" value="checkbox' + formID + '" type="hidden"><input name="checkbox23[]" value="' + finalFieldsToSubmit[24] + '" type="checkbox"> ');       document.write('<input name="q[24]" id="q[24]" value="checkbox' + formID + '" type="hidden"><input name="checkbox24[]" value="' + finalFieldsToSubmit[25] + '" type="checkbox"> ');       document.write('<input name="q[25]" id="q[25]" value="checkbox' + formID + '" type="hidden"><input name="checkbox25[]" value="' + finalFieldsToSubmit[26] + '" type="checkbox"> ');       document.write('<input name="q[26]" id="q[26]" value="checkbox' + formID + '" type="hidden"><input name="checkbox26[]" value="' + finalFieldsToSubmit[27] + '" type="checkbox"> ');       document.write('<input name="q[27]" id="q[27]" value="checkbox' + formID + '" type="hidden"><input name="checkbox27[]" value="' + finalFieldsToSubmit[28] + '" type="checkbox"> ');       document.write('<input name="q[28]" id="q[28]" value="checkbox' + formID + '" type="hidden"><input name="checkbox28[]" value="' + finalFieldsToSubmit[29] + '" type="checkbox"> ');       document.write('<input name="q[29]" id="q[29]" value="checkbox' + formID + '" type="hidden"><input name="checkbox29[]" value="' + finalFieldsToSubmit[30] + '" type="checkbox"> ');       document.write('<input name="q[30]" id="q[30]" value="checkbox' + formID + '" type="hidden"><input name="checkbox30[]" value="' + finalFieldsToSubmit[31] + '" type="checkbox"> ');       document.write('<input name="q[31]" id="q[31]" value="checkbox' + formID + '" type="hidden"><input name="checkbox31[]" value="' + finalFieldsToSubmit[32] + '" type="checkbox"> ');       document.write('<input name="q[32]" id="q[32]" value="checkbox' + formID + '" type="hidden"><input name="checkbox32[]" value="' + finalFieldsToSubmit[33] + '" type="checkbox"> ');       document.write('<input name="q[33]" id="q[33]" value="checkbox' + formID + '" type="hidden"><input name="checkbox33[]" value="' + finalFieldsToSubmit[34] + '" type="checkbox"> ');         document.write('<input name="q[34]" id="q[34]" value="checkbox' + formID + '" type="hidden"><input name="checkbox34[]" value="' + finalFieldsToSubmit[35] + '" type="checkbox"> ');         document.write('<input name="q[35]" id="q[35]" value="checkbox' + formID + '" type="hidden"><input name="checkbox35[]" value="' + finalFieldsToSubmit[36] + '" type="checkbox"> ');         document.write('<input name="q[36]" id="q[36]" value="checkbox' + formID + '" type="hidden"><input name="checkbox36[]" value="' + finalFieldsToSubmit[37] + '" type="checkbox"> ');        var indexFormElement = 5;  for(i = 1; i < finalFieldsToSubmit.length; i++)  {  if(finalFieldsToSubmit[i] == '')  document.contactForm.elements[indexFormElement].checked = false;  else  document.contactForm.elements[indexFormElement].checked = true;    indexFormElement += 2;  }        if(submittingToFollower == false)  setCookie(formSubmittedOnceCookie, '1', exp);          document.contactForm.submit();              }     }              function enableAll() {  var formLength = document.contactForm.length;   for(i = 0; i < formLength; i++)  enableField(i);  }      function clearAllFields() {  var formLength = document.contactForm.length;   var fieldType;  for(i = 0; i < formLength; i++)  {  fieldType = document.contactForm[i].type;  if (fieldType == "checkbox" || fieldType == "radio")  {  document.contactForm.elements[i].checked = false;   }  else   {   if ( (fieldType == "text") || (fieldType == "textarea") ||   (fieldType == "select-one") || (fieldType == "hidden") )   {  document.contactForm.elements[i].value = '';  }  }  }   }        function disableAll() {  var formLength = document.contactForm.length;   for(i = 0; i < formLength; i++)  disableField(i);  }        function getRow(rowNumber) {  var undefined;    switch(rowNumber) {  case 1:   return fields.slice(row1[0], row1[1] + 1);   break;  case 2:   return fields.slice(row2[0], row2[1] + 1);   break;  case 3:   return fields.slice(row3[0], row3[1] + 1);   break;  case 4:   return fields.slice(row4[0], row4[1] + 1);   break;  case 5:   return fields.slice(row5[0], row5[1] + 1);   break;  case 6:   return fields.slice(row6[0], row6[1] + 1);   break;  case 7:   return fields.slice(row7[0], row7[1] + 1);   break;  case 8:   return fields.slice(row8[0], row8[1] + 1);   break;  case 9:   return fields.slice(row9[0], row9[1] + 1);   break;  case 10:   return fields.slice(row10[0], row10[1] + 1);   break;  case 11:   return fields.slice(row11[0], row11[1] + 1);   break;  case 12:   return fields.slice(row12[0], row12[1] + 1);   break;  case 13:   return fields.slice(row13[0], row13[1] + 1);   break;  case 14:   return fields.slice(row14[0], row14[1] + 1);   break;  case 15:   return fields.slice(row15[0], row15[1] + 1);   break;  case 16:   return fields.slice(row16[0], row16[1] + 1);   break;  case 17:   return fields.slice(row17[0], row17[1] + 1);   break;  case 18:   return fields.slice(row18[0], row18[1] + 1);   break;  case 19:   return fields.slice(row19[0], row19[1] + 1);   break;  case 20:   return fields.slice(row20[0], row20[1] + 1);   break;  case 21:   return fields.slice(row21[0], row21[1] + 1);   break;  case 22:   return fields.slice(row22[0], row22[1] + 1);   break;  case 23:   return fields.slice(row23[0], row23[1] + 1);   break;  case 24:   return fields.slice(row24[0], row24[1] + 1);   break;  case 25:   return fields.slice(row25[0], row25[1] + 1);   break;  case 26:   return fields.slice(row26[0], row26[1] + 1);   break;   default:   return undefined;   }   }       function getRowNumber(checkBoxNumber) {  var undefined;  if( checkBoxNumber != undefined)  {  if(checkBoxNumber >= row1[0] && checkBoxNumber <= row1[1])  return 1;  if(checkBoxNumber >= row2[0] && checkBoxNumber <= row2[1])  return 2;  if(checkBoxNumber >= row3[0] && checkBoxNumber <= row3[1])  return 3;  if(checkBoxNumber >= row4[0] && checkBoxNumber <= row4[1])  return 4;  if(checkBoxNumber >= row5[0] && checkBoxNumber <= row5[1])  return 5;  if(checkBoxNumber >= row6[0] && checkBoxNumber <= row6[1])  return 6;  if(checkBoxNumber >= row7[0] && checkBoxNumber <= row7[1])  return 7;  if(checkBoxNumber >= row8[0] && checkBoxNumber <= row8[1])  return 8;  if(checkBoxNumber >= row9[0] && checkBoxNumber <= row9[1])  return 9;  if(checkBoxNumber >= row10[0] && checkBoxNumber <= row10[1])  return 10;  if(checkBoxNumber >= row11[0] && checkBoxNumber <= row11[1])  return 11;  if(checkBoxNumber >= row12[0] && checkBoxNumber <= row12[1])  return 12;  if(checkBoxNumber >= row13[0] && checkBoxNumber <= row13[1])  return 13;  if(checkBoxNumber >= row14[0] && checkBoxNumber <= row14[1])  return 14;  if(checkBoxNumber >= row15[0] && checkBoxNumber <= row15[1])  return 15;  if(checkBoxNumber >= row16[0] && checkBoxNumber <= row16[1])  return 16;  if(checkBoxNumber >= row17[0] && checkBoxNumber <= row17[1])  return 17;  if(checkBoxNumber >= row18[0] && checkBoxNumber <= row18[1])  return 18;  if(checkBoxNumber >= row19[0] && checkBoxNumber <= row19[1])  return 19;  if(checkBoxNumber >= row20[0] && checkBoxNumber <= row20[1])  return 20;  if(checkBoxNumber >= row21[0] && checkBoxNumber <= row21[1])  return 21;  if(checkBoxNumber >= row22[0] && checkBoxNumber <= row22[1])  return 22;  if(checkBoxNumber >= row23[0] && checkBoxNumber <= row23[1])  return 23;  if(checkBoxNumber >= row24[0] && checkBoxNumber <= row24[1])  return 24;  if(checkBoxNumber >= row25[0] && checkBoxNumber <= row25[1])  return 25;  if(checkBoxNumber >= row26[0] && checkBoxNumber <= row26[1])  return 26;   }  else  return undefined; }      function getBlockRows(checkBoxNumber) {  if(checkBoxNumber > 10 && checkBoxNumber < 29)  return new Array(1,2,3,4,5,6);    if(checkBoxNumber > 28 && checkBoxNumber < 45)  return new Array(7,8,9,10,11,12);    if(checkBoxNumber > 44 && checkBoxNumber < 57)  return new Array(13,14);    if(checkBoxNumber > 56 && checkBoxNumber < 74)  return new Array(15,16,17,18,19,20);    if(checkBoxNumber > 73 && checkBoxNumber < 91)  return new Array(21,22,23,24,25,26); }                        function saveFields()  {   var checkFields = '';  var emailFormatCorrect = false;  var fieldsOK = false;        document.contactForm.elements[0].value = deleteSpaces(document.contactForm.elements[0].value);     document.contactForm.elements[1].value = deleteSpaces(document.contactForm.elements[1].value);     document.contactForm.elements[2].value = deleteSpaces(document.contactForm.elements[2].value);       document.contactForm.elements[5].value = deleteSpaces(document.contactForm.elements[5].value);    document.contactForm.elements[6].value = deleteSpaces(document.contactForm.elements[6].value);    document.contactForm.elements[7].value = deleteSpaces(document.contactForm.elements[7].value);           checkFields += document.contactForm.elements[0].value + ',';  checkFields += document.contactForm.elements[1].value + ',';  checkFields += document.contactForm.elements[2].value + ',';  checkFields += document.contactForm.elements[5].value + ',';  checkFields += document.contactForm.elements[6].value + ',';  checkFields += document.contactForm.elements[7].value;      fieldsOK = requiredFields(checkFields);         if(fieldsOK)  {    if(isEmail( document.contactForm.elements[2].value ) )    {  if(isEmail( document.contactForm.elements[7].value ) )   {  emailFormatCorrect = true;  }  else  {  alert('Follower\'s email invalid:\n ' + document.contactForm.elements[7].value + '\nPlease insert a valid email \t');  }  }  else  {  alert('Leader\'s email invalid:\n ' + document.contactForm.elements[2].value + '\nPlease insert a valid email \t');  }    }       if(emailFormatCorrect && fieldsOK)  {    var setvalue;  var fieldType;  var prevElementName;  var today = new Date();   var undefined;            var exp;    var feedBack;           var string = "";        var formLength = document.contactForm.length;  for (i = 0; i < formLength; i++)  {       fieldName = document.contactForm[i].name;       fieldValue = document.contactForm[i].value;         fieldType = document.contactForm[i].type;          if (fieldType == "radio")   {    var radioElementLength = 0;    if(document.contactForm.elements[fieldName].length != undefined)  radioElementLength = document.contactForm.elements[fieldName].length;    if(radioElementLength == 0)  {  if(document.contactForm.elements[fieldName].disabled == true)  string += "x" + "\|";  else  {  if(document.contactForm.elements[fieldName].checked == true)  string += "1" + "\|";    if(document.contactForm.elements[fieldName].checked == false)  string += "0" + "\|";  }    }  else  {   if(prevElementName != fieldName)  {  for (x=0; x < radioElementLength; x++)   {  if(document.contactForm.elements[fieldName][x].disabled == true)  {  string += "x" + "\|";  }   else  {  if(document.contactForm.elements[fieldName][x].checked == true)  {  string += "1" + "\|";   }    if(document.contactForm.elements[fieldName][x].checked == false)  {  string += "0" + "\|";  }  }     }   }   }        prevElementName = fieldName;    }            if ((fieldType == "text") || (fieldType == "textarea") || (fieldType == "select-one"))   {  string += document.contactForm.elements[fieldName].value + "\|";  }          if (fieldType == "checkbox")   {  if (document.contactForm.elements[fieldName].disabled == true)   string += "x" + "\|";  else  {  if (document.contactForm.elements[fieldName].checked == true)   string += "1" + "\|";    if (document.contactForm.elements[fieldName].checked == false)   string += "0" + "\|";   }    }            if (fieldType == "hidden")   {  string += document.contactForm.elements[fieldName].value + "\|";  }  }      var rowStateString = '';  for(i = 0; i < rowState.length; i++)  {  rowStateString += rowState[i] + '\|';  }       var savedSubmitForm = setCookie(submitForm, string, exp);  var savedRowStateCookieName = setCookie(rowStateCookieName, rowStateString, exp);  var savedFormSubmittedOnceCookie = setCookie(formSubmittedOnceCookie, '0', exp);      if(savedSubmitForm && savedRowStateCookieName && savedFormSubmittedOnceCookie )  location.href = revisePage+ '.html';      }     }       function isEmail(emailEntered) { 	var x = emailEntered; 	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 	     	return filter.test(x); }           function requiredFields(checkFields) {  var checkInputs = checkFields.split(",");  var i = 0, q = 0;    for(i = 0; i < checkInputs.length; i++)  {  if(checkInputs[i] == '')  {  alert('Please fill in all required inputs marked with an asterisk (*)');  return false;  }  }    return true; }      function deleteSpaces(stringName) {  var i = 0;  var newStringName = '';  for(i = 0; i < stringName.length; i++)  {   if(stringName.charAt(i) == ' ')  {  }  else  newStringName = newStringName + stringName.charAt(i);  }    return newStringName; }    function reloadForm() {  resetForm();  var undefined;      var fieldArray = getFields(submitForm);   if(fieldArray == undefined)  {  }  else  {      var tempRowState = getFields(rowStateCookieName);    for(i = 0; i < rowState.length; i++)  rowState[i] = tempRowState[i];    document.contactForm.elements[0].value = fieldArray[0];  document.contactForm.elements[1].value = fieldArray[1];  document.contactForm.elements[2].value = fieldArray[2];  document.contactForm.elements[3].value = fieldArray[3];    if(fieldArray[4] == '1')  document.contactForm.elements[4].checked = true;  document.contactForm.elements[5].value = fieldArray[5];  document.contactForm.elements[6].value = fieldArray[6];  document.contactForm.elements[7].value = fieldArray[7];  document.contactForm.elements[8].value = fieldArray[8];  if(fieldArray[9] == '1')  document.contactForm.elements[9].checked = true;     document.contactForm.elements[10].value = fieldArray[10];  var fieldArraySize = fieldArray.length;  for(i = 11; i < (fieldArraySize - 1); i++)  {  if (fieldArray[i] == 'x')   document.contactForm.elements[i].disabled = true;  else  {  if (fieldArray[i] == '1')   document.contactForm.elements[i].checked = true;    if (fieldArray[i] == '0')   document.contactForm.elements[i].checked = false ;   }  }     }    eraseAllCookies(); }                 function setCookie(name, value, expires, path, domain, secure) {          document.cookie = name + "=" + escape(value) +  ((expires) ? "; expires=" + expires.toGMTString() : "") +  ((path) ? "; path=" + path : "") +  ((domain) ? "; domain=" + domain : "") +  ((secure) ? "; secure" : "");      if(getCookie(name) == value)  return true;  else  return false;    }              function getCookie(name)   {  var dc = document.cookie;  var prefix = name + "=";  var begin = dc.indexOf("; " + prefix);  if (begin == -1)   {  begin = dc.indexOf(prefix);  if (begin != 0)   return null;  }  else   {  begin += 2;  }  var end = document.cookie.indexOf(";", begin);    if (end == -1)   {  end = dc.length;  }      return unescape(dc.substring(begin + prefix.length, end));  }             function eraseCookie(cookieName)  {   var today = new Date();  var numberOfDays = -1;  var exp = new Date(today.getTime()+ numberOfDays*24*60*60*1000);    setCookie(cookieName,"",exp);  }           function getFields(cookieName)  {  var fieldValues;   var fieldArray;        fieldValues = getCookie(cookieName);   if(fieldValues)  fieldArray = fieldValues.split("\|");     return fieldArray;  }   function eraseAllCookies() {  eraseCookie(submitForm);  eraseCookie(rowStateCookieName);  eraseCookie(formSubmittedOnceCookie);  eraseCookie(redirectToThnxPage);  eraseCookie(formKidsRegCookie);   }      function isEmptyField(fieldString)  {  var i = 0;  for(i = 0; i < fieldString.length; i++)  {  if(fieldString.charAt(i) != ' ')  return false;  }    return true;  }                                      