Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';

function toggleQuestion(Elm){
	while(Elm.nodeType==3 || !$(Elm).hasClassName("answer")) {
		if(!Elm.nextSibling) break;
		Elm = Elm.nextSibling;
	}
	var settings = { duration: 0.5 };
	$$(".answer").each(function(a){if($(a).visible()) {Effect.SlideUp(a, settings);}});
	if(!$(Elm).visible()) {
		Effect.SlideDown(Elm, settings);
	}
}

function showpage(cls,Elm){
	$$("."+cls).each(function(a){$(a).hide();});
	if(!$(Elm).visible()) {
		$(Elm).show();
	}
}

function loadContent(pageId, section)
{
	var path = '/'+pageId+'/'+section+'/';
	
	Ext.Ajax.request({
		url: path+'body.panel',
		success: function(response,opts){
			document.getElementById("bodyContent").innerHTML = response.responseText;
			reapplyContactLinkActions();
		},
		failure: function(response, opts){
			Ext.MessageBox.alert('Oops', 'There was an error retrieving the the body content.');
		}
	});
	
	Ext.Ajax.request({
		url: path+'side.panel',
		success: function(response,opts){
			document.getElementById("sideContent").innerHTML = response.responseText;
			reapplyContactLinkActions();
		},
		failure: function(response, opts){
			Ext.MessageBox.alert('Oops', 'There was an error retrieving the the side panel content.');
		}
	});	
}

