var intInOpacity = 0;

var intOutOpacity = 100;

var intCurrent = 1;

var boolRunning = false;



var pngAlpha = false;

var pngNormal = false;

var agt=navigator.userAgent.toLowerCase(); 

var is_major = parseInt(navigator.appVersion);

var is_gecko  = agt.indexOf('gecko')!=-1;	

var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

var is_ie3    = (is_ie && (is_major < 4));

var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );

var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );

var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);

 

if (is_ie5_5up)

	pngAlpha = true;

if (is_gecko)

	pngNormal = true;



function changeImage()

{

	if(!boolRunning && document.getElementById)

	{

		intNext = intCurrent + 1;

		if(intNext > intNumberOfImages)

			intNext = 1;			

		

		boolRunning = true;

		show('bigImage' + intNext);

		fadeOut('bigImage' + intCurrent);

		fadeIn('bigImage' + intNext);

		

		intCurrent = intNext;

	}

}



function fadeOut(strId)

{	

	if(is_gecko)

		document.getElementById(strId).style.MozOpacity = intOutOpacity/100*.99;

	else

		document.getElementById(strId).style.filter = 'Alpha(opacity=' + intOutOpacity + ')';

	intOutOpacity -= 10;

	

	if(intOutOpacity>=0)

	{

		setTimeout('fadeOut("'+strId+'")',50);

	}

	else

	{

		intOutOpacity = 100;

		hide(strId);

		boolRunning = false;

	}

}



function fadeIn(strId)

{

	if(is_gecko)

		document.getElementById(strId).style.MozOpacity = intInOpacity/100*.99;

	else

		document.getElementById(strId).style.filter = 'Alpha(opacity=' + intInOpacity + ')';

	intInOpacity += 10;

	if(intInOpacity<=100)

	{

		setTimeout('fadeIn("'+strId+'")',50);

	}

	else

		intInOpacity = 0;

}



function show(strId)

{

	if(document.getElementById)

		document.getElementById(strId).style.visibility = 'visible';

	else

		if(document.all)

			eval('document.all.' + strId + '.style.visibility = "visible"');

		else				

				if(document.layers)

					eval('document.' + strId + '.visibility = "visible"');

}



function hide(strId)

{

	if(document.getElementById)

		document.getElementById(strId).style.visibility = 'hidden';

	else

		if(document.all)

			eval('document.all.' + strId + '.style.visibility = "hidden"');

		else				

				if(document.layers)

					eval('document.' + strId + '.visibility = "hidden"');

}



function highLight(strId)

{

	if(document.getElementById)

		document.getElementById(strId).style.backgroundColor = '#6FD1F8';

}



function highLightOff(strId)

{

	if(document.getElementById)

		document.getElementById(strId).style.backgroundColor = '#FFFFFF';

}





function displayLogo (strId, strPath, intWidth, intHeight, strClass, strAlt) {

	if (pngAlpha) {

		document.write('<div id="logotype" style="height:79px; width:53px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'images/logo.jpg\',sizingMethod=\'scale\');"></div>');

	} else if (pngNormal) {

		document.write('<div id="logotype"><img src="images/logo.jpg" width="39" height="91" alt="" border="0"></div>');

	} else {

		document.write('<div id="logotype"><img src="images/logo.jpg" width="39" height="91" alt="" border="0"></div>');

	}

}
