function flash(swf,width,height,transparent,links)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"');
document.write('width="' + width + '" height="' + height + '">');
document.write('<param name="movie" value="' + swf + '" />');
document.write('<param name="quality" value="high" />');
// if(transparent=='true'){
 // document.write('<param name="wmode" value="transparent">');
 //}
document.write('<param name="FlashVars" value="' + links + '" />');

document.write('<embed src="' + swf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>'); 
document.write('</object>');
}

//Função para colocar as horas atualizando em min e min - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function mostradata(){
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()
	if (hours <=9)
hours="0"+hours;
	if (minutes<=9)
minutes="0"+minutes;
	if (seconds<=9)
seconds="0"+seconds;
	var cdate="<span>"+hours+":"+minutes+":"+seconds+" "+"</span>" 
	clock.innerHTML= cdate;
setTimeout("mostradata()",1000);
}

//FUNÇÃO IMPRIMIR - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function DoPrinting() {
	if (!window.print){
		alert("Use o Netscape ou Internet Explorer \n nas versões 4.0 ou superior!")
		return
	}
	window.print()
}
function confirma(url,t){
	switch(t){
	case 1:
		a = confirm("Tem certeza de que deseja excluir este produto de seu carrinho?")
		break;
	case 2:
		a = confirm("Tem certeza de que esvaziar seu carrinho?")
		break;
	}
	if(a==true){
		window.location.href = url
	}		
}

function formataMoeda(pValor){
	var retorno = pValor.toFixed(2).toString().split(".");
	switch(retorno[0].length){
		case 9:
			retorno[0] = retorno[0].substr(0,retorno[0].length-6) + "." + retorno[0].substr(3,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
		case 8:
			retorno[0] = retorno[0].substr(0,retorno[0].length-6) + "." + retorno[0].substr(3,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
		case 7:
			retorno[0] = retorno[0].substr(0,retorno[0].length-6) + "." + retorno[0].substr(3,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
		case 6:
			retorno[0] = retorno[0].substr(0,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
		case 5:
			retorno[0] = retorno[0].substr(0,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
		case 4:
			retorno[0] = retorno[0].substr(0,retorno[0].length-3) + "." + retorno[0].substr(retorno[0].length-3,3);
			break;
	}
	vretorno = retorno.join(",");
	return vretorno;
}