function getObj(id) {
	if(document.all){
		return document.all(id);
	} else if (document.getElementById) {
		return document.getElementById(id);
	}
}

function setInnerHTML(id, str) {
	if (document.getElementById(id)) {
		document.getElementById(id).innerHTML = str;
	} else if (document.all[id]) {
		document.all[id].innerHTML = str;
	}
}

function getInnerHTML(id) {
	if (document.getElementById(id)) {
		return document.getElementById(id).innerHTML;
	} else if (document.all[id]) {
		return document.all[id].innerHTML;
	}
}

function setBackColor(obj, color)
{
    obj.style.background = color;
}

function setClassName(obj, cssClass)
{
    obj.className = cssClass;
}

function loadFlash(arquivo, w, h) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" align="middle">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="' + arquivo + '" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<param name="bgcolor" value="#f1f1f1" />\n');
	document.write('<embed src="' + arquivo + '" quality="high" wmode="transparent" bgcolor="#f1f1f1" width="' + w + '" height="' + h + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}

function setScroll()
{
    getObj('ScrollX').value = getScrollLeft();
    getObj('ScrollY').value = getScrollTop();
}

function getScrollLeft()
{
    return document.documentElement.scrollLeft;
}

function getScrollTop()
{
    return document.documentElement.scrollTop;
}

function ajustaScroll()
{
	scrollTo(getObj('ScrollX').value, getObj('ScrollY').value);
}

function mudaCampo(CampoAtual, ProxCampo, Qtde)
{
	if(CampoAtual.value.length == Qtde){
		ProxCampo.focus();
		ProxCampo.select();
	}
}

function openPopup(url, w, h, sc)
{
	var t = (window.screen.height-h)/2;
	var l = (window.screen.width-w)/2;
	sc = (sc)? 'yes':'no';
	config = 'menubar=no, toolbar=no, resizable=no, scrollbars=' + sc + ',status=no, location=no, width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
	popup = window.open(url, 'Popup_4BIO', config);
	popup.focus();
}