//
$(function() {
	$('#subFormPanel').hide();
	$('#mapLargeBox').hide();
	
    $("img[@ref=over]")  
        .mouseover(function () {  
            this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");  
        })  
        .mouseout(function () {  
            this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");  
        })  
        .each(function () {  
            this.preloaded = new Image;  
            this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
    });
});
//
function getData(obj, url, refobj) {
    $(obj).load(url+'/'+$(refobj).val());
}

function loadForm(formID, url) {
	$(formID).load(url);
	$(formID+":hidden").show("normal");
}

function hideForm(formID) {
	$(formID).fadeOut("normal");
}

function showMap(mapID) {
	$(mapID).fadeIn("slow");
}

function updateCValue(obj, url, refobj) {
    $(obj).load(url+'/'+$(refobj).val());
}

function postForm(formID, url, paramID) {
	var param = {};
	$('input',$(paramID)).each(function() {
		param[$(this).attr('name')] = ($(this).val())? $(this).val() : '';
	});
	$('select',$(paramID)).each(function() {
		param[$(this).attr('name')] = ($(this).val())? $(this).val() : '';
	});
	$('textarea',$(paramID)).each(function() {
		param[$(this).attr('name')] = ($(this).val())? $(this).val() : '';
	});
	$(formID).load(url, param);
} 