/*********************************************************************
 *
 * </common/js/common.js>
 *
 *********************************************************************/

$(function(){

	//Rollover
	var conf = {
		className : 'rollOver'
	};
	if($('.'+conf.className) == null){return false;};
	$('.'+conf.className).each(function(){
		this.originalSrc = this.src;
		this.rolloverSrc = this.originalSrc.replace('_off.', '_on.');
		preloadImage(this.rolloverSrc);
	}).hover(function(){
		this.src = this.rolloverSrc;
	},function(){
		this.src = this.originalSrc;
	});
	
	//Dropdown Menu
	$("ul#globalMenu li").not("ul#globalMenu li.current").hover(
		function(){
			$('ul.globalSubMenu', this).css('visibility', 'visible');
			$('a img', this).attr('src', function(i) { this.src = this.src.replace('_off.gif', '_on.gif');});
		},
	
		function(){
			$('ul.globalSubMenu', this).css('visibility', 'hidden');
			$('a img', this).attr('src', function(i) { this.src = this.src.replace('_on.gif', '_off.gif');});
		}
	);
	
	$("ul#globalMenu li.current").hover(
		function(){
			$('ul.globalSubMenu', this).css('visibility', 'visible');
		},
		
		function(){
			$('ul.globalSubMenu', this).css('visibility', 'hidden');
		}
	);

});

//Preload
preloadedImages = [];
function preloadImage(url){
	var p = preloadedImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
}

//openwindow
/*----base_openwindow----*/
function openw01(url){
	var win;
	win = window.open(url,'winneme01','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=600,height=450');
	win.window.focus();
}

/*----photo_openwindow----*/
function openw02(url){
	var win;
	win = window.open(url,'winneme02');
	win.window.focus();
}

/*----headoffice_openwindow----*/
function openw03(url){
	var win;
	win = window.open(url,'winneme03','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=730,height=450');
	win.window.focus();
}

/*----magazine_openwindow----*/
function openw04(url,winname,x,y){
	var win;
	win = window.open(url,winname,'width='+x+',height='+y);
	win.window.focus();
}


/*----searchhelp_openwindow----*/
function openw05(url){
	var win;
	win = window.open(url,'winneme05','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=680,height=440');
	win.window.focus();
}

/*----Corporate Governance_openwindow----*/
function openw06(url){
	var win;
	win = window.open(url,'winneme05','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=685,height=500');
	win.window.focus();
}

/*----dbook_openwindow----*/
function openw07(url){
	var win;
	win = window.open(url,'winneme07','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=1015,height=700');
	win.focus();
}

/*----word_openwindow----*/
function openw08(url){
	var win;
	win = window.open(url,'winneme08','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=550,height=450');
	win.window.focus();
}

/*----office_openwindow----*/
function openw09(url){
	var win;
	win = window.open(url,'winneme09','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=730,height=750');
	win.window.focus();
}

/* sslform_openwindow
   同じ親ウィンドウに開く */
function ctrlWin(url){
	if(!window.opener || window.opener.closed){
		window.open(url);
	}else{
		window.opener.location.href = url;
		opener.focus();
	}
}

/* sslform_openwindow
   同じ親ウィンドウに開いて、popupを閉じる */
function ctrlWin01(url){
	if(!window.opener || window.opener.closed){
		window.open(url);
	}else{
		window.opener.location.href = url;
		opener.focus();
		self.close();
	}
}

/* sslform_openwindow
   別ウィンドウに開く */
function ctrlWin999(url){
	window.open(url);
}




