//NeedleCrafter Javascript
// Tom Raab October 2001
// Browser detection
// DEVELOPMENT JS

var isNS = (document.layers) ? true : false ;
var isIE = (document.all) ? true : false ;
var isW3 = (document.getElementById) ? true : false ;

//alert('isNS = '+isNS + '\nisIE = '+isIE+'\nisW3 = '+isW3);
// make sure it is contained in the frameset


function showLayer() 
{
	for(i=0; i<arguments.length; i++) 
	{
		var layer = arguments[i];
		if(isIE) 
		{
			document.all[layer].style.visibility = 'visible';
		}
		else 
		{
			document.layers[layer].visibility = 'show';
		}
	}
}
function hideLayer() 
{
	for(i=0; i<arguments.length; i++) 
	{	
		var layer = arguments[i];		
		if(isIE) 
		{			
			document.all[layer].style.visibility = 'hidden';			
		}
		else {
			document.layers[layer].visibility = 'hide';
		}
	}
}
function writeToLayer(layer,content) {
	if(isW3)
	{
		//alert('attempt to write = '+content);
		document.getElementById(layer).innerHTML = content;
	}
	else if(isIE) {	
		document.all[layer].innerHTML = content;
	}
	else {	
		document.layers[layer].document.open();
		document.layers[layer].document.write(content);
		document.layers[layer].close();		
	}
}

//IE mouse overs for navbar tablecells
function mover(a) {

	if (isIE) 
	{
		document.all[a].style.color = "#000000"; /* rollover text color CORRECT */
		document.all[a].style.background = "#ccffcc"; /* rollover background color CORRECT */
		document.all[a].style.cursor = "hand";
		//document.all[a].style.font-size = 15;
	}
}
function moff(a,color,typecolor) {
	
	if(!color)
		color = '#000000'; /* navbar text color */
	if(!typecolor)
		typecolor='#99cc99'; /* navbar background color CORRECT */
		
	if(isIE)
	{
		document.all[a].style.color = "#ffffff"; /* rolled over text */
		document.all[a].style.background = "#99cc99"; /* rolled over background CORRECT */
	}
}


//NS mouse overs for navbar tablecells
function mover(a) {

	if (isNS) 
	{
		document.all[a].style.color = "#000000"; /* rollover text color CORRECT */
		document.all[a].style.background = "#ccffcc"; /* rollover background color CORRECT */
		document.all[a].style.cursor = "hand";
		//document.all[a].style.font-size = 15;
	}
}
function moff(a,color,typecolor) {
	
	if(!color)
		color = '#000000'; /* navbar text color */
	if(!typecolor)
		typecolor='#99cc99'; /* navbar background color CORRECT */
		
	if(isNS)
	{
		document.all[a].style.color = "#ffffff"; /* rolled over text */
		document.all[a].style.background = "#99cc99"; /* rolled over background CORRECT */
		document.all[a].style.cursor = "hand";
	}
}

var fontSize = 3;
var myText = '';

function changeFontSize(n) { 
 fontSize = fontSize+n;
 
//alert(fontSize);
 
var newText = '<font size="' + fontSize + '">';
 		newText += myText;
 		newText += '</font>';
 		
 		document.all['text'].innerHTML = newText;
}
var page = new Array();
page['t0'] = 'home.html';
page['t1'] = 'library.html';
page['t2'] = 'store.html';
page['t3'] = 'gallery.html';
page['t4'] = 'messages/mboard.html'; 
page['t5'] = 'links/links.html';
page['t6'] = 'support.html';
page['t7'] = 'contact.html';
var loc = '';

function goToPage(id) 
{
	//alert(id);	
	document.location.href = loc+page[id];
}

