safari=(navigator.userAgent.indexOf('Safari')!=-1);

//used to swap which detail image you see when you click on the numbers below each main/detail image
function showPic(whichimageset,whichnavset,whichthumblink,whichpic) {
if (document.getElementById) {
	
	// find all the a tags in the views div passed with "whichset" and set the class to nothing
	var alinks = document.getElementById(whichnavset).getElementsByTagName('a');
	for(var i=0;i<alinks.length;i++){
		alinks[i].className='viewoff';
	}
	// find the a tag to switch and change the class to viewon
	document.getElementById(whichthumblink).className = 'viewon';

	// if the browser is safari, set the placeholder div to a blank image; this fixes a resize error
	if (safari) document.getElementById(whichimageset).src = '/images/blank.gif';
	
	// set the placholder div to the url of "this" a href passed
	document.getElementById(whichimageset).src = whichpic.href;			
		return false;
	} 
	else {
		return true;
	}
}

//used to hide and show sets of images+corresponding data when you click on the thumbnails on the left column
function switchInfo(whichchunks) {
	
	// Descriptions on right side
	// find all the imagedescription desc ids and set them to display:none
	var imgdescs = document.getElementById('imagedescriptions').getElementsByTagName('div');
	for(var i=0;i<imgdescs.length;i++){
		imgdescs[i].style.display='none';
	}	
	// find the div tag to switch and change the appropriate description to show
	var activeimgdesc = 'desc' + whichchunks;
	document.getElementById(activeimgdesc).style.display = 'block';

	// Detail Images in main content area
	// find all the detailimages img ids and set them to display:none
	var detailimgs = document.getElementById('detailimages').getElementsByTagName('div');
	for(var i=0;i<detailimgs.length;i++){
		detailimgs[i].style.display='none';
	}	
	// find the div tag to switch and change the appropriate image to show
	var activedetailimgs = 'details' + whichchunks;
	document.getElementById(activedetailimgs).style.display = 'block';

	// Number Links below main image, 01, 02, etc
	// find all the viewslinks li ids and set them to display:none
	var viewsnums = document.getElementById('viewslinks').getElementsByTagName('ul');
	for(var i=0;i<viewsnums.length;i++){
		viewsnums[i].style.display='none';
	}	
	// find the ul tag to switch and change the appropriate set of thumbnail number links to show
	var activeviewnums = 'views' + whichchunks;
	document.getElementById(activeviewnums).style.display = 'block';
}