//rollovers
var iName=""; 

default1 = new Image(); default1.src = "http://www.school-fundraising.com/Images/Nav/ViewCatalog_Off.gif";
changed1 = new Image(); changed1.src = "http://www.school-fundraising.com/Images/Nav/ViewCatalog_On.gif";
hover1 = new Image(); hover1.src = "http://www.school-fundraising.com/Images/Nav/ViewCatalog_Hover.gif";

default2 = new Image(); default2.src = "http://www.school-fundraising.com/Images/Nav/RequestInfo_Off.gif";
changed2 = new Image(); changed2.src = "http://www.school-fundraising.com/Images/Nav/RequestInfo_On.gif";
hover2 = new Image(); hover2.src = "http://www.school-fundraising.com/Images/Nav/RequestInfo_Hover.gif";

default3 = new Image(); default3.src = "http://www.school-fundraising.com/Images/Nav/ShopCatalog_Off.gif";
changed3 = new Image(); changed3.src = "http://www.school-fundraising.com/Images/Nav/ShopCatalog_On.gif";
hover3 = new Image(); hover3.src = "http://www.school-fundraising.com/Images/Nav/ShopCatalog_Hover.gif";

default4 = new Image(); default4.src = "http://www.school-fundraising.com/Images/Nav/Home_Off.gif";
changed4 = new Image(); changed4.src = "http://www.school-fundraising.com/Images/Nav/Home_On.gif";
hover4 = new Image(); hover4.src = "http://www.school-fundraising.com/Images/Nav/Home_Hover.gif";


function Ichange(p) {
    var pSrc=eval(p+ ".src");
    document[iName].src = pSrc;
}

//Writes the navigation to the page based on variable at the top of each page.


function printSellingNav() { 
if (section == "Home" ) {
		document.write('<A HREF="http://www.school-fundraising.com/"><IMG SRC="http://www.school-fundraising.com/Images/Nav/Home_On.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" ALT="Home"></A>');
	} 
	else {
		document.write('<A HREF="http://www.school-fundraising.com/" onMouseOver="iName=\'image4\'; Ichange(\'hover4\')" onMouseOut="Ichange(\'default4\')"><IMG SRC="http://www.school-fundraising.com/Images/Nav/Home_Off.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" name="image4" ALT="Home"></A>');
	}

	if (section == "Catalog" ) {
		document.write('<A HREF="http://www.school-fundraising.com/Catalog/Catalog.html"><IMG SRC="http://www.school-fundraising.com/Images/Nav/ViewCatalog_On.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" ALT="View Catalog"></A>');
	} 
	else {
		document.write('<A HREF="http://www.school-fundraising.com/Catalog/Catalog.html" onMouseOver="iName=\'image1\'; Ichange(\'hover1\')" onMouseOut="Ichange(\'default1\')"><IMG SRC="http://www.school-fundraising.com/Images/Nav/ViewCatalog_Off.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" name="image1" ALT="View Catalog"></A>');
	}
	
	if (section == "RequestInfo" ) {
		document.write('<A HREF="http://www.school-fundraising.com/RequestInfo/RequestInfo.php"><IMG SRC="http://www.school-fundraising.com/Images/Nav/RequestInfo_On.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" ALT="Request Information"></A>');
	} 
	else {
		document.write('<A HREF="http://www.school-fundraising.com/RequestInfo/RequestInfo.php" onMouseOver="iName=\'image2\'; Ichange(\'hover2\')" onMouseOut="Ichange(\'default2\')"><IMG SRC="http://www.school-fundraising.com/Images/Nav/RequestInfo_Off.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" name="image2" ALT="Request Information"></A>');
	}
	
/*	if (section == "ShopCatalog" ) {
		document.write('<A HREF="http://www.school-fundraising.com/Shop/Shop.html"><IMG SRC="http://www.school-fundraising.com/Images/Nav/ShopCatalog_On.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" ALT="Order Products"></A>');
	} 
	else {
		document.write('<A HREF="http://www.school-fundraising.com/Shop/Shop.html" onMouseOver="iName=\'image3\'; Ichange(\'hover3\')" onMouseOut="Ichange(\'default3\')"><IMG SRC="http://www.school-fundraising.com/Images/Nav/ShopCatalog_Off.gif" WIDTH="190" HEIGHT="22" HSPACE="0" VSPACE="0" BORDER="0" name="image3" ALT="Order Products"></A>');
	}*/
	
	document.write();
} 

