function checkform(){
         if ($F('cur-cat')=='' || $F('cur-cat')=='Select a category...')
        {
                alert('Please select a category.');
                return false;
        }
        return true;
}

function features(id){
	Effect.toggle(id,'blind');
}

function popper(theURL,winName,features) {
  window.open(theURL,winName,features);
}
  
function catLoad(form,element){
 	var country = $F('c-select');
 	var pars = "c="+country;
 	var url = "/includes/categories.php";
 	
 	var myProcess = new Ajax.Updater (
		element,
		url,
		{
			method: 'get',
			parameters: pars
			}
		);
 }



// VENDOR PASSWORD

function startPass(){
	Effect.BlindDown('display');
}

function sendPass(){

	var url = 'scripts/ajax/vendorpass.php';
	var pars = 'pemail='+$F('pemail');
	var myProcess = new Ajax.Updater (
	'password',
	url,
		{
		method: 'post',
		parameters: pars
		}
	);
}

// vendor account validation

function chForm(e){
	thisForm = Event.element(e);
	var error = 'no'
	var required = $(thisForm).getElementsByClassName('req');
	
	required.each(function(n){
		
		myDaddy = n.up();
		if (n.next('img') !== undefined) n.next('img').remove();
		if ($F(n) == '' || typeof $F(n) == 'undefined'){
			new Insertion.After(n,"<img src=\"images/chk_off.png\" />");
			error = 'yes';
		}
	});
	if (error === 'yes') {
		Event.stop(e);
		alert("Please complete the fields denoted with a red 'X'");
	}
}

function accountForm(){
	Event.observe('account', 'submit', chForm);
}

function listingForm(){
	//Event.observe('listing', 'submit', chForm);
	//Event.observe('type','change', switchPackage);
} 

function switchPackage(){
	//pack = $F('type');
	alert('here');
	//Effect.toggle('images', 'blind');
}