function linkGoogle( address ){
	address =  my_escape( utf16to8( address ) );
	var url = "http://maps.google.co.jp/maps?q=" + address + "&spn=0.004223,0.007237&hl=ja";
	window.open( url , "_blank" ,"height=600,width=800,directories =0,menubar =0,status =0,toolbar =0,resizable=1");
}
function linkGooglef1( near,q ){
	near =  my_escape( utf16to8( near ) );
	q	=my_escape(utf16to8(q));
	var url = "http://maps.google.com/maps?hl=ja&lr=lang_ja&ie=UTF-8&oe=UTF-8&near=" + near + "&q="+q;
	window.open( url , "_blank" ,"height=600,width=800,directories =0,menubar =0,status =0,toolbar =0,resizable=1");
}
function my_hex(n, len) {
    var out, i;
    out = "";
    for(i = 0; i < len; i++) {
	out = "0123456789ABCDEF".charAt(n & 0xf) + out;
	n >>= 4;
    }
    return out;
}
function utf16to8(str) {
    var out, i, len, c;

    out = "";
    len = str.length;
    for(i = 0; i < len; i++) {
	c = str.charCodeAt(i);
	if ((c >= 0x0001) && (c <= 0x007F)) {
	    out += str.charAt(i);
	} else if (c > 0x07FF) {
	    out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
	    out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));
	    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
	} else {
	    out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));
	    out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));
	}
    }
    return out;
}
function my_escape(str) {
    var c, i, out;

    if(navigator.appName != "Microsoft Internet Explorer")
	return str.replace(/[^.0-9A-Z_a-z-]/g, function(s) {
	    c = s.charCodeAt(0);
	    if(c < 256)
		return "%" + my_hex(c, 2);
	    return "%u" + my_hex(c, 4);
	});

    out = "";
    for(i = 0; i < str.length; i++) {
	c = str.charAt(i);
	if(c.match(/[^.0-9A-Z_a-z-]/)) {
	    c = str.charCodeAt(i);
	    if(c < 256)
		out += "%" + my_hex(c, 2);
	    else
		out += "%u" + my_hex(c, 4);
	} else
	    out += c;
    }
    return out;
}
