<!--
var pic = [];
addLoadListener(external);
addLoadListener(photos);
addLoadListener(emailLink);
function addLoadListener(fn) {
  if (typeof window.addEventListener != 'undefined') {
    window.addEventListener('load', fn, false);
  } else if (typeof document.addEventListener != 'undefined') {
    document.addEventListener('load', fn, false);
  } else if (typeof window.attachEvent != 'undefined') {
    window.attachEvent('onload', fn);
  } else {
    var oldfn = window.onload;
    if (typeof window.onload != 'function') {
      window.onload = fn;
    } else {
      window.onload = function() {
        oldfn();
        fn();
      };
    }
  }
}
function $(strid) {
	if(document.getElementById(strid)) return document.getElementById(strid);
}
function external() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
			anchor.title = "This will open a new window.";
		}
  }
}
function photos() {
	if(document.body.id == 'photos') {
		x = document.getElementById('col').getElementsByTagName('a');
		for(var i = 0; i < x.length; i++) {
			x[i].rel = i;
			x[i].onclick = swapImg;
			pic[i] = new Image();
			pic[i].src = x[i].href.replace('photos.html?', 'images/');
		}
	}
}
function swapImg() {
	var y = document.getElementById('photo');
	var j = this.rel;
	var this_img = pic[j].src;
	var this_cap = this.getElementsByTagName('img')[0].alt;
	y.innerHTML = '<img src="' + this_img + '" alt="" height="' + pic[j].height + '" width="' + pic[j].width + '" />\r\t<p>' + this_cap + '</p>';
	return false;
}
function chooseImg() {
	j = this.rel;
	width = pic[j].width + 20;
	height = pic[j].height + 20;
	params = 'width='+ width;
	params += ', height='+ height;
	params += ', menubar=no, toolbar=no, resizable=no';
	newwin = window.open(this.href, this.title, params);
 	if (window.focus) newwin.focus();
 	return false;
}
function emailLink() {
	var x = document.getElementsByTagName('span');
	var j = 0;
	for(var i = 0; i < x.length; i++) {
		if(x[i].className == 'email') {
			var isSimone = x[i].innerHTML.match('Simone');
			var isDavid = x[i].innerHTML.match('Chef');
			var email = isSimone ? 'simone' + '@' + 'simonesez.com' : isDavid ? 'damgoodsweet' + '@' + 'aol.com' : x[i].innerHTML.replace(" (AT) ", "@");			 
			if(isSimone) var simone = x[i].innerHTML.split("").reverse().join("");
			if(isDavid) var david = x[i].innerHTML.split("").reverse().join("");
			if(j == 1 && simone) simone = simone.split(" ").reverse().join(" ");
			//if(j == 1 && david) david = david.split(" ").reverse().join(" ");
			x[i].innerHTML = isSimone ? '<a href="mailto:' + email + '">' + simone + '</a>' : isDavid ? '<a href="mailto:' + email + '">' + david + '</a>' : '<a href="mailto:' + email + '">' + email.split("").reverse().join("") + '</a>';
			j++;
		}
	}
}
//-->