function montaFlash(swf, width, height, id, wmode) {
	monta_swf = "";
	monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" id=\""+ id +"\" width=\""+ width +"\" height=\""+ height +"\">";
	monta_swf += "<param name=\"movie\" value=\""+ swf +"\" />";
	monta_swf += "<param name=\"wmode\" value=\""+ wmode +"\" />";
	monta_swf += "<param name=\"menu\" value=\"false\" />";
	monta_swf += "<embed src=\""+ swf +"\" quality=\"high\" wmode=\""+ wmode +"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" id=\""+ id +"\" width=\""+ width +"\" height=\""+ height +"\"></embed>";
	monta_swf += "</object>";
	document.write(monta_swf);
}

function popWin(URL,NAME,WIDTH,HEIGHT,RESIZE,SCROLL) {
   winId = window.open(URL,NAME,'width='+WIDTH+',height='+HEIGHT+',resizable='+RESIZE+',scrollbars='+SCROLL+',menubar=no,toolbar=no,location=no,directories=no,status=no');
	var clientWidth = screen.availWidth;
	var clientHeight = screen.availHeight;
	var xPos = (clientWidth - WIDTH)/2;
	var yPos = (clientHeight - HEIGHT)/2;
	winId.moveTo(xPos,yPos);
}

function CheckMail(str){
	var testresults
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		testresults=false
	else { 
		testresults=true
	}
	return (testresults)
}

function getKey(e) {
	return (window.event) ? event.keyCode : e.which
}

function formatar(src, maska, e) {
	var scan	= getKey(e);
	var i = src.value.length;
	var saida = maska.substring(0,1);
	var texto = maska.substring(i);
	var tecla	= String.fromCharCode(scan);
	var mask	= "0123456789"
	if (scan == 13 || scan == 8 || scan == 0) return true;
	if (mask.indexOf(tecla) == -1) {
		return false;
	}
	if (texto.substring(0,1) != saida && scan != 8) {
		src.value += texto.substring(0,1);
	}
	return true;
}

function apenasNumero(objCampo,e) {
	var scan	= getKey(e);
	var tecla	= String.fromCharCode(scan);
	var mask	= "0123456789"
	if (scan == 13 || scan == 8 || scan == 0) return true;
	if (mask.indexOf(tecla) == -1) {
		return false;
	}
	return true;
}

function toMais(txt) {
	document.getElementById(txt).value.toUpperCase();
}	
