//
// General JavaScript Utilities
//


// This function writes the HTML for the standard footer.

function stdFooter() {
	var d = new Date(); 
	var y = d.getYear();
	if (y < 2000) y += 1900;
	document.write('<p class="footertext">All contents copyright &copy; ' + y +  ' Alanco Agricultural Ltd.</p>');
}
// This function writes the HTML for the standard header.

function stdHeader (hdrText, fillHeight, noImage) {
    var imgloc = (location.hostname == 'localhost') ? '/newspray/img/' : '/newspray/img/';
    var baseloc = (location.hostname == 'localhost') ? '/newspray/' : '/newspray/';
	if (! fillHeight) {
		fillHeight = 282;
	}
    document.write('<img id="menuImgPlaceholder" border="0" src="img/header.jpg">\n');
	document.write('<div class="pagetitle" id="pagetitle">' + hdrText + '</div>');

}


function filenameOnly (URL) {
    var lURL = URL;
	var i = lURL.lastIndexOf('/');
	if (i != -1) {
	   lURL = lURL.substr(i + 1);
	}
	return lURL
}

function valDate(DateToCheck){
	var arrDate = DateToCheck.split("/");
	var DAY = arrDate[0];
	var MONTH = arrDate[1];
	var YEAR = arrDate[2];
	var strDate = MONTH + "/" + DAY + "/" + YEAR;
	var testDate=new Date(strDate);
	if(testDate.getMonth()+1==MONTH){
		return true;
	} 
	else{
		return false;
	}
}

