var myGlobalHandlers = {
        onCreate: function(){
                if ($('systemWorking')) {
                        Element.show('systemWorking');
                }
        },
        onComplete: function() {
                if(Ajax.activeRequestCount == 0) {
                        if ($('systemWorking')) {
                                Element.hide('systemWorking');
                        }
                }
        },
        onException: function() {
                if ($('systemWorking')) {
                        Element.hide('systemWorking');
                }
        }
};
Ajax.Responders.register(myGlobalHandlers);

// ajaxRequestHandler
// params is a list of args to send to url
// action is the function to be called after the responseText is spit back
function ajaxRequestHandler(url, params, action) {
        var requesttype = 'post';
        if (window.XMLHttpRequest) {
                requesttype = 'get';
        }
        var myAjax = new Ajax.Request(
        url,
        {
                method: requesttype,
                postBody: params,
                parameters: params,
                onComplete: action,
                requestHeaders:['Referer', document.location.href]
        });
}

function changeClass(thisDiv) {
        var linkId;
        var linkIds = ['jqmcbp', 'music', 'pics', 'moxiedare', 'video', 'links'];
        linkIds.each(function(key) {
                if ($(key)) {
			$(key).className = 'normal';
                }
        });
	if ($(thisDiv)) {
		$(thisDiv).className = 'active';
	}

}

function doNothing(theData) {
	return true;
}

function showContent(theData) {
	var myData = theData.responseText;
	if ($('content')) {
		$('content').innerHTML = myData;
	}
}

function showMe(thisId) {
	if ($(thisId)) {
		Element.show(thisId);
	}
}

function hideMe(thisId) {
	if ($(thisId)) {
		Element.hide(thisId);
	}
}

window.onload= function() {
	// stuff you want to happen onload
}

