var isNS4 = (navigator.appName=="Netscape")?1:0;

function formatar(src, mask) {	

		var i = src.value.length;
		var saida = mask.substring(0,1);		
		var texto = mask.substring(i)	
		if (texto.substring(0,1) != saida) 
		{
			src.value += texto.substring(0,1);
		}		
}

function numeral(O){
	Objeto = document.getElementById(O.name);
	
	if(isNS4 == 0){	
		if(event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;   
	}
	
	if(isNS4 == 1){	
		if(event.which < 45 || event.which > 57) return false;
	}	

}

function fechaA() {
	document.getElementById('divPop').style.visibility = 'hidden';
}
function flashTopo(){
document.write(''+
	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="780" height="290">'+
    '  <param name="movie" value="swf/topo.swf" />'+
    '  <param name="quality" value="high" />'+
    '  <param name="wmode" value="transparent" />'+
    '  <embed src="swf/topo.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="290"></embed>'+
    '</object>');
}
function montaFlash(swf, width, height, id, wmode, cache)
{
noCache = cache || cache == undefined ? "" : "?" + new Date();

monta_swf = "";
monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" id=\""+ id +"\" width=\""+ width +"\" height=\""+ height +"\" title=\"\">";
monta_swf += "<param name=\"movie\" value=\""+ swf + noCache +"\" />";
monta_swf += "<param name=\"quality\" value=\"high\" />";
monta_swf += "<param name=\"menu\" value=\"false\" />";
monta_swf += "<param name=\"wmode\" value=\""+ wmode +"\" />";
monta_swf += "<embed src=\""+ swf + noCache +"\" quality=\"high\" menu=\"false\" 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);
}
var url_site="http://www.copysimile.com.br" 
var titulo_site="Copy Símile - Impressões que Marcam" 
function adiciona_bookmark(){if (document.all)window.external.AddFavorite(url_site,titulo_site)} 

function enquete(theURL) {
	 window.open('',theURL,"top=150,left=250,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=420");
}

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 veiculo(veiq) {
   winId = window.open("veiculos.php?veic="+veiq,"veiculos","width=749,height=575,resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,directories=no,status=no");
	var clientWidth = screen.availWidth;
	var clientHeight = screen.availHeight;
	var xPos = (clientWidth - 770)/2;
	var yPos = (clientHeight - 550)/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 abreformIndique(){
	url = document.location.toString();
	//alert(url);
	//alert(sPathJSP);
	window.open('http://www3.chevrolet.com.br/indique_amigo/pop_indique.jsp?url=' + url, 'novox', 'toolbar,width=401,height=390,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no')

}


