
function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    
    if(styleObject) { styleObject.visibility = newVisibility;

	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function toggleObjectDisplay(objectId) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);   
    if(styleObject) 
    { 
       if (styleObject.display=='none')              
           { 
             styleObject.display = '';
           } 
            else
           {
              styleObject.display = 'none';
           }
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} 

function expand(panelFull,imgLess,imgMore ) {
	   styleObj=document.getElementById(panelFull).style;
	   styleObjLess=document.getElementById(imgLess).style;
	   styleObjMore=document.getElementById(imgMore).style;

	   if (styleObj.display=='none')
	   {
	   	styleObj.display='block';
	   	styleObjLess.display='block';
	   	styleObjMore.display='none';
	   }
	   else {
	   	styleObj.display='none';
	   	styleObjLess.display='none';
	   	styleObjMore.display='block';
	    }
}

// open the client email with the specified address
function showCont(encodedCont)
{
  // do the mailto: link
  location.href = "mailto:" + decodeCont(encodedCont);
}

// display the email address in the statusbar
function displayStatus(encodedCont)
{
  window.status = "mailto:" + decodeCont(encodedCont);
}

// clear the statusbar message
function clearStatus()
{
  window.status = "";
}

// return the decoded email address
function decodeCont(encodedCont)
{
  var cont = "";
  for (i=0; i < encodedCont.length;)
  {
    // holds each letter (2 digits)
    var letter = "";
    letter = encodedCont.charAt(i) + encodedCont.charAt(i+1)

    // build the real email address
    cont += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }
  
  return cont;
}

var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);

function FireDefaultButton(event, target) {
var element = event.target || event.srcElement;
if (event.keyCode == 13 && !(element && (element.tagName.toLowerCase() == "textarea"))) 
    {
        var defaultButton=null;
        if (__nonMSDOMBrowser) 
        {
            defaultButton = document.getElementById(target);           
            var evObj = document.createEvent('MouseEvents');
            evObj.initEvent( 'click', true, true );
            defaultButton.dispatchEvent(evObj);
            event.cancelBubble = true;
            if (event.stopPropagation) event.stopPropagation();
            return false;
                
        }
        else 
        {
            defaultButton = document.all[target];
            if (defaultButton && typeof(defaultButton.click) != "undefined") 
            {
                defaultButton.click();
                event.cancelBubble = true;
                if (event.stopPropagation) event.stopPropagation();
                return false;
                }
        }

    }
return true;
}

function FireDefaultButtonMultiSource(event, targetArray, sourceMultiArray) {
var element = event.target || event.srcElement;
if (event.keyCode == 13 && !(element && (element.tagName.toLowerCase() == "textarea") ) ) 
    {
        var targetIndex = -1;
        for (i = 0; i < targetArray.length; i++)
        {
            for (j = 0; j < sourceMultiArray[i].length; j++)
            {
              if ( sourceMultiArray[i][j] == element.id) 
              {
                targetIndex = i ; break;
              }
            }
            if (targetIndex != -1) { break;}
         }
        if (targetIndex <0)
        {
           return true;
        }
        var target = targetArray[targetIndex];
        var defaultButton=null;
        if (__nonMSDOMBrowser) 
        {
            defaultButton = document.getElementById(target);           
            var evObj = document.createEvent('MouseEvents');
            evObj.initEvent( 'click', true, true );
            defaultButton.dispatchEvent(evObj);
            event.cancelBubble = true;
            if (event.stopPropagation) event.stopPropagation();
            return false;
                
        }
        else 
        {
            defaultButton = document.all[target];
            if (defaultButton && typeof(defaultButton.click) != "undefined") 
            {
                defaultButton.click();
                event.cancelBubble = true;
                if (event.stopPropagation) event.stopPropagation();
                return false;
                }
        }

    }
return true;
}

function PromptRSSUrl(pURL) {
    prompt('Enter the URL below into your RSS feed reader to view headlines',pURL) 
}





