//For IE and Firefox compatibility issues
function getAttribute(o, id){

	return o.getAttribute(id);
	
}

function setAttribute(o, id, value){

	return o.setAttribute(id, value);
	
}

function getNodeValue(o, id){

    var n = o.getElementsByTagName(id);
    if(n)
        if(n.length > 0)
            if(n[0].firstChild)
                return n[0].firstChild.nodeValue;
    
    return "";
}

function trim(str){

	return str.replace(/^\s+|\s+$/g, '') ;

}

function parseBool(val){
	var ret = false;
	
	if(val == "true" || val == true)
		ret = true;
	
	return ret;		
		
} 

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
