/* Show help notes */
function showHelpNote(linkId, noteId){
	
	var positionTop 	= document.getElementById(linkId).offsetTop;
	var positionRight	= document.getElementById(linkId).offsetRight;
	var positionBottom	= document.getElementById(linkId).offsetBottom;
	var positionLeft	= document.getElementById(linkId).offsetLeft;
	
	if((positionLeft - 140) > 0 ){
		positionLeft = positionLeft - 140;
	}

	if((positionTop - (document.getElementById(noteId).offsetHeight / 2) ) > 0 ){
		positionTop = positionTop - document.getElementById(noteId).offsetHeight / 2;
	}

	document.getElementById(noteId).style.position = "absolute";	
	document.getElementById(noteId).style.left = positionLeft + "px";
	document.getElementById(noteId).style.top = positionTop + "px";		
	document.getElementById(noteId).style.visibility= "visible";	
}

/* Hide help notes */	
function hideHelpNote(noteId){
	document.getElementById(noteId).style.visibility= "hidden";		
}



function toggle_help(show_help_text, hide_help_text, show_help_img, hide_help_img){

	Effect.toggle('help_text', 'slide');
	current_display = document.getElementById('help_text').style.display;
	if(current_display == "none"){
		document.getElementById('help_button_img').src  	= hide_help_img ;
		document.getElementById('help_button_img').alt  	= hide_help_text ;
		document.getElementById('help_button_img').title  	= hide_help_text ;				
	}else{
		document.getElementById('help_button_img').src  	= show_help_img ;
		document.getElementById('help_button_img').alt  	= show_help_text ;
		document.getElementById('help_button_img').title  	= show_help_text ;				
	}
}








// -----------------

	var ajaxRequest = false;
	var ajaxReturn;

	
	function sendAjaxRequest() {
		if (window.XMLHttpRequest) {					
			// Ajax Request for Mozilli, Opera & Safari browsers
			ajaxRequest = new XMLHttpRequest(); 
		} else if (window.ActiveXObject) {
			try {
				// Ajax Request for IE 5 browsers
				ajaxRequest = new ActiveXObject('Msxml2.XMLHTTP'); // IE 5
			} catch (e) {
				try {
					// Ajax Request for IE 6 browsers
					ajaxRequest = new ActiveXObject('Microsoft.XMLHTTP'); 
				} catch (e) {}
			}
		}

		// verifiy ajax request beeing created
		if (!ajaxRequest) {
			alert("Error: Ajax request could not be created.");
			return false;
		} else {
		
			if(!requestFile){
				alert("Error: Missing request file.");	
			}
			ajaxRequest.open('post', requestFile, true);
			ajaxRequest.send(null);
			ajaxRequest.onreadystatechange = handleRequest;
		}
	}

	function handleRequest() {
		switch (ajaxRequest.readyState) {
			case 4:
				if (ajaxRequest.status != 200) {
					alert(ajaxRequest.status);
				} else {
					ajaxReturn = ajaxRequest.responseText;
					handleAjaxReturn(ajaxReturn);
				}
				break;
			default:
				break;
		}
	}

//-----



