/*
WinOpen(src,width,height)について
----------------------------------------------------
htmlから幅と高さを指定して別窓を開く関数です。
以下のようにaタグにonclick属性に書き込みます。

<a href="popup.html" target="_blank" onClick="WinOpen(this.href,550,600); return false;"></a>

・jsを切っている人のためにtarget属性は入れておいてください
・this.hrefはaタグのhref属性に入っている値を入れるので変更する必要はありません
・widthには別窓の幅、heightには別窓の高さを数値で指定してください
*/
function WinOpen(src,width,height){
   if(! WinOpen.arguments[1]) width  = 500;
   if(! WinOpen.arguments[2]) height = 500;
   var wo = window.open(src,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height);
   wo.window.focus();
}

/*
WinFixOpen(src)について
----------------------------------------------------
jsであらかじめ設定した幅と高さの別窓を開く関数です。
以下のようにaタグにonclick属性に書き込みます。

<a href="popup.html" target="_blank" onClick="WinFixOpen(this.href); return false;"></a>

・jsを切っている人のためにtarget属性は入れておいてください
・this.hrefはaタグのhref属性に入っている値を入れるので変更する必要はありません
*/
function WinFixOpen(src){
   var wo = window.open(src,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=300,height=400");
   wo.window.focus();
}

/*
WinClose()について
----------------------------------------------------
閉じるボタンで使用してください。

<a href="javascript:void(0)" onClick="WinClose()"></a>
*/
function WinClose(){
   self.window.close();
}

/*
form input btn rallover
----------------------------------------------------
*/

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

/*
drob down menu
----------------------------------------------------
*/
sfHover = function() {
	if(document.getElementById("nav")){	
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


/*
direction
----------------------------------------------------
*/

<!-- Hide Scripts from Old Browsers

function addEventCallback(obj, handler, callback) {
var tmp = obj[handler];
obj[handler] = function () { if (tmp) tmp(); callback(); };
}

addEventCallback(window, "onload", function() {
rolloverManager.initialize();
// 起動時イベントは必ずここに追加してください。
});

/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php

	Modifier: Concent, Inc., 2007-07-25
	- not only 'img' objects, but 'input', 'area' (imagemap) are available.
	- you can change image file suffix with a classname like 'imgover_suffix'.
	- window.onload binding mechanism is changed.
*/

var rolloverManager = new function() {
	var that = this; // save the context, to be used in private method.
	this.rolloverClass = 'imgover';
	this.defaultRolloverImageSuffix = '_ov';

this.initialize = function() {
	setRollovers('img',   function(image) {return (true);                 });
	setRollovers('input', function(input) {return (input.type == 'image');});
	return that;
}

function getRolloverClass(anObject) {
	var rolloverClassRe = new RegExp('^(' + that.rolloverClass + ')(.*)');
	if (!anObject.className) return null;
	var classNames = anObject.className.split(' ');
	var i, n;
	for (i = 0, n = classNames.length; i < n; i++) {
		var classNameElements = classNames[i].match(rolloverClassRe);
		if (classNameElements) return classNameElements;
		// returns an array [class_full, class_base, class_extension]
	}
	return null;
}

function setRollovers(targetTag, isRolloverObject) {
	var aImages = document.getElementsByTagName(targetTag); //like 'img', 'input',...
	var i, n;
	for (i = 0, n = aImages.length; i < n; i++) {
		var image = aImages[i];
		if (!image.className) continue;
		if (!getRolloverClass(image)) continue;
		if (!isRolloverObject(image)) continue;
		if (image.useMap) { // case of clickable map
			setRolloversClickableMap(image);
			continue; // next image
		}
		setRollover(image);
	}
}
function setRolloversClickableMap(image) {
	var mapId = image.useMap.match(/^\#(.*)/)[1]; // cut off the initial "#"
	var areas = document.getElementById(mapId).areas;
	var i, n;
	for (i = 0, n = areas.length; i < n; i++) {
		if (getRolloverClass(areas[i])) {
			setRollover(image, areas[i]);
		}
	}
}

function setRollover(targetImage, eventCaptureObject) {
	// if eventCaptureObject catch some mouseover/mouseout event,
	// then replace the image source of targetImage.
	var src = targetImage.src;

	if (!eventCaptureObject) eventCaptureObject = targetImage;
	var rolloverImageSuffix = getRolloverClass(eventCaptureObject)[2] // _XX of imgover_XX
		|| that.defaultRolloverImageSuffix;                       // _ov

	var ftype = src.substring(src.lastIndexOf('.'), src.length);
	var hsrc = src.replace(ftype, rolloverImageSuffix + ftype);
	var mouseoverImage = new Image();
	var mouseoutImage  = new Image();

	mouseoverImage.src = hsrc;	// preload mouseover image
	mouseoutImage.src  = src;	// save as mouseout image

	eventCaptureObject.onmouseover = function() {
		targetImage.src = hsrc;
	}	
	
	eventCaptureObject.onmouseout = function() {
		targetImage.src = src;
	}
}
} // /rolloverManager

// End Hiding -->