function getClasses(id) {
	var returnto = 'class';
        $(returnto).disabled = true;
        $(returnto).style.background = 'url(images/loading.gif) no-repeat center';
 	var url = 'dynamic_list.php';
	var myAjax = new Ajax.Request( url, {
                method: 'post',
                parameters: {action: 'getClasses', typeID: id, field: returnto},
                onSuccess: function(Response) {
                        $(returnto).style.background = '';
                        $(returnto).disabled = false;
                        $(returnto).replace(Response.responseText);
                        if (cur_class) {
                                $(returnto).value = cur_class;
                        }
                }
        });
}
function setType(id) {
	$('powerboat').src = 'images/powerboat_up.jpg';
	$('sailboat').src = 'images/sailboat_up.jpg';
	$('yacht').src = 'images/yacht_up.jpg';
	$('smallboat').src = 'images/smallboat_up.jpg';
	$('pwc').src = 'images/pwc_up.jpg';
	switch(id) {
		case 1:
		        $('powerboat').src='images/powerboat_down.jpg'
		        break;
		case 2:
		        $('sailboat').src='images/sailboat_down.jpg'
		        break;
		case 3:
		        $('yacht').src='images/yacht_down.jpg'
		        break;
		case 4:
		        $('smallboat').src='images/smallboat_down.jpg'
		        break;
		case 5:
		        $('pwc').src='images/pwc_down.jpg'
		        break;
	}
	$('type').value = id;
	$('type').onchange();
}
function expandBox(link, box) {
	if (box.style.display != 'block') {
	        box.style.display = 'block';
	        link.innerHTML = 'Hide User Profile';
	}
	else {
	        box.style.display = 'none';
	        link.innerHTML = 'Show all User Profile';
	}
	return false;
}
function deleteListing(listing) {
        var answer = confirm("Do you really want to delete this listing?");
        if (answer)
                document.location.href='dashboard.php?dellisting=' + listing;
}
function deletePhoto(photo) {
        var answer = confirm("Do you really want to delete this photo?");
        if (answer)
                document.location.href='photo_edit.php?delphoto=' + photo;
}

