	  var currentpane = "";
	  var currentupimg = "";
	  var recongalleriesLoaded = false;
	  var warehousegalleriesLoaded = false;
	  var mainpageLoaded = false;

	  function changePane(panename) {
		  //alert(panename);
		  if (panename != currentpane)
		  {			  
			  $(panename).show("slide", {direction: "left"}, 750);
			  $(currentpane).hide();  
			  currentpane = panename;
			  var btn = panename.replace("#", "").replace("pane", "btn");
			  setupimg(btn);
		  }		  		  
	  }

	  function resetbuttons() {
		  $("#mainbtn").attr("src", "images/main_up.jpg");
		  $("#reconbtn").attr("src", "images/recon_up.jpg");
		  $("#warebtn").attr("src", "images/ware_up.jpg");
		  $("#contactbtn").attr("src", "images/contact_up.jpg");
		  $("#inventorybtn").attr("src", "images/inventory_up.jpg");
	  }

	  function setupimg(button) {
		  if (button == "openhousebtn")
		  {
			  button = "mainbtn";
		  }
		  if (currentupimg != button)
		  {
		      resetbuttons();
			  $("#" + button).attr("src", "images/" + button.replace("btn", "") + "_over.jpg");			  
		  }
		  currentupimg = button;
	  }

	  function initMap() {
		   $("#map").jmap('init', {'mapType': 'map', "mapCenter":[42.817348, -85.985119],'mapShowjMapsIcon': false,'mapEnableScaleControl': false});
		   $("#map").jmap('AddMarker', {
			  'pointLatLng': [42.817348, -85.985119],
			  'pointHTML': '<span style="font-size: 12px; line-height: 14px;">EX-FACTORY Warehouse &amp; Showroom<br />8191 Logistics Dr.<br />Zeeland, MI 49464<br />Ph: (616) 772-1520<br /><br /><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=8191+Logistics+Dr.,+Zeeland,+MI&sll=35.185055,-80.68413&sspn=0.00954,0.018497&ie=UTF8&ll=42.817881,-85.983896&spn=0.008562,0.018497&z=16&iwloc=A" target="_blank">Click here for Larger Map</a></span>',
			  'pointIsRemovable':false,
			  'pointIsDraggable':false
		   });
	  }

	  function initReconGalleries() {
		  $("#before1 a").lightBox({fixedNavigation:true});
		  $("#after1 a").lightBox({fixedNavigation:true});
		  $("#before2 a").lightBox({fixedNavigation:true});
		  $("#after2 a").lightBox({fixedNavigation:true});
		  $("#before3 a").lightBox({fixedNavigation:true});
		  $("#after3 a").lightBox({fixedNavigation:true});
		  $("#before4 a").lightBox({fixedNavigation:true});
		  $("#after4 a").lightBox({fixedNavigation:true});
		  $("#before5 a").lightBox({fixedNavigation:true});
		  $("#after5 a").lightBox({fixedNavigation:true});
		  recongalleriesLoaded = true;
	  }

	  function initMain() {
//		  $("a#openhouse").click(function() { changePane('#openhousepane'); });
		  mainpageLoaded = true;
	  }

	  $(document).ready(function() {
		  if (location.hash == "")
		  {
			  $("#mainpane").show();
			  currentpane = "#mainpane";
			  currentupimg = "main";			  
		  }
		  else 
		  {
			  $(location.hash + "pane").show();
			  currentpane = location.hash + "pane";
			  currentupimg = location.hash.replace("#", "");
		  }

	  	  var btn = currentpane.replace("#", "").replace("pane", "btn");

		  setupimg(btn);	
		  
		  if (currentpane == "#mainpane")
		  {
			  if (!mainpageLoaded)
			  {
				  initMain();
			  }
		  }

		  if (currentpane == "#reconpane")
		  {
			  if (!recongalleriesLoaded)
			  {
				  initReconGalleries();
			  }
		  }

		  if (currentpane == "#warepane")
		  {
			  if (!warehousegalleriesLoaded)
			  {
				  $("#waregallery a").lightBox({fixedNavigation:true});
				  warehousegalleriesLoaded = true;
			  }
		  }

		  if (currentpane == "#contactpane")
		  {
			 initMap();
		  }

		  $(document).pngFix();

		  $("#menu a.mainlink").click(function() {
			  changePane('#mainpane');
			  //return false;
		  });

		  $("#menu a.reconlink").click(function() {
			  changePane('#reconpane');			  
			  if (!recongalleriesLoaded)
			  {
 				  initReconGalleries();
			  }
			  //return false;
		  });

		  $("#menu a.warelink").click(function() {
			  changePane('#warepane');
			  if (!warehousegalleriesLoaded)
			  {
				  $("#waregallery a").lightBox({fixedNavigation:true});
				  warehousegalleriesLoaded = true;
			  }
			  //return false;
		  });

		  $("#menu a.contactlink").click(function() {
			  changePane('#contactpane');
			  initMap();
		  });	
	  });