//toggles layer visibility on and off
function show(id) {
	document.getElementById(id).style.visibility = "visible";
}
function hide(id) {
	document.getElementById(id).style.visibility = "hidden";
}
function toggleVisibility(id) {
	if (document.getElementById(id).style.visibility == "hidden") {
		document.getElementById(id).style.visibility = "visible";
	} else {
		document.getElementById(id).style.visibility = "hidden";
	}
}

// highlights and copies certain content (share links)
function HighlightAll(theField) {
var tempval=eval(document.getElementById(theField))
tempval.focus()
tempval.select()
if (document.all){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Contents highlighted and copied to clipboard!"
setTimeout("window.status=''",1800)
}
}

//make tables semi-transparent
function transDiv(myObj){
var theheight=document.getElementById(myObj+'Table').offsetHeight;
var thewidth=document.getElementById(myObj+'Table').offsetWidth;
document.getElementById(myObj+'Grad').style.height=theheight+'px';
document.getElementById(myObj+'Grad').style.width=thewidth+'px';
document.getElementById(myObj+'Table').style.backgroundColor='';
document.getElementById(myObj+'Grad').style.zIndex=1;
document.getElementById(myObj+'Table').style.zIndex=2;
if (document.getElementById(myObj+'Flash'))	{document.getElementById(myObj+'Flash').style.zIndex=3;}
}

// when a photo is shown, open extra divs
function photoAddOn_show(myDiv) {
	var divList=new Array(3)
	divList[0]='Share';
	divList[1]='ViewComment';
	divList[2]='GetCode';
	var x=0;
	// loop through list
	for (x=0; x<3; x++) {
		if (myDiv==divList[x]) {
			document.getElementById(divList[x]).style.display='block';
		} else {
			document.getElementById(divList[x]).style.display='none';
		}
	}
}

// for the 'prev' and 'next' buttons when watching photos
function highlightPrevNext(myObj) {
	document.getElementById(myObj+'Box').style.border='silver solid 1px;';
	document.getElementById(myObj+'Box').style.padding='2px';
	document.getElementById(myObj).style.background='white';
}
function removeHighlightPrevNext(myObj) {
	document.getElementById(myObj+'Box').style.border='none';
	document.getElementById(myObj+'Box').style.padding='3px';
	document.getElementById(myObj).style.background='';
}

// display or hide (usually divs)
function HideandShow(myObjShow,myObjHide1,myObjHide2)	{
var objShow =document.getElementById(myObjShow);
objShow.style.display='block';
objShow.style.visibility='visible';
if (document.getElementById(myObjHide1)){
	var objHide1 =document.getElementById(myObjHide1);
	objHide1.style.display='none';
	objHide1.style.visibility='hidden';
}
if (document.getElementById(myObjHide2)){
	var objHide2 =document.getElementById(myObjHide2);
	objHide2.style.display='none';
	objHide2.style.visibility='hidden';
}
}