//hide/show main content imagefunction toggleImage(state) {	if (state == 'visible') {		Effect.BlindUp('contentPic');		$('togglePic').update('<a href="javascript:toggleImage(\'hidden\')">Show Picture</a>');			}	if (state == 'hidden') {		Effect.BlindDown('contentPic');		$('togglePic').update('<a href="javascript:toggleImage(\'visible\')">Hide Picture</a>');	}}//swap main content imagefunction switchImage(image, type, alt) {	$('contentPic').update('<img id="contentPicImg" src="/gallery/'+type+'/'+image+'" alt="'+alt+'" />');	resizeImg();}//show/hide additional options in Projetsfunction showOptions(state) {	if (state == 'hidden') {		Event.stopObserving($('sectionMoreBut'), 'mouseover');		$('sectionMoreBut').update('&nbsp;&laquo;&nbsp;&nbsp;');		Effect.BlindDown('sectionSubMenu', { duration: 0.7 });				$('sectionMoreBut').observe('mouseover', showOptions.curry('visible'));	}	if (state == 'visible') {		Event.stopObserving($('sectionMoreBut'), 'mouseover');		$('sectionMoreBut').update('&nbsp;&raquo;&nbsp;&nbsp;');		Effect.BlindUp('sectionSubMenu', { duration: 0.7 });				$('sectionMoreBut').observe('mouseover', showOptions.curry('hidden'));	}}function addObservers() {	$('sectionMoreBut').observe('mouseover', showOptions.curry('hidden'));}//included variablesvar origWidth = 0;//document.observe("dom:loaded", resizeImg);Event.observe(window, 'load', function() {									   	if ( $('contentText').hasClassName('contentProjects')) { 		//preload additional images in Projects		var elements = $$('#thumbs img');		elements.each(function(el) {				var imgSrc = el.readAttribute('src').sub('/thumbs','');				$(el).preload(imgSrc);		});		//get orig width of image loading into projects; use as max width in resizeImg		origWidth = $('contentPicImg').getWidth();		//origWidth = 575;		resizeImg();				addObservers();			} else if ( $('contentText').hasClassName('contentAbout')) { 		//add selected beauty to About left menu		var elements = $$('.aboutOptions a');		elements.each(function(el) {			if ($(el).hasClassName('selectedAbout')) {				var aURL = el.readAttribute('href');				var string = '<a href="'+aURL+'">'+$(el).text+'</a> &rsaquo;';				$(el).update(string);			}		});	} else if ( $('contentText').hasClassName('contentHome')) { 		origWidth = $('contentPicImg').getWidth();		resizeImg();				var images = [  			"gallery/commercial/hartford4.jpg",						"gallery/libraries/Wellesley4.jpg",  			"gallery/commercial/wvit9.jpg",			"gallery/fire/Mahopac.jpg",			"gallery/parks/Gillette6.jpg",			"gallery/parks/fidelco1.jpg",			"gallery/nursing/laurels2.jpg",  						"gallery/education/Tolland5.jpg"		]; 				new Widget.Blender("contentPicImg", images);	}	});Event.observe(window, 'resize', resizeImg);//resize main project imagefunction resizeImg() {	var dimensions = $('contentText').getDimensions();	var dim = (dimensions.width - 50);	if (dim > origWidth) { dim = origWidth; }	$('contentPicImg').writeAttribute("width", dim);	//force redraw (ie6)	$('contentText').redraw();}Element.addMethods({  //forced redraw method  redraw: function(element){    element = $(element);    var n = document.createTextNode(' ');    element.appendChild(n);    (function(){n.parentNode.removeChild(n)}).defer();    return element;  },  //preload image method  preload: function(element, preloadSrc){	  var img = new Image();	  img.src = preloadSrc;	  return img;  }});