﻿// JScript File
/*
	Tabs functions by Joshua Lieberman
*/

function hideLayer(id){ 
//alert("in hide layer");
	if (document.getElementById){ obj = document.getElementById(id); }
	obj.style.display = "none"; 
}
function showLayer(id){ 
//alert("in show layer");
	if (document.getElementById){ obj = document.getElementById(id); }
	obj.style.display = "block"; 
}
function toggleLayer( whichLayer )
{
//alert("in toggle layer");
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function toggleAllOtherLayersOff(whichLayer,n)
{
//alert("in toggle all other layers off");
	for (i=1;i<=n;i++)
	{
		if (i!=whichLayer) { // Do this too all other tabs then the clicked on tab
			var divBlock="commentForm"+i;
			hideLayer(divBlock); // hide it's comment form
			var tabOnBlock="linkForm"+i+"on";
			hideLayer(tabOnBlock); // hide it's on state tab
			var tabOffBlock="linkForm"+i+"off";
			showLayer(tabOffBlock); // show it's off state tab
		}
	}
}
function tabs(t,n){
	toggleAllOtherLayersOff(t,n);
	var commentBlock="commentForm"+t;
	toggleLayer(commentBlock);
	var tabBlockOn="linkForm"+t+"on";
	var tabBlockOff="linkForm"+t+"off";
	
    //alert("before show layer call");
	showLayer(tabBlockOn);
	
    //alert("before hide layer call");
	hideLayer(tabBlockOff);
	//alert("after hide layer call");
} 

// For the Contact Us - Locations




