
/* rewrite HTML */
/* ! prototype.js ! */

function rewriteHTML(id, filename){
	new Ajax.Updater(id, filename, {method:'get'});
}




/* swap IMG */

function swapIMG(url,name){
document[name].src=url;
}


/* open HTML */

function openHTML(url,name,wid,hig){
var controlWindow = window.open(url,name,'width='+wid+',height='+hig+',resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1');
}


/* show-hide OBJ */

function showOBJ(block){
document.getElementById(block).style.display = "block";
}
function hideOBJ(block){
document.getElementById(block).style.display = "none";
}


/* ANCHOR */

function ANCHOR(id){
	obj = document.getElementById(id);
	y = obj.offsetTop;
	scrollTo(0,y);
}


/* pursuit CURSOR */

var pursuitCalled = false;
function pursuitCURSOR(cursorId) {
	if (!pursuitCalled) {
		pursuitCalled = true;
		var cursorMove = function (ev) {
			var cursor = $(cursorId);
			if (cursor) {
				cursor.style.left = Event.pointerX(ev) + "px";
				cursor.style.top  = Event.pointerY(ev) + "px";
			}
		}.bindAsEventListener();

		Event.observe(document, "mousemove", cursorMove);
		Event.observe(window, "unload", function () {
			Event.stopObserving(document, "mousemove", cursorMove);
		});
	}
}
