/**
 * 
 */
 

var client = mqtt.connect('wss://lightlimited.com:1884')

client.on('connect', function() {
	client.subscribe('clocktower')
})

client.on('message', function(topic, message) {
	// message is Buffer
	console.log(message.toString())
})

function publishColour(colour) {
	client.publish('clocktower', colour);
}

var vadjust=8
function clickColor(hex, seltop, selleft, html5) {
seltop -=vadjust;
	c = hex;
    if ((seltop+(200+vadjust))>-1 && selleft>-1) {
        document.getElementById("selectedhexagon").style.top=seltop + "px";
        document.getElementById("selectedhexagon").style.left=selleft + "px";
        document.getElementById("selectedhexagon").style.visibility="visible";
  } else {
        document.getElementById("selectedhexagon").style.visibility = "hidden";
  }

  client.publish('clocktower', hex);

}
function mouseOverColor() {
}

function mouseOutMap() {
}
