//画像スクロール
/* This script and many more are available free online atThe JavaScript Source!! http://javascript.internet.com
Created by: Jeroen Haan | http://www.haan.net/ */

/* -----------------------------------------------   
Streaming banners - v.1   (c) 2006 www.haan.net   
You may use this script but please leave the credits on top intact.   
Please inform us of any improvements made.   
When usefull we will add your credits.  
------------------------------------------------ */

function clip() { 	
	// width of the banner container 
	var contWidth = 6156;	//ピッタリ
//	var contWidth = 6360;	//少しズレ
//	var contWidth = 6996; 
	// height of the banner container 
	var contHeight = 144; 
	var id1 = document.getElementById('slideA');
	var id2 = document.getElementById('slideB');
	id1.style.left = parseInt(id1.style.left)-1 + 'px';
	document.getElementById('slideCont').style.width = contWidth + "px";
	document.getElementById('slideCont').style.clip = 'rect(auto,'+ contWidth +'px,' + contHeight +'px,auto)';
	id2.style.display = '';
	if(parseFloat(id1.style.left) == -(contWidth)) {
//		alert(contWidth+"\n"+parseFloat(id1.style.left));
		id1.style.left = '0px'; 	
	} 	

	//setTimeout(clip,25)
	setTimeout(clip,10)
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {  var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
		
		if (oldonload) {
			oldonload();
		}
		func();
	}
}
}

//画像切り替え
window.addEvent('domready',function(){
	var nS2 = new noobSlide({
		box: $('box2'),
		items: [0,1,2,3,4,5,6,7,8],
		interval: 3000,
		autoPlay: true,
		fxOptions: {
			duration: 1000,
			transition: Fx.Transitions.Bounce.easeOut,
			wait: false
		},
	
			addButtons: {
			previous: $('prev1'),
			play: $('play1'),
			stop: $('stop1'),
			next: $('next1')
		}
	
	});
});


cnt = 0;
cnt2 = 0;
inout = "in";
str = "fedcba9876543210";
function strFade() {
//	document.all["moji"].innerHTML = myArray[cnt2];
	document.getElementById("moji").innerHTML = myArray[cnt2];
	c = str.charAt(cnt);
	if(inout == "in") cnt++; else cnt--;
//	document.all["ID"].style.color = "#"+c+c+c+c+c+c;
	document.getElementById("moji").style.color = "#"+c+c+c+c+c+c;
	if(cnt == 15) inout = "out";
	if(cnt == 0){
		inout = "in";
		cnt2++;
		if(cnt2 == 5) cnt2 = 0;
	}
	setTimeout("strFade(' + str + ')",200);
}


//	メニューマウスオーバー時

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_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];}
}