		//-- ##################################################################
//-- ##################################################################

var monBlock1	= null;
var monImg1		= null;
var monIdx1		= 0;
var monContainer1= null;
var monTimeout1	= 7000;
var monEffect1	= 2;
var monHref1;
var monSrc1;
var monCaption1;
var monDuration1;
var imgHeight;
var imgWidth;

function montage1( dura, href, src, caption, width, height,imgH, imgW, animate )
{
	if( monBlock1 )
	{
		return;
	}
		
	imgHeight = imgH;
    imgWidth = imgW;
	monHref1		= href;
	monSrc1		= src;
	monCaption1	= caption;
	monDuration1 = dura;
	
	// this is the case for browsers that don't support filters...
	var cycle	= Math.floor( Math.random() * href.length );

	// switch off animation if we're not on broadband
	var m_montage	= ( typeof(animate) != "undefined" ? animate : hasBroadband1() );				
	if( m_montage == false || src.length <= 1  )
	{
		document.writeln( montagePicker1( cycle ) );
		return;
	}
	
	// go build all of the nested DIVs out
	monIdx1		= cycle;
	
	var nextImage	= (monIdx1 + 1) % src.length;

	if( height > 0 ) { document.writeln( "<div id=\"container\" style=\"width:" + width +"px;height:" + height + "px\">" ); }
	else { document.writeln( "<div id=\"container\" style=\"width:" + width +"px\">" ); }

	for( i = 0; i < src.length; i++ )
	{
		// set up a placeholder
		document.write( "<div id=\"montage1" + i + "\" style=\"display:none;width:" + width +"px;height:" + height + "px\">" );
		//alert("<div id=\"montage1" + i + "\" style=\"display:none;width:" + width +"px;height:" + height + "px\">" );
		if( i == nextImage )
		{
			// only prefetch the first image we will display
			document.write( montagePicker1( i ) );
		}
		
		document.write( "</div>" );
	}

	document.writeln( "</div>" );

	// pull the images out
	monBlock1	= new Array( src.length );
	monImg1		= new Array( src.length );

	for( i = 0; i < src.length; i++ )
	{
		monBlock1[i]	= document.getElementById( "montage1" + i );
		
		if( i == nextImage )
		{
			monImg1[i] = document.getElementById( "monImg1" + i );
		}
		else
		{
			monImg1[i] = null;
		}
	}

	monContainer1 = document.getElementById("container");
	
	montageEffects1();
}

function montageEffects1()
{
	var nextImage	= (monIdx1 + 1) % monImg1.length;
	
	// run the transition	
	if(  monEffect1 > 0 )
	{
		try
		{
			if( monEffect1 == 1 )
			{
				monContainer1.style.filter = "blendTrans(duration=0.6)";
				monContainer1.filters(0).apply();
 				montageSelect1( nextImage );
				monContainer1.filters(0).play();
			}
			else
			{
				monContainer1.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1.0,transition=7)";
				monContainer1.filters(0).apply();
				monContainer1.filters(1).apply();
 				montageSelect1( nextImage );
				monContainer1.filters(0).play();
				monContainer1.filters(1).play();
			}
		}
		catch( e ) { montageSelect1( nextImage ); }
	}
	else
	{
		montageSelect1( nextImage );
	}
	
	if(monDuration1[nextImage]==undefined)
	{
		monDuration1[nextImage]=5000;
	}
	

	// asked to be called again a little later
	setTimeout( "montagePrep1()", monDuration1[nextImage] - 1500 );
	setTimeout( "montageSwap1()", monDuration1[nextImage] );
}

function montageSelect1( nextImage )
{
	monBlock1[monIdx1].style.display = "none";
	monIdx1 = nextImage;
	monBlock1[monIdx1].style.display = "block";
}		

function montagePrep1()
{
	// prefetch the next image if we don't already have it
	var nextImage	= (monIdx1 + 1) % monImg1.length;

	if( !monImg1[nextImage] )
	{
		monBlock1[nextImage].innerHTML = montagePicker1( nextImage );
		monImg1[nextImage] = document.getElementById( "monImg1" + nextImage );
	}
}

function montageSwap1()
{
	if( monImg1[monIdx1].complete )
	{
		// move the image index along
		montageEffects1();
	}
	else
	{
		// check again 3 seconds later
		setTimeout( "montageSwap1()", 3000 );
	}
}

function montagePicker1( cycle )
{
    
	var divHtml;
	if( monHref1[cycle] != null ) 
	{
	    pTop = (138-imgHeight[cycle])/2
	    //alert(imgHeight[cycle]);
		divHtml = "<A href=\"" + monHref1[cycle] + "\"><IMG style='padding-top:"+ pTop +"px;height:"+ imgHeight[cycle] +"px;width:"+ imgWidth[cycle] +"px;' border='0'  src=\"" + monSrc1[cycle] + "\" alt=\"" + monCaption1[cycle] + "\" BORDER=\"0\" ID=\"monImg1" + cycle + "\"></a>";
	}
	else
	{
	    pTop = (138-imgHeight[cycle])/2
		divHtml = "<IMG style='padding-top:"+ pTop +"px;height:"+ imgHeight[cycle] +"px;width:"+ imgWidth[cycle] +"px;' border='0' src=\"" + monSrc1[cycle] + "\" ID=\"monImg1" + cycle + "\">";
	}
	
	return divHtml;
}

function hasBroadband1()
{
	//if( readIEVer() < 5.0 )
	//{
		//return false;
	//}
	
	try
	{
		document.body.addBehavior ("#default#clientCaps");
	
		return ( typeof(document.body.connectionType) != "undefined" && document.body.connectionType == "lan" );
	}
	catch( e )
	{
		return false;
	}
}