Javascript Style Configuration Pulled From CSS

These functions allow CSS to be the prime source for colors so JS can be set never to need configuraiton - it all comes from CSS

function getMapSwitchNavStyles(){
 mapSwitchNavColor = getStyle('mapSwitchNav_INT','color');
 mapSwitchNavColorYAH = getStyle('mapSwitchNav_US','color');
 mapSwitchNavTextDecoration = getStyle('mapSwitchNav_INT','text-decoration');
 mapSwitchNavTextDecorationYAH = getStyle('mapSwitchNav_US','text-decoration');
}

function getStyle(el,styleProp)
{
 /*
  http://www.quirksmode.org/dom/getstyles.html
  Pass styles in as style sheet declorations, IE wants javascript way
 */ 
 var x = document.getElementById(el);
 if (x.currentStyle){
  //ie
  switch(styleProp)
  {
  case 'text-decoration':
    styleProp = 'textDecoration';
    break;   
  default:
  }
  var y = x.currentStyle[styleProp];
 }else if (window.getComputedStyle){
  var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
 }
 return y;