var item = 0;

var mnuLine = new Array();



function DoMenu(Page)

{

	var i = 0;

	var Path;

	var OpenTag;

	var CloseTag;

	

	OpenTag = ""

	CloseTag = ""

	Path = "../";

	if (Page == "Home") Path = "";

	if (Page == "Expense") Path = "../../";



	mnuSetItem(Page, "Home", 					"Home", 			Path, "index.htm");

	/*mnuSetItem(Page, "Professional Staff", 		"Staff", 			Path, "Business/ProfStaff.htm");*/

	mnuSetItem(Page, "Services", 	"Services", 		Path, "Business/ProfServices.htm");

	/*mnuSetItem(Page, "Case studies", 			"Case studies", 	Path, "Business/History.htm");*/

	mnuSetItem(Page, "SalesLogix", 				"SalesLogix", 		Path, "Business/SalesLogix.htm");

	/*mnuSetItem(Page, "WildDucks Byte", 			"WildDucks Byte", 	Path, "Business/Newsletter.htm");*/

	mnuSetItem(Page, "Directions", 				"Directions", 		Path, "Business/Directions.htm");

	/*mnuSetItem(Page, "Glossary", 				"Glossary", 		Path, "Business/Glossary.htm");*/

	mnuSetItem(Page, "Contact Us", 				"Contact Us", 		Path, "Business/ContactUs.htm");

	/*mnuSetItem(Page, "Client login", 			"Clients", 			Path, "Business/Login.htm");*/

	mnuSetItem(Page, "Support", 				"Support", 			Path, "Support/index.htm");

	mnuSetItem(Page, "Careers", 				"Careers", 		Path, "Business/Careers.htm");

	/*mnuSetItem(Page, "",                        "Expense",          Path, "Addon/Expense/Expense.htm");*/



	for (i = 0; i < item; i++)

	{

		if (mnuLine[i].Name.length > 0)

		{

			if (mnuLine[i].ShortName == "WildDucks Byte") 

			{

				OpenTag = "<I>"; 

				CloseTag = "</I>";

			}

			else

			{

				OpenTag = "";

				CloseTag = "";

			}

			document.write('<A HREF="' + mnuLine[i].Loc + '"<SPAN CLASS="' + mnuLine[i].Style + '">&nbsp;' +OpenTag + mnuLine[i].Name + CloseTag + '&nbsp;</SPAN></A><BR>');

		}

	}

	

	/*document.write('<BR><BR><BR><BR><BR><BR><IMG SRC="' + Path + 'Graphics/MenuDuck.JPG" WIDTH="180" HEIGHT="120">');

	ShowToday();*/	

	

}



function mnuItem(Name, ShName, Path, Loc, Style)

{

	this.Name = Name;

	this.ShortName = ShName;

	this.Loc = Path + Loc;

	this.Style = Style;

}



function mnuSetItem(Page, Name, ShName, Path, Loc)

{

	var Style;

	

	if (Name == Page)

		{Style = "hilite";

		Loc = "#";}

	else

		{Style = "menuBar";}

	

	mnuLine[item++] = new mnuItem(Name, ShName, Path, Loc, Style);

}



function DoPageBottomLinks()

{

	var i = 0;

	var ItemsPerLine = 5;

	var count = 0;

	

	document.write('<P STYLE="font-size: 10px">');



	do

	{

		if (mnuLine[i].Name.length > 0)

		{

			if (mnuLine[i].ShortName == "WildDucks Byte") mnuLine[i].ShortName = "<I>" + mnuLine[i].ShortName + "</I>";

		

			document.write('<A HREF="' + mnuLine[i].Loc + '">' + mnuLine[i].ShortName + '</A>');

			count++;

			i++;

		

			if ((count < ItemsPerLine) && (i < item))

			{

				document.write(" | ");

			}

			else

			{

				document.write('<BR>');

				count = 0;

			}

		}

		else

		{

			i++;

		}

	} while (i < item);



	document.write('</P>');

}



function DoCopyright()

{

	document.write('<P STYLE="font-size: 10px"><BR>Copyright &copy; 2004 by Wild Ducks Systems, Inc.<P>');

}



function SafEmail(user, domain, suffix)

{

	document.write('<p><b><a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">Click here to send us an email</a></b></p>');

}





var cookies = new Object();

	

function SendToCompany()

