function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* Dreamweaver std code above - mine below */

var staffNames = ['christie', 'leny', 'dana', 'jody', 'stephanie','jennifer'];
function isStaff(id) {
  for (var i = 0; i < staffNames.length; i++) {
    if (id == staffNames[i]) return true;
  }
  return false;
}

function loadStaffDetails(element) {
  if (element.id != null && element.id != undefined && isStaff(element.id)) {
    var staffName = element.id;
		if (staffName == 'christie' || staffName == 'jennifer') {
			document.getElementById('staff-name').style.marginTop = '0px';
		} else {
			document.getElementById('staff-name').style.marginTop = '40px';
		}
    document.getElementById('selectedStaff').innerHTML = element.id;
    highlightPhoto(staffName);
    document.getElementById('staff-name').innerHTML = staffName.toUpperCase();
    document.getElementById('staff-details').innerHTML = getStaffText(staffName);
  }
}

function highlightPhoto(staffName) {
  for (var i = 0; i < staffNames.length; i++) {
    if (staffName == staffNames[i]) {
      // selected staff member gets highlighted photo
      document.getElementById(staffName).style.backgroundImage = 'url("images/' + staffName +'_on.jpg")';
    } else {
      // everyone else gets a low key version
      document.getElementById(staffNames[i]).style.backgroundImage = 'url("images/' + staffNames[i] +'.jpg")';
    }
  }
}

function getStaffText(staffName) {
	var details;
	if (staffName == 'christie') {
		details = '<p>Christie is happiest making other people look their best.</p>' +
							'<p>She is also the proud owner of Vanity Spa and has gathered the<br>' +
							'finest girls around her. She is dedicated to creating a personalized,<br>' +
							'friendly and down-to-earth spa environment for upscale spa services.</p>' +
							'<p>You will find Christie in the front of the store, warmly welcoming<br>' +
							'new guests and valued regulars, recommending suitable products for<br>' +
							'your regime, answering beauty questions, and providing the best<br>' +
							'brow shaping service in Calgary.</p>';
	} else if (staffName == 'leny') {
		details = '<p>Leny has a loyal following of clientele who love her<br>' +
							'friendly charm and excellence in aesthetics. Leny has helped<br>' +
							'people to look and feel their best for many years.<br>' +
							'It brings her great joy to provide first class care and honed aesthetic<br>' +
							'services. And she does one mean french!</p>';
	} else if (staffName == 'dana') {
		details = '<p>Dana&#39;s career blossomed in some of Alberta&#39;s most prestigious spas.<br>' +
							'Her area of expertise is in facials and skin care.<br>' +
							'Have Dana design your skin care regime with her vast knowledge<br>' +
							'of products. Her mastery of aesthetics and genuine concern for your<br>' +
							'personal regime underlines every service she provides.</p>';
	} else if (staffName == 'jody') {
		details = '<p>Jody is the ultimate beauty professional, after 15 years as a make-up<br>' +
              'artist she has discovered an amazing new way to make women look<br>' +
              'beautiful without having her visit their homes each morning (a common<br>' +
              'request). Jody is thrilled to offer her semi-permanent make-up<br>' +
              'at Vanity, come see her for a consultation.</p>';
  } else if (staffName == 'stephanie') {
    details = '<p>Stephanie combines a calming presence with great technical skill.<br>' +
              'She skillfully creates a relaxed, spa experience while she<br>' +
              'tends to your beauty needs. She is renowned for her ability to<br>' +
              'induce deep relaxation during Vanity&#39;s body facial.<br>' +
              'Let her healing hands take you away.</p>';
  } else if (staffName == 'jennifer') {
    details = '<p>Jennifer offers over 14 years of experience in the spa, health and<br>' +
              'wellness industry. She is the founder of the new service exclusive<br>' +
              'to Vanity; The Fassage, a facial and body massage combined to<br>' +
              'rejuvenate every inch of your body.</p>' +
              '<p>Jennifer also offers reflexology at Vanity, which can be added on to<br>' +
              'any service. Her speciality is relaxing facials which her gentle<br>' +
              'caring persona make the ultimate indulgence.</p>'
        ;
	}
	return details;
}

// cross browser implementation of Hover functionality - can be used by IE via the htc file
function hover(element) {
  if (element.id != null && element.id != undefined && isStaff(element.id)) {
    element.style.backgroundImage = 'url(images/' + element.id + '_ro.jpg)';
  }
}
function out(element) {
  if (element.id != null && element.id != undefined && isStaff(element.id)) {
    if (document.getElementById('selectedStaff').innerHTML == element.id) {
      element.style.backgroundImage = 'url(images/' + element.id + '_on.jpg)';
    } else {
      element.style.backgroundImage = 'url(images/' + element.id + '.jpg)';
    }
  }
}