﻿// JScript File

//Create an array 
var allPageTags = new Array(); 

/*----Funtion to hide elements by class within a tag-----*/

function hideByClass(theClass,theTag) {  
//Populate the array with all the page tags  
var allPageTags=document.getElementsByTagName(theTag);  
//Cycle through the tags using a for loop  
	for (i=0; i<allPageTags.length; i++) {  
//Pick out the tags with our class name  
		if (allPageTags[i].className==theClass) {  
//Manipulate this in whatever way you want  
			allPageTags[i].style.display='none';  
			}  
		} 
	} 

/*----Funtion to show elements by class within a tag-----*/	

	function showByClass(theClass,theTag) {  
//Populate the array with all the page tags  
var allPageTags=document.getElementsByTagName(theTag);  
//Cycle through the tags using a for loop  
	for (i=0; i<allPageTags.length; i++) {  
//Pick out the tags with our class name  
		if (allPageTags[i].className==theClass) {  
//Manipulate this in whatever way you want  
			allPageTags[i].style.display='block';  
			}  
		} 
	} 



function toggleVisibility(id, state) {
 
 var WC3type, NNtype, IEtype;
 
 switch(state) {
 case "show":
  WC3type="block";
  NNtype="block";
  IEtype="block";
  break;
 case "hide":
  WC3type="none";
  NNtype="none";
  IEtype="none";
  break;
 }
 
 if (document.getElementById) {
  if (document.getElementById(id)) {
   // make sure layer exists before attempting to change style
   eval("document.getElementById(id).style.display = \"" + WC3type + "\"");
  }
 } else {
  if (document.layers) {
   // make sure layer exists
   if (document.layers[id]) {
    document.layers[id].visibility = NNtype;
   }
  } else {
   if (document.all) {
    // make sure layer exists
    if (eval("document.all." + id)) {
     eval("document.all." + id + ".style.display = \"" + IEtype + "\"");
    }
   }
  }
 }
}

function closeOpenHotDogs(classToHide,toShow,tag){
	
	hideByClass(classToHide,tag);
	toggleVisibility(toShow,'show');

}