function showInline(id) 
//=====================
{
	var d = document.getElementById(id);
	if (d)
		d.style.display='inline';
}
	
function show(id) 
//===============
{
	var d = document.getElementById(id);
	if (d)
		d.style.display='block';
}
		
function hide(id) 
//===============
{
	var d = document.getElementById(id);
	if (d)
		d.style.display='none';
}

function setRowHidden(tr, hidden) {
  //"table-row"; for Mozilla
  //"block";     for MSIE   --> so className="" will perform default display
  tr.className = hidden ? "hidden" : "";
}
	
function setVisibility(id, value) 
//===============================
{
	var d = document.getElementById(id);
	if (d)
		d.style.visibility=value;
}

function setTextContent(object, text)
//===================================
{
	if (navigator.appName == "Microsoft Internet Explorer")	
		object.innerText = text;
	else
		object.textContent = text;
}

function clearTextContent(object)
//===============================
{
	if (navigator.appName == "Microsoft Internet Explorer")	
		object.innerText = '';
	else
		object.textContent = '';
}

function setTextContentForCell(object, text)
//==========================================
{
	if( text == "" )
		text = "&nbsp;"
	if (navigator.appName == "Microsoft Internet Explorer")	
		object.innerText = text;
	else
		object.textContent = text;
}

function getTextContent(object)
//=============================
{
	if (navigator.appName == "Microsoft Internet Explorer")	
		return object.innerText;
	else
		return object.textContent;
}

function removeFromClassName(element, classToRemove)
//==================================================
{
  var className = element.className; 
  var classes   = className.split(" " + classToRemove);
  element.className = classes[0];
}

function removeClassName (elem, className) {
	elem.className = elem.className.replace(className, "").trim();
}

function addCSSClass (elem, className) {
	removeClassName (elem, className);
	elem.className = (elem.className + " " + className).trim();
}

String.prototype.trim = function() {
	return this.replace( /^\s+|\s+$/, "" );
}

//This returns the height of the visible part of the window
function getWindowheight() 
//========================
{ 
  var windowheight = 0; 
  //if (typeof(window.innerheight) == 'number') 
  if ( window.innerHeight ) 
    windowheight = window.innerHeight; 
  else if (document.documentElement && document.documentElement.clientHeight) 
    windowheight = document.documentElement.clientHeight; 
  else if (document.body && document.body.clientHeight) 
    windowheight = document.body.clientHeight; 
    
  return windowheight;
} 

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

function browserInitialisation()
//==============================
{
  this.browser=navigator.userAgent;
  this.isOpera   =(this.browser.toLowerCase().indexOf('opera')>=0)?true:false;
  this.isFirefox =(this.browser.toLowerCase().indexOf('firefox')>=0)?true:false;
  this.isMSIE    =(this.browser.toLowerCase().indexOf('msie')>=0)?true:false;
  this.isOldMSIE =(this.browser.toLowerCase().match(/msie\s[0-6]/gi))?true:false;
  this.isSafari  =(this.browser.toLowerCase().indexOf('safari')>=0)?true:false;
  
  this.navigatorVersion=navigator.appVersion.replace(/.*?MSIE\s(\d\.\d).*/g,'$1')/1;
  this.isOldMSIE =(this.isMSIE&&this.navigatorVersion<7)?true:false
}
