	// Location of the CFC file which contains all the components for these functions
	var urlEyeBook = "/mxajax/core/cf/eyebook.cfc";
	
	// Show and hide the eyebook functionality
	function showEyeForm(params, destination) {
		
	if ( document.getElementById(destination).innerHTML == '' ) {			
		
			new mxAjax.Data({
				executeOnLoad:true,
				paramArgs: new mxAjax.Param(urlEyeBook,{param:params, cffunction:"displayEyeform"}),
				postFunction: handleDataEyeForm
			});
		
	}
	else { document.getElementById(destination).innerHTML = '' }
	   
		function handleDataEyeForm(response) {
			var myHTMLOutput = JSON.parse(response);
			document.getElementById(destination).innerHTML = myHTMLOutput;
		}
	}

	// Add to a new eye book
	function addEyeBook() {
		new mxAjax.Data({
			executeOnLoad:true,
			paramArgs: new mxAjax.Param(urlEyeBook,{param:"eyeBook={newBook},iid={iid},mid={mid}", cffunction:"addEyeBook"}),
			postFunction: handleDataAddEB
		});
	   
		function handleDataAddEB(response) {
			var myHTMLOutput = JSON.parse(response);
			document.getElementById('eyeForm').innerHTML = '';
		}
	}
	
	// Add to an existing eye book
	function updateEyeBook() {
		new mxAjax.Data({
			executeOnLoad:true,
			paramArgs: new mxAjax.Param(urlEyeBook,{param:"eyeBook={existing},iid={iid},mid={mid}", cffunction:"updateEyeBook"}),
			postFunction: handleDataAddEB
		});
	   
		function handleDataAddEB(response) {
			var myHTMLOutput = JSON.parse(response);
			document.getElementById('eyeForm').innerHTML = '';
		}
	}		
	
	// Remove insight from eyeBook
    function remInsightEyeBook(params, destination) {
        new mxAjax.Data({
            executeOnLoad:true,
            paramArgs: new mxAjax.Param(urlEyeBook,{param:params, cffunction:"remBookmark"}),
            postFunction: handleData
        });
       
        function handleData(response) {
            var myHTMLOutput = JSON.parse(response);
            document.getElementById(destination).style.display = 'none';
        }
        
        
    }
	// Remove eyeBook
    function remEyeBook(params, destination) {
		
		if (window.confirm("Are you sure you want to delete this eyeBook?")) {
		
        new mxAjax.Data({
            executeOnLoad:true,
            paramArgs: new mxAjax.Param(urlEyeBook,{param:params, cffunction:"remEyeBook"}),
            postFunction: handleData
        });
		
		}
		else {
		}
       
        function handleData(response) {
            var myHTMLOutput = JSON.parse(response);
            document.getElementById(destination).style.display = 'none';
        }
        
        
    }

	
function disableEnterKey(e)
{
     var key;      
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox      

     return (key != 13);
}
