/**
 *
 */

var mouseX;
var mouseY;

var word;

var popupShow = false;

$(window).load(function() {
	$('#menu1').hide();

    $(this).click(function(e){
    	if (!popupShow){
    		$('#menu1').hide();
    	}
    	popupShow = false;
    });

    $('#popup_web').click(function(e){
    	window.open(word);
    });

    $('#popup_google').click(function(e){
    	window.open("https://www.google.co.jp/search?q="+word);
    });

    $('#popup_map').click(function(e){
    	window.open("https://maps.google.com/maps?q="+word);
    });

    $('#popup_transit').click(function(e){
    	window.open("/ViewMapService/ViewTransit.jsp?daddr="+encodeURIComponent(encodeURIComponent(word)));
    });

    $('#popup_object').click(function(e){
    	findSubject.find(word, "full", "object_all");
    });

});

var PopupMenu = function(){};

PopupMenu.prototype.show = function(x, y, w){
	popupShow = true;
	$('#menu1').css('left',mouseX - 300+'px');
	$('#menu1').css('top',mouseY+'px');
	$('#menu1').show();

	word = w;

};