function printLogoTop() {
	document.write('<A HREF="http://www.school-fundraising.com//index.html"><IMG SRC="http://www.school-fundraising.com/Images/Clear.gif" WIDTH="360" HEIGHT="59" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="LEFT" ALT="School-Fundraiser.com by Maredy"></A><IMG SRC="http://www.school-fundraising.com/Images/Clear.gif" WIDTH="230" HEIGHT="36" HSPACE="0" VSPACE="0" BORDER="0"><BR><A HREF="http://www.maredy.com/careers" CLASS="navlink"><IMG SRC="http://www.school-fundraising.com/Images/IconHome.gif" WIDTH="15" HEIGHT="13" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="ABSBOTTOM" STYLE="margin-right: 4px;">PARTNER WITH US</A>&nbsp;&nbsp;&nbsp;<A HREF="http://www.maredy.com" CLASS="navlink"><IMG SRC="http://www.school-fundraising.com/Images/IconHome.gif" WIDTH="15" HEIGHT="13" HSPACE="0" VSPACE="0" BORDER="0" ALIGN="ABSBOTTOM" STYLE="margin-right: 4px;">MAREDY.COM</A>&nbsp;&nbsp;&nbsp;<BR>');
}

function printFooterNav() {
	document.write('<TABLE WIDT="760" CELLPADDING="2" CELLSPACING="0" BORDER="0"><TR><TD WIDTH="560" ALIGN="LEFT" VALIGN="MIDDLE" CLASS="text"><DIV CLASS="footertext" ID="brown" STYLE="line-height: 11px;">&nbsp;&nbsp;Are you with a group that is looking for other great fundraising ideas?<BR></DIV>&nbsp;&nbsp;<A HREF="http://www.ezoncampusfundraisers.com" class="navlink">EZ On-Campus Fundraisers</A>&nbsp;&nbsp;&#149;&nbsp;&nbsp;<A HREF="http://www.cookiedoughfundraiser.com" class="navlink">Cookie Dough</A><BR></TD><TD WIDTH="200" ALIGN="LEFT" VALIGN="BOTTOM" CLASS="text"><A HREF="http://www.school-fundraising.com//SiteMap/SiteMap.html" CLASS="navlink">Site Map</A>&nbsp;&nbsp;&#149;&nbsp;&nbsp;<A HREF="http://www.maredy.com/Contact/Contact.html" CLASS="navlink">Contact Us</A>&nbsp;&nbsp;&#149;&nbsp;&nbsp;<A HREF="http://www.maredy.com" CLASS="navlink">Maredy.com</A>&nbsp;&nbsp;<BR></TD></TR></TABLE>');
}

function printFooter() {
	document.write('<IMG SRC="http://www.school-fundraising.com/Images/Clear.gif" WIDTH="770" HEIGHT="6" HSPACE="0" VSPACE="0" BORDER="0"><BR>Maredy &#149; 12150 Flint Place &#149; Poway, CA 92064 &#149; Tel: 1-800-4-MAREDY (1-800-462-7339)<BR>&copy; 2008 All Rights Reserved<BR><BR>Member in Good Standing: Association of Fund-Raising Distributors and Suppliers<BR><A HREF="http://www.afrds.org" TARGET="_blank"><IMG SRC="http://www.school-fundraising.com/Images/AFRDSSm.gif" WIDTH="59" HEIGHT="59" HSPACE="0" VSPACE="0" BORDER="0" ALT="Association of Fund-Raising Distributors and Suppliers"></A><BR><BR>');
}



// simple CSS calendar popup
// written by Darren Munk 7/05
// ---

var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);

