// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function completeValueInput(obj,strVerificacao){
	
	if(obj.value == strVerificacao){
		obj.value = '';
	}else{
		if(obj.value == ''){
			obj.value = strVerificacao;
		}
	}
}

function validate_form_contato(form){
	var bReturn = true;
	emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;

	if($('#contato_nome').val() == "" || $('#contato_nome').val() == "Nome completo"){
		alert('Informe por favor o seu nome.');
		bReturn = false;
	}else{
		
		if($('#contato_email').val() == "" || $('#contato_email').val() == "E-mail"){
			alert('Informe por favor o seu endereço de e-mail.');
			bReturn = false;
		}else{

			if( !emailRegExp.test($('#contato_email').val()) ){
				alert('Informe por favor um endereço de e-mail válido.');
				bReturn = false;
			}else{
				if($('#contato_texto').val() == "" || $('#contato_texto').val() == ""){
					alert('Informe por favor o texto.');
					bReturn = false;
				}

			}

		}
	}
	return bReturn;

}


function videoshow(id, codigo, titulo){
	
	$('#video_'+id).html("<strong><h3> » "+ titulo +"</h3></strong><br><center><object width=\"450\" height=\"355\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+ codigo +"&fs=1&autoplay=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/"+ codigo +"&hl=pt_BR&fs=1&autoplay=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"450\" height=\"355\"></embed></object></center><br>");
	//bazinga

}


