﻿// JScript File
function Tabs(name, id, end, imgOff, imgOn){
//hide all tab contents and change all tabs to blue- pass start, pass end 
    Tabshide(1, end, name, imgOff);
//show the tab that was clicked on
    Tabshow(name + id, imgOn);
}
function Tabshow(idName, imgOn)// id of element on rollover
		{
		// Get the td element-pass name 
        var myTD = document.getElementById('td' + idName);
		if(myTD){
   	   	    // Change backgound image to on image
		    myTD.style.backgroundImage="url(" + imgOn + ")";
		}
		// Get the a element-pass name 
        var myA = document.getElementById('a' + idName);
		if(myA){
   	   	    // Set a element color to clicked on gray
		    myA.style.color='#222222';
		}
		// Get the child <div> element-pass name for section B
		var myel = document.getElementById('div' + idName);
		if (myel){
			// Expand child <div> element
		    myel.style.display = 'block';
		}
		// Get the child <div> element-pass name for section C (downloads)
		var myel = document.getElementById('divDL' + idName);
		if (myel){
			// Expand child <div> element
		    myel.style.display = 'block';
		}
	}

function Tabshide(start, end, name, imgOff)//hide all solution content
{
	for (var i= start; i < end+1; i++){
		var idName = name + i
		//alert(idName);
		// Get the td element-pass name 
        var myTD = document.getElementById('td' + idName);
		if(myTD){
   	   	    // Reset backgound image from td element
   	   	    myTD.style.backgroundImage="url(" + imgOff + ")";
		}
		// Get the a element-pass name 
        var myA = document.getElementById('a' + idName);
		if(myA){
   	   	    // Set a element color back to blue
		    myA.style.color='#376D91';
		}
		// Get the child <div> element-pass name for section B
		var myel = document.getElementById('div' + idName);
		if (myel){
			// Collapse child <div> elements
		    myel.style.display = 'none';
		}
		// Get the child <div> element-pass name for section C (downloads)
		var myel = document.getElementById('divDL' + idName);
		if (myel){
			// Collapse child <div> elements
		    myel.style.display = 'none';
		}
		
	}
}

