var ClassifiedsForm = new Class({
        
	  initialize: function(frm){
	  frm = $(frm);

           this.err = $('classError');
           this.scroll = new Fx.Scroll(window);

  	   frm.addEvent('submit', function (e) {

	                e.stop(); // Stop the form submission
                	if($('category').get('value') != '') frm.submit(); // Check value
	                if($('category').get('value') == '') {
		                    this.err.show();
		                    this.scroll.toElement(this.err); // Scroll to...
	                }
               }.bind(this));
        }
});

document.addEvent('domready',function(){
	new ClassifiedsForm($('classForm'));
});

function hide(obj)
  {
      obj1 = document.getElementById(obj);
      obj1.style.display = 'none';
  }
function show(obj)
  {
      obj1 = document.getElementById(obj);
      obj1.style.display = '';
  }

function show_other(optionValue)
{
	if(optionValue=='31' || optionValue=='229') {
                         show('make'); show('models'); show('year'); show('odometre');
        }else if(optionValue=='233'){
                         show('make'); show('year'); hide('odometre'); hide('models');
        }else{
                         hide('make'); hide('models'); hide('year'); hide('odometre');
        }
}

