﻿/* *****************************************************************************
gt_mouse.js
Cross-browser mouse hover and click utilities. 

Note:
Giantech red std  = #c72133
Giantech red dark = #871623

originator  = Wayne Chang (Nov 2007)
last modify = Wayne Chang (Nov 2007)
***************************************************************************** */

// -----------------------------------------------------------------------------------------------------------
// mouse_pri_heat: change to colorful appearance for primary nav
// -----------------------------------------------------------------------------------------------------------
function mouse_pri_heat( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_pri_' + item_num );

		the_target.style.backgroundImage = 'url(../_media/nav_pri_hot.png)';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_pri_cool: restore inactive appearance for primary nav
// -----------------------------------------------------------------------------------------------------------
function mouse_pri_cool( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_pri_' + item_num );

		the_target.style.backgroundImage = 'url(../_media/nav_pri_cool.png)';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_pri_activecool: restore inactive appearance for current-page indicator
// -----------------------------------------------------------------------------------------------------------
function mouse_pri_activecool( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_pri_' + item_num );

		the_target.style.backgroundImage = 'url(../_media/nav_pri_warm.png)';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_pri_click: colorful mouseup
// -----------------------------------------------------------------------------------------------------------
function mouse_pri_click( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_pri_' + item_num );

		the_target.style.backgroundImage = 'url(../_media/nav_pri_click.png)';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_sec_heat: change to colorful appearance for secondary nav
// -----------------------------------------------------------------------------------------------------------
function mouse_sec_heat( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_sec_' + item_num );

		// hot border
		the_target.style.border = '2px solid #c72133';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_sec_cool: restore inactive appearance for secondary nav
// -----------------------------------------------------------------------------------------------------------
function mouse_sec_cool( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_sec_' + item_num );
		
		// cold border
		the_target.style.border = '2px solid #ffffff';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_sec_activecool: restore inactive appearance for current-page indicator
// -----------------------------------------------------------------------------------------------------------
function mouse_sec_activecool( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_sec_' + item_num );
		
		// cold border
		the_target.style.border = '2px solid #c72133';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// mouse_sec_click: colorful mouseup
// -----------------------------------------------------------------------------------------------------------
function mouse_sec_click( item_num ) {
	if( item_num > 0 )
	{
		var the_target = document.getElementById( 'item_nav_sec_' + item_num );
		
		// click border
		the_target.style.border = '2px solid #871623';
	}

	return 0;
}

// -----------------------------------------------------------------------------------------------------------
// shw_link_coolall: remove all slideshow control link highlights
// -----------------------------------------------------------------------------------------------------------
function shw_link_coolall() {
	var counter;
	var the_target;

	document.getElementById( 'item_nav_ter_slideshow' ).className = '';

	for( counter = 1; counter < g_item_num_max; counter++ )
	{
		the_target = document.getElementById( 'item_nav_ter_' + counter );

		if( the_target.className.indexOf( '_hot' ) != -1 )
			the_target.className = '';
	}
}

// -----------------------------------------------------------------------------------------------------------
// shw_link_heat: highlight specified slideshow control link
// -----------------------------------------------------------------------------------------------------------
function shw_link_heat( the_item ) {
	// cleanse palate
	shw_link_coolall();

	// highlight
	document.getElementById( 'item_nav_ter_' + the_item ).className = 'item_nav_ter_hot';
}

