function getIt(name) {

	  if (is_nav4)
	    return(document.layers[name]);
	  else if (is_ie4) {
	  	if ( eval('document.all.' + name) != null) {
		    layer = eval('document.all.' + name + '.style');
		    return(layer);
		} else
			return(null);
	  } else if (is_ie5up || is_nav5up || is_moz) {
		var elms = document.getElementById(name);
		return elms.style
	  } else
	    return(null);
}
function createIt(name, left, top, width, height, visible, mouseover,mouseout, content) {
	  var it;
	  if (mouseover)
	  {
	  	mouseover=' onMouseOver="'+mouseover+'" ';
	  }
	  if (mouseout)
	  {
	  	mouseout=' onMouseOut="'+mouseout+'" ';
	  }
	  if (is_nav && is_nav4) {
	    document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height +  ' visibility=' + (visible ? '"show"' : '"hide"') +  mouseover+mouseout+'>');
	    document.writeln(content);
	    document.writeln('</layer>');
	    it = getIt(name);
	    it.width = width;
	    it.height = height;
	  } else {
	//document.writeln('<div id="' + name + '"' + mouseover+mouseout+' style="position:absolute; overflow:none; filter:alpha(opacity=100); left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;"' : 'hidden;"'));
	document.writeln('<div id="' + name + '"' + mouseover+mouseout+' style="position:absolute; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;"' : 'hidden;"'));
	  document.writeln(' >');
	    document.writeln(content);
	    document.writeln('</div>');
	  }
	return true;
}
function clipIt(name, left, up, right, down) {		
	var it = getIt(name);		
	if (it != null) {
  		if (is_nav4) {
			it.clip.left   = left;
			it.clip.top    = up;
		    it.clip.right  = right;
			it.clip.bottom = down;
		} else if (is_ie) {
			it.clip = 'rect(' + up + ' ' +  right + ' ' + down + ' ' + left +')';
	    } else {
     		it.height = down - up;
			it.width	= right - left;
			it.top	= (up) + "px";
			it.left	= (left) + "px";
		}
	}
	return true;
}
function colorIt(name, color) {		
  	var it = getIt(name);		
	if (it != null) {
	    if (is_nav4) 
    		it.bgColor = color;
		else
    		it.backgroundColor = color;
	}
	return true;
}

function hideIt(name) {		
  	var it = getIt(name);		
	if (it != null) {
	 	if (is_nav4)
    		it.visibility = "hide";
		else
   			 it.visibility = "hidden";
	}
	return true;
}
function changeIt(name,stuff) {		
  	var it = getIt(name);		
	if (it != null) {
	 	if (is_nav4)
		{
			it.document.open();
			it.document.write(stuff);
			it.document.close();
		}
		else if (is_nav5up || is_moz)
		{
			var itt=document.getElementById(name);
   		 	itt.innerHTML=stuff;
		}
		else
		{
   		 	document.all[name].innerHTML = stuff;
		}
	}
	return true;
}

function showIt(name) {		
  	var it = getIt(name);		
	if (it != null) {
	  	if (is_nav4)
    		it.visibility = "show";
		else
   		 	it.visibility = "visible";
	}
	return true;
}
function moveIt(name, x, y) {		
  	var it = getIt(name);		
	if (it != null) {
	  	if (is_nav4)
    		it.moveTo(x, y);
	 	else if (is_ie) {
    		it.left = x + "px";
   			it.top  = y + "px";
		} else {
			//it.height = iHeight - y;
			//it.width	= iWidth - x;
	    		//it.left = x + "px";
   			//it.top  = y + "px";
			var itt=document.getElementById(name);
			itt.style.left=x + 'px';
   			itt.style.top=y + 'px';
	    		it.left=x + 'px';
   			it.top=y + 'px';
	  	}
	}
	return true;
}
function getXOffset(name)
{
	var it=name;
    if (document.layers && document.layers[it]) {
        return document.layers[it].pageX;
    }
    else if (document.all) {

           return document.all[it].offsetLeft;
    }
	xx=document.getElementById(name);
	return xx.offsetLeft;
	return 0;
}
function getYOffset(name)
{
	var it=name;
	if (! is_ie)
	{
		it=getIt(name);
	}
    if (document.layers && document.layers[it]) {
        return document.layers[it].pageY;
    }
    else if (document.all) {

           return document.all[it].offsetTop;
    }
	xx=document.getElementById(name);
	return xx.offsetTop;
}
function show_props(obj, objName) {
	var result = ""
	for (var i in obj) {
			result +='<br>'+ objName + "." + i + " = " + obj[i] + "\n"
	}
	return result;
}
