////////////////////////////////////////////////////////////
// hide and/or show item or hide all and show this item
// Ask
//	item = the number of the item id
//	theString = prefix of item id
//	maxItem = nbr d'item dans la liste
//
// Item id must start at 0, can't be interupted and stopt at maxItem - 1

function hideAllAndShowThis(item, theString, maxItem)	{
	if($(theString+item).getStyle('display') != "block"){
		for (i=0; i<maxItem; i++){
			$(theString+i).hide();
		}
		$(theString+item).show();
	}else
		$(theString+item).hide();
}



var hotspots = document.getElementsByName('hotspot');
var toggles = document.getElementsByName('toggle');


function visibilitytoggle()
{
  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = 'none';
  }
  
  for (var i = 0; i < hotspots.length; i++)
  {
  hotspots[i].someProperty = i;
  hotspots[i].onclick = function() {toggle(this.someProperty)};
  }
}

function toggle(i)
{
  if (toggles[i].style.display == 'none')
  {toggles[i].style.display = ''
  }
  else
  toggles[i].style.display = 'none'
} 

function showall()
{
  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = '';
  }
}

function hideall()
{
  for (var i = 0; i < toggles.length; i++)
  {
  toggles[i].style.display = 'none';
  }
}

function showHideMe(target){
	if($(target).getStyle('display') != "block") $(target).setStyle('display') != "block";
	else $(target).setStyle('display') != "none";
}

function showHideContactMe(showStatus, sourceId){
	if(showStatus == 0){ //hide
		$('contact_me').setStyle({display: 'none'});
		$('FORM_MOBILE').value='';
		$('FORM_EMAIL').value='';
		$('FORM_FNAME').value='';
		$('FORM_LNAME').value='';
		$('CONTACT_ME').setAttribute("onclick", "showHideContactMe(1, this.id)");
		$('CONTACT_ME').checked =false;
		$('CONTACT_ME_LINK').setAttribute("onclick", "showHideContactMe(1, this.id)");
	}
	else{ // show
		$('contact_me').setStyle({display: 'block'});
		$('CONTACT_ME').setAttribute("onclick", "showHideContactMe(0, this.id)");
		$('CONTACT_ME_LINK').setAttribute("onclick", "showHideContactMe(0, this.id)");
		$('CONTACT_ME').checked =true;
	}
}