/*Friday, November 17,2006
the addAccessKey.js
the accesskey attribute in linux firefox (Alt + accesskey) is equal to clicking the link;
the accesskey attribute in windows firefox (Alt + Shift +  accesskey) is equal to clicking the link;
the accesskey attribute in windows IE (Alt + accesskey) is just placing the current focus to the link;
 this script emulates the accesskey functionality of linux firefox, when the page is viewed in IE browser 
 where most of our end-user is using;
 the script first needs the prototype.js library;
 you only need to add the accesskey="myletter" to all the links that need the the accesskey that you normaly do
 if you dont want to add the accesskey on a certain link just add the class="dontDisable" attribute and your done;
 tested in linux and windows firefox , IE windows
 ****PLEASE USE accessKey (with the capital K) so that IE will also understand it 
 -MARK
 */

Event.observe(window, 'load', function() {
	var linkTags = document.getElementsByTagName('a');
	for(i = 0; i < linkTags.length; i++) {
		if( (linkTags[i].getAttribute('accesskey')) || (linkTags[i].getAttribute('accessKey')) ){		
			Event.observe(linkTags[i], 'focus', function(event) {
					if ( Event.element(event).className != 'dontDisable' ) {
						window.focus();
						if (Event.element(event).href) {
							with (Event.element(event)) {
								location=href;
								setAttribute("oldHref",Event.element(event).getAttribute("href"));
								removeAttribute("href");
								style.textDecoration="none";
								style.color="#ACA899";
								style.cursor="progress";
							}
						}
					}
	
			}, false);
		}
	}
}, false);

