

var ie = false;
if(navigator.appName == "Microsoft Internet Explorer") ie = true;
//NN4 crashes with word "style", NN6 ignores "style"

//now can have spaces in strings
var homecaption = new Array(20);
var numberofhomecaptions = 6;

homecaption[1] = 'Indian';
homecaption[2] = 'Community';
homecaption[3] = 'and Culture';
homecaption[4] = 'Association';
homecaption[5] = '- Cambridge';
homecaption[6] = ' ';	//for positioning

var popupymmdd;

var howmanybookable = 0;

function playtune()	//050521
{
	var s = "";
	s += '<SPAN id="tdtune">';
	//s += '<SPAN id="spanplaytune">';
	s += '</SPAN>';
	document.write(s);
	playtune2();
}

function playtune2()	//050521
{
//alert("222");
	var musictitle = new Array(40);
	var musicfile = new Array(40);
	var numberoftunes = 35;
	
	var indianmidibase = midibase + "indian/";	//webdata.js
/*
	var winloc = window.location + "";	//file:///C:/0our... IE  file:///C|/0our... NN  locks without + ""
	if (winloc.substring(0, 9) == "file:///C")	//local, IE or NN
		//indianmidibase = "../../../0Cambridge/caribbean/";
		indianmidibase = "../";
	else //on WWW, IE or NN
		//indianmidibase = "http://martinmann.members.beeb.net/caribbean/";
		indianmidibase = "../";
*/
	//alert(indianmidibase);
//alert("222");

	musictitle[1] = "ghagirya";
	musicfile[1] = "ghagirya.mid";
	musictitle[2] = "geetamr";
	musicfile[2] = "geetamr.mid";
	musictitle[3] = "GagakSeRJ16";
	musicfile[3] = "gagakserj16.mid";
	musictitle[4] = "dildeya";
	musicfile[4] = "dildeya.mid";
	musictitle[5] = "bday";
	musicfile[5] = "bday.mid";
	musictitle[6] = "ashiq";
	musicfile[6] = "ashiq.mid";
	musictitle[7] = "anthem";
	musicfile[7] = "anthem.mid";
	musictitle[8] = "adit";
	musicfile[8] = "adit.mid";
	musictitle[9] = "Julie2";
	musicfile[9] = "julie2.mid";
	musictitle[10] = "Ind4";
	musicfile[10] = "ind4.mid";
	musictitle[11] = "Ladki2";
	musicfile[11] = "ladki2.mid";
	musictitle[12] = "haemere";
	musicfile[12] = "haemere.mid";
	musictitle[13] = "kuchkuch";
	musicfile[13] = "kuchkuch.mid";
	musictitle[14] = "Jab";
	musicfile[14] = "jab.mid";
	musictitle[15] = "KusumRJ4";
	musicfile[15] = "kusumrj4.mid";
	musictitle[16] = "hotel_ca";
	musicfile[16] = "hotel_ca.mid";
	musictitle[17] = "kuchh_na";
	musicfile[17] = "kuchh_na.mid";
	musictitle[18] = "kishore";	//mirri manko ?
	musicfile[18] = "kishore.mid";
	musictitle[19] = "lata";
	musicfile[19] = "lata.mid";
	musictitle[20] = "sayoni2";
	musicfile[20] = "sayoni2.mid";
	musictitle[21] = "saagar1";
	musicfile[21] = "saagar1.mid";
	musictitle[22] = "mtr";
	musicfile[22] = "mtr.mid";
	musictitle[23] = "rj1";
	musicfile[23] = "rj1.mid";
	musictitle[24] = "Taremix(virasat)";
	musicfile[24] = "taremix(virasat).mid";
	musictitle[25] = "Raja1";
	musicfile[25] = "raja1.mid";
	musictitle[26] = "thusha";
	musicfile[26] = "thusha.mid";
	musictitle[27] = "Pinna";
	musicfile[27] = "pinna.mid";
	musictitle[28] = "rangeela";
	musicfile[28] = "rangeela.mid";
	musictitle[29] = "Pukarta";
	musicfile[29] = "pukarta.mid";
	musictitle[30] = "MudumuneRJ3";
	musicfile[30] = "mudumunerj3.mid";
	musictitle[31] = "ObeSinarj15.mid";
	musicfile[31] = "obesinarj15.mid";
	musictitle[32] = "Vasana";
	musicfile[32] = "vasana.mid";
	musictitle[33] = "ye-zamin";
	musicfile[33] = "ye-zamin.mid";
	musictitle[34] = "ykh1";
	musicfile[34] = "ykh1.mid";
	musictitle[35] = "HadaPaneRJ18";
	musicfile[35] = "hadapanerj18.mid";

	var tunenumber = getcookienumber("indtune", numberoftunes);
	savenextnumbertocookie("indtune", tunenumber, numberoftunes)
	
	var s = "";

/*
	s += 'Playing tune - ';
	s += '<SPAN TITLE=" Click to download music file ">';
	s += '<A HREF="../';
	s += musicfile[tunenumber];
	s += '">';	
	s += musictitle[tunenumber];
	s += '</A></SPAN><BR>';
	
	s += '<EMBED SRC="../';
	s += musicfile[tunenumber];	//no spaces in file name
	s += '" AUTOSTART="true" display="true" width=140 height=45>';
	//alert(s);
	document.write(s);
*/
//alert(indianmidibase);

	s += '<SPAN TITLE=" Click for next tune ">';
	//s += '<A HREF="javascript:history.go(0)">';
	//s += '<A HREF="javascript:playtune2()">';
	s += '<A HREF="javascript:afterpageloads()">';	//indianinside.js
	s += 'Playing';
	s += '</A>';
	s += '</span>';
	s += ' tune - ';
	s += '<SPAN TITLE=" Right mouse click to download music file ">';
	s += '<A HREF="';
	s += indianmidibase;
	s += musicfile[tunenumber];
	s += '">';
	s += musictitle[tunenumber];
	s += '</A></SPAN><BR>';
//alert(indianmidibase);

	s += '<EMBED SRC="';
	s += indianmidibase;
	s += musicfile[tunenumber];	//no spaces in file name
//alert(s);
	//s += "maryann.MID";	//no spaces in file name	//ok
	//s += '" AUTOSTART="true" display="true" width=140 height=45>';
	s += '" AUTOSTART="true" display="true" height=45>';
	//document.write(s);
	//document.getElementById("tdtune").innerHTML = s;
	//document.write('<embed src="maryann.MID" autostart="true" display="true" width=140 height=50>');	//ok
//alert(s);
	return s;
}

