
function _findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x==d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function _showHideLayers() { 
  var i,p,v,obj,args=_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function _displayLayers() { 
  var i,args=_displayLayers.arguments;
  for (i=0; i<(args.length-1); i+=2) 
			_changeProp(args[i],'style.display',args[i+1])
}

function _setText(objName,newText) { 
  if ((obj=_findObj(objName))!=null) 
		with (obj)
//			if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
//			else innerHTML = unescape(newText);
			 innerHTML = unescape(newText);
}

function _setTextOfTextfield(objName,newText) { 
  var obj = _findObj(objName); if (obj) obj.value = newText;
}

function _changeProp(objName,theProp,theValue) { 
  var obj = _findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function _getProp(objName,theProp) { 
  var obj = _findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) return eval("obj."+theProp);
}

function addOption(theSel, theText, theValue)
{
	var newOpt = new Option(theText, theValue);
	var selLength = theSel.length;
	theSel.options[selLength] = newOpt;
}

function _getSel(objName,theProp) { 
  var obj = _findObj(objName);
  if (obj)
		return eval("obj.options[obj.selectedIndex]."+theProp);
}

// 25.08.2003 Created by dario B. Clear all items leave only the first one
function ClearCombo(objCombo)
{
	
	// Get combo length
	var n=objCombo.length;
	
	// Clear all items excluding first one
	for (var i=1; i<n; i++)
	{
		objCombo.options[1]=null;
	}

}

