mybut=0;

mainimgs = new Array();
for(i=1;i<=8;i++){
	mainimgs[i]="new_image"+i+".jpg";
}
imgmax=mainimgs.length-1;

floatimgs = new Array();
for(i=1;i<=8;i++){
	floatimgs[i]="new_float"+i+".png";
}
imgmax=floatimgs.length-1;

floatx = new Array();
floatx[1] = 500;
floatx[2] = 600;
floatx[3] = 20;
floatx[4] = 590;
floatx[5] = 590;
floatx[6] = 590;
floatx[7] = 100;
floatx[8] = 20;


floaty = new Array();
floaty[1] = -350;
floaty[2] = -350;
floaty[3] = -140;
floaty[4] = -130;
floaty[5] = -130;
floaty[6] = -130;
floaty[7] = -350;
floaty[8] = -130;

myint=setInterval(goimg,4000);

img=1;

$(document).ready(function() {
		$('div.head1').hide();
		$('div.text1').hide();
});


function goimg(){

	img++;

	for(i=1;i<=imgmax;i++){
		document.getElementById("th"+i).style.border="2px solid black";
	}
	document.getElementById("th"+img).style.border="2px solid white";

//	$('div.mainf').slideUp();
	$('div.maino').fadeOut(400, function(){
		document.getElementById("maino").src=mainimgs[img];
//		document.getElementById("mainf").src=floatimgs[img];

//		$('div.mainf').css("left",floatx[img]);
//		$('div.mainf').css("top",floaty[img]);

		$('div.maino').fadeIn(400, function(){

//			$('div.mainf').fadeIn(1000);

//			$('div.mainf').fadeIn(1000, function(){
//				alert("image successfully complete");
//			});

			if(img>=imgmax)
				img=0;


		});

	});

}

function pic_clicked(pic){

	clearInterval(myint);
	img=pic-1;
	goimg();

}