{

	var name, value;

	var beg, mid, end;

	

	for (name in cookies)

	{

		cookies = new Object();

		break;

	}



	beg = 0;

	while (beg < document.cookie.length)

	{

		mid = document.cookie.indexOf('=', beg);

		end = document.cookie.indexOf(';', beg);

		if (end == -1) end = document.cookie.length;

		

		if ((mid > end) || (mid == -1))

		{

			name = document.cookie.substring(beg, end);

			value = "";

		}

		else

		{

			name = document.cookie.substring(beg, mid);

			value = document.cookie.substring(mid + 1, end);

		}

		cookies[name] = unescape(value);

		

		beg = end + 2;

	}



	document.forms(0).elements(0).value = cookies["wdsCompany"];

}



function varitext(text)

{

	text = document;

	print(text);

}



function ShowToday()

{

	var months=new Array(13);

	var Days = new Array(8);

					

	months[1]="January";

	months[2]="February";

	months[3]="March";

	months[4]="April";

	months[5]="May";

	months[6]="June";

	months[7]="July";

	months[8]="August";

	months[9]="September";

	months[10]="October";

	months[11]="November";

	months[12]="December";

	

	Days[1]="Sunday";

	Days[2]="Monday";

	Days[3]="Tuesday";

	Days[4]="Wednesday";

	Days[5]="Thursday";

	Days[6]="Friday";

	Days[7]="Saturday";



	var time=new Date();

	var lmonth=months[time.getMonth() + 1];

	var lDay = Days[time.getDay() + 1];

	var date=time.getDate();

	var year=time.getYear();



	if (year < 2000)

		year = year + 1900;

	

	document.write("<center>");

	document.write("<p>");

	document.write("<b>");

	document.write(lDay + '<br>');

	document.write(lmonth + " ");

	document.write(date + ", " + year);

	document.write("</b>");

	document.write("</p>");

	document.write("</center>");

	

}





function ShowDoc(strClient, FormName)

{

	var mo, yr, DocName, Fldr;



	Fldr = FormName;

	Fldr = Fldr.toLowerCase();

	

	switch (FormName)

	{

	case 'BORDEREAUX':

		mo = '' + (document[FormName].Month.options.selectedIndex + 1);

		yr = '' + (2004 + document[FormName].Year.options.length - document[FormName].Year.options.selectedIndex);

		if (mo.length < 2) mo = '0' + mo;

		DocName = yr + mo + '.htm';

		break;

	

	case 'PROPERTY':

		mo = '' + (document[FormName].Month.options.selectedIndex + 1);

		yr = '' + (2004 + document[FormName].Year.options.length - document[FormName].Year.options.selectedIndex);

		if (mo.length < 2) mo = '0' + mo;

		DocName = yr + mo + 'AssetsGTMill';

		if ((yr == 2003 && mo < 11) || (yr < 2003) || (yr == 2005 && mo > 6) || (yr > 2005))

			DocName = DocName + '.htm';

		else

			DocName = DocName + '.snp';

		

		/*commented out and replaced with above on 8/23/2005 DPB

		if ((yr > 2002 && mo > 10) || (yr > 2003))

			DocName = DocName + '.snp';

		else

			DocName = DocName + '.htm';*/

		break;



	case 'CALIFORNIA':

		Fldr = 'property'

		mo = '' + (document[FormName].Month.options.selectedIndex + 1);

		yr = '' + (2004 + document[FormName].Year.options.length - document[FormName].Year.options.selectedIndex);

		if (mo.length < 2) mo = '0' + mo;

		DocName = yr + mo + 'AssetsCAProp';

		if ((yr == 2005 && mo > 6) || (yr > 2005))

			DocName = DocName + '.htm';

		else if ((yr == 2004 && mo < 5) || (yr < 2004))

			{

			alert("The report you have selected is not available");

			return; }

		else

			DocName = DocName + '.snp';

		

		/*commented out and replaced with above on 8/23/2005 DPB

		if ((yr > 2003 && mo > 4) || (yr > 2004))

			DocName = DocName + '.snp';

		else {

			alert("The report you have selected is not available");

			return; }*/



		break;



	case 'FLOOD':

		mo = document[FormName].RepList.options.selectedIndex;

		DocName = document[FormName].RepList.options[mo].value;

		break;



	case 'OTHER':

		mo = document[FormName].RepList.options.selectedIndex;

		DocName = document[FormName].RepList.options[mo].value;

		break;

	}



	location = 'http://www.wildducks.com/Client/' + strClient + '/' + Fldr + '/' + DocName;

	return 0;

			

}





function send(FormName)

{

	alert(document[FormName].strName.value);





}