/* *****************************************************************************
_scripts.js
Nav highlighting and on-click popups.

originator  = Wayne Chang (Apr 2008)
last modify = Wayne Chang (Dec 2008)
***************************************************************************** */

// -----------------------------------------------------------------------------------------------------------
// sub_show, sub_restore: rollovers. Bandwidth-heavy but demo always runs from hard drive.
// -----------------------------------------------------------------------------------------------------------
function sub_show( the_item ) {
	document.getElementById('menu_earth').src = '_chrome_s2/sub_earth_plus_' + the_item + '.png';
}

function sub_restore() {
	document.getElementById('menu_earth').src = '_chrome_s2/sub_earth_plus_all.png';
}

function sub_icon_on( the_type ) {
	document.getElementById( 'icon_'+the_type ).src = '_chrome_s2/sub_icon_' + the_type + '_on.png';
}

function sub_icon_off( the_type ) {
	document.getElementById( 'icon_'+the_type ).src = '_chrome_s2/sub_icon_' + the_type + '_off.png';
}


// -----------------------------------------------------------------------------------------------------------
// rainbow_show, rainbow_restore: hide and show popup window media divs by number.
// -----------------------------------------------------------------------------------------------------------
function rainbow_show( the_item ) {
	document.getElementById('img_rainbow').src = '_chrome_s2/rainbow_' + the_item + '.png';
}

function rainbow_restore( the_item ) {
	document.getElementById('img_rainbow').src = '_chrome_s2/rainbow.png';
}


// -----------------------------------------------------------------------------------------------------------
// media_show, media_hide: hide and show popup window media divs by number.
// -----------------------------------------------------------------------------------------------------------
function media_show( the_item ) {
	document.getElementById('media_' + the_item).style.display = '';
}

function media_hide( the_item ) {
	document.getElementById('media_' + the_item).style.display = 'none';
}


// -----------------------------------------------------------------------------------------------------------
// make_popup: open appropriately sized popup window.
// -----------------------------------------------------------------------------------------------------------

function make_popup( name, size_x, size_y, the_url ) {
	more_chrome = 'no';
	
	the_left = (screen.width / 2) - (size_x / 2);
	the_top = (screen.height / 2) - (size_y / 2) - 50;

	window.open( the_url, name, 'toolbar=' + more_chrome + ',location=' + more_chrome + ',status=no, scrollbars=no, ' + 
		'menubar=yes, width=' + size_x + ',height=' + size_y + ',top=' + the_top + ',left=' + the_left );
}




// -----------------------------------------------------------------------------------------------------------
// home rainbow functions
// -----------------------------------------------------------------------------------------------------------
function home_rainbow_show( the_item ) {
	document.getElementById('img_rainbow').src = '_chrome_s2/rainbow_' + the_item + '.png';
}

function home_rainbow_restore( the_item ) {
	document.getElementById('img_rainbow').src = '_chrome_s2/rainbow.png';
}

function home_show( the_item ) {
	document.getElementById('menu_earth').src = '_chrome_s2/home_earth_plus_' + the_item + '.png';
}

function home_restore() {
	document.getElementById('menu_earth').src = '_chrome_s2/home_earth_plus_all.png';
}

function home_icon_on( the_type ) {
	document.getElementById( 'icon_'+the_type ).src = '_chrome_s2/home_icon_' + the_type + '_on.png';
}

function home_icon_off( the_type ) {
	document.getElementById( 'icon_'+the_type ).src = '_chrome_s2/home_icon_' + the_type + '_off.png';
}

