/*
	javascript functions
	============================
	website 	: 	rocabella
	date 		: 	26-3-2009		
	author 		: 	mayra metaxa / developer
	company		: 	mozaik creative business solutions
	url			:	http://www.mozaik.com

*/


/* gallery */

function show_image(which)
{
	active_image= which;
	
	for (i=0;i<how_many;i++)
		document.getElementById('thumb_box'+i).className = "thumb_box";
	
	document.getElementById('thumb_box'+which).className = "thumb_box_loc";

	document.getElementById('gallery_prev').src = img_arr[which];
	
	var speed = Math.round(800 / 100);
	var timer = 0;
	//fade out
	changeOpac(0, 'gallery_prev');
	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'gallery_prev')",(timer * speed));
		timer++;
	}	
	
}


function changeOpac(opacity, id) 
{
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}


function show_next_img()
{
	var temp = active_image + 1;
		
	if (temp>actual_img)
		temp = 0;							
	
	show_image(temp);
}

function show_prev_img()
{
	var temp;
	
	if (active_image>=1)
	{
		 temp = active_image - 1;
	}
	else
		temp=how_many-1;

	show_image(temp);		
}
