<!--

// by Jeremiah, P.D.H. All In One Enterprises Ltd.

var s  = -1; // counter for text sub link array
var i = -1; // counter for image array

var images 	= new Array();  //array for main nav images
var links 	= new Array(); // array for main nav links
var subLinks 	= new Array(); // array for sub links
var subTxt	= new Array(); // array for sub links text

var path 		= "./rollover/"
var Lspacer	= '<img height="38px" width="10px" src="' + './images/spacer_38x20px.jpg" alt="spacer" valign="top">'
var Enlarge_path	= "./images/products/"

// *** Setup your available images here ***
// *** uncomment and order as you want to see menu image order
	// user variables -- please set up
	var idefault 	= 0 		// sets the default image: User changeable
	var ext 		=".jpg"		//set the rollover extension --  all files must have this extension
	var ext_htm	=".htm"		// webpage must be same as root image name eg. contact_off  -- contact is root would be contact.htm or whatever extension you set


	images[++i] 	= "dailydeals"
	links[i]	= "./" + images[i] + ext_htm


	subTxt[++s]	= images[i] + '_idx'; // index for the first one...
		subTxt[++s]	= "current deals";
		subLinks[s]	= "#" ;
		subTxt[++s]	= images[i] + '_end'; // index for the last one...
/*
		subTxt[++s]	= "prizes!";
		subLinks[s]	= "./prizes" + ext_htm;


*/
/*	images[++i] 	= "nativecrafts";
	links[i]	= "./" + images[i] + ext_htm;

	subTxt[++s]	= images[i] + '_idx'; // index for the first one...
		subTxt[++s]	= "baskets";
		subLinks[s]	= "./nc_baskets" + ext_htm;
		subTxt[++s]	= "beadwork";
		subLinks[s]	= "./nc_beadwork" + ext_htm;
		//subTxt[++s]	= "carvings";
		//subLinks[s]	= "./nc_carvings" + ext_htm;
	subTxt[++s]	= images[i] + '_end'; // index for the last one...
*/
/*
	images[++i] 	= "jewellery"
	links[i]	= "./" + images[i] + ext_htm
	subTxt[++s]	= images[i] + '_idx'; // index for the first one...
		subTxt[++s]	= "handmade jewellery";
		subLinks[s]	= "./quillbaskets" + ext_htm;
		subTxt[++s]	= "gold";
		subLinks[s]	= "./beadwork" + ext_htm;
		subTxt[++s]	= "silver";
		subLinks[s]	= "./carvings" + ext_htm;
	subTxt[++s]	= images[i] + '_end'; // index for the last one...
*/

	images[++i] 	= "contactus"
	links[i]	= "./" + images[i] + ext_htm

//
//	images[++i] 	= "menu"
//	links[i]	= "#"
//
//	images[++i] 	= "contactus"
//	links[i]	= "./contact.htm"



// *** END INIT IMAGES
	// dynamic mouse over function	// swapImg(x = swap | 1 = on | 0 = off | 2=down
function swapImg(isOn, img){ 		

if(! document.images){
	alert("Javascript not supported on this browser!!");  // fix this to redirect
	return;
}
if(img == ""){
	alert('Image not specified!'); 
	return false;}
else{


//MouseOver  turn image on      eg. 	eval('document.images.' + img + '.src = "' + path + img + '_on.gif"');   .gif changed for variable ext
	if(isOn == 1){ 
		eval('document.images.' + img + '.src = "' + path + img + '_over" + ext');
		//document.images.anchor.src = path + img + "_anchor.gif";  		// this is to change another image other than rollover
// MouseDown  image down
	}else if(isOn ==2){  
		eval('document.images.' + img + '.src = "' + path + img + '_on" + ext');
	}
// MouseOut  turn image off
	else{ 
		eval('document.images.' + img + '.src = "' + path + img + '_off" + ext');
	}
}

//if(images[idefault] == img) eval('document.images.' + img + '.src = "' + path + images[idefault] + '_on.gif"'); // sets default menu image to on
}



function setImg(img){
			for(i=0; i<images.length; i++){
				if(images[i] == img){
					//eval('document.images.rootImg.src = "' + img + '.gif"');
					idefault = i
				}
				eval('document.images.' + images[i] + '.src = "' + path + images[i] + '_off.jpg"');

			}
	eval('document.images.' + img + '.src = "' + path + images[idefault] + '_on.gif"');
}


