// JavaScript Document
// This validates the area code
function validateArea() {
	var area = document.getElementById("area").value;
	var validated = isNaN(area);
		if(validated) {
				alert('THIS IS ONLY FOR NUMBERS');
				var area = document.getElementById("area").value= '';
			
			}
	}
// this ends the area code validation
// this starts the phone number validation
function validatePhone() {
	var phone = document.getElementById("telefono").value;
	var validated = isNaN(phone);
		if(validated) {
			alert('ONLY NUMBERS. NO TEXT OR SPACES');
			var phone = document.getElementById("telefono").value= '';
			}
	}
	//this ends the phone validation
function DoCustomValidation()
{
  var frm = document.forms["form1"];
  if(frm.pass.value != frm.pass2.value)
  {
    alert('The Password and verified password does not match!');

	var pass = document.getElementById("pass").value= '';
	var pass2 = document.getElementById("pass2").value= '';
	    return false;
  }
  else
  {
    return true;
  }
}
		function validatephone(xxxxx) {
	 var maintainplus = '';
 	var numval = xxxxx.value
 	if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
 	curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
 	xxxxx.value = maintainplus + curphonevar;
 	var maintainplus = '';
 	xxxxx.focus;
}
// This atarts the search box balidation for both make and model
  

 function validateOnSubmit() {
    var elem;
    var errs=0;
    // execute all element validations in reverse order, so focus gets
    // set to the first one in error.
	var make = document.getElementById("Category").value;
	var model = document.getElementById("SubCat").value;
  
	if (make == 1) errs += 1; 
	if (model == 1) errs += 1; 
	

    if (errs>1)  alert('PLEASE SELECT A MAKE AND MODEL.');
    if (errs==1) alert('PLEASE SELECT A MAKE AND MODEL');

    return (errs==0);
  }
  	
function PhotoListing() {
		// this will hide id item
		var div = document.getElementById('HideMe').style.display = "none" ;
		var div = document.getElementById('ShowMe').style.display = "block" ;
		
		}	
function PhotoListingShow() {
		// this will hide id item
		var div = document.getElementById('HideMe').style.display = "block" ;
		var div = document.getElementById('ShowMe').style.display = "none" ;
		
		}	
