// 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["application/x-shockwave-flash"].enabledPlugin;
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=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/photo_' + photonumber + '.jpg" width="748" height="254" border="0" alt="" usemap="#map_visual">')
document.write('<map name="map_visual">')
document.write('<area shape="rect" alt="" coords="642,213,747,253" href="' + __path + 'contact/">')
document.write('<area shape="rect" alt="" coords="535,213,641,253" href="' + __path + 'faq/">')
document.write('<area shape="rect" alt="" coords="428,213,534,253" href="' + __path + 'pr/">')
document.write('<area shape="rect" alt="" coords="321,213,427,253" href="' + __path + 'gallery/">')
document.write('<area shape="rect" alt="" coords="214,213,320,253" href="' + __path + 'activities/">')
document.write('<area shape="rect" alt="" coords="107,213,213,253" href="' + __path + 'cooperate/">')
document.write('<area shape="rect" alt="" coords="0,213,106,253" 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;
}
}