/* uses an input's title property to show/hide prompt text in the field */

function clearPrompt(obj) {
        if (obj.value == obj.title) {
                obj.value = '';
        }
}
function resetPrompt(obj) {
        if (obj.value == '') {
                obj.value = obj.title;
        }
}
/**************** deprecated
function submitPropertyTypeForm(formId, objId,PropertyType, region, minPrice, maxPrice) {
        var form = document.getElementById(formId);
        // get selected value
        obj = document.getElementById(objId);
        region = obj.options[obj.selectedIndex].value;
        form.action = '/property/Montana/'+region+'/'+PropertyType+'/'+minPrice+'/'+maxPrice+'/';
        form.submit();
}
*/
function submitForm(ID) {
        var form = document.getElementById(ID);
        if (form) {
                form.submit();
        }
}

function submitFormD(ID) {
	if(formValidator()) {
        	var form = document.getElementById(ID);
	        if (form) {
                	form.submit();
        	}
	}
}

function addFormBtn(label, btnClass, form, action) {
        document.write('<a href="javascript: ' + action + 'Form(\'' + form + '\');" class="' + btnClass + '" onclick="this.blur();"><span>' + label + '</span></a>');
}

function addFormBtnD(label, btnClass, form, action) {
        document.write('<a href="javascript: ' + action + 'FormD(\'' + form + '\');" class="' + btnClass + '" onclick="this.blur();"><span>' + label + '</span></a>');
}


function addCloseBtn(label, btnClass) {
        document.write('<a href="javascript: window.close();" class="' + btnClass + '" onclick="this.blur();"><span>' + label + '</span></a>');
}

