// JavaScript Document

$(function () {
	if (typeof document.body.style.maxHeight == "undefined") {
		location.href = 'ie6.html';
	}
	$('#tree').hide();
	$('.imgBox img').hide();
});

var i = 0;
var int=0;
$(window).bind("load", function(){
	var int = setInterval("doThis(i)",100);
});

function doThis() {
	var images = $('img').length;
	if (i >= images) {
		clearInterval(int);
		}
		$('img:hidden').eq(0).fadeIn(500);
		i++;
		//$('#tree').fadeIn(4000);
	if($.browser.msie){
		$('#tree').show();
	}else{
		$('#tree').fadeIn(4000);
	}
}

function image_set() {
	var randnum = 1 + Math.floor( Math.random() * 8 );
//	document.getElementById("re").innerHTML = randnum;
//	document.getElementById("grand_image").src = "images/topmain_0"+ randnum +".jpg";
	//setTimeout(scrollTo(0,1), 100);
	if(randnum==3 | randnum==7){
		document.getElementById("grand_image").src = "images/topmain_02.jpg";
		document.getElementById("currents").style.backgroundColor ="#004D33";
		document.getElementById("tree").style.marginLeft="465px";
	} else if(randnum==4 | randnum==8) {
		document.getElementById("grand_image").src = "images/topmain_03.jpg";
		document.getElementById("currents").style.backgroundColor ="#46a";
		document.getElementById("tree").style.marginLeft="465px";
	} else {
		document.getElementById("grand_image").src = "images/topmain_01.jpg";
	}
}
