var image_rotate_delay = 10000; // delay in milliseconds (2000 = 2 secs)
var current_big_image = 1;
var iInterval;
function put_image(img_id){
	window.clearInterval(iInterval);
	current_big_image = img_id;
	auto_animate();
	
}
function auto_animate(){
	

	for(i=0; i<image_collection.length; i++){
		document.getElementById('thumb_id_'+i).className = "";
	}
	document.getElementById('thumb_id_'+current_big_image ).className = "selected";
	document.getElementById('big_image_container').innerHTML = '<a href="'+image_collection[current_big_image][0]+'"  target="_blank"><img src="'+image_collection[current_big_image][1]+'" border="0" /></a>';
	current_big_image++;
	if(current_big_image>=image_collection.length){
		current_big_image=0;
	}


}
function rotate_big_image(){

	iInterval = window.setInterval("auto_animate()", image_rotate_delay);
}
function stop_roatation(){
	window.clearInterval(iInterval);
}




/*
teaser animate v2
*/

var current_big_teaser = 0;

function next_big_teaser(){
	current_big_teaser++;
	if(current_big_teaser >= image_collection.length)
		current_big_teaser = 0;
        show_big_teaser();
	show_small_teaser();
}
function previous_big_teaser(){
	current_big_teaser--;
	if(current_big_teaser <0)
		current_big_teaser = image_collection.length -1;
        show_big_teaser();
	show_small_teaser()
}
function show_big_teaser(){
	document.getElementById('big_image_container_2').innerHTML = '<a href="'+image_collection[current_big_teaser][0]+'"  target="_blank"><img src="'+image_collection[current_big_teaser][1]+'" border="0" /></a>';
	
}
function show_small_teaser(){
	current_small_teaser = current_big_teaser+1;
	if(current_small_teaser >= image_collection.length )
		current_small_teaser = 0;
	
	//document.getElementById('thumb_id').innerHTML = '<img src="'+image_collection[current_small_teaser][3]+'" /><span>'+image_collection[current_small_teaser][2]+'</span>';
        document.getElementById('thumb').innerHTML = '<span>'+image_collection[current_big_teaser][2]+'</span>';

}
