



// get Browser Type ---------------------- START ------------------------

if(navigator.platform=="MacPPC" || navigator.platform=="MacIntel") {
	osPlat="mac";
} else {
	osPlat="win";
}

if(navigator.userAgent.lastIndexOf("Firefox")>=0) {
	bwsName="firefox";
} else if(navigator.userAgent.lastIndexOf("Chrome")>=0) {
	bwsName="chrome";
} else if(navigator.userAgent.lastIndexOf("Safari")>=0) {
	bwsName="safari";
} else if(navigator.userAgent.lastIndexOf("Netscape")>=0) {
	bwsName="netscape";
} else if(navigator.userAgent.lastIndexOf("MSIE")>=0) {
	bwsName="ie";
} else if(navigator.userAgent.lastIndexOf("Opera")>=0) {
	bwsName="opera";
} else {
	bwsName="other";
}

// get Browser Type ---------------------- END ------------------------




// Flash Field ---------------------- START ------------------------

// HTML内から下記のフォーマットで呼び出す
// RunFooEx("XXX.swf","幅","高さ","ID","背景色");

function RunFooEx(fFile,fW,fH,fID,fBg) {
	if(navigator.appName.charAt(0)!="M") {
		for(i=0;i<=navigator.plugins.length-1;i++) {
			if(navigator.plugins[i].filename.indexOf("Flash",0)>=0 || navigator.plugins[i].filename.indexOf("SWF",0)>=0) {
				flashplugin=true;
				break;
			} else {
				flashplugin=false;
			}
		}
	} else {
		flashplugin=true;
	}
	
	
	if(flashplugin) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width='+fW+' height='+fH+' id='+fID+'>');
		document.write('<param name=movie value=\"'+fFile+'\">');
		document.write('<param name=quality value=high>');
		document.write('<param name=bgcolor value='+fBg+'>');
		document.write('<param name=wmode value=transparent>');
		document.write('<param name=allowScriptAccess value=always>');
		document.write('<embed src=\"'+fFile+'\" quality=high bgcolor='+fBg+' width='+fW+' height='+fH+' name='+fID+' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" allowScriptAccess="always">');
		document.write('</embed>\n</object>');
	} else{
		getcache();
		replace1st();
	}
}

// Flash Field ---------------------- END ------------------------




// Replace actions ---------------------- START ------------------------

//代替画像とURLのリスト
indexnaviContAry=new Array();
indexnaviUrlAry=new Array();

indexnaviContAry.push("femtocell");
indexnaviUrlAry.push("3g/products_and_solutions/prod_femtocell/index.html");

indexnaviContAry.push("ngt");
indexnaviUrlAry.push("transportsolutions/index.html");

indexnaviContAry.push("oss");
indexnaviUrlAry.push("nextgenerationoss/index.html");

indexnaviContAry.push("saas");
indexnaviUrlAry.push("saassolutions/index.html");

indexnaviContAry.push("dc");
indexnaviUrlAry.push("datacenter/index.html");

indexnaviContAry.push("mwc2010");
indexnaviUrlAry.push("http://www.nec.com/mwc/");



function getcache() {
	//代替画像をキャッシュ
	for(i=0;i<indexnaviContAry.length;i++) {
		var cacheimg=new Image();
		cacheimg.src="indexitems/replace_"+indexnaviContAry[i]+".jpg";
	}
}

function replace1st() {
	//代替画像を入れる枠を設定
	settxt='<div id="replaceimg"></div>';
	document.getElementById("indexnavi").innerHTML=settxt;
	movreplace();
}


var navi_nownum=1;
var navi_count=0;
var naviTimer;

function movreplace() {
	navi_count++;
	if(navi_count==1) {
		//画像divを透明にし、画像を切り替える
		if(osPlat=="win" && bwsName=="ie") {
			document.getElementById("replaceimg").style.filter="alpha(opacity=0)";
		} else {
			document.getElementById("replaceimg").style.opacity=0;
		}
		setimgtxt='<a href="'+indexnaviUrlAry[navi_nownum-1]+'">';
		setimgtxt+='<img src="indexitems/replace_'+indexnaviContAry[navi_nownum-1]+'.jpg" width="566" height="123" border="0" alt="" />';
		setimgtxt+='</a>';
		document.getElementById("replaceimg").innerHTML=setimgtxt;
	} else if(navi_count>=2 && navi_count<=11) {
		//フェイドイン
		if(osPlat=="win" && bwsName=="ie") {
			document.getElementById("replaceimg").style.filter="alpha(opacity="+((navi_count-1)*10)+")";
		} else {
			document.getElementById("replaceimg").style.opacity=(navi_count-1)/10;
		}
	}
	
	if(navi_count<=11) {
		naviTimer=setTimeout("movreplace()",50);
	} else {
		navi_count=0;
		if(navi_nownum>=indexnaviContAry.length) {
			navi_nownum=1;
		} else {
			navi_nownum++;
		}
		
		//数秒待ってから、次のバナーに切り替える
		naviTimer=setTimeout("movreplace()",7000);
	}
}



// Replace actions ---------------------- END ------------------------




