if (document.images)
{
	var products_services0 = new Image();
	products_services0.src = "http://www.redballoxygen.com/images/imgTabProductsServicesOff.gif";
	var products_services1 = new Image();
	products_services1.src = "http://www.redballoxygen.com/images/imgTabProductsServicesOn.gif";
	var capabilities0 = new Image();
	capabilities0.src = "http://www.redballoxygen.com/images/imgTabCapabilitiesOff.gif";
	var capabilities1 = new Image();
	capabilities1.src = "http://www.redballoxygen.com/images/imgTabCapabilitiesOn.gif";
	var news0 = new Image();
	news0.src = "http://www.redballoxygen.com/images/imgTabNewsOff.gif";
	var news1 = new Image();
	news1.src = "http://www.redballoxygen.com/images/imgTabNewsOn.gif";
	var links0 = new Image();
	links0.src = "http://www.redballoxygen.com/images/imgTabLinksOff.gif";
	var links1 = new Image();
	links1.src = "http://www.redballoxygen.com/images/imgTabLinksOn.gif";
	var bottom0 = new Image();
	bottom0.src = "http://www.redballoxygen.com/images/imgHeaderBottom.gif";
	var bottom1 = new Image();
	bottom1.src = "http://www.redballoxygen.com/images/imgHeaderBottomOn.gif";
}

function isEmail(string) 
{
	if (!string)
	{
		return false;
	}
	
	var iChars = "*|,\":<>[]{}`\';()&$#%";
	
	for (var i = 0; i < string.length; i++) 
	{
		if (iChars.indexOf(string.charAt(i)) != -1)
		{
			return false;
		}
	}
	return true;
}     


function isReady() 
{
    if (document.frmContact.txtName.value == "")
    {
    		alert('Please enter your name');
    		document.frmContact.txtName.focus();
        	return false;
    }
    else if (isEmail(document.frmContact.txtEmail.value) == false) 
    {
        	alert("Please enter a valid email address.");
        	document.frmContact.txtEmail.focus();
        	return false;
    }
    else if (document.frmContact.txtMessage.value == "")
    {
    		alert('Please enter a message');
    		document.frmContact.txtMessage.focus();
        	return false;
    }
    
    return true;
}

function rollOut(imgName) 
{
    if (document.images) 
    {
        document[imgName].src = eval(imgName+"0.src");
    }
}

function rollIn(imgName)
{
    if (document.images)
    {
        document[imgName].src = eval(imgName+"1.src");
    }
}


function returnElement(sContent)
{
	var objLocation;
	var sElement;
	
	if(document.getElementById)
	{
		sElement = "document.getElementById('" + sContent + "')";
	}
	else if(document.all)
	{
		sElement = "document.all['" + sContent + "']";
	}
	
	objLocation = eval(sElement);
	return objLocation;
}



// Hides form elements to prevent from showing through
function prepareForm(sVisibilityToggle) 
{
	for(var i=0; i < document.forms.length; i++)
	{
		for(var j=0; j < document.forms[i].elements.length; j++) 
		{
			if (document.forms[i].elements[j].type.indexOf("select") != -1)
			{
				document.forms[i].elements[j].style.visibility = sVisibilityToggle;
			}
		}
	}
}

// Displays the submenu 
function displaySubnav(sSubnav)
{
	rollIn(sSubnav);
	
	if (sSubnav == "products_services")
	{
		rollIn('bottom');
	}
	
	var sSubnavName = sSubnav + "Menu";
	var objLocation = returnElement(sSubnavName);	
	if (objLocation)
	{
		objLocation.style.visibility = 'visible';
	}
	
	prepareForm('hidden');
}

// Hides the submenu
function hideSubnav(sSubnav, bRemoveHighlight)
{
	if (bRemoveHighlight)
	{
		rollOut(sSubnav);
		
		if (sSubnav == "products_services")
		{
			rollOut('bottom');
		}
	}
	
	var sNav = returnElement(sSubnav+"Menu");
	if (sNav)
	{
		sNav.style.visibility = 'hidden';
	}
	
	prepareForm('visible');
	
}

var arrSubnav = new Array();

arrSubnav[0] = new Array("products_services",
210, // pixels from left
240,	// width of menu
"Medical Gases",
"http://www.redballoxygen.com/products_services_medical_gases.php",
"Specialty Gases",
"http://www.redballoxygen.com/products_services_specialty_gases.php",
"Industrial Gases",
"http://www.redballoxygen.com/products_services_industrial_gases.php",
"Bulk Gases",
"http://www.redballoxygen.com/products_services_bulk_gases.php",
"Welding & Industrial Supplies",
"http://www.redballoxygen.com/products_services_supplies.php",
"Propane",
"http://www.redballoxygen.com/products_services_propane.php",
"Welding Productivity Enhancement Program",
"http://www.redballoxygen.com/products_services_welding_productivity.php",
"Fire Extinguishers",
"http://www.redballoxygen.com/products_services_fire_extinguishers.php"
);