function showCalendar(month,year)
{
	theID = "calendar";
	document.getElementById(theID).innerHTML = calendarHTML(month,year);
	document.getElementById(theID).style.display = '';
	document.getElementById(theID).style.position = 'absolute';
	theButton = document.images['popcalendar'];

	if( NS4 )
	{
		theButton_x = theButton.x;
	}
	else
	{
		xPos = theButton.offsetLeft;
		tempEl = theButton.offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	  theButton_x = xPos;
	}

	if( NS4 )
	{
		theButton_y = theButton.y;
	}
	else
	{
		yPos = theButton.offsetTop;
		tempEl = theButton.offsetParent;
		while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
		theButton_y = yPos;
	}
	  
	document.getElementById(theID).style.left = (theButton_x + theButton.width + 3 ) +"px";
	document.getElementById(theID).style.top = (theButton_y - 2) + "px";
}

function hideCalendar()
{
	theID = "calendar";
	document.getElementById(theID).style.display = 'none';
}

function setDateField(fieldID,theValue)
{
	document.getElementById(fieldID).value = theValue;
	hideCalendar();
}

function calendarHTML(month,year)
{
	months = new Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec");
	month_days = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	
	if( month == 2 && ( year % 4 ) == 0 )
	  eom = 29;
	else
	  eom = month_days[month-1];
	
	if( month == 1 )
	{
		last_month = 12;
		last_month_year = year - 1;
	}
	else
	{
	  last_month = month - 1;
	  last_month_year = year;
	}
	
	if( month == 12 )
	{
		next_month = 1;
		next_month_year = year + 1;
	}
	else
	{
	  next_month = month + 1;
	  next_month_year = year;
	}
	
	month_date = new Date(year,month-1,1);
	start = month_date.getDay();
	ret_val = '<table><thead><tr><td colspan="7" class="month"><span style="font-size:8px;color:#AAA;padding-right:8px;" class="clickable" onclick="showCalendar('+last_month+','+last_month_year+')">'+months[last_month-1]+'</span>'+months[month-1]+' '+year;
	ret_val += '<span style="font-size:8px;color:#AAA;padding-left:8px;" class="clickable" onclick="showCalendar('+next_month+','+next_month_year+')">'+months[next_month-1]+'</span></td></tr><tr><td>s</td><td>m</td><td>t</td><td>w</td>';
	ret_val += '<td>t</td><td>f</td><td>s</td></tr></thead><tbody><tr>';
	
	today = new Date();
	today_date = (today.getMonth() + 1) + '/' + today.getDate() + '/' + today.getFullYear();
	
	for( i=1;i<=eom+start;i++ )
	{
		d = i - start;
		display_day = d;
		calendar_month = month;
		compare_date = month + '/' + d + '/' + year;
		
		if( calendar_month < 10 )
			calendar_month = '0' + calendar_month;
	  if( d < 10 )
	  	d = '0' + d;
		
		calendar_date = calendar_month + '/' + d + '/' + year;
		if( d > 0 )
		{
			ret_val += '<td class="clickable';
		
		 	if( Date.parse(compare_date) == Date.parse(today_date) )
		 	{
		 		ret_val += ' today';
		 	}
		 	else if( Date.parse(compare_date) < Date.parse(today_date) )
		 	{
		 		ret_val += ' past';
		 	}
		 	else
		 	{
		 		ret_val += ' future';
		 	}
		 	
			ret_val += '" onclick="setDateField(\'decision_date_c\',\''+ calendar_date + '\')">'+ display_day +'</td>';
		}
		else
			ret_val += "<td class='empty'>&nbsp;</td>";
		
		if( i == eom+start )
		{
			if( i % 7 > 0 )
			{
				cells_remaining = 7 - (i%7);
				for( j=0;j<cells_remaining;j++ )
					ret_val += "<td>&nbsp;</td>";
			}
		}
		else if( i % 7 == 0 )
			ret_val += "</tr><tr>";
	}
	
	ret_val += '</tr></tbody></table>';
	return ret_val;
}