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 loadImage(id, imagem) {
	if(document.images){
		document.images[id].src = imagem;
	}
}

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 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, 'Jogos', config);
	popup.focus();
}

function FecharJanela() { window.close(); }

function popupg(url){ 

	t = (window.screen.height-6100)/2;
	l = (window.screen.width-500)/2;
	url = 'catalogo_pecas_img743f.html?pc=' + url;

	config = "menubar=0,toolbar=0,resizable=Yes,scrollbars=Yes,status=0,location=0,width=610,height=500,top="+t+",left="+l;
	window.open(url, 'Peças', config);
	
	return;
	
}

function PopUpInstrumento(img){ 

	t = (window.screen.height-560)/2;
	l = (window.screen.width-420)/2;
	url = 'MostraImgGrandedc11.html?img=' + img;

	config = "menubar=0,toolbar=0,resizable=yes,scrollbars=no,status=0,location=0,width=560,height=420,top="+t+",left="+l;
	window.open(url, 'Instrumentos', config);
	
	return;
	
}

function AbrePopUpImagem(img){ 

	t = (window.screen.height-700)/2;
	l = (window.screen.width-600)/2;
	url = 'PopUpImagemdc11.html?img=' + img;

	config = "menubar=0,toolbar=0,resizable=yes,scrollbars=yes,status=0,location=0,width=700),height=600,top="+t+",left="+l;
	window.open(url, 'Instrumentos', config);
	
	return;
	
}

function PopUpArquivo(url){ 

	t = (window.screen.height-6100)/2;
	l = (window.screen.width-500)/2;

	config = "menubar=0,toolbar=0,resizable=Yes,scrollbars=Yes,status=0,location=0,width=610,height=500,top="+t+",left="+l;
	window.open(url, 'Peças', config);
	
	return;
	
}
	
function formSelect(form, campo, valor){ for(i = 0; i < form[campo].length; i++){ if(form[campo].options[i].value == valor){ form[campo].options[i].selected = true; return; } } return; }


function loadFlautaClarineta() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="220" height="190" align="middle">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value="flash/flauta_clarineta.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="bgcolor" value="#FFFFFF" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<embed src="flash/flauta_clarineta.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="220" height="190" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}



function checa(f){
	
	if(f.busca.value == ''){
		alert('O campo Busca esta em branco.');
		f.busca.focus();
		return false;
	}	
	if (f.busca.value.length <= 2){
		alert('Deve haver um minimo de 3 caracteres para busca.');
		f.busca.focus();
		return false;
	}
		
	return true;
	
}

function OpenBocais(cod){
	window.open("bocais/ExibeBocalade4.html?cod="+cod);
}