
// ====================================================================== //
// Scripts for Fatatrac.com                                               //
// Navigation functions written by Tim Jones nacimiento.com               //
// copyright 2000-2005 pantheondesign.com, nacimiento.com                 //
// ====================================================================== //

// ====================================================================== //
// rollover button system
// ====================================================================== //

/* 
Documentation 

create the graphics and target pages
edit the link in the top frame or left side frame
create a new individual button function (below)
create a new swap area function section (below)

There are 3 place to edit when changing the buttons:
	1. the page where the graphic button link exists. Either frame-toparea.html or frame-leftside.html
	2. here in the "individual button functions"
	3. here in the swapImage function
	
To remove a sticky link 
1. comment it out where it exists, either frame-toparea.html or frame-leftside.html
	Then every link AFTER it must be renumbered.

2. Comment out the individual btn function in this file and renumber all folllowing functions.

3. Comment out the corresponding section of the swapImage function and
	renumber all the following sections.

4. good luck, it's pretty tricky/wacky...

*/







// individual button functions.
// These provide the feedback but they do not change the page.

//  button 1 
function swap_1_roll () { 
  swapImage ('document.','btn1','titolo-green.gif'); }
function swap_1_norm () { 
  swapImage ('document.','btn1','titolo-white.gif'); }
function sele_1      () { 
  swapArea  ('btn1'); }

//  button 2 
function swap_2_roll () { 
  swapImage ('document.','btn2','ages-green.gif'); }
function swap_2_norm () { 
  swapImage ('document.','btn2','ages-white.gif'); }
function sele_2      () { 
  swapArea  ('btn2'); }

//  button 3 
function swap_3_roll () { 
  swapImage ('document.','btn3','subjects-green.gif'); }
function swap_3_norm () { 
  swapImage ('document.','btn3','subjects-white.gif'); }
function sele_3      () { 
  swapArea  ('btn3'); }

//  button 4 
function swap_4_roll () { 
  swapImage ('document.','btn4','authors-green.gif'); }
function swap_4_norm () { 
  swapImage ('document.','btn4','authors-white.gif'); }
function sele_4      () { 
  swapArea  ('btn4'); }

//  button 5
function swap_5_roll () { 
  swapImage ('document.','btn5','series-green.gif'); }
function swap_5_norm () { 
  swapImage ('document.','btn5','series-white.gif'); }
function sele_5      () { 
  swapArea  ('btn5'); }


// the following are in the left frame NOT the top frame


//  button 6 the Fatatrac logo
function swap_6_roll () { 
  swapImage ('top.oLeft.document.','btn6','logo-green.gif'); }
function swap_6_norm () { 
  swapImage ('top.oLeft.document.','btn6','logo-white.gif'); }
function sele_6      () { 
  swapArea  ('btn6'); }

//  button 7 the Novita button
function swap_7_roll () { 
  swapImage ('top.oLeft.document.','btn7','news-green.gif'); }
function swap_7_norm () { 
  swapImage ('top.oLeft.document.','btn7','news-white.gif'); }
function sele_7      () { 
  swapArea  ('btn7'); }

//  button 8 the Acquista button
function swap_8_roll () { 
  swapImage ('top.oLeft.document.','btn8','acquista-hover.gif'); }
function swap_8_norm () { 
  swapImage ('top.oLeft.document.','btn8','acquista-link.gif'); }
function sele_8      () { 
  swapArea  ('btn8'); }

//  button 9 the Informazione button
function swap_9_roll () { 
  swapImage ('top.oLeft.document.','btn9','info-green.gif'); }
function swap_9_norm () { 
  swapImage ('top.oLeft.document.','btn9','info-white.gif'); }
function sele_9      () { 
  swapArea  ('btn9'); }
  
//  button 10 the Millanta button
function swap_10_roll () { 
  swapImage ('top.oLeft.document.','btn10','gallina-green.jpg'); }
function swap_10_norm () { 
  swapImage ('top.oLeft.document.','btn10','gallina-white.jpg'); }
function sele_10      () { 
  swapArea  ('btn10'); }


// unused

//  button 11 the Fatatracchi button
// function swap_11_roll () { 
//   swapImage ('top.oLeft.document.','btn11','fatatracchi-green.gif'); }
// function swap_11_norm () { 
//   swapImage ('top.oLeft.document.','btn11','fatatracchi-white.gif'); }
// function sele_11      () { 
//   swapArea  ('btn11'); }

