// jjokinawa + JNS
var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-611640-8']);
	_gaq.push(['_setDomainName', 'none']);
	_gaq.push(['_setAllowLinker', true]);
	_gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

// JNS click count
  jQuery(function($) {
	var pages = [ "list.php", "details.php", "reserve.php", "inquiry_traffic.php", "inquiry_hotel.php", "room.php", "traffic.php", "rentacar.php", "other_option.php", "traffic_other.php", "check_price.php", "guest_info.php", "complete.php" ];	
	var _thisUrl = $(location).attr('href');
	if (_thisUrl.match("/hotel.php")) {
		if (_thisUrl.match("relativity=1")) {
			_thisUrl = "hotel01.php";
		} else if (_thisUrl.match("relativity=2")) {
			_thisUrl = "hotel02.php";
		} else if (_thisUrl.match("relativity=3")) {
			_thisUrl = "hotel03.php";
		} else {
			_thisUrl = "hotel00.php";
		}
	}
	else {
		var pages_length = pages.length;
		var key;
			for (key = 0; key < pages_length;key ++) {
				if (_thisUrl.match(pages[key])) {
					_thisUrl = pages[key];
				break;
			}
		}
    }
	$.each($('a,input:image,input:submit'), function() {
	var _thisId = $(this).closest("[id]").attr("id");
	$(this).click(function() {
		_gaq.push(['_trackEvent', _thisUrl, _thisId, $(this).attr('href')]);
		});
	});
});
