var button = new Array();
var action = new Array();
var buttonWidth = new Array();

/////////////////////////////////////////////////////////////////////////////
/////////////////////// BEGIN OF EDITABLE SECTION ///////////////////////////
/////////////////////////////////////////////////////////////////////////////

// Edit this for your buttons text and actions.
// You can add or remove as much buttons as you want.
// Just be sure to use "button[number]", "buttonWidth[number]" and "action[number]"
// 	for each button, using the same button number for the three variables!
//
// Text format is: '...text...<u>underlined_letter<\/u>...text...';
// Important: Underline just ONE letter and be very carefull from
// 	NOT to use the same letter for more than one button!!
// Try also not to use letters that already have a function under
//  	the browser (i.e. If you use "e", you'll activate your button
//	AND the already asigned combination for "EDIT" menu.)
//
// In the time you need to refer to some button on other scripts, each button
//	has an id based on "bnumber". For example, button 1 has the id "b1".
//
// Let's use 5 buttons for this example:

button[1] = '<u>F<\/u>orecasts';
buttonWidth[1] = 100;	//This is the button's width, in pixels.
action[1] = function () {
	// Place here you actions for button 1:
	window.open('http://www.sord.nv.doe.gov/Forecasts/Forecasts.html');
	// End of actions for button 1.
}

button[2] = 'Weather <u>D<\/u>ata';
buttonWidth[2] = 120;	//This is the button's width, in pixels.
action[2] = function () {
	// Place here you actions for button 1:
	window.open('http://www.sord.nv.doe.gov/home_observed_data.htm');
	// End of actions for button 1.
}

button[3] = 'Emergenc<u>y<\/u> Response';
buttonWidth[3] = 150;	//This is the button's width, in pixels.
action[3] = function () {
	// Place here you actions for button 1:
	window.open('http://www.sord.nv.doe.gov/internal/Emergency_Response/home_emergency_re.htm');
	// End of actions for button 1.
}

button[4] = '<u>M<\/u>odels';
buttonWidth[4] = 100;	//This is the button's width, in pixels.
action[4] = function () {
	// Place here you actions for button 1:
	window.open('http://www.sord.nv.doe.gov/RAMS/RAMS-model.htm');
	// End of actions for button 1.
}

button[5] = '<u>C<\/u>limate';
buttonWidth[5] = 100;	//This is the button's width, in pixels.
action[5] = function () {
	// Place here you actions for button 1:
location.href='http://www.sord.nv.doe.gov/home_climate.htm';
	// End of actions for button 1.
}
button[6] = '<u>R<\/u>esearch';
buttonWidth[6] = 100;	//This is the button's width, in pixels.
action[6] = function () {
	// Place here you actions for button 1:
location.href='http://www.sord.nv.doe.gov/home_research-new.htm';
	// End of actions for button 1.
}
button[7] = '<u>A<\/u>bout SORD';
buttonWidth[7] = 110;	//This is the button's width, in pixels.
action[7] = function () {
	// Place here you actions for button 1:
location.href='http://www.sord.nv.doe.gov/home_SORD_Infor.htm';
	// End of actions for button 1.
}
button[8] = '<u>L<\/u>inks';
buttonWidth[8] = 100;	//This is the button's width, in pixels.
action[8] = function () {
	// Place here you actions for button 1:
location.href='http://www.sord.nv.doe.gov/home_links.htm';
	// End of actions for button 1.
}

///////////////////////////////////////////////////////////////////////////
/////////////////////// END OF EDITABLE SECTION ///////////////////////////
///////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
//            Don't edit bellow or you could get errors!		  //
////////////////////////////////////////////////////////////////////////////

function placeButton(value) {
	if (button[value]) {
		if (button[value].indexOf('<u>') != -1) {
			document.write('<button id="b'+value+'" style="Width : '+buttonWidth[value]+'px ; Height : 22px" onClick="action['+value+']()"><font face="MS Sans Serif" size="1">'+button[value]+'</button>');
		} else {
			alert('You didn\'t specify the underlined letter for the button number '+value+'. This button cannot be placed until you specify the underlined letter by using <u> and <\/u> tags.');
		}
	} else {
		alert('You are trying to place the button number '+value+', but you didn\'t declare its values on the variables area. \r\rThe button '+value+' will not be placed until you specify the variables "button['+value+']" and "action['+value+']".');
	}
}

document.write('<script'+'>');
document.write('function myfocus(n) {');
for (a=1; a<button.length; a++) {
	document.write('if (n=='+a+') {document.all.b'+a+'.focus()}');
}
document.write('}');
document.write('<'+'/script>');

function chkKey(evt) {
	var mykey, alt, ctrl, shift;
	if (window.Event) {
		mykey = evt.which;
		alt = (evt.modifiers & Event.ALT_MASK) ? true : false;
		ctrl = (evt.modifiers & Event.CONTROL_MASK) ? true : false;
		shift = (evt.modifiers & Event.SHIFT_MASK) ? true : false;
	} else {
		mykey = evt.keyCode;
		alt = evt.altKey;
		ctrl = evt.ctrlKey;
		shift = evt.shiftKey;
	}
	if (mykey!=0 && mykey!=16 && mykey!=17 && mykey!=18) {
		if (alt) {
			for (i=1; i<button.length; i++) {
				ui = button[i].indexOf('<u>');
				ul = button[i].substring(ui + 3, ui + 4).toLowerCase();
				if (String.fromCharCode(mykey).toLowerCase() == ul) {
					myfocus(i);
					action[i]();
					break;
				}
			}
		}
	}
	return true;
}
if (window.Event) {
	document.captureEvents(Event.KEYDOWN);
	document.onkeydown = chkKey;
} else {
	document.onkeydown = function() {
		return chkKey(event);
	}
}
//<!-- This script and many more are available free online at -->
//<!-- The JavaScript Source!! http://javascript.internet.com -->
//<!-- Original:  fz@galeza.com (Paco Zarabozo A.) -->
//<!-- Web Site:   http://galeza.com -->
