//faq.js
//written by L.D. Buta on 5/26/2005

function showFAQ() {
		 var count = 1;
		 var HTMLstr = "";
		 HTMLstr += '<div id="faq">';
		 HTMLstr += '<table class="faqtable" border = "0" cellpadding = "0" cellspacing = "0" width="100%">';
		 HTMLstr += '<tr><td class="nfsfaq" width="8%">FAQ</td><td class="nfs">NFS Coin Machines</td></tr>';
		for (m = 0; m < NFS_FAQ.length; m++) {
		if (count != NFS_FAQ.length) {
		HTMLstr += '<tr><td id="link_' +m+ '" class="nav" colspan="2"><li><a href="#" class="faqlink" onclick="toggleVis(' +m+ ');">' +NFS_FAQ[m][0]+ '</a></li></td></tr>';
		}
		else {
		HTMLstr += '<tr><td id="link_' +m+ '" class="nav" colspan="2"><li><a href="#" class="faqlink" onclick="toggleVis(' +m+ ');">' +NFS_FAQ[m][0]+ '</a></li></td></tr>';
		} count++;
		}
		HTMLstr += '</table></div>';
		HTMLstr +='<div id="faqdetails" style="visibility: hidden; overflow: auto;"></div>';
		document.write(HTMLstr);
		document.close();
		}
		
        var activeRow;
		function toggleVis (row,obj) {
		var content = NFS_FAQ[row][1];
		var el = document.getElementById('faqdetails').style;
		if (el.visibility == 'hidden') {
		activeRow = row;
			el.visibility = 'visible';
			document.getElementById('faqdetails').innerHTML = content;
			}
			
		else if (el.visibility == 'visible' && activeRow != row) {
			el.visibility = 'hidden';
			activeRow = row;
			el.visibility = 'visible';
			document.getElementById('faqdetails').innerHTML = content;
		}
		}
		
		function highLightCell () {
			var td = document.getElementsByTagName("td");
  				for(var i = 0; i < td.length; i++){
					  if(td[i].className == "nav"){
				      td[i].onmouseover = function(){this.className="navover";}
				      td[i].onmouseout = function(){this.className="nav";}
				      td[i].onclick = hiLiteCell;
				    }
				}
			}

		function hiLiteCell(){
		  var td = document.getElementsByTagName("td");
		  for(var i = 0; i < td.length; i++){
		      if(td[i].className.substring(0,3)=="nav"){
			  td[i].className = "nav";
		      td[i].onmouseover = function() {this.className = "navover";}
		      td[i].onmouseout = function() {this.className = "nav";}
		    }
		  }
		  this.onmouseover = null;
		  this.onmouseout = null;
		  this.className = "navover";
		}