///////////////////////////////////
//
// Hide border on focus on IE
//
// Thanks to Cody Lindley
// For info see
// http://codylindley.com/Javascript/223/hiding-the-browsers-focus-borders-should-i-shouldnt-i
//
///////////////////////////////////

// Find all link elements and add an onfocus attribute and value
function hideFocusBorders(){
	if (!document.getElementsByTagName) return false;
	var theahrefs = document.getElementsByTagName("a");
	if (!theahrefs) return;
	for(var x=0;x!=theahrefs.length;x++){
		theahrefs[x].onfocus = function stopLinkFocus(){ this.hideFocus=true; };
	}
}

addEvent(window, 'load', hideFocusBorders);

///////////////////////////////////
//
// Add event
//
///////////////////////////////////

// Add an eventListener to browsers that can do it somehow.
// Originally by the amazing Scott Andrew.
function addEvent(obj, evType, fn){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
	return false;
  }
}
