<!-- Begining
// ------------------------------------------------------------------------
// To automatically resize the iFrame so it doesn't display a scroll bar.
function resize_iframe(nameID){ 
	document.getElementById(nameID).height=100; // required for Moz, value can be "", null, or integer 
	document.getElementById(nameID).height=window.frames[nameID].document.body.scrollHeight;
}   
// To automatically resize the parent iFrame so it doesn't display a scroll bar (not used at present).
function resize_topiframe(){ 
	window.parent.resize_iframe('iframeExample');
}  
// To display the number of frames on a page (used for testing).
function count_iframes(){ 
	document.getElementById('iframeCount').innerHTML= window.frames.length;
}  
// ------------------------------------------------------------------------
// To randomly select one of the examples for display on the Examples page.

links = new Array("Data/001_Example.html",
                  "Data/002_Example.html",
                  "Data/003_Example.html",
                  "Data/004_Example.html",
                  "Data/005_Example.html",
                  "Data/006_Example.html",
                  "Data/007_Example.html",
                  "Data/008_Example.html",
                  "Data/009_Example.html",
                  "Data/010_Example.html",
                  "Data/011_Example.html",
                  "Data/012_Example.html",
                  "Data/013_Example.html",
                  "Data/014_Example.html",
                  "Data/015_Example.html",
                  "Data/016_Example.html",
                  "Data/017_Example.html",
                  "Data/018_Example.html",
                  "Data/019_Example.html",
				  "Data/020_Example.html",
				  "Data/021_Example.html",
				  "Data/022_Example.html");

function randomPageLink(nameRanID) {
	var i = Math.floor(Math.random()*links.length);
	document.getElementById(nameRanID).src= links[i];
} 
// ------------------------------------------------------------------------
// To change the title on Example page to display category title.
function switchTitle(cat) {
	if (cat == "ODBC"){ 
		document.getElementById('titleDiv').innerHTML = "Writing data to ODBC databases";
    } else if (cat == "Excel"){
		document.getElementById('titleDiv').innerHTML = "Working with Microsoft Excel";
	} else if (cat == "Linux"){
		document.getElementById('titleDiv').innerHTML = "Integrating data from Linux and QNX systems";
	} else if (cat == "Web"){
		document.getElementById('titleDiv').innerHTML = "Live data on the Web";
	} else if (cat == "Network"){
		document.getElementById('titleDiv').innerHTML = "Networking your data";	
	} else if (cat == "Scripting"){
		document.getElementById('titleDiv').innerHTML = "DataHub Scripting";
	} else if (cat == "Email"){
		document.getElementById('titleDiv').innerHTML = "Email and SMS Text Messages";
	}
}
// ------------------------------------------------------------------------
//  End -->
