function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var aImages  = document.getElementsByTagName('img');
	var sTempSrc;
	
	for ( var i = 0; i < aImages.length; i++ ) {
		if ( aImages[i].className == 'imgover' ) {
			var src   = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc  = src.replace(ftype, '_ov'+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( '_ov'+ftype , ftype );
				this.setAttribute( 'src' , sTempSrc );
			}
		}
	}
}

window.onload   = initRollovers;
window.onunload = initRollovers;

function inputFocus(obj,txt) {
	if (obj.value == txt) obj.value = "";
}
function inputBlur(obj,txt){
	if (obj.value == "") obj.value = txt;
}
function clickGoogleSearch() {
	if ( $( '#GoogleSearch' ).val() == 'サイト内検索' ) {
		$( '#GoogleSearch' ).val( '' );
	}
	$( '#GoogleSearch' ).css( 'color' , '#000000' );
}
function mouseoutGoogleSearch() {
	if ( $( '#GoogleSearch' ).val() == '' ) {
		$( '#GoogleSearch' ).val( 'サイト内検索'      );
		$( '#GoogleSearch' ).css( 'color' , '#A4A4A4' );
	}
}

function popupMagazine(url) {
	window.open(url,'magazine','directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,width=900px,height=450px');
}
function popupMovie(vol,w,h) {
	window.open('./movie/'+vol+'.php',vol,'directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,width='+w+'px,height='+h+'px');
}