function zeventrow(name, year)	//returns (string)home <tr>news <tr>recent <tr>50news <tr>50recent //uses indiancalendar.js
{
	var s1 = '<TR><TD VALIGN="top">';
	//s1 += '<IMG SRC="../map3.gif" ALT="1k image of India" WIDTH=48 HEIGHT=50>';
	s1 += '<IMG SRC="../map3.gif" ALT="1k image of India" WIDTH=24 HEIGHT=25>';
	s1 += '</TD><TD VALIGN="top">';
	var s2 = '<BR></TD></TR>';
	var s = "";
	var symmdd = "";
	var symmdd2 = "";
	var symmdd3 = "";
	var symmdd4 = "";
	var symmdd5 = "";
	var bnodate = false;
	var bhome = false;
	var border = false;	//o
	var b50 = false;
	var bpicture = false;
	var bpast = false;
	var bhomeshow = false;	//show one only
	var yearstart = (yearnow - 1)%10;
	var yearend = (yearnow + 1)%10;
	if (year != null)
	{
		yearstart = year%10;
		yearend = year%10;
	}
	//for ( var y = (yearnow - 1)%10; y <= (yearnow + 1)%10; y++ )	//1, 2, 3 for 2002, = range in ymmdd[]
	for ( var y = yearstart; y <= yearend; y++ )
	{
		for ( var m = 1; m <= 12; m++ )
		{
			for ( var d = 1; d <= 31; d++ )
			{
				dateknown = "";	
				bnodate = false;
				bhome = false;
				b50 = false;
				border = false;
				bpast = false;
				bpicture = false;
				if (nowms > eventms(y, m, d) )
					bpast = true;  //show after event					
				//if (INDymmdd[y*10000 + m*100 + d] != "")	//an entry exists
				if (INDymmdd[y*10000 + m*100 + d] != null)	//an entry exists
				{
					symmdd = INDymmdd[10000*y + 100*m + d ];
					symmdd2 = INDymmdd2[10000*y + 100*m + d ];	//for booking prices
					symmdd3 = INDymmdd3[10000*y + 100*m + d ];
					symmdd4 = INDymmdd4[10000*y + 100*m + d ];
					symmdd5 = INDymmdd5[10000*y + 100*m + d ];
					dateknown = datestring(y + 10*(Math.floor(yearnow/10) ), m, d) + ", ";
					if (symmdd.substring(0,1) == "d")	//no date, multiday or unknown, no date to be automatically shown
					{
						bnodate = true;
						dateknown = "";
						symmdd = symmdd.slice(1);
					}
					if (symmdd.substring(0,1) == "h")	//home page
					{
						bhome = true;
						symmdd = symmdd.slice(1);
					}
					if (symmdd.substring(0,1) == "c")	//50's club page
					{
						b50 = true;
						symmdd = symmdd.slice(1);
					}					
			if (symmdd.substring(0,1) == "j")	//JM calendar
			{
				symmdd = symmdd.slice(1);
			}
			if (symmdd.substring(0,1) == "o")	//order
			{
				border = true;
				symmdd = symmdd.slice(1);
			}
					if (symmdd.substring(0,1) == "p")	//50's club page
					{
						bpicture = true;
						symmdd = symmdd.slice(1);
					}					

					if ( (name == "home")  && bhome && !bpast && !bhomeshow)
					{
						bhomeshow = true;
						popupymmdd = 10000*y + 100*m + d + "";	//need as string
						if (bnodate)	
							s += symmdd;
						else
						{
							//s += dateknown + "<br>" + symmdd; 
							s += dateknown + symmdd; 
						}
					}

/*
			if ( (name == "home") && bhome && !bpast && !bhomeshow)
			{
				bhomeshow = true;
				if (bnodate)
					s += [10000*y + 100*m + d ] + symmdd;		//no S1 S2 for home
				//else		s += dateknown + "<br>" + symmdd; 
				else		
					//s += [10000*y + 100*m + d ] + dateknown + symmdd; 
					s += [10000*y + 100*m + d ] + symmdd; 
			}
*/			
					symmdd = symmdd.replace(/#/gi, "<br>");	//if not home replace # with <br> g=global in string, i=case insensitive
					if ( (name == "news") && !bpast && !b50)   
						s += s1 + " " + dateknown + symmdd + s2;  
			if ( (name == "order") && !bpast && border)	//uses data in crbcalendardata.js
			//bookitem, bookprice initialised in crbsubs.htm
			{					
				howmanybookable++;
				bookitem[howmanybookable] = dateknown + symmdd;
				bookprice[howmanybookable] = symmdd2;							
				if (symmdd3 != "")
				{
					howmanybookable++;
					bookitem[howmanybookable] = dateknown + symmdd;
					bookprice[howmanybookable] = symmdd3;							
				}
				if (symmdd4 != "")
				{
					howmanybookable++;
					bookitem[howmanybookable] = dateknown + symmdd;
					bookprice[howmanybookable] = symmdd4;							
				}
				if (symmdd5 != "")
				{
					howmanybookable++;
					bookitem[howmanybookable] = dateknown + symmdd;
					bookprice[howmanybookable] = symmdd5;							
				}
			}
					if ( (name == "recent") && bpast && !b50)  
						s = s1 + dateknown + symmdd + s2 + s;  
					if ( (name == "50news") && !bpast && b50)  
						s += s1 + " " + dateknown + symmdd + s2;  
					if ( (name == "50recent") && bpast && b50) 
						s = s1 + dateknown + symmdd + s2 + s;  
					if ( (name == "picture") && bpicture) 
						s = s1 + dateknown + symmdd + s2 + s;  
				}			
			}
		}
	}
	if (name == "home")
	{
		if ( !bhomeshow )
		{
			for ( var n = weekdaynow; n <= ( weekdaynow + 7 ); n++ )
			{
				if (INDw[n%7] )
				{
					s = weekday[n%7] + " " + INDw[n%7];
					break;
				}
			}
		}
	}

	return s;
}

function zwebsitedesignby()	//uses webdata.js   030218
{
	//alert(window.location);
	var localsite = '/0colc/indian/indianhtmjs/';	//change this
	var endslice = localsite.length + 10;
	var s = "";

	var winloc = window.location + "";	//file:///C:/0our... IE  file:///C|/0our... NN  locks without + ""
	if ( (winloc.substring(0, 9) == "file:///C") && (winloc.substring(10, endslice) == localsite) )
	{
		s += '<A HREF=' + localpublishaddress + '>';
		s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}
	else
	{
		s += '<A HREF=' + webpublishaddress + '>';
		s += '<span title=" Get PUBLISHED on the WWW for only £48 ! ">';
	}

	s += '<FONT COLOR="#0000FF">Website</FONT></span></A> design by ';
	s += '<A HREF="mailto:';
	s += martinemail;
	s += '?subject=' + document.URL + ' ">';  //ok
	s += '<span title=" Tel 01223 860150 ">';
	s += '<FONT COLOR="#0000FF">Martin</FONT></span></A>';
	document.write(s);
}

function eventstring(name)	//returns string home news recent
{
	var s1 = '<TR><TD VALIGN="top">';
	s1 += '<IMG SRC="palm2.gif" ALT="1k image of palm tree from ';
	s1 += 'http://fl-mall.com/stores/lovebeach/" WIDTH=29 HEIGHT=50>';
	s1 += '</TD><TD VALIGN="top">';
	var s2 = '<BR></TD></TR>';
	var s = "";
	var srecent = "";
	var snews = "";
	var shome = "";
	var dateknown = "";
	for ( var y = (yearnow - 1)%10; y <= (yearnow + 1)%10; y++ )	//1, 2, 3 for 2002, = range in INDymmdd[]
	{
		for ( var m = 1; m <= 12; m++ )
		{
			for ( var d = 0; d <= 31; d++ )
			{
				if (INDymmdd[y*10000 + m*100 + d] != "")
				{
					if (d != 0)	//date in month known
					{
						dateknown = datestring(y + 10*(Math.floor(yearnow/10) ), m, d);
					}
					s = INDymmdd[10000*y + 100*m + d ];	
					if (nowms > eventms(y, m, d) )	//show after event
					{
						srecent = s1 + dateknown + " " + s + s2 + srecent;
					}
					else
					{
						snews += s1 + dateknown + " " + s + s2;
						if (s.charAt(0) == " " && shome == "")	//show on home page
						{
							//shome = datestring(y + 10*(Math.floor(yearnow/10) ), m, d) + " " + s;
							shome = dateknown + " " + s;
						}
					}
					s = "";
					dateknown = "";	
				}
			}
		}
	}
	if (name == "home")
	{
		return shome;
	}
	if (name == "news")
	{
		return snews;
	}
	if (name == "recent")
	{
		return srecent;
	}
}

/*
var weekday = new Array(7);
	weekday[0] = 'Sunday';
	weekday[1] = 'Monday';
	weekday[2] = 'Tuesday';
	weekday[3] = 'Wednesday';
	weekday[4] = 'Thursday';
	weekday[5] = 'Friday';
	weekday[6] = 'Saturday';
	
var monthname = new Array(13);
	monthname[1] = 'January';
	monthname[2] = 'February';
	monthname[3] = 'March';
	monthname[4] = 'April';
	monthname[5] = 'May';
	monthname[6] = 'June';
	monthname[7] = 'July';
	monthname[8] = 'August';
	monthname[9] = 'September';
	monthname[10] = 'October';
	monthname[11] = 'November';
	monthname[12] = 'December';
*/

function getcookienumber(name, max)	//returns number from cookie(name) or a random number, 1 - max
{
	var namestr = name + "=";
	var namelen = namestr.length;
	var cooklen = document.cookie.length;
	var string = null;
	var i = 0;
	while (i < cooklen)
	{
		var j = i +namelen;
		if (document.cookie.substring(i, j)== namestr)
		{
			endstr=document.cookie.indexOf(";",j);
			if (endstr==-1)
			{
				endstr = document.cookie.length;
			}
			string = unescape(document.cookie.substring(j, endstr));
		}
		i=document.cookie.indexOf(" ",i) + 1;
		if (i==0) break;
	}
	if ( (string == "NaN") || (string == null) )
	{
		number = parseInt(Math.floor(Math.random() * (max + 1) ) );	//1-max
	}
	else
	{
		number = parseInt(string);
	}
	return number;
}

var quotebackground = "00AA00";	//6BBD00 00FF00  8FFF8F  light green
var navfontcolourlight = "FFFFFF";	//lighter when mouseover = A:hover = BODY
var navfontcolourdark = "FFFF00";	//normal, after mouseout = A:active = A:link = BODY = Click for
var fontcolourgreyedout = "EECC00";	//greyed out, !=navbackcolourlight, EECC00
var navbackcolourlight = "FFAA99";	//lighter when mouseover
var navbackcolourdark = "FF8800";	//normal, after mouseout

var numberoflinks = 202;
caption = new Array(numberoflinks);
span = new Array(numberoflinks);
link = new Array(numberoflinks);

caption[0]=" ";	//first must be " "
span[0]=" ";	//or wrong font, colour in NN4
link[0]=" ";	//don't know why

caption[10]="<NOBR>WHAT WE DO</NOBR>";
span[10]=" Aims, regular activites ";
link[10]="inddo2.htm";

caption[20]="NEWS";
span[20]=" Forthcoming and recent Activities ";
link[20]="indnews2.htm";
caption[21]="What\'s on";
span[21]=" Forthcoming Events ";
link[21]="indnews2.htm";
caption[22]="Regulars";
span[22]=" Regular events ";
link[22]="indianregular.htm";
caption[24]="Recent";
span[24]=" Recent trips, festivals, concerts, dances, recitals ";
link[24]="indrecent.htm";

//caption[31]="Recent Events";
//span[31]=" Recent trips, festivals, concerts, dances, recitals ";
//link[31]="indeven2.htm";
//caption[35]="2003";
//span[35]=" Our 2003 trips, festivals, concerts, dances, recitals ";
//link[35]="indeven2003.htm";
//caption[36]="2002";
//span[36]=" Our 2002 trips, festivals, concerts, dances, recitals ";
//link[36]="indeven2002.htm";
//caption[37]="2001";
//span[37]=" Our 2001 trips, festivals, concerts, dances, recitals ";
//link[37]="indeven2001.htm";
//caption[38]="2000";
//span[38]=" Our 2000 trips, festivals, concerts, dances, recitals ";
//link[38]="indeven2000.htm";
//caption[39]="1999";
//span[39]=" Our 1999 trips, festivals, concerts, dances, recitals ";
//link[39]="indeven1999.htm";

caption[40]="CONTACT";
span[40]=" Telephone, e-mail, address, map, hall hire, membership, committee members ";
link[40]="indcont2010.htm";
caption[41]="Contact";
span[41]=" Telephone, e-mail, address, map, membership, committee members ";
link[41]="indcont2010.htm";
caption[42]="Map";
span[42]=" Map to our centre you can print ";
link[42]="indmap.htm";
//caption[43]="Committee";
//span[43]=" Committee members ";
//link[43]="indcommframe.htm";
caption[44]="Membership";
span[44]=" Membership application/renewal form ";
link[44]="indmember.htm";

/*
caption[50]="YOUTH";
span[50]=" Regular Youth activities, have your say, Mega Mela picture ";
link[50]="indyouth.htm";
caption[51]="Activities";
span[51]=" Regular activities ";
link[51]="indyouth.htm";
caption[52]="Have Your Say";
span[52]=" Youth Message board - see what other people say";
link[52]="indianyouthguest.htm";
//caption[52]="Messages";
//span[52]=" Youth Message board ";
//link[52]="indmessageframe.htm";
caption[53]="Mega Mela";
span[53]=" Mega Mela picture ";
link[53]="indmegamela.htm";

caption[50]="BUSINESSES";
span[50]=" Local Indian Businesses ";
link[50]="indianbusiness.htm";
caption[51]="Activities";
span[51]=" Local Indian Businesses ";
link[51]="indianbusiness.htm";
*/

caption[60]="<NOBR>OVER 50'S</NOBR>";
span[60]=" Over 50's Club, news, committee, have your say, pictures ";
link[60]="ind50b.htm";
//caption[61]="Our Club";
//span[61]=" Regular meetings, committee ";
//link[61]="ind50b.htm";
//caption[62]="What\'s on";
//span[62]=" Forthcoming special events ";
//link[62]="ind50news.htm";
//caption[63]="Recent";
//span[63]=" Recent special events ";
//link[63]="ind50event.htm";
//caption[64]="Have Your Say";
//span[64]=" Over 50's Message board - see what other people say ";
//link[64]="indian50guest.htm";
//caption[66]="2002";
//span[66]=" 2002 events ";
//link[66]="ind50event2002.htm";
//caption[67]="New Year";
//span[67]=" 2002 New Year Party at Bharat Bhavan ";
//link[67]="ind2002newyear.htm";
//caption[68]="2001";
//span[68]=" 2001 events ";
//link[68]="ind50event2001.htm";
//caption[69]="Paris trip";
//span[69]=" Paris trip pictures ";
//link[69]="indparis2.htm";

/*
caption[70]="LANGUAGE";
span[70]=" Gujarati Language classes, student pictures ";
link[70]="indlang.htm";
caption[71]="Classes";
span[71]=" Gujarati Language classes ";
link[71]="indlang.htm";
caption[72]="Students";
span[72]=" student pictures ";
link[72]="indstud2.htm";

caption[80]="MUSIC";
span[80]=" Indian music tuition, special courses ";
link[80]="indmusic2.htm";
caption[81]="Classes";
span[81]=" Indian music tuition ";
link[81]="indmusic2.htm";
//caption[82]="2001 March";
//span[82]=" Special course ";
//link[82]="indmusic0103.htm";

//caption[90]="SPORTS";
//span[90]=" Football, indoor sports ";
//link[90]="indsport.htm";
*/

caption[100]="CD";
span[100]=" Order a copy of our Bhajan CD ";
link[100]="indiancd.htm";

/*
caption[100]="FESTIVALS";
span[100]=" Indian festivals, Annakut, Diwali, Havan, Holi ";
link[100]="indann2.htm";
caption[101]="Annakut";
span[101]=" Annakut Festival pictures ";
link[101]="indann2.htm";
caption[102]="Diwali";
span[102]=" Diwali Festival pictures ";
link[102]="inddiw2.htm";
caption[103]="Havan";
span[103]=" Havan Festival pictures ";
link[103]="indhav2.htm";
caption[104]="Holi";
span[104]=" Holi Festival information ";
link[104]="indholi2.htm";
caption[107]="Shivratri";
span[107]=" Shivratri Festival ";
link[107]="indshivratri.htm";
caption[108]="Tulsi Vivah";
span[108]=" Tulsi Vivah Festival pictures ";
link[108]="indtuls2.htm";
*/

caption[110]="PROJECTS";
span[110]=" Eye Clinic, Earthquake relief, Street name ";
link[110]="indeye2.htm";
caption[111]="Eye Clinic";
span[111]=" Eye Clinic in India ";
link[111]="indeye2.htm";
//caption[112]=" Earthquake Appeal ";
//span[112]=" 2001 Gujarat Earthquake Relief Appeal ";
//link[112]="indquakeappeal.htm";
//caption[113]=" Earthquake response ";
//span[113]=" Cambridge response to 2001 earthquake ";
//link[113]="indquakeresponse.htm";
//caption[114]="Street Name";
//span[114]=" Choosing our own Street Name ";
//link[114]="indstreet2.htm";

caption[120]="QUIZ";
span[120]=" How much do you know about India ? ";
link[120]="indquiz2.htm";

caption[130]="LINKS";
span[130]=" UK Indian websites, Indian newspapers ";
link[130]="indlinkframe.htm";

//caption[140]="SEARCH";
//span[140]=" Search the website for pages containing a particular word ";
//link[140]="indsearchframe.htm";

caption[150]="AARTI";
span[150]=" Aarti / Bhajans ";
link[150]="indianarati.htm";

caption[160]="PICTURES";
span[160]=" Pictures of our Events ";
link[160]="indianpicture.htm";

caption[170]="BOOKING FORM";
span[170]=" Book your tickets for events and renew your subscription here ";
link[170]="indianbooking.htm";

caption[200]="<NOBR>HOME Page</NOBR>";
span[200]=" Back to the Home Page ";
link[200]="indianhome.htm";

caption[300]="Web Address Cards";
span[300]="";
link[300]="indiancard.htm";

caption[400]="Add to Favourites";
span[400]="";
link[400]="javascript:window.external.AddFavorite(window.location, document.title);";

function savenextnumbertocookie(name, number, max) 	//saves next in sequence 1 - max
{
	number = number%max;	//0 - (max-1)
	number++;
	var expdate=new Date();
	expdate.setTime(expdate.getTime() + (1*24*60*60*1000*365));	//+1 year of milliseconds
	expdate=expdate.toGMTString();
	document.cookie=name+"="+escape(number)+";expires="+expdate+";"	//no spaces
}

function zeventrow2(name, year)	//returns (string)home <tr>news <tr>recent <tr>50news <tr>50recent
{
	var s1 = '<TR><TD VALIGN="top">';
	s1 += '<IMG SRC="palm2.gif" ALT="1k image of palm tree from ';
	s1 += 'http://fl-mall.com/stores/lovebeach/" WIDTH=29 HEIGHT=50>';
	s1 += '</TD><TD VALIGN="top">';
	var s2 = '<BR></TD></TR>';
	var s = "";
	var symmdd = "";
	var bnodate = false;
	var bhome = false;
	var b50 = false;
	var bpast = false;
	var bhomeshow = false;	//show one only
	var yearstart = (yearnow - 1)%10;
	var yearend = (yearnow + 1)%10;
	if (year != null)
	{
		yearstart = year%10;
		yearend = year%10;
	}
	for ( var y = yearstart; y <= yearend; y++ )
	{
		for ( var m = 1; m <= 12; m++ )
		{
			for ( var d = 0; d <= 31; d++ )
			{
				dateknown = "";	
				bnodate = false;
				bhome = false;
				b50 = false;
				bpast = false;
				if (INDymmdd[y*10000 + m*100 + d] != "")	//an entry exists
				{
					symmdd = INDymmdd[10000*y + 100*m + d ];
					dateknown = datestring(y + 10*(Math.floor(yearnow/10) ), m, d) + ", ";
					if (symmdd.substring(0,1) == "d")	//no date, multiday or unknown, no date to be automatically shown
					{
						bnodate = true;
						dateknown = "";
						symmdd = symmdd.slice(1);
					}
					if (symmdd.substring(0,1) == "c")	//50's club page
					{
						b50 = true;
						symmdd = symmdd.slice(1);
					}					
					if (symmdd.substring(0,1) == "h")	//home page
					{
						bhome = true;
						symmdd = symmdd.slice(1);
					}
					if (symmdd.substring(0,1) == "j")	//JM calendar
					{
						symmdd = symmdd.slice(1);
					}
					if (nowms > eventms(y, m, d) )	bpast = true;  //show after event
					
					if ( (name == "news") && !bpast && !b50)   s += s1 + " " + dateknown + symmdd + s2;  
					if ( (name == "recent") && bpast && !b50)  s = s1 + dateknown + symmdd + s2 + s;  
					if ( (name == "50news") && !bpast && b50)  s += s1 + " " + dateknown + symmdd + s2;  
					if ( (name == "50recent") && bpast && b50) s = s1 + dateknown + symmdd + s2 + s;  
					if ( (name == "home")  && bhome && !bpast && !bhomeshow)
					{
						bhomeshow = true;
						if (bnodate)
							s += symmdd;
						else		
							//s += dateknown + "<br>" + symmdd; 
							s += dateknown + symmdd; 
					}
				}			
			}
		}
	}
	if ( (name == "home" ) && !bhomeshow )
	{
		var n = 0;
		var whhmmNow = weekdaynow*10000 + hournow*100 + minutenow;
		for ( var w = 0; w <= 13; w++ )
		{
			for ( var h = 0; h <= 24; h++ )
			{
				for ( var m = 0; m <= 60; m++ )
				{
					n = w*10000 + h*100 + m;
					if ( ( n >= whhmmNow ) && whhmm[n%70000]  && !bhomeshow )
					{
						shome = weekday[w%7] + " " + whhmm[n%70000];
						bhomeshow = true;
						break;
					}
				}
			}
		}
	}
	return s;
}


