// JavaScript Document
// 京 UTF-8


function centerWindow(wx,wy,file) {

	x = (screen.width  - wx) / 2;

	y = (screen.height - wy) / 2;

	subWin = window.open( file, "sub", "left="+x+", top="+y+", width="+wx+", height="+wy );

}



function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



// Roll Over Images

function rollOvers() {

	if (!document.getElementById) return

	

	var aPreLoad = new Array();

	var sTempSrc;

	var aImages = document.getElementsByTagName('img');



	for (var i = 0; i < aImages.length; i++) {		

		if (aImages[i].className == 'btn') {

			var src = aImages[i].getAttribute('src');

			var ftype = src.substring(src.lastIndexOf('.'), src.length);

			var hsrc = src.replace(ftype, '_current'+ftype);



			aImages[i].setAttribute('hsrc', hsrc);

			

			aPreLoad[i] = new Image();

			aPreLoad[i].src = hsrc;

			

			aImages[i].onmouseover = function() {

				sTempSrc = this.getAttribute('src');

				this.setAttribute('src', this.getAttribute('hsrc'));

			}	

			

			aImages[i].onmouseout = function() {

				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_current'+ftype, ftype);

				this.setAttribute('src', sTempSrc);

			}

		}

	}

}



// Open New Window

function externalLinks(){

	var node_a = document.getElementsByTagName('a');

	for (var i in node_a) {

		if (node_a[i].className == 'external' || node_a[i].className == 'pdf' || node_a[i].className == 'xls' || node_a[i].className == 'doc') {

			node_a[i].onclick = function() {

				window.open(this.href, '', '');

				return false;

			};

		}

	}

};

function JustSizeWindow(img,width,height){
	
	var opt = "";
	opt += 'top=100,left=100';
	opt += ',width='+width+',height='+height+',';
	opt += 'directories=0,toolbar=0,menubar=0,scrollbars=0,status=0,resizable=1';
	
	jsw = window.open('','jsw',opt);
	
	jsw.focus();
	
	jsw.document.open();
	htm  = '<html><head>';
	htm += '<meta http-equiv="Content-Type" content="text/html; charset=shift_JIS">';
	htm += '<title>画像サンプル<\/title>';
	htm += '<\/head>';
	
	htm += '<bod' + 'y style="margin:0; padding:0;">';
	
	htm += '<a href="javascript:window.close();">';
	htm += '<img src="'+img+'" width="'+width+'" height="'+height+'" border="0" alt="画像をクリックするとウィンドウを閉じます">';
	htm += '<\/a>';
	htm += '<\/bod'+'y><\/html>';
	jsw.document.write(htm);
	jsw.document.close();
	
};



