  var curimg1=0
function rotateimages1(){
document.getElementById("slideshow1").setAttribute("src", galleryarray1[curimg1])
curimg1=(curimg1<galleryarray1.length-1)? curimg1+1 : 0
Animation1()
Animation4()
Animation3()

}

var curimg2=0
function rotateimages2(){
document.getElementById("slideshow2").setAttribute("src", galleryarray2[curimg2])
curimg2=(curimg2<galleryarray2.length-1)? curimg2+1 : 0
Animation2()
}

window.onload=function(){
setInterval("rotateimages1()", 2500)
MM_preloadImages('http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_04.png','http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_05.png','http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_06.png','http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_07.png','http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_08.png','http://www.dangerensemble.com/graphics/images/dangerEnsemble_Front_over_09.png')
}

function MM_swapImgRestore() { 
  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() { 
  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) {
  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() { 
  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];}
}
  
  
  
  /////////////////////////////////////////////////////////////////////////////
		 /////////////////////////   Magic Animation 1.0   ///////////////////////////
		/////////////////////////////////////////////////////////////////////////////
		
		// Animation styles used in Magic /////////////////////////////////////////////
		
		function styleLinear(x) { return x; }
		function styleSin(x) { return Math.sin(x*Math.PI/2); }
		function stylePulse(x) { return (Math.sin(x*2*Math.PI) + 1) / 2; }
		function styleBounce(x) { return (x == 0) ? 0 : (((-Math.sin(x*25)/(x*25))+1)*(1-x))+x; }
		function styleBounceLess(x) { return (x == 0) ? 0 : (((-Math.sin(x*15)/(x*15))+1)*(1-x))+x; }
		function styleBounceMore(x) { return (x == 0) ? 0 : (((-Math.sin(x*35)/(x*35))+1)*(1-x))+x; }
		
		// Magic Animation Core ///////////////////////////////////////////////////////
		
		magic = new function ()
		{
			this.effects = [];
			this.interval;
			this.frequency = 30;
			
			this.remove = function(effect)
			{
				var i = 0;
				while (i < this.effects.length) 
				  if (this.effects[i] == effect) 
					this.effects.splice(i, 1);
				  else i++;
						
				if (this.effects.length == 0) 
				  window.clearInterval(this.interval);
			}
			
			this.tick = function()
			{
				for (var i=0; i<this.effects.length; i++)			
					this.effects[i].tick();
			}
		
			this.add = function(effect)
			{
				this.effects.push(effect);
				if (this.effects.length == 1)
					this.interval = window.setInterval(function() {magic.tick();}, this.frequency);	
			}
		}
		
		
		function effectObject(elementId, ticksToStart, speed, action, style, loop, coAction, endAction) 
		{		
			this.elementId = elementId;
			this.ticksToStart = (ticksToStart == undefined) ? 0 : ticksToStart;
			this.speed = speed;
			this.now = 0;
			this.action = action;
			this.coAction = coAction;
			this.endAction = endAction;
			this.loop = (loop == undefined) ? false : loop;
			this.style = (style == undefined) ? styleSin : style;
			this.tick = function()
			{
				if (this.ticksToStart > 0)
				{
					this.ticksToStart--;
					return;
				}
				
				if (this.now > 100)
				{
					if (this.loop)
						this.now = 0;
					else
					{
						magic.remove(this);				
						if (this.endAction != undefined) 
							this.endAction();
					}
				}
				else
				{
					if (typeof elementId == 'string' && document.getElementById(elementId) == null)
					{
						magic.remove(this);
						return;
					}			
					this.action();
					
					if (this.coAction != undefined)
						this.coAction();
					
					this.now += this.speed;
					if (this.now > 100) this.now = 101;			
				}
			}
			
			magic.add(this);
		}
		
		// Magic Effects //////////////////////////////////////////////////////////////
		
		
		function changeNumber(element, what, suffix, value1, value2, speed, ticksToStart, style, loop, coAction, endAction)
		{
			action = function()
			{
				this.element.style[this.what] = Math.round(this.value1 + this.style(this.now/100)*(value2-value1)) + suffix;
			}
			effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction);
			effect.element = (typeof element == 'string') ? document.getElementById(element) : element;
			effect.what = what;
			effect.value1 = value1;
			effect.value2 = value2;
		}
		
		function fade(element, opacity1, opacity2, speed, ticksToStart, style, loop, coAction, endAction)
		{
			action = function()
			{		
				this.element.style.opacity = this.opacity1 + this.style(this.now/100) * (this.opacity2-this.opacity1);
				this.element.style.filter = "alpha(opacity=" + this.element.style.opacity*100 + ")";
			}
			effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction);
			effect.element = (typeof element == 'string') ? document.getElementById(element) : element;
			effect.opacity1 = opacity1;
			effect.opacity2 = opacity2;
		}
		
		function move(element, top1, left1, top2, left2, speed, ticksToStart, style, loop, coAction, endAction)
		{	
			changeNumber(element, "top", "px", top1, top2, speed, ticksToStart, style, loop, coAction, endAction);
			changeNumber(element, "left", "px", left1, left2, speed, ticksToStart, style, loop);
		}
		
		function scale(element, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction)
		{
			changeNumber(element, "width", "px", width1, width2, speed, ticksToStart, style, loop, coAction, endAction);
			changeNumber(element, "height", "px", height1, height2, speed, ticksToStart, style, loop);
		}

		function Animation1() 
		{
			move("slideshow1", 0, 0, 0, 300, 5, 0, styleSin, false, null, 
			  function() { move("slideshow1", 0, 300, 0, 0, 5, 20, styleSin); });
		}
		
		function Animation2() 
		{
			fade("slideshow2", 1, 0, 5, 0, styleLinear, false, null, 
			  function() { fade("slideshow2", 0, 1, 5, 0, styleLinear); });
		}
		
		function Animation3() 
		{
			fade("slideshow1", 1, 0, 5, 0, styleLinear, false, null, 
			  function() { fade("slideshow1", 0, 1, 5, 0, styleLinear); });
		}
		
		function Animation4() 
		{
			fade("slideshow1", 1, 0, 1, 0, styleLinear, false, null, 
			  function() { fade("slideshow1", 0, 1, 1, 0, styleLinear); });
		}
		
