var date = new Date();

var monthsFull = new Array();
monthsFull[0] = "January";
monthsFull[1] = "February";
monthsFull[2] = "March";
monthsFull[3] = "April";
monthsFull[4] = "May";
monthsFull[5] = "June";
monthsFull[6] = "July";
monthsFull[7] = "August";
monthsFull[8] = "September";
monthsFull[9] = "October";
monthsFull[10] = "November";
monthsFull[11] = "December";

var TheYear = date.getFullYear();
var TheDate = date.getDate();
var TheMonthFull = monthsFull[date.getMonth()];
var DateLine = TheMonthFull + " " + TheDate + ", " + TheYear;

function open_howto() {
	window.open('downloadHow.html','DownloadHow','width=450,height=215,scrollbars=0');
}

function open_survey() {
	window.open('survey/index.html','Survey','width=450,height=400,scrollbars=0');
}

function progressTo(label) {
	var i = 0;
	while(myLoc = eval("document.getElementById('q"+i+"');")) {
		if(i == label) {
			myLoc.style.display = '';
		}
		else {
			myLoc.style.display = 'none';
		}
		i++;
	}
}

function progressBack(label) {
	var i = 0;
	while(myLoc = eval("document.getElementById('q"+i+"');")) {
		if(i == label) {
			myLoc.style.display = '';
		}
		else {
			myLoc.style.display = 'none';
		}
		i++;
	}
}

function showHide(id) {
	var myID = eval("document.getElementById('"+id+"');");
		if(myID.style.display == '') {
		 myID.style.display = 'none';
		}
		else {
		 myID.style.display = '';
		}
}

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
window.attachEvent("onload", correctPNG);

//IMAGE FLIP
CMC1 = new Image(177,98)
CMC1.src = "images/newsletterCMC.jpg"
CMC2 = new Image(177,98)
CMC2.src = "images/newsletterCMCred.jpg"

function CMCOut() {
document.CMCbutton.src = CMC2.src; return true;
}
function CMCBack() {
document.CMCbutton.src = CMC1.src; return true;
}

MFSA1 = new Image(168,98)
MFSA1.src = "images/newsletterMFSA.jpg"
MFSA2 = new Image(168,98)
MFSA2.src = "images/newsletterMFSAred.jpg"

function MFSAOut() {
document.MFSAbutton.src = MFSA2.src; return true;
}
function MFSABack() {
document.MFSAbutton.src = MFSA1.src; return true;
}
