/*
	javascript functions
	============================
	website 	: 	www.amirandes.com/
	date 		: 	13-10-2008		
	author 		: 	mayra metaxa / developer
	company		: 	mozaik creative business solutions
	url			:	http://www.mozaik.com

*/

function show_selection(id)
{
	for (i=1;i<=6;i++)
	{
		document.getElementById('accom_mnu_'+i).className = "";
		document.getElementById('two_cols_target'+i).style.display = "none";
	}
		
	document.getElementById('accom_mnu_'+id).className = "loc";
	document.getElementById('two_cols_target'+id).style.display = "block";
}



/* gallery */

function bring_next_protogroup()
{
	var num_of_img = img_arr.length;
	var thumb_id = 1;
	var displayed =0;
	
	previous_from = protogroup_from;
	
	protogroup_to = Number(protogroup_from + how_many);		
	
	for (i=protogroup_from;i<protogroup_to;i++)
	{
		document.getElementById("thumb"+thumb_id).src = img_arr[i];

		if (img_arr[i]!="")
		{
			displayed = displayed + 1;
			document.getElementById("thumb"+thumb_id).style.display = "block";
		}
		else
			document.getElementById("thumb"+thumb_id).style.display = "none";
			
		thumb_id = thumb_id +1;		
	}	
	protogroup_from = protogroup_to;
	
	if (protogroup_from >=num_of_img-1)
		protogroup_from = 0;
		
	if (previous_from==0)
	{
		previous_from=1;
		displayed = how_many-1;
	}
	document.getElementById('small_letters').innerHTML = (previous_from) + " - " + (previous_from+displayed);
}

function bring_prev_protogroup()
{	
	var num_of_img = img_arr.length;

	var x = protogroup_from - (how_many*2);
	protogroup_from = x;
		
	if (x<=0)
		protogroup_from = how_many - x;
		
	if (x>=num_of_img-1)
		protogroup_from = 0;
	
	if (x<=0)
		protogroup_from = 0;

	bring_next_protogroup();
}

function show_image(id)
{
	document.getElementById('show_thumb').src = document.getElementById(id).src;
	
	for (i=1;i<=how_many;i++)
	{
		document.getElementById('thumb'+i).className = "";
	}
	document.getElementById(id).className = "loc";
}

function showhide_thumbs()
{
	if ( (document.getElementById('gallerythumbs').style.display == "block") || (document.getElementById('gallerythumbs').style.display == "") )
	{
		document.getElementById('gallerythumbs').style.display = "none";
		document.getElementById('gallery_col').style.width = "16px";
		document.getElementById('showhide').style.margin = "158px 0 0 0px";
		document.getElementById('showhide_img').src = "html_images/buttons/show.gif";
	}
	else
	{
		document.getElementById('gallerythumbs').style.display = "block";
		document.getElementById('gallery_col').style.width = "106px";
		document.getElementById('showhide').style.margin = "158px 0 0 90px";
		document.getElementById('showhide_img').src = "html_images/buttons/hide.gif";
	}
}

/**/
function show_floorplan(id)
{
	document.getElementById('floorplan').src = document.getElementById(id).src;
	document.getElementById('floorplan').style.display = "block";
	document.getElementById('floorplan').style.border = "solid 1px #897034";
	
	for (i=1;i<=floorplans_num;i++)
	{
		document.getElementById('floor'+i).className = "";
	}
	document.getElementById(id).className = "loc";
}

function close_floorplan()
{
	document.getElementById('floorplan').style.display = "none";
	for (i=1;i<=floorplans_num;i++)
	{
		document.getElementById('floor'+i).className = "";
	}
}