function CarregarFlash(url,w,h,transparente){
	var obj="<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='"+w+"' height='"+h+"'>";
	obj+="<param name='movie' value='"+url+"' />";
	obj+="<param name='quality' value='best' />";
	//VERIFICA SE É TRANSPARENTE
	if(transparente=="yes")
	{obj+="<param name='BGCOLOR' value='#FFFFFF' /><param name='wmode' value='transparent' />";}
	obj+="<embed src='"+url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+w+"' height='"+h+"'";
	if(transparente=="yes"){obj+=" wmode='transparent'"}
	obj+="></embed></object>";
	document.write(obj);
}

function popUpImg(param,width,height){
	window.open('popUp.php?img='+param,'','width='+width+',height='+height+',toolbar=0,titlebar=0,statusbar=0,resizable=1');
}

function popFotos(idFoto){
	window.open('galeria.php?id='+idFoto,'','width=645,height=430,toolbar=0,titlebar=0,statusbar=1');
}

function vContato(f){
	if(f.nome.value==''){
		showError('Nome Inv&aacute;lido');
		return false;
	}
	if(f.email.value==''){
		showError('E-mail Inv&aacute;lido');
		return false;
	}
	if(f.email.value.indexOf('@')==-1){
		showError('E-mail Inv&aacute;lido');
		return false;
	}
	if(f.email.value.indexOf('@')!=f.email.value.lastIndexOf('@')){
		showError('E-mail Inv&aacute;lido');
		return false;
	}
	if(f.email.value.indexOf('.',f.email.value.indexOf('@'))==-1){
		showError('E-mail Inv&aacute;lido');
		return false;
	}
	if(f.telefone.value.length!=0){
		if(f.telefone.value.length<8){
			showError('Telefone Inv&aacute;lido');
			return false;
		}
	}
	if(f.mensagem.value==''){
		showError('Digite alguma mensagem');
		return false;
	}
		
	return true;
}

function showError(msg){
	div = document.getElementById('error');
	campo = div.getElementsByTagName('td')[2];
	campo.innerHTML=msg;
	div.style.visibility="visible";
}

function hideError(){
	div = document.getElementById('error');
	campo = div.getElementsByTagName('td')[2];
	campo.innerHTML='';
	div.style.visibility="hidden";
}

function vEnviaAmigo(f){
	if(f.nomeAmigo.value==''){
		alert('Nome do amigo Invalido');
		f.nomeAmigo.focus();
		return false;
	}
	if(f.emailAmigo.value==''){
		alert('E-mail Invalido');
		f.emailAmigo.focus();
		return false;
	}
	if(f.emailAmigo.value.indexOf('@')==-1){
		alert('E-mail Invalido');
		f.emailAmigo.focus();
		return false;
	}
	if(f.emailAmigo.value.indexOf('@')!=f.emailAmigo.value.lastIndexOf('@')){
		alert('E-mail Invalido');
		f.emailAmigo.focus();
		return false;
	}
	if(f.emailAmigo.value.indexOf('.',f.emailAmigo.value.indexOf('@'))==-1){
		alert('E-mail Invalido');
		f.emailAmigo.focus();
		return false;
	}
	if(f.nomeRemetente.value==''){
		alert('O seu nome esta Invalido');
		f.nomeRemetente.focus();
		return false;
	}
	return true;
}