var timeouts = new Array();

function sendPing (controller, timeout) {
	if ((tail - head > 1) || (head > tail)) return;
	
	messageREWAD('/:/'+controller+'/ping', '');
	timeouts[controller] = setTimeout('sendPing("'+controller+'", '+timeout+');', timeout);
}

function startPinger (controller, timeout) {
	clearTimeout(timeouts[controller]);
	timeouts[controller] = setTimeout('sendPing("'+controller+'", '+timeout+');', timeout);
}

function stopPinger (controller) {
	clearTimeout(timeouts[controller]);
}

function sendPingEx(controller) {
	if ((tail - head > 1) || (head > tail)) return;
	
	showdbg('PingEx');
	messageREWAD('/:/'+controller+'/ping', '');
}
