function vldForm(frm)
{
	var a = document.getElementById("captcha");
	
	var name = document.getElementById("fld_name");
	var email = document.getElementById("fld_email");
	var phone = document.getElementById("fld_phone");
	
	if (name.value.length < 2) {
		alert('Please enter your name.');
		name.focus();
		return false;
	}
	
	if (email.value.indexOf("@") == -1 || email.value.indexOf(".") == -1 || email.value.length < 5) {
		alert('Pelase enter valid email address.');
		email.focus();
		return false;
	}
	
	if (phone.value.length < 6) {
		alert('Please enter your telephone number.');
		phone.focus();
		return false;
	}
	
	if (a.value.length < 3) {
		alert("Please enter valid security code.");
		a.focus();
		return false;
	}
	
	var form	= eval('document.'+ frm);
	var qtdCampos	= form.length;
	var x;
	
	for(x=0;x<=qtdCampos-1;x++)
	{
		if(form.elements[x].valid != null)
		{
			if(form.elements[x].valid == 'n' || form.elements[x].valid == 'N')
			{
				if(isNaN(form.elements[x].value))
				{
					alert('Please fill in the fields correctly *');
					form.elements[x].focus();
					return(false);
				}
			}
			else
			{
				if(form.elements[x].name.indexOf("email") != -1)
				{
					if(
						form.elements[x].value.indexOf("@") <= 0  ||
						form.elements[x].value.indexOf(".") == -1 ||
						form.elements[x].value.length <= 5
					)
					{
						alert('E-mail Invalid *');
						form.elements[x].focus();
						return(false)
					}
				}
				else if(form.elements[x].value == '' || form.elements[x].value == ' ')
				{
					alert('Please fill in the fields correctly *');
					form.elements[x].focus();
					return(false);
				}
			}
		}
	}
	
	return(true);
}

function comboData(nomeCampo,complemento,sDia,sMes,sAno){
	
	var anoInicial, anoAtual, data, dataAtual, anosMais, marcar, x, y, nomeCampo, Sdia, Smes, Sano, edicao, retorno;

			data = new Date();
			anoInicial = 1910;
			dataAtual = data.getDate() +'/'+ data.getMonth() +'/'+ data.getFullYear();
			anoAtual = data.getFullYear();
			anosMais = parseInt(anoAtual);
			edicao = false;
			retorno	= "";

				if(sDia == undefined && sDia == undefined && sDia == undefined)
				{
					sDia	= data.getDate();
					sMes	= (data.getMonth())+1;
					sAno	= data.getFullYear();
				}
			//==================== DIA ====================>
				retorno += "<select id='"+ nomeCampo +"cbDia' onChange=\"document.getElementById('"+ nomeCampo +"').value = document.getElementById('"+ nomeCampo +"cbDia').value +'/'+ document.getElementById('"+ nomeCampo +"cbMes').value +'/'+ document.getElementById('"+ nomeCampo +"cbAno').value;\" style='width:40px' "+ complemento +">";

			for(x=1;x<=31;x++){// Escrevendo o Combo com os Dias
				if(x <= 9){
					y = "0"+ x;
				}
				else{
					y = x;
				}
					if(sDia == y){
						marcar = " selected";
					}
					else{
						marcar = "";
					}
				retorno += "<option value='"+ y +"'"+ marcar +">"+ y +"</option>";
				if(x == 31){
					retorno += "</select> / ";
				}
			}
			//==================== MES ====================>
				retorno += "<select id='"+ nomeCampo +"cbMes' onChange=\"document.getElementById('"+ nomeCampo +"').value = document.getElementById('"+ nomeCampo +"cbDia').value +'/'+ document.getElementById('"+ nomeCampo +"cbMes').value +'/'+ document.getElementById('"+ nomeCampo +"cbAno').value;\" style='width:40px' "+ complemento +">";

				for(x=1;x<=12;x++){//Escrevendo o Combo com os Meses;
					if(x <= 9){
						y = "0"+ x;
					}
					else{
						y = x;
					}
					
						if(sMes == y){
							marcar = " selected";
						}
						else{
							marcar = "";
						}
					retorno += "<option value='"+ y +"'"+ marcar +">"+ y +"</option>";
					if(x == 12){
						retorno += "</select> / ";
					}				
				}
			//==================== ANO ====================>
				retorno += "<select id='"+ nomeCampo +"cbAno' onChange=\"document.getElementById('"+ nomeCampo +"').value = document.getElementById('"+ nomeCampo +"cbDia').value +'/'+ document.getElementById('"+ nomeCampo +"cbMes').value +'/'+ document.getElementById('"+ nomeCampo +"cbAno').value;\" style='width:60px' "+ complemento +">";
				for(x=anoInicial;x<=anosMais;x++){
					if(sAno == x){
						marcar = " selected";
						edicao = true;
					}
					else{
						if(x == anoAtual && edicao == false){
							marcar = " selected";
						}
						else{
							marcar = "";
						}
					}

				retorno += "<option value='"+ x +"'"+ marcar +">"+ x +"</option>";
				if(x == anosMais){
					retorno += "</select>";
				}				
			}
		//================== HIDDEN COM  O VALOR DA DATA ======================>
		if(isNaN(Sdia) && isNaN(Smes) && isNaN(Sano)){
			retorno += " <input type='hidden' name='"+ nomeCampo +"' id='"+ nomeCampo +"' value='"+ dataAtual +"'>";
		}
		else{
			retorno += " <input type='hidden' name='"+ nomeCampo +"' id='"+ nomeCampo +"' value='"+ sDia +"/"+ sMes +"/"+ sAno +"'>";
		}
		
		return(retorno);
}