function checkFieldForm(){
	//return true;
	if( !(validateNotEmpty($('#name').val()) ) ){
		showMessage("Ingrese su Nombre");
		return false;
	}else{
		if( !(validateName($('#name').val()) ) ){
			showMessage("Ingrese Nombre Valido");
			return false;
		}
	}
	if( !(validateNotEmpty($('#phone').val()) ) ){
		showMessage("Ingrese su Tel&eacute;ono");
		return false;
	}else{
		if( !( validateNumeric($('#phone').val()) ) ){
			showMessage("Ingrese Tel&eacute;ono Valido");
			return false;			
		}
	}	
	if( !(validateNotEmpty($('#email').val()) ) ){
		showMessage("Ingrese su Email");
		return false;
	}else{
		if( !( validateEmail($('#email').val()) ) ){
			showMessage("Ingrese Email Valido");
			return false;			
		}
	}
	
	return true;
}

function indexPropertyView(){
	$('html').scrollTo( {top:'0px', left:'0px'}, 750, { onAfter: function(){
		showAjaxLoading('#prominent');
		showAjaxLoading('#inHome');
		$.post("kernel/index.php", 
				{ option: "propertyView" },
				function(data){
					var JSONobject = JSON.parse(data);
					$("#prominent").fadeOut('slow', function() { 
						$(this).html(JSONobject.prominent).fadeIn('slow', function(){
							$("#inHome").fadeOut('slow', function() { 
								$(this).html(JSONobject.inHome).fadeIn('slow', function(){
									zIndexFixing();
								}); 
							});						
						}); 
					});
					return false;
				});
	} } );
}

$(window).bind('load', function(){
	indexPropertyView();
	
	$('#enviarFormIndex').click(function(){
		enviarMailIndex();
	});
	
});

$(function(){
	$('html').scrollTo( {top:'0px', left:'0px'}, 750, { onAfter: function(){	
		$('.home:a').addClass('homeSelected');
		showSelect('idTypePropertySearch', 'typeProperty', '', 0, 0, '');
		showSelect('idTypeOperationSearch', 'typeOperation', '', 0, 0, '');
		showSelect('idProvinceSearch', 'province', '', 0, 0, '');
		showSelect('idLocalitySearch', '', '', 0, 0, '');
	} } );
	
	$('#bucad_btnlupa').click(function(){
		$('html').scrollTo( {top:'0px', left:'0px'}, 750, { onAfter: function(){
			$('#searchForm').submit();
		} } );
	});
});
