function galleryWindow(url,width,height)
{
  window.open(url,"","alwaysRaised,dependent,width="+(width+50)+",height="+(height+50));
}

function increaseFontSizes()
  {
    changeFontSize("body",1.2,"n");
  }

function decreaseFontSizes()
  {
    changeFontSize("body",0.9,"n");
}

function resetFontSizes()
  {
    history.go();
  }

function changeFontSize(element,multiplier,debug)
{
  var fontSize=document.getElementById(element).style.fontSize;
  //Strip off the units (em)
  fontSize=fontSize.substring(0,fontSize.length-2);
  fontSize=multiplier*fontSize;
  document.getElementById(element).style.fontSize=fontSize+"em";

  //Store the current font size as a cookie so we can get it on the next page
  var exp = new Date();
  var oneYearFromNow = exp.getTime() + (365*24*60*60*1000);
  exp.setTime(oneYearFromNow);
  var cookieString="FontSize"+element+"="+fontSize+"; path=/; expires=" + exp.toGMTString();
  document.cookie=cookieString;

  if (debug=="y")
    {
      alert (document.getElementById('tester').style.fontSize);
    }
}

function setFontSizes() {
  //We need to get the font sizes inline from the stylesheet before we can edit them
  if (isIE()) {
    var ssRules=document.styleSheets[0].rules; //the main style sheet
  } else {
    var ssRules=document.styleSheets[0].cssRules;
  }

  //Get the body fontsize value
  for (i=0;i<ssRules.length;i++) {
      if (ssRules[i].selectorText.toLowerCase()=='body') {
	if (isIE()) {
	  var rule=ssRules[i].style.cssText.toLowerCase();
          var rules=rule.split(';');
          for (j=0;j<rules.length;j++) {
	      if (rules[j].match(/font-size/gi)) {
		  var fs=rules[j].split(':')[1];
              }
          }  
        } else { 
          var fs=(ssRules[i].style.getPropertyValue('font-size'));
        }
      break;
    }
  }

  //Set the fontsize explicitly
  document.getElementById('body').style.fontSize=fs;
}

function isIE() {
  //Return true if it is IE
    if (window.ActiveXObject)   {return true;}
    return false;
}
