function LoadImages(numberofimages, file, extension)
{
    for(var i = 1; i<=numberofimages; i++) {
        this[i]= new Image()
        this[i].src= file + i + extension
    }
    return this
}


var slide=1;
var fade;
var fadeId;
var browser;

function body_load()
{
	slideshow=new LoadImages(5,'images/slide','.jpg');
	setInterval('changeSlide()',10000);
	browser=BrowserDetect.browser;
}
function changeSlide()
{
	fade=0;
	fadeId=setInterval('fadeInMask()',10);
	setTimeout('showSlide()',400);
	//setTimeout('fadeOutM()',700);
}

function showSlide()
{
	slide++;
	if(slide>5)
	{
		slide=1;
	}
	if(document.images)
	{
		eval('document.images["slide1"].src='+'slideshow[slide].src');
	}
	setTimeout('fadeOutM()',300);
}
function fadeInMask()
{
	fade+=5;
	if(fade>=100)
	{
		fade=100;
		clearInterval(fadeId);
		
	}
	if(browser!='Explorer')
	{
		document.getElementById('fadeDiv').style.opacity=fade/100;
	}else{
		document.getElementById('fadeDiv').filters.alpha.opacity=fade;
	}
}
function fadeOutM()
{
	fade=100;
	fadeId=setInterval('fadeOutMask()',10);
}
function fadeOutMask()
{
	fade-=5;
	if(fade<=0)
	{
		fade=0;
		clearInterval(fadeId);
	}
	if(browser!='Explorer')
	{
		document.getElementById('fadeDiv').style.opacity=fade/100;
	}else{
		document.getElementById('fadeDiv').filters.alpha.opacity=fade;
	}
}


function sizemainwin(isize)
{
	document.all.mframe.height=isize;
}

function highlightbutton(btn)
{
	for(x=1;x<=10;x++)
	{
		but='button'+x;
		lnk='link'+x;
		if(x==btn)
		{
			document.all(but).className='mnuhltd';
			document.all(lnk).className='mnulinks';
		}
		else
		{
			document.all(but).className='mnutd';
			document.all(lnk).className='mnulink';
		}
	}
	if(btn==10)
	{
		document.all.mframe.height=1200;
	}
	else if(btn==10)
	{
		document.all.mframe.height=400;
	}
	else if(btn==2)
	{
		document.all.mframe.height=1500;
	}
	else if(btn==6)
	{
		document.all.mframe.height=1300;
	}
	else
	{
		document.all.mframe.height=540;
	}
}
