function getElemRefs(id)
{
	var el = (document.all)? document.all[id]: (document.getElementById)? document.getElementById(id): (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function getLyrRef(lyr,doc)
{
 if (document.layers) {
  var theLyr;
  for (var i=0; i<doc.layers.length; i++) {
    theLyr = doc.layers[i];
   if (theLyr.name == lyr) return theLyr;
   else if (theLyr.document.layers.length > 0) 
      if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
     return theLyr;
   }
  return null;
  }
}

function preloadImages() {
	var d=document;
	if(d.images)	{
		if(!d.MM_p) {
			d.MM_p = new Array();
		}
		
    var i, j = d.MM_p.length, a = preloadImages.arguments;
		
		for(i = 0; i < a.length; i++) {
    	if (a[i].indexOf("#") != 0) {
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
		}
	}
}

function init_input_fields ()
{
  if (!document.getElementById) return
  
  var aInputs = document.getElementsByTagName('input');
  var aInputsTemp = new Array();
  
  
  for (var i = 0; i < aInputs.length; i++)
  {
    if (aInputs[i].className == 'inputtext' && (aInputs[i].type == 'text' || aInputs[i].type == 'textarea')) {
      aInputsTemp[i] = aInputs[i].value;
      
      aInputs[i].setAttribute('src', aInputsTemp[i]);
         
      aInputs[i].onfocus = function() {
        if (this.value == this.src)
        {
          this.setAttribute('value', '');
        }
      }
      aInputs[i].onblur = function () {
        if(this.value == '')
        {
          this.setAttribute('value', this.getAttribute('src'));
        }
      }
    }
  }
}

/*

	Browser layout fixes

*/

function action_browser ()
{
  if (browser.isIE4up == true)
  {
    a = getElemRefs('right_body_input_image');
    a.css.paddingTop = '1px';
  }
}

function init_style (bodyText, incrementColumn, bodyTextHeight)
{
	var bodyTextObject = getElemRefs(bodyText);
	var incrementColumnObject = getElemRefs(incrementColumn);
	
	if (typeof (bodyTextObject) != 'undefined' && typeof (incrementColumnObject) != 'undefined' && bodyTextObject.clientHeight > 171)
	{
		var incrementColumnHeight = bodyTextObject.clientHeight - bodyTextHeight;
		incrementColumnObject.style.height = incrementColumnObject.clientHeight + incrementColumnHeight;
	}

}

/*

	Browser layout fixes end

*/