/**
 * JavaScript library
 * Version: 2009
 * Dependencies: jquery-1.2.6.js
 */
// Location URI

var locationURL = "http://travel-japan.jp/chs";

/**
 * External links
 */
function externalLinks(){
	if(!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for(var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	}
}
$(function(){ externalLinks()});

/**
 * Rollover images
 */
function smartRollover(){
	if(document.getElementsByTagName){
		var imageTags = document.getElementsByTagName('img');
		for(var i=0; i < imageTags.length; i++){
			if(imageTags[i].className == 'rollover'){
				if(imageTags[i].getAttribute('src').match('_off.')){
					imageTags[i].onmouseover = function(){
						this.setAttribute('src',this.getAttribute('src').replace('_off.','_on.'));
					}
					imageTags[i].onmouseout = function(){
						this.setAttribute('src',this.getAttribute('src').replace('_on.','_off.'));
					}
				}
			}
		}
	}
}
$(function(){ smartRollover()});

/**
 * Image toolbar cancel
 */
function imageToolbarCancel(){
	if (!document.getElementsByTagName) return;
	var imageTags = document.getElementsByTagName('img');
	for (var i=0; i < imageTags.length; i++) {
		imageTags[i].setAttribute('galleryimg','no');
	}
}
$(function(){ imageToolbarCancel()});

/**
 * Popup new window
 */
function popupWindow(popHref,popWidth,popHeight){
	popUpWin = window.open(
		popHref,
		'subwin',
		'width='+popWidth+',height='+popHeight+',scrollbars=1,resizable=1,directories=0,toolbar=0,status=1,location=0'
		);
	popUpWin.focus();
}
