/** Show Help Functions **/
var help_layer, help_timer, help_scroller;

function ScrollHelp() {
	if( help_layer && help_layer.style.top ) {
		help_layer.style.top = document.viewport.getScrollOffsets().top+5+'px';
	}
}


function HideHelp() {
	  
  help_layer.style.visibility='hidden';
  window.clearInterval( help_scroller );
  
}

function ShowHelp( module, field ) {
	
	var url =  '/admin/help/controller.php?module='+module+'&field='+field;
	var myAjax = new Ajax.Request( url,	{	method: 'get', onComplete: ShowHelpCallback }	);
	help_scroller = window.setInterval(ScrollHelp,5);
}

function ShowHelpCallback( response ) {
	if( !help_layer ) {
		help_layer = document.createElement('div');
		help_layer.className = 'help_layer';
		document.body.appendChild( help_layer );
	}
	
	var htm = response.responseText;
	htm += '<center><a href="javascript:HideHelp();" class="helpbody">Close</a></center>';
	
	help_layer.style.top = 5+document.body.scrollTop+'px';
	help_layer.style.left= '5px';
	help_layer.innerHTML = htm;
	
	
	help_layer.style.visibility='visible';
}
