


function setHref (xId, xText, xPre, xDom, xSub) {
/* Define email addresses at runtime to prevent harvesting by spam spiders */
/* xId element to modify, xText, replacement text, xPre email prefix, xDom email suffix, xSub email subject line */
	var sHref = 'm' + 'ailto:' + (xPre || "carol") + '@' + (xDom || 'carol-carter.com') +
		(xSub ? '?subject=' + escape(xSub) : '');
	var oObj = document.getElementById(xId);
	oObj.href = sHref;
	return
}


function setImgSize(xId, iHaspect, iWaspect) {
/* Set's the image size to fill the page.  Used for Carol's Gallery Photo */
	var oObj = document.getElementById(xId);
//	var iWpx = self.innerWidth;
//	var iHpx = self.innerHeight;
//	var iWpx = document.body.offsetWidth;
//	var iHpx = document.body.offsetHeight;
	var iWpx = document.body.clientWidth; // seems to work in IE and Firefox...
	var iHpx = document.body.clientHeight;
	var iImgAspect = (1.0 * iHaspect / iWaspect); /* Aspect Ratio of Image */
	var iWinAspect = (1.0 * iHpx / iWpx); /* Aspect Ratio of window */
	if(iImgAspect >= iWinAspect) { /* Image is taller, so window height is constraining factor */
		oObj.height = iHpx;
		oObj.width = Math.floor(iHpx * 1.0 / iImgAspect);
	} else {
		oObj.width = iWpx;
		oObj.height = Math.floor(iWpx * 1.0 * iImgAspect);
	};
}

function openPage (xId) {
	/* Opens the specified page full screen. */
	var oObj = document.getElementById(xId);
	var sUrl = oObj.href;
	var sParameters = 'fullscreen,resizable=1,location=0,toolbar=0,status=0,menubar=0';
	try {
		var w = window.innerWidth || document.body.clientWidth;
		var h  = window.innerHeight || document.body.clientHeight;
		/* sParameters += ',width=' + w.toString() + ',height=' + h.toString(); */
	} catch (e) {
	};
	window.open(sUrl,'name', sParameters);
}

$(document).ready(
	function() {
		$(".thisyear").text( (new Date()).getFullYear() );
	}
);