function loadSubnav(sHexBGColor, sHexOverColor, sHexFontColor, sHexFontOverColor, sHexLineColor, sThisSection)
{
	if((document.all) || (document.getElementById))
	{
		var this_arrSubnav = new Array();
		this_arrSubnav = arrSubnav;
		var sSubnav = "";
		
		for (j = 0; j < this_arrSubnav.length; j++)
		{			
			var sCurrent = this_arrSubnav[j][0];
			var arrCurrent = this_arrSubnav[j];
			var bInArray = false;
			
			for (var k = 0; k < arrCurrent.length; k++)
			{
				if (sThisSection == arrCurrent[k])
				{
					bInArray = true;
				}			
			}
			
			if (bInArray)
			{
				sSubnav += "<div id=\"" + sCurrent + "Menu\" style=\"z-index:999;position: absolute; left: " + this_arrSubnav[j][1] + "; width: " + this_arrSubnav[j][2] + ";  visibility: hidden\" onmouseover=\"displaySubnav('" + sCurrent + "');\" onmouseout=\"hideSubnav('" + sCurrent + "', false);\">";
			}
			else
			{
				sSubnav += "<div id=\"" + sCurrent + "Menu\" style=\"z-index:999;position: absolute; left: " + this_arrSubnav[j][1] + "; width: " + this_arrSubnav[j][2] + ";  visibility: hidden\" onmouseover=\"displaySubnav('" + sCurrent + "');\" onmouseout=\"hideSubnav('" + sCurrent + "', true);\">";
			}
			
			
			sSubnav += "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"" + this_arrSubnav[j][2] + "\">";
			
			for (i=3; i < this_arrSubnav[j].length-1; i=i+2)
			{
				sSubnav += "<tr>";
				sSubnav += "<td width=\"1\" bgcolor=\"" + sHexLineColor + "\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"22\"></td>";
				sSubnav += "<td bgcolor=\"" + sHexBGColor + "\" class=\"subNav\" onClick=\"document.location.href='" + this_arrSubnav[j][i+1] + "'\" onmouseover=\"this.bgColor='" + sHexOverColor + "';this.style.color='" + sHexFontOverColor+ "';\" onmouseout=\"this.bgColor='" + sHexBGColor + "';this.style.color='" + sHexFontColor + "'\" style=\"color: " + sHexFontColor + "\"><div style=\"padding-left:7px;\">" + this_arrSubnav[j][i] + "</a></div></td>";
				sSubnav += "<td width=\"1\" bgcolor=\"" + sHexLineColor + "\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"22\"></td>";
				sSubnav += "</tr>";
				sSubnav += "<tr>";
				sSubnav += "<td colspan=\"3\" bgcolor=\"" + sHexLineColor + "\" height=\"1\"><img src=\"images\imgSpacer.gif\" width=\"1\" height=\"1\"></td>";
				sSubnav += "</tr>";
			}
			
			sSubnav += "</table>";
			sSubnav += "</div>";
		}
		document.write(sSubnav);
	}
}

function showContent(sContent)
{
	var objLocation = returnElement(sContent);	
	if (objLocation)
	{
		objLocation.style.visibility = 'visible';
	}
}

function hideContent(sContent)
{
	var objLocation = returnElement(sContent);	
	if (objLocation)
	{
		objLocation.style.visibility = 'hidden';
	}
}

function showLocation(sContent)
{
	hideAllLocations();
	var objLocation = returnElement(sContent);	
	if (objLocation)
	{
		objLocation.style.display = 'block';
	}
}

function hideLocation(sContent)
{
	var objLocation = returnElement(sContent);	
	if (objLocation)
	{
		objLocation.style.display = 'none';
	}
}

function hideAllLocations(){
hideLocation('mt_pleasant');	
hideLocation('longview');			
hideLocation('ft_worth');			
hideLocation('dallas');				
hideLocation('tyler');				
hideLocation('buffalo');			
hideLocation('fayetteville');	
hideLocation('mena');					
hideLocation('benton');				
hideLocation('arkadelphia');	
hideLocation('texarkana');		
hideLocation('el_dorado');		
hideLocation('minden');				
hideLocation('monroe');				
hideLocation('shreveport');		
hideLocation('natchitoches');	
hideLocation('alexandria');		
hideLocation('leesville');		
hideLocation('carthage');			
hideLocation('lufkin');				
hideLocation('houston');	
hideLocation('springdale');	
}
