function processIn(ourForm) {
	if (!ourForm.zip.value) {
		alert('Please enter a US Zip Code');
		return false;
	}

	if (!isZip(ourForm.zip.value)) {
		alert('Please enter a US Zip Code');
		return false;
	}

	window.location = 'http://www.carsforagrand.com/zip/'+ourForm.zip.value+'/';
	return false;
}


function addBookmark(title, url) {
        if (window.sidebar) { // firefox
              window.sidebar.addPanel(title, url,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( url, title);
        } else {
               alert("Sorry, your browser doesn't support this. Try pressing Ctrl-D to bookmark.");
        }
}


function moveMenu() {
	 document.getElementById('left').innerHTML = document.getElementById('leftContent').innerHTML
}

function isZip(s) 
{

     // Check for correct zip code
     reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);

     if (!reZip.test(s)) {
          return false;
     }

return true;
}

function zipsubmit(){ 
	
	var keywrds = document.getElementById('keywrds').value;
	var maxprice = document.getElementById('maxprice').value;
	var radius = document.getElementById('radius').value;
	var zip = document.getElementById('zip').value;
	
	if (!zip) zip = 'any'; 
	
	window.location = "/zip/"+escape(zip)+"/"+escape(keywrds)+"/"+escape(maxprice)+"/"+escape(radius)+"/";
}