function WriteLinks(pageButtonOn){

  for(a=0; a<=i; a++){
	if (pageButtonOn == images[a] ){ // write page button  as on so active page has button depressed
		document.write('<td nowrap valign="top" align="left">' + Lspacer + '<td nowrap valign="top" align="left">' + '<a href="' + links[a] + '"><img border="0" alt="' + images[a] + '" name="' + images[a] + '"  src="' + path + images[a] + '_on.jpg"></a></td>');	
		// write sublinks here possible as div floating position according to depressed button
	}else{
		document.write('<td nowrap valign="top" align="left">' + Lspacer + '<td nowrap valign="top" align="left">' + '<a href="' + links[a] + '"><img border="0" alt="' + images[a] + '" name="' + images[a] + '" onClick="javascript: setImg(\'' + images[a] + '\');" onMouseOver="javascript: swapImg(2, \'' + images[a] + '\');" onMouseDown="javascript: swapImg(2, \'' + images[a] + '\');" onMouseOut="javascript: swapImg(0, \'' + images[a] + '\');" src="' + path + images[a] + '_off.jpg"></a></td>');	
	}
  }

}

/*function WriteSubLinks(page){

  for(a=0; a<=s; a++){
	if (page + '_idx' == subTxt[a] ){ // write sublinks for page
		++a; // -- move pointer to next element

		for(b=a; b<=s; b++){ // loop through and write sublinks till _end
		
			if (page + '_end' == subTxt[b]){ // check if next index is encountered - if so all sublinks available were written
				return;	
			}else{
				
				document.write('&nbsp;&nbsp;<span class="sublinks"><a class="sublinks" href=' + subLinks[b] + '>' + subTxt[b] + '</a></span>' );	
				
			}
		//		alert ('For ' + subTxt[b]);
		}
		//document.write('<td nowrap valign="top" align="left">' + '|' + '<td nowrap valign="top" align="left">' + '<a href="' + links[a] + '"><img border="0" alt="' + images[a] + '" name="' + images[a] + '"  src="' + path + images[a] + '_on.jpg"></a></td>');	
	}else{
		//document.write('<td nowrap valign="top" align="left">' + Lspacer + '<td nowrap valign="top" align="left">' + '<a href="' + links[a] + '"><img border="0" alt="' + images[a] + '" name="' + images[a] + '" onClick="javascript: setImg(\'' + images[a] + '\');" onMouseOver="javascript: swapImg(2, \'' + images[a] + '\');" onMouseDown="javascript: swapImg(2, \'' + images[a] + '\');" onMouseOut="javascript: swapImg(0, \'' + images[a] + '\');" src="' + path + images[a] + '_off.jpg"></a></td>');	
		//alert ('else ' + subTxt[a]);
	}
  }

}*/

function WriteSubLinks(page, sub){

  for(a=0; a<=s; a++){
	if (page + '_idx' == subTxt[a] ){ // write sublinks for page
		++a; // -- move pointer to next element

		for(b=a; b<=s; b++){ // loop through and write sublinks till _end
		
			if (page + '_end' == subTxt[b]){ // check if next index is encountered - if so all sublinks available were written
				return;	
			}else{
				if (sub == subTxt[b]){ // write the active sublink
					document.write('&nbsp;&nbsp;<span class="a_sublinks"><a class="a_sublinks" href=' + subLinks[b] + '>' + subTxt[b] + '</a></span>' );	
				}else{			// write normal sublink
					document.write('&nbsp;&nbsp;<span class="sublinks"><a class="sublinks" href=' + subLinks[b] + '>' + subTxt[b] + '</a></span>' );	
				}
			}

		}

	}else{


	}
  }

}
function Enlarge(o_big_img){ //WORKING

	//clear all borders -- 
		//eval('o_big_img.style.border = "3px solid transparent"');	
		//document.images[].style.border = "3px solid transparent";
	var tn1 = document.getElementById("tn1")
	eval('tn1.style.border = "3px solid transparent"'); //CHANGE COLOR TO BODY COLOR #405f91 - DOESN'T LIKE #
	var tn2 = document.getElementById("tn2")
	eval('tn2.style.border = "3px solid transparent"');	
	var tn3 = document.getElementById("tn3")
	eval('tn3.style.border = "3px solid transparent"');

	//eval('document.images.large.src = "' + Enlarge_path + big_img');
	document.images.large.src = Enlarge_path + o_big_img.name;
	eval('o_big_img.style.border = "3px solid white"'); // the class for the thumbnail must be specified and must match the pixel width or page elements will move
}
-->