// JavaScript Document
		
		var topZIndex = 3;
		var selectedButton = 1;		
		var rotationID;
		var rotationInterval = 3000;
		var rotationTarget = 1;
		var opacityInterval = 10;			// how much the opacity changes per tick
		var msecsPerFrame = 30;			// length of each frame
		var currentFadingOpacity = 100;
		var currentAppearingOpacity = 0;
		var int_id = -1;
		var rotate = true;

		if (throttle == '') throttle = 3;

		function makePrimary ( buttonNum ) {
					
			// do swap of main image (add any fades here)
			// troubleshooting comment by Zuri 2011-12-02
			topZIndex ++;
			try {
			document.getElementById ( "ImgMap" + buttonNum ).style.zIndex = topZIndex;
			document.getElementById ( "ImgMap" + buttonNum ).style.opacity =  0;
			document.getElementById ( "ImgMap" + buttonNum ).style.filter = "alpha(opacity=" + 0 + ")";
			swapMain ( buttonNum, selectedButton );
				
			//do swap of selected button states 
			document.getElementById ( "Btn_ImgMap" + selectedButton ).className = "imageMap_unselected_" + selectedButton;
			document.getElementById ( "Btn_ImgMap" + buttonNum ).className = "imageMap_selected_" + buttonNum;

			// set new selected button
			selectedButton = buttonNum;
}
catch(err) {}
			
			
		}

		function swapMain ( inc, out ) {
    			
			clearInterval ( int_id );
			int_id = setInterval ( "shiftOpacity(" + inc + "," + out + ")", msecsPerFrame );		
			
		}

		function shiftOpacity ( inc, out ) {

			// drop fading opacity on active image
				currentFadingOpacity -= opacityInterval;			
				if ( currentFadingOpacity < 0 ) currentFadingOpacity = 0;
				
				// Fade ... Firefox + Others
				var tmpFadingOp = currentFadingOpacity / 100;
				document.getElementById ( "ImgMap" + out ).style.opacity =  tmpFadingOp;
			
				// Fade ... Internet Explorer
				document.getElementById ( "ImgMap" + out ).style.filter = "alpha(opacity=" + currentFadingOpacity + ")";
			



			// increase appearing opacity on selected image
				currentAppearingOpacity += opacityInterval;
				if ( currentAppearingOpacity > 100 )  {
	
					currentAppearingOpacity = 100;
										
				}
				

				// Appear ... Firefox + Others 
				var tmpAppOp = currentAppearingOpacity / 100;
				document.getElementById ( "ImgMap" + inc ).style.opacity =  tmpAppOp;
		    
				// Appear ... Internet Explorer
				document.getElementById ( "ImgMap" + inc ).style.filter = "alpha(opacity=" + currentAppearingOpacity + ")";
		
	
			// check for reset
				if ( currentAppearingOpacity == 100 ) {
					
					reset();

				}			

		}

		function reset () {

			// remove the interval
			clearInterval ( int_id );
			currentFadingOpacity = 100;
			currentAppearingOpacity = 0;			

		}
	
		function rotateImage()
		{
		  if (rotate) {
		    var nextImg = 1;
		    if (selectedButton == 3)
		      nextImg = 1;
		    else
		      nextImg = selectedButton + 1;
		    makePrimary(nextImg);
		    setTimeout("rotateImage()", throttle * 1000);
		  }
		}

  	         setTimeout("rotateImage()", throttle * 1000);
