onmousedown=”functionNameHere (‘caselabelhere’)”

or

ajaxManager(‘start_up’)

would signify to the browser to use the function ajaxManager and to only execute the start_up case. In using the case / switch method in this manner we are effectively creating sub functions within the main function that often results in code brevity.

Line 4: Creates our first case. In this instance we are creating a case labelled load_page.

Line 5: We don't want older browser to use the script so we create an if condition to allow only browsers that support document.getElementById