// Photo Selector for None Flash Player
var photonumber;

function selPhoto() {
	photonumber = Math.ceil(Math.random()*6);
}

// Flash Judge
function validFlash(){
	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]){
		var plugin = ( navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ?
		navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0 );
		//alert( parseInt(plugin.description.match(/\d+\.\d+/)) ); // "10"の場合は"10"となる
		
		//var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
		//alert(parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)))
		if (plugin && parseInt(plugin.description.match(/\d+\.\d+/))>=reqVersion)
		return true;
	}else if(navigator.appName && navigator.appName.indexOf("Microsoft")!=-1 && navigator.userAgent.indexOf("Windows")!=-1 && navigator.userAgent.indexOf("Windows 3.1")==-1){
		return true;
	}else{
		return false;
	}
}

// no flash player
function writeFlashMAIN(){
if(!validFlash()){
selPhoto();
document.write('<img src="' + __path + 'common/visual/sub_' + photonumber + '.jpg" width="748" height="124" border="0" alt="" usemap="#map_visual">')
document.write('<map name="map_visual">')
document.write('<area shape="rect" alt="" coords="642,83,747,123" href="' + __path + 'contact/">')
document.write('<area shape="rect" alt="" coords="535,83,641,123" href="' + __path + 'faq/">')
document.write('<area shape="rect" alt="" coords="428,83,534,123" href="' + __path + 'pr/">')
document.write('<area shape="rect" alt="" coords="321,83,427,123" href="' + __path + 'gallery/">')
document.write('<area shape="rect" alt="" coords="214,83,320,123" href="' + __path + 'activities/">')
document.write('<area shape="rect" alt="" coords="107,83,213,123" href="' + __path + 'cooperate/">')
document.write('<area shape="rect" alt="" coords="0,83,106,123" href="' + __path + 'about/">')
document.write('</map>')
}
else {
// ok
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"')
document.write(' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"')
document.write(' width="' + swfWidth + '" height="' + swfHeight + '" id="' + swfID + '" align="' + swfAlign + '">')
document.write('<param name="allowScriptAccess" value="' + swfAllowScriptAccess + '" />')
document.write('<param name="movie" value="' + swfFile + '" />')
document.write('<param name="quality" value="' + swfQuality + '" />')
document.write('<param name="bgcolor" value="' + swfBgcolor + '" />')
document.write('<embed src="' + swfFile + '" quality="' + swfQuality + '" bgcolor="' + swfBgcolor + '" width="' + swfWidth + '" height="' + swfHeight + '" name="' + swfID + '" align="' + swfAlign + '" allowScriptAccess="' + swfAllowScriptAccess + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
document.write('</object>')
}
}

// ----- Function Navi -----

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
func_home_over = newImage("../common/img/func_home-over.gif");
func_wfproma_over = newImage("../common/img/func_wfproma-over.gif");
func_sitemap_over = newImage("../common/img/func_sitemap-over.gif");
btn_hungermap_over = newImage("../common/img/btn_hungermap-over.gif");
preloadFlag = true;
}
}
