function writeDate()
{
	//method to get a date and format it nicely
	var tmp = new Date();
	var year = tmp.getFullYear();
	var month = tmp.getMonth() + 1;
	var day = tmp.getDate();
	var w_day = tmp.getDay();

	//now format day of week
	if(w_day == 1)
	{	w_day = "Monday";	}
	else if(w_day == 2)
	{	w_day = "Tuesday";	}
	else if(w_day == 3)
	{	w_day = "Wednesday";	}
	else if(w_day == 4)
	{	w_day = "Thursday";	}
	else if(w_day == 5)
	{	w_day = "Friday";	}
	else if(w_day == 6)
	{	w_day = "Saturday";	}
	else if(w_day == 0)
	{	w_day = "Sunday";	}

	//quick format of month
	if(month == 1)
	{	month = "January";	}
	else if(month == 2)
	{	month = "February";	}
	else if(month == 3)
	{	month = "March";	}
	else if(month == 4)
	{	month = "April";	}
	else if(month == 5)
	{	month = "May";	}
	else if(month == 6)
	{	month = "June";	}
	else if(month == 7)
	{	month = "July";	}
	else if(month == 8)
	{	month = "August";	}
	else if(month == 9)
	{	month = "September";	}
	else if(month == 10)
	{	month = "October";	}
	else if(month == 11)
	{	month = "November";	}
	else if(month == 12)
	{	month = "December";	}

	tmp = w_day + " " + month + " " + day + ", " + year;

	document.write(tmp);
}

