function byID(id)
{
	var obj;
	if (document.getElementById) obj = document.getElementById(id);
	else if (document.all) obj = document.all[id];
	else if (document.layers) {
		obj 	  = document.layers[id];
		obj.style = document.layers[id];	
	}
	return obj;	
}

var time_out;

function RunSlideShow(i, amount, first, isClicked)
{
	if (isClicked == 1) {
		clearTimeout(time_out);
	}

	if (first == 0) {
		mint.fx.Fade("banner_"+i, 0, 20, 500);
		byID("banner_"+i).style.display = "none";
	}	
	
 	i++;
	if (i > amount) i = 1;
	
	for (var a = 1; a < 6; a++)
	{
		byID("banner_"+a).style.display = "none";
		byID("banner_"+a).style.opacity = "0";	
		if (a == i) { byID("switch"+a).style.backgroundColor = "#c3c4c7"; }
		else { byID("switch"+a).style.backgroundColor = "white"; }
	}	
	
	byID("banner_"+i).style.display = "block";
	byID("banner_"+i).style.opacity = "0";
	mint.fx.Fade("banner_"+i, 100, 20, 500);	
	
	time_out = setTimeout('RunSlideShow('+i+', '+amount+', 0)', 6000);
}

function correct()
{
    var windowWidth = 0;
    if(typeof( window.innerWidth ) == 'number') {
    	windowWidth = window.innerWidth - 18;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	windowWidth = document.documentElement.clientWidth;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	windowWidth = document.body.clientWidth;
    }

  	var tmpA = 0;
  	var tmpB = 0;
  	var tmpRest = 0;
  	var a = 0;
		
	if (1001 > windowWidth) {
		byID("background-left").style.display = "none";
		byID("background-right").style.display = "none";
	} else if (1631 < windowWidth) {
		byID("background-left").style.width = "127px";
		byID("background-right").style.width = "173px";
		byID("frame").style.width = "1300px";
	} else {			
		tmpRest = windowWidth - 1000;
		if ((tmpRest % 2) == 1) { a = 1; }			
		tmpA = tmpRest / 2;	
		byID("background-left").style.width = tmpA + "px";
		byID("background-right").style.width = tmpA + "px";
		byID("frame").style.width = windowWidth + "px";	
	}
}

