document.write("<img width=\"0\" height=\"0\" id=\"heatmapTrack\" /><iframe frameborder=\"0\" width=\"0\" height=\"0\" id=\"heatmapView\"></iframe>");
var heatmapViewKeypressEntered = "";
var heatmapData = "";
var heatmapMousePosX = "";
var heatmapMousePosY = "";
var heatmapHoverUpdate = true;
function heatmapHoverTrack(){
	heatmapHoverUpdate = true;
}
$(document).ready(function(){
	$("#heatmapTrack")
		.css({
			"position" : "absolute",
			"top" : "0px",
			"left" : "0px",
			"opacity" : "0.00"
		});
	$("#heatmapView")
		.hide()
	
	setInterval(heatmapHoverTrack, 5000);
	
	$(document)
		.keypress(function(e){
			heatmapViewKeypressCurrent = (e.keyCode ? e.keyCode : e.which);
			heatmapViewKeypressEntered = heatmapViewKeypressEntered + heatmapViewKeypressCurrent;
			if(heatmapViewKeypressCurrent == 104){
				heatmapViewKeypressEntered = "104";
			}
			else if(heatmapViewKeypressEntered == "104101971161099711299"){
				$("#heatmapView")
					.css({
						"position" : "absolute",
						"top" : "0px",
						"left" : "0px",
						"opacity" : "0.00",
						"width" : $(document).width(),
						"height" : $(document).height(),
						"z-index" : "9999"
					})
					.attr("src", "http://file.idc.asia/heatmap/view.php?o=c&w=" + $(document).width() + "&u=" + window.location)
					.show()
					.fadeTo("slow", 0.50);
			}
			else if(heatmapViewKeypressEntered == "1041019711610997112119"){
				$("#heatmapView")
					.css({
						"position" : "absolute",
						"top" : "0px",
						"left" : "0px",
						"opacity" : "0.00",
						"width" : $(document).width(),
						"height" : $(document).height(),
						"z-index" : "9999"
					})
					.attr("src", "http://file.idc.asia/heatmap/view.php?o=w&u=" + window.location)
					.show()
					.fadeTo("slow", 0.50);
			}
			else if(heatmapViewKeypressEntered == "27"){
				$("#heatmapView")
					.css({
						"width" : "0px",
						"height" : "0px"
					})
					.attr("src", "#")
					.hide()
			}
		})
		.mousemove(function(e){
			heatmapMousePosX = e.pageX;
			heatmapMousePosY = e.pageY;
			if(heatmapHoverUpdate){
				heatmapData = "http://file.idc.asia/heatmap/track.php?x=" + heatmapMousePosX + "&y=" + heatmapMousePosY + "&w=" + $(document).width() + "&c=0";
				$("#heatmapTrack").attr("src", heatmapData);
				heatmapHoverUpdate = false;
			}
		})
		.click(function(){
			heatmapData = "http://file.idc.asia/heatmap/track.php?x=" + heatmapMousePosX + "&y=" + heatmapMousePosY + "&w=" + $(document).width() + "&c=1";
			$("#heatmapTrack").attr("src", heatmapData);
		})
})
