/***************whiteFlash***************/
function writeFlash(name, width, height, wmode){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
+' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'
+' width='+width+' height="'+height+'">'
+'<param name="movie" value="'+name+'" />'
+'<param name="quality" value="high" />'
+'<param name="wmode" value="'+wmode+'" />'
+'<embed src="'+name+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"'
+' type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" wmode="'+wmode+'">'
+'</object>');
}

/***************openNewFixsizeWin***************/
function newWin(url){
	window.open(url, "window_name", "width=800,height=600,scrollbars=no,location=no,status=no,resizable=no");
}

/***************smartRollover***************/
(function(onLoad) {
    try {
        window.addEventListener('load', onLoad, false);
    } catch (e) {
        window.attachEvent('onload', onLoad);
    }
})(function() {
    var over = function() { this.src = this.src.replace('_off.', '_on.'); };
    var out  = function() { this.src = this.src.replace('_on.', '_off.'); };
    var img = document.getElementsByTagName('img');
    for (var i = 0, l = img.length; i < l; i++) {
        if (!img[i].src.match(/_off\./)) continue;
        img[i].onmouseover = over;
        img[i].onmouseout  = out;
    }
});

/***************<img src="filename_off.jpg"/>***************/

/***************misc***************/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}function popup(path, name, width, height, position, scrollbars, resizable) {

	if( typeof(position) == "undefined" ) {
		position = "center";
	}

	if( typeof(scrollbars) == "undefined" ) {
		scrollbars = "no";
	}

	if( typeof(resizable) == "undefined" ) {
		resizable = "yes";
	}

	if(position == "center") {
		lf= (window.screen.availWidth - width) / 2;
		tp = (window.screen.availHeight - height) / 2;
	} else if(position == "right") {
		lf = window.screen.availWidth - width - 10;
		tp= 0;
	} else {
		lf= 0;
		tp = 0;
	}

	window.open("/popup.html?src="+path, name, "top="+tp+",left="+lf+",width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",status=no,toolbar=no,directories=no,menubar=no");
}

//popupAnyイ
function popupAny(path, name, width, height, position, scrollbars, resizable) {

	if( typeof(position) == "undefined" ) {
		position = "center";
	}

	if( typeof(scrollbars) == "undefined" ) {
		scrollbars = "yes";
	}

	if( typeof(resizable) == "undefined" ) {
		resizable = "yes";
	}


	if(position == "center") {
		lf= (window.screen.availWidth - width) / 2;
		tp = (window.screen.availHeight - height) / 2;
	} else if(position == "right") {
		lf = window.screen.availWidth - width - 10;
		tp= 0;
	} else {
		lf= 0;
		tp = 0;
	}

	window.open(path, name, "top="+tp+",left="+lf+",width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",status=no,toolbar=no,directories=no,menubar=no");
}

//popupAny2イズ抜き
function popupAny2(path, name, width, height, position) {
 popupAny(path, name, width, height, position, "yes", "no")
}

//popupAny3バー抜き
function popupAny3(path, name, width, height, position) {
 popupAny(path, name, width, height, position, "no", "no")
}
