function ValidateDataComputerImaging()
{
	
	
	var element = document.getElementById('contactDate');
	if (element.value != "")
	{
		return false;
	}
	
	var element = document.getElementById('txtFirstName');
	element.value=trim(element.value);
	if (element.value == "")
	{
		alert('Please, enter your first name.');
		element.focus();
		return false;
	}
	else
	{
		if(HasNumbers(element.value))
		{
			alert('First name contains numbers, please remove them.');
			element.focus();
			return (false);
		}
	}	
	
	var element =document.getElementById('txtLastName');
	element.value=trim(element.value);
	if (element.value == "")
	{
		alert('Please, enter your last name.');
		element.focus();
		return false;
	}
	else
	{
		if(HasNumbers(element.value))
		{
			alert('Last name contains numbers, please remove them.');
			element.focus();
			return (false);
		}
	}
	
	element =document.getElementById('txtPhone');
	element.value=trim(element.value);
	
	if (element.value == "")
	{
		alert('Please, enter your phone number.');
		element.focus();
		return false;
	}
	else if(!ValidatePhone(element.value))
	{
		alert("Please, enter a valid phone number.");
		element.focus();
		return false;
	}
		
	element = document.getElementById('txtEmail');
	element.value=trim(element.value);
	if (element.value == "")
	{
		alert('Please, enter your email.');
		element.focus();
		return false;
	}
	else
	{
		if(!ValidateEmail(element.value))
		{
			alert("Please check the emails address");
			element.focus();
			return false;
		}
	}
	
	var valid = false;
	var chkList= document.getElementById('cblProcedures');
	var chkLista= chkList.getElementsByTagName("input");
	
	for(var i=0;i<chkLista.length;i++)
	{  
		if(chkLista[i].checked)
		{
			valid = true;
			break;
		}
	}
	
	if(valid == false)
	{
		alert('Please, please select a procedure.');
		
		return false;
	}
	
	var rdo = document.getElementById('optHowWouldYouLikeReply');
	var tag = rdo.getElementsByTagName("input");
	if (!tag[0].checked && !tag[1].checked)
	{
		alert('Please, select how would you like us to reply.');
		
		return false;
	}
	
	
	
	element = document.getElementById('fupFile1');
	var ExtensionAllows=document.getElementById("hddComputerImagingUploadExtension").value.toLowerCase();
	if (element.value!="" && !ValidFile(element.value,ExtensionAllows))
	{
		alert('Select a file with these extension: (' + ExtensionAllows + ')');
		element.focus();
		return false;
	}	
	
	element = document.getElementById('fupFile2');
	if (element.value!="" && !ValidFile(element.value,ExtensionAllows))
	{
		alert('Select a file with these extension: (' + ExtensionAllows + ')');
		element.focus();
		return false;
	}	
	
	element =document.getElementById('fupFile3');	
	if (element.value!="" && !ValidFile(element.value,ExtensionAllows))
	{
		alert('Select a file with these extension: (' + ExtensionAllows + ')');
		element.focus();
		return false;
	}	
	
	element = document.getElementById('fupFile4');
	if (element.value!="" && !ValidFile(element.value,ExtensionAllows))
	{
		alert('Select a file with these extension: (' + ExtensionAllows + ')');
		element.focus();
		return false;
	}	
	return true;
}

function ValidFile(value,ExtensionAllows)
{
        
	    var arrExtension=ExtensionAllows.split(",");
	    var IsValid=false;
    	
	    var i=0;
	    for (i=0;i<arrExtension.length;i++) 
	    {
		    var pos=value.toLowerCase().indexOf(arrExtension[i]);
		    if (pos>=0)	{
			    IsValid=true;
			    break;
		    }										
    			
    		
	    }
	    return IsValid;
}

function ValidateEmail(valor)
{
	if (/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(valor))
	return true;
	else
	return false;
}

function HasNumbers(valor) 
{
    if (/[0-9]/.test(valor))
            return true;
    else
            return false;
}

function ValidatePhone(incoming)
{
	var ValidChars = "0123456789.()- ";
	var IsCorrect=true;
	var Char;

	for (cont = 0; cont < incoming.length && IsCorrect == true; cont++) 
	{ 
		Char = incoming.charAt(cont); 
		if (ValidChars.indexOf(Char) == -1) 
			return false;
	}
	return true;
}

function clearText(thefield)
{
	if (thefield.defaultValue == thefield.value) 
		thefield.value = "";
} 

function replaceText(thefield)
{
	if (thefield.value == "") 
		thefield.value = thefield.defaultValue;
}

function trim(myString)
{
 return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
}



