User:Lirmont/monaco.js

function include(filename) {	var head = document.getElementsByTagName('head')[0]; script = document.createElement('script'); script.src = filename; script.type = 'text/javascript'; head.appendChild(script) }

function addEventHandler(target, eventType, handler) {   if (target.addEventListener) { target.addEventListener(eventType, handler, false); } else if (target.attachEvent) { target.attachEvent("on" + eventType, handler); } else { target["on" + eventType] = handler; } }

function includeFiles {   include('/index.php?title=User:Anthoron/prototype.js&action=raw&ctype=text/javascript'); include('/index.php?title=User:Lirmont/tooltip.js&action=raw&ctype=text/javascript'); }

function displayForm {	$('pointName').innerHTML=' Show Name'; $('symbolHolder').innerHTML= 'blip '                                   + 'check '                                   + 'text ' + '';

$('buttonHolder').innerHTML=' Add Point '; $('textareaHolder').innerHTML='';

return false; }

function showCoordinates(event) { var element = Event.element(event); $('xPosField').innerHTML = ((Event.pointerX-positionedOffset(element).left)/element.getWidth)+"%"; $('yPosField').innerHTML = ((Event.pointerY-positionedOffset(element).top)/element.getHeight)+"%"; var e = new Event(e).stop; }

addEventHandler(window, "load", includeFiles); addEventHandler(window, "load", displayForm); addEventHandler($('pictureFrame'), "mouseover", showCoordinates);