/**********************************************************
	Preload Page Images - XHTML compliant version
		and
	Image Toggle
	Eric Dickman/Ray Dickman
	v1.0 - June 27, 2004

		A simple function to preload all images on
		a page for quick use later on.  A must for
		images used in "rollover" applications.

	Usage:
		Copy both the function and the function
		calls to the document's <head> (it must be
		run when the document loads).

		When preloading for image rollovers, suffix
		the image_name with "_on" for the mouseover
		image and with "_off" for the default state
		image so that they may be used with the
		img_toggle function below.

		Call:
		preload('image_name','image_path');

***********************************************************/
function preload(imgObj,imgSrc)
{
	eval(imgObj+' = new Image()')
	eval(imgObj+'.src = "'+imgSrc+'"')
}

preload('home_on','images/home_on.gif');
preload('home_off','images/home_off.gif');
preload('philosophy_on','images/philosophy_on.gif');
preload('philosophy_off','images/philosophy_off.gif');
preload('services_on','images/services_on.gif');
preload('services_off','images/services_off.gif');
preload('aboutus_on','images/aboutus_on.gif');
preload('aboutus_off','images/aboutus_off.gif');
preload('portfolio_on','images/portfolio_on.gif');
preload('portfolio_off','images/portfolio_off.gif');
preload('contact_on','images/contact_on.gif');
preload('contact_off','images/contact_off.gif');

preload('next_on','images/next_on.gif');
preload('next_off','images/next_off.gif');
preload('up_on','images/up_on.gif');
preload('up_off','images/arrow_up.gif');

/******************************************
	Corresponding image toggle function
	for image rollovers.
	Very clean and simple method and it's
	easy to figure out the meaning when
	you see the	function call.

	Usage:
		img_toggle('news', 'on');
		img_toggle('news', 'off');
*******************************************/
function img_toggle(imgId, mode)
{
	if (document.getElementById) {
		document.getElementById(imgId).src = eval(imgId + "_" + mode + ".src");
	} else if (document.all) {
		document.all[imgId].src = eval(imgId + "_" + mode + ".src");
	}
}

/*function displayPrintLink() {
	document.write("<a href=\"#\" onclick=\"setActiveStyleSheet(\'print sheet\'); return false;\">PRINT FRIENDLY</a>");
}*/
/* Print function that puts up an alert box if you are using
IE 5.x for Macintosh - which doesn't support window.print()*/
function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature. Please use: File > Print...");
}

/*function setActiveStyleSheet(title) {
	if (window.print) {
	  var i, a, main;
	  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
	      a.disabled = true;
	      if(a.getAttribute("title") == title) a.disabled = false;
	    }
	  }
	}
	else {
      alert("Sorry, your browser doesn't support this feature. Please use: File > Print...");
	}
}*/