//  button 12 the why Fatatrac button
// function swap_12_roll () { 
//   swapImage ('top.oLeft.document.','btn12','why-green.gif'); }
// function swap_12_norm () { 
//   swapImage ('top.oLeft.document.','btn12','why-white.gif'); }
// function sele_12      () { 
//   swapArea  ('btn12'); }

//  button 13 the filostroca button
// function swap_13_roll () { 
//   swapImage ('top.oLeft.document.','btn13','gallina-green.jpg'); }
// function swap_13_norm () { 
//   swapImage ('top.oLeft.document.','btn13','gallina-white.jpg'); }
// function sele_13      () { 
//   swapArea  ('btn13'); }



// ============================================================================ //
// ============================================================================ //
// ============================================================================ //

// function that actually does the swapping
function swapImage(path,imgName,newImg) {
	 eval(path + imgName + '.src = "' + newImg + '"');
}

// ============================================================================ //



// function which turns buttons on and off  (i.e. redefines their event handlers)
// and switches the content frame and the top right graphic.
// make sure you get the links indices [#] right for your page                  

function swapArea (btnClicked) {
	if (btnClicked == 'btn1') {
		document.links[0].onmouseover			= nothing;
		document.links[0].onmouseout			= nothing;
		document.btn1.src						= 'titolo-sel.gif';
		top.oMid.maincontent.location.href		= 'index-titolo.html';
	} else {
		document.links[0].onmouseover			= swap_1_roll;
		document.links[0].onmouseout			= swap_1_norm;
		document.btn1.src						= 'titolo-white.gif';
	}
	if (btnClicked == 'btn2') {
		document.links[1].onmouseover			= nothing;
		document.links[1].onmouseout			= nothing;
		document.btn2.src						= 'ages-sel.gif';
		top.oMid.maincontent.location.href		= 'index-eta.html';
	} else {
		document.links[1].onmouseover			= swap_2_roll;
		document.links[1].onmouseout			= swap_2_norm;
		document.btn2.src						= 'ages-white.gif';
	}
	if (btnClicked == 'btn3') {
		document.links[2].onmouseover			= nothing;
		document.links[2].onmouseout			= nothing;
		document.btn3.src						= 'subjects-sel.gif';
		top.oMid.maincontent.location.href		= 'index-argomenti.html';
	} else {
		document.links[2].onmouseover			= swap_3_roll;
		document.links[2].onmouseout			= swap_3_norm;
		document.btn3.src						= 'subjects-white.gif';
	}
	if (btnClicked == 'btn4') {
		document.links[3].onmouseover			= nothing;
		document.links[3].onmouseout			= nothing;
		document.btn4.src						= 'authors-sel.gif';
		top.oMid.maincontent.location.href		= 'index-autori.html';
	} else {
		document.links[3].onmouseover			= swap_4_roll;
		document.links[3].onmouseout			= swap_4_norm;
		document.btn4.src						= 'authors-white.gif';
	}
	if (btnClicked == 'btn5') {
		document.links[4].onmouseover			= nothing;
		document.links[4].onmouseout			= nothing;
		document.btn5.src						= 'series-sel.gif';
		top.oMid.maincontent.location.href		= 'index-collane.html';
	} else {
		document.links[4].onmouseover			= swap_5_roll;
		document.links[4].onmouseout			= swap_5_norm;
		document.btn5.src						= 'series-white.gif';
	}


	<!-- the following btns are in the left frame -->

	if (btnClicked == 'btn6') {
	// the Fatatrac logo button
		top.oLeft.document.links[0].onmouseover		= nothing;
		top.oLeft.document.links[0].onmouseout		= nothing;
		top.oLeft.document.btn6.src					= 'logo-sel.gif';
		top.oMid.maincontent.location.href			= 'logo.html';
	} else {
		top.oLeft.document.links[0].onmouseover		= swap_6_roll;
		top.oLeft.document.links[0].onmouseout		= swap_6_norm;
		top.oLeft.document.btn6.src					= 'logo-white.gif';
	}
	if (btnClicked == 'btn7') {
	// the Acquista link
		top.oLeft.document.links[1].onmouseover		= nothing;
		top.oLeft.document.links[1].onmouseout		= nothing;
		top.oLeft.document.btn7.src					= 'news-sel.gif';
		top.oMid.maincontent.location.href			= 'index-novita-top.html';
	} else {
		top.oLeft.document.links[1].onmouseover		= swap_7_roll;
		top.oLeft.document.links[1].onmouseout		= swap_7_norm;
		top.oLeft.document.btn7.src					= 'news-white.gif';
	}
	// the informazione link
	if (btnClicked == 'btn8') {
		top.oLeft.document.links[2].onmouseover		= nothing;
		top.oLeft.document.links[2].onmouseout		= nothing;
		top.oLeft.document.btn8.src					= 'acquista-select.gif';
		top.oMid.maincontent.location.href			= 'index-titolo.html';
	} else {
		top.oLeft.document.links[2].onmouseover		= swap_8_roll;
		top.oLeft.document.links[2].onmouseout		= swap_8_norm;
		top.oLeft.document.btn8.src					= 'acquista-link.gif';
	}
	if (btnClicked == 'btn9') {
	// the Millanta link
		top.oLeft.document.links[3].onmouseover		= nothing;
		top.oLeft.document.links[3].onmouseout		= nothing;
		top.oLeft.document.btn9.src					= 'info-sel.gif';
		top.oMid.maincontent.location.href			= 'index-ordinare.html';
	} else {
		top.oLeft.document.links[3].onmouseover		= swap_9_roll;
		top.oLeft.document.links[3].onmouseout		= swap_9_norm;
		top.oLeft.document.btn9.src					= 'info-white.gif';
	}
	if (btnClicked == 'btn10') {
		top.oLeft.document.links[4].onmouseover		= nothing;
		top.oLeft.document.links[4].onmouseout		= nothing;
		top.oLeft.document.btn10.src				= 'gallina-sel.jpg';
		top.oMid.maincontent.location.href			= 'filastroccaDJ.html';
	} else {
		top.oLeft.document.links[4].onmouseover		= swap_10_roll;
		top.oLeft.document.links[4].onmouseout		= swap_10_norm;
		top.oLeft.document.btn10.src				= 'gallina-white.jpg';
	}
// 	if (btnClicked == 'btn11') {
// 		top.oLeft.document.links[5].onmouseover		= nothing;
// 		top.oLeft.document.links[5].onmouseout		= nothing;
// 		top.oLeft.document.btn11.src				= 'fatatracchi-sel.gif';
// 		top.oMid.maincontent.location.href			= 'index-why-fatatracchi.html';
// 	} else {
// 		top.oLeft.document.links[5].onmouseover		= swap_11_roll;
// 		top.oLeft.document.links[5].onmouseout		= swap_11_norm;
// 		top.oLeft.document.btn11.src				= 'fatatracchi-white.gif';
// 	}
// 	if (btnClicked == 'btn12') {
// 		top.oLeft.document.links[6].onmouseover		= nothing;
// 		top.oLeft.document.links[6].onmouseout		= nothing;
// 		top.oLeft.document.btn12.src				= 'why-sel.gif';
// 		top.oMid.maincontent.location.href			= 'index-why.html';
// 	} else {
// 		top.oLeft.document.links[6].onmouseover		= swap_12_roll;
// 		top.oLeft.document.links[6].onmouseout		= swap_12_norm;
// 		top.oLeft.document.btn12.src				= 'why-white.gif';
// 	}

	<!-- !!! there is another link (links[7]) here in the leftside frame -->
	<!-- it is the mailto link and is NOT part of this scheme. -->

// 	if (btnClicked == 'btn13') {
// 		top.oLeft.document.links[8].onmouseover		= nothing;
// 		top.oLeft.document.links[8].onmouseout		= nothing;
// 		top.oLeft.document.btn13.src				= 'gallina-sel.jpg';
// 		top.oMid.maincontent.location.href			= 'filastroccaDJ.html';
// 	} else {
// 		top.oLeft.document.links[8].onmouseover		= swap_13_roll;
// 		top.oLeft.document.links[8].onmouseout		= swap_13_norm;
// 		top.oLeft.document.btn13.src				= 'gallina-white.jpg';
// 	}



// get rid of the pesky focus outline in IE
	parent.parent.focus();
}

// a function which does nothing. 
function nothing () {}


// ====================================================================== //
// end of scripts ======================================================= //
// ====================================================================== //