function writeFooter()
{
	var date = new Date();
	var year = date.getFullYear();

	document.write("<table width=\"97%\" align=\"center\">");
	document.write("<tr>");
	document.write("<td>");
	document.write("<center>&copy;" + year + " CampUSA InterActive Incorporated<br>All Rights Reserved</center>");
	document.write("<br><br>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
}

function drawBanner(place)
{
	/***
		This method will draw out the logo and the links on the top bar.  The purpose is to simplify changes
		that will need to be made to this portion of the page.  The 'place' variable refers
		to the location of the page in terms of folders off the root.  So far, we will only support
		the root plus two levels deep:
		
		Page Location:			Call:
		/						drawBanner("root");
		/REPORTS				drawBanner("1");
		/REPORTS/publish		drawBanner("2");
		
	***/
	//document.write("<table align=\"center\" width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	
	if(place == "root")
	{
		image1.src = "images/home.gif";
		image1on.src = "images/home-hover.gif";
		image2.src = "images/about.gif";
		image2on.src = "images/about-hover.gif";
		image3.src = "images/services.gif";
		image3on.src = "images/services-hover.gif";
		image4.src = "images/contact.gif";
		image4on.src = "images/contact-hover.gif";
	}
	
	if(place == "1")
	{
		image1.src = "../images/home.gif";
		image1on.src = "../images/home-hover.gif";
		image2.src = "../images/about.gif";
		image2on.src = "../images/about-hover.gif";
		image3.src = "../images/services.gif";
		image3on.src = "../images/services-hover.gif";
		image4.src = "../images/contact.gif";
		image4on.src = "../images/contact-hover.gif";
	}
	
	if(place == "2")
	{
		image1.src = "../../images/home.gif";
		image1on.src = "../../images/home-hover.gif";
		image2.src = "../../images/about.gif";
		image2on.src = "../../images/about-hover.gif";
		image3.src = "../../images/services.gif";
		image3on.src = "../../images/services-hover.gif";
		image4.src = "../../images/contact.gif";
		image4on.src = "../../images/contact-hover.gif";
	}
	document.write("<tr>");
	
	if(place == "root")
	  document.write("<td align=\"left\" valign=\"bottom\" width=\"70%\" background=\"images/top_back.jpg\">");
	else if(place == "1")
	  document.write("<td align=\"left\" valign=\"bottom\" width=\"70%\" background=\"../images/top_back.jpg\">");
	else if(place == "2")
	  document.write("<td align=\"left\" valign=\"bottom\" width=\"70%\" background=\"../../images/top_back.jpg\">");
	
	
	if(place == "root")
	{	
		document.write("<A HREF=\"home.html\" onmouseover=\"on('image1');\" onmouseout=\"off('image1');\"><img class=\"top-button\" src=\"images/home.gif\" name=\"image1\"></a>");
		document.write("<A HREF=\"about/index.html\" onmouseover=\"on('image2');\" onmouseout=\"off('image2');\"><img class=\"top-button\" src=\"images/about.gif\" name=\"image2\"></a>");
		document.write("<A HREF=\"services/index.html\" onmouseover=\"on('image3');\" onmouseout=\"off('image3');\"><img class=\"top-button\" src=\"images/services.gif\" name=\"image3\"></a>");
		document.write("<A HREF=\"support/contact.html\" onmouseover=\"on('image4');\" onmouseout=\"off('image4');\"><img class=\"top-button\" src=\"images/contact.gif\" name=\"image4\"></a>");
	}
	else if(place == "1")
	{	
		document.write("<A HREF=\"../home.html\" onmouseover=\"on('image1');\" onmouseout=\"off('image1');\"><img class=\"top-button\" src=\"../images/home.gif\" name=\"image1\"></a>");
		document.write("<A HREF=\"../about/index.html\" onmouseover=\"on('image2');\" onmouseout=\"off('image2');\"><img class=\"top-button\" src=\"../images/about.gif\" name=\"image2\"></a>");
		document.write("<A HREF=\"../services/index.html\" onmouseover=\"on('image3');\" onmouseout=\"off('image3');\"><img class=\"top-button\" src=\"../images/services.gif\" name=\"image3\"></a>");
		document.write("<A HREF=\"../support/contact.html\" onmouseover=\"on('image4');\" onmouseout=\"off('image4');\"><img class=\"top-button\" src=\"../images/contact.gif\" name=\"image4\"></a>");
	}
	else if(place == "2")
	{	
		document.write("<A HREF=\"../../home.html\" onmouseover=\"on('image1');\" onmouseout=\"off('image1');\"><img class=\"top-button\" src=\"../../images/home.gif\" name=\"image1\"></a>");
		document.write("<A HREF=\"../../about/index.html\" onmouseover=\"on('image2');\" onmouseout=\"off('image2');\"><img class=\"top-button\" src=\"../../images/about.gif\" name=\"image2\"></a>");
		document.write("<A HREF=\"../../services/index.html\" onmouseover=\"on('image3');\" onmouseout=\"off('image3');\"><img class=\"top-button\" src=\"../../images/services.gif\" name=\"image3\"></a>");
		document.write("<A HREF=\"../../support/contact.html\" onmouseover=\"on('image4');\" onmouseout=\"off('image4');\"><img class=\"top-button\" src=\"../../images/contact.gif\" name=\"image4\"></a>");
	}
	
	
	document.write("</td>");
	
	document.write("<td align=\"left\" valign=\"bottom\" width=\"30%\" background=\"images/top_back.jpg\">");
	if(place == "root")
	{
		document.write("<img src=\"images/top_logo_2b.jpg\" border=\"0\">");
	}
	else if(place == "1")
	{
		document.write("<img src=\"../images/top_logo_2b.jpg\" border=\"0\">");	
	}
	else if(place == "2")
	{
		document.write("<img src=\"../../images/top_logo_2b.jpg\" border=\"0\">");	
	}
	document.write("</td>");	
	document.write("</tr>");
}

function populateDates(start, end)
{
	var start_date = "";
	var end_date = "";
	
	var todaysDate = new Date();
	var tmp_month1 = todaysDate.getMonth()+1;
	var tmp_day1 = todaysDate.getDate();
	var tmp_year1 = todaysDate.getFullYear();
	
	/*
	var lastDate = new Date();
	lastDate.setMonth((tmp_month1-1)-1);
	var tmp_month2 = lastDate.getMonth()+1;
	var tmp_day2 = lastDate.getDate();
	var tmp_year2 = lastDate.getFullYear();
	*/
	
	var lastDate = new Date();
	lastDate.setDate(tmp_day1-1);
	var tmp_month2 = lastDate.getMonth()+1;
	var tmp_day2 = lastDate.getDate();
	var tmp_year2 = lastDate.getFullYear();
	
	//pad the leading 0 for dates
	if(tmp_month1 < 10)
	{	tmp_month1 = "0" + tmp_month1;	}
	if(tmp_month2 < 10)
	{	tmp_month2 = "0" + tmp_month2;	}
	
	//pad the leading 0 for days
	if(tmp_day1 < 10)
	{	tmp_day1 = "0" + tmp_day1;	}
	if(tmp_day2 < 10)
	{	tmp_day2 = "0" + tmp_day2;	}
	
	start_date = tmp_month2 + "/" + tmp_day2 + "/" + tmp_year2;
	end_date = tmp_month1 + "/" + tmp_day1 + "/" + tmp_year1;
	
	if(start != "" && start != null)
	{	start.value = start_date;	}
	
	if(end != "" && end != null)
	{	end.value = end_date;	}
}

function setMRfex(fexName)
{  
	document.form.IBIMR_fex.value=fexName;
}

function confirmLogout()
{
	if(confirm("Are you sure you wish to log out?"))
	{	return true;	}
	else
	{	return false;	}
}

/********IMAGE HOVER LOGIC*********/
var NN3 = false;

image1= new Image();
image1on = new Image();

image2= new Image();
image2on = new Image();

image3= new Image();
image3on = new Image();

image4= new Image();
image4on = new Image();

image5= new Image();
image5on = new Image();


function on3(name)   {
        document[name].src = eval(name + "on.src");
}
function off3(name)  {
        document[name].src = eval(name + ".src");
}
NN3 = true;

function on(name)  {
        if (NN3) on3(name);
}
function off(name)  {
        if (NN3) off3(name);
}
/******END IMAGE HOVER LOGIC*******/