
//////////////////////////////////////////////////////////////
//												//
//			Date:10-6-2005 (mm-dd-yyyy)			//
//												//
//////////////////////////////////////////////////////////////


function onIndexarrow() {
	document.viewarrow.src="./img/index_arrow_1.gif";
}

function offIndexarrow() {
	document.viewarrow.src="./img/index_arrow_0.gif";
}

function onContact() {
	document.contact.src="../img/contactbtt_1.gif";
}

function offContact() {
	document.contact.src="../img/contactbtt_0.gif";
}

function downContact() {
	document.contact.src="../img/contactbtt_2.gif";
}

function mailForm() {
	document.mail.submit();
}


function onContact_home() {
	document.contact.src="./img/contactbtt_1.gif";
}

function offContact_home() {
	document.contact.src="./img/contactbtt_0.gif";
}

function downContact_home() {
	document.contact.src="./img/contactbtt_2.gif";
}

function mailForm() {
	document.mail.submit();
}



function onClose() {
	document.closebtt.src="../ad/img/close_btt_1.gif";
}

function offClose() {
	document.closebtt.src="../ad/img/close_btt_0.gif";
}

function downClose() {
	document.closebtt.src="../ad/img/close_btt_2.gif";
}


function subwinAd(url){
	//winfl=0;
	avWidth = screen.availWidth;
	avHeight = screen.availHeight;
	winWidth = 960;
	//winHeight = 560;
	winHeight = avHeight-25;
	//winLeft = (avWidth-winWidth)/2;
	//winTop = (avHeight-winHeight)/2;
	//newWindow = 0;
	newWindow =window.open(url,"AD_Subwindow","left=0,top=0,width=" + winWidth + ",height=" + winHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes");
	newWindow.focus();
}



function subwinMap(url){
	//winfl=0;
	avWidth = screen.availWidth;
	avHeight = screen.availHeight;
	winWidth = 760;
	//winHeight = 560;
	winHeight = avHeight-25;
	//winLeft = (avWidth-winWidth)/2;
	//winTop = (avHeight-winHeight)/2;
	//newWindow = 0;
			newWindow =window.open(url,"MAP_Subwindow","left=0,top=0,width=" + winWidth + ",height=" + winHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
			newWindow.focus();
}



function onSubmit() {
	document.submit1.src="../products/img/searchbtt_1.gif";
}

function offSubmit() {
	document.submit1.src="../products/img/searchbtt_0.gif";
}

function downSubmit() {
	document.submit1.src="../products/img/searchbtt_2.gif";
}

function submitForm() {
	document.directsearch.submit();
}


function onDxfbtt()	{
	document.dxf.src="../products/img/spec_01_btt_1.gif";
}

function offDxfbtt()	{
	document.dxf.src="../products/img/spec_01_btt_0.gif";
}

function onHighbtt()	{
	document.high.src="../products/img/spec_02_btt_1.gif";
}

function offHighbtt()	{
	document.high.src="../products/img/spec_02_btt_0.gif";
}



function onMap(n) {
	document.images["map"+n].src="../profile/img/map_btt_1.gif";
}

function offMap(n) {
	document.images["map"+n].src="../profile/img/map_btt_0.gif";
}

function downMap(n) {
	document.images["map"+n].src="../profile/img/map_btt_2.gif";
}



var defx = 800;			// 移動量
var defsp = 10;			// 初期速度
var nowx = defx;		// 残り移動量初期設定値
var speed = defsp;		// スピードを初期速度に設定
var downp = 110;		// 減速ポイント
var splim = 100;		// 最高速度
var minp = 10;			// 開始速度・最終速度の区間
var muki = 1;			// 移動方向の初期設定値
var rx = 0;			// 初期X座標
var gm = 0;			// 先頭に戻る時用の移動量

function softScroll(ag) {
	if (ag<0 || ag>0) {
		muki = ag;
	}
	if (gm>0) {
		nowx=gm;
		gm=(-1)*defx;
		defx=nowx;
	}
	
	if(nowx>0) {
		if(speed<splim && nowx>downp) {
			speed = (defx-nowx>minp) ? Math.ceil((defx - nowx)*.25) : 6;
		} else if(nowx>downp) {
			speed+=0;
		} else {
			speed = (nowx>minp) ? Math.ceil(nowx*.08) : 1;
		}
		nowx-=speed;
		rx-=speed*muki;
		
		document.getElementById("slideBox").style.left=rx;
		setTimeout("softScroll()",8);
	} else {
		if (gm<0) {
			defx=(-1)*gm;
			gm=0;
		}
		nowx = defx;
		speed = defsp;
	}
}





//function moveImage(n)	{
//	y=-350;
//	s=n*y
//	document.getElementById("slideBox").style.top=s;
//}

function moveImage(n)	{
	x=-282;
	s=n*x
	document.getElementById("slideBox").style.left=s;
}

// ユーザー識別子を記録
function stampUserID( ip ) {
	var id = getCookie("USERID");
	if ( id == "" ) {

		dd = new Date();
		ye = dd.getYear();      if (ye < 1900) ye += 1900;
		mo = dd.getMonth() + 1; if (mo < 10) mo = "0" + mo;
		da = dd.getDate();      if (da < 10) da = "0" + da;
		ho = dd.getHours();     if (ho < 10) ho = "0" + ho;
		mi = dd.getMinutes();   if (mi < 10) mi = "0" + mi;
		se = dd.getSeconds();   if (se < 10) se = "0" + se;
		date = ye + "/" + mo + "/" + da + "+" + ho + mi + se;

		var ipad = ip;
		var info;
		if( ip == "" ) {
			info = java.net.InetAddress.getLocalHost();
			ipad = info.getHostAddress();
		}

		id = "+" + ipad + "+" + date;
	}
	setCookie("USERID", id, 180);
}

function getUserID() {
	return getCookie("USERID");
}

// 訪問回数を記録
function bakedCookie() {
	times = getCookie("Times");
	if (times == "") {
		times = 0;
	}
	times++;
	date = getCookie("Date");
	if (date == "") {
		date = "????";
	}
	//document.write("これまでの訪問回数：" + times + "<br>");
	//document.write("前回の訪問日：" + date + "<br>");

	//times++;

	dd = new Date();
	ye = dd.getYear();      if (ye < 1900) ye += 1900;
	mo = dd.getMonth() + 1; if (mo < 10) mo = "0" + mo;
	da = dd.getDate();      if (da < 10) da = "0" + da;
	ho = dd.getHours();     if (ho < 10) ho = "0" + ho;
	mi = dd.getMinutes();   if (mi < 10) mi = "0" + mi;
	se = dd.getSeconds();   if (se < 10) se = "0" + se;
	date = ye + "/" + mo + "/" + da + " " + ho + ":" + mi + ":" + se;

	setCookie("Times", times);
	setCookie("Date", date);

	// clearCookie("Times");
	// clearCookie("Date");
}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) {
			return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
		}
		xx1 = xx2 + 1;
	}
	return("");
}

function setCookie(key, val, days_expired )
{
	var tmp = key + "=" + escape(val) + "; ";
	// tmp += "path=" + location.pathname + "; ";

	if( days_expired > 0 )
	{
		var sday = new Date();
		sday.setTime(sday.getTime() + (days_expired * 1000 * 60 * 60 * 24));
		tmp += "expires=" + sday.toGMTString();
	}
	//tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
	//alert( "set:" + tmp );
	document.cookie = tmp;

}

function clearCookie(key) {
	document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}

function flashCookie() {
	times = getCookie("Times");
	document.write("これまでの訪問回数：" + times + "<br>");
}

function SOGOs() {
	movieName ="./fla/sogo.swf"+"?"+ "count=" + getCookie("Times");
	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="860" HEIGHT="300" id="sogo">');
	document.write('<PARAM NAME=movie VALUE="' + movieName + '">');
	document.write('<PARAM NAME=loop VALUE=false>');
	document.write('<PARAM NAME=menu VALUE=false>');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=bgcolor VALUE="#FFFFFF">');
	document.write('<EMBED src="' + movieName + '" loop=false menu=false quality=high bgcolor="#FFFFFF"  WIDTH="860" HEIGHT="300" NAME="sogo" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}



