﻿<!-- // gallery.js

////////  Photo Gallery functions ////////

// function swapgallerypic(imgid)
// change source and details of displayed gallery pic
function swapgallerypic(imgid) { // $photoID, $photoTitle, $photoDescription
		
	if (isArray(photodetails[imgid])) {
	
		//alert(photodetails[imgid]['photoid']);
		
		var pagetoc_cont = document.getElementById('pagetoc');
		pagetoc_cont.innerHTML = ' &raquo; ' + photodetails[imgid]['pagetoc'];
		
		var phototitle_cont = document.getElementById('phototitle');
		phototitle_cont.innerHTML = photodetails[imgid]['phototitle'];
		
		// h3phototitle
		var h3phototitle_cont = document.getElementById('h3phototitle');
		h3phototitle_cont.innerHTML = photodetails[imgid]['phototitle'];
		
		var mainimage = document.getElementById('mainpic');
		mainimage.src = '../../images/gallery/' + photodetails[imgid]['photoid'] + '.jpg';
		mainimage.alt = 'A photograph of ' + photodetails[imgid]['phototitle'];
		
		var photodesc_cont = document.getElementById('photodesc');
		photodesc_cont.innerHTML = photodetails[imgid]['photodesc'];
		
		var contribname_cont = document.getElementById('contribname');
		contribname_cont.innerHTML = photodetails[imgid]['contribname'];
		
		var contribcompany_cont = document.getElementById('contribcompany');
		// show or hide company name
		// check this works in firefox, etc
		if (photodetails[imgid]['contribcompany'] != '') {
			contribcompany_cont.style.display = 'block';
			contribcompany_cont.innerHTML = '<strong>Company:</strong> ' + photodetails[imgid]['contribcompany'];
		}
		else {
			contribcompany_cont.innerHTML = '';
			contribcompany_cont.style.display = 'none';
		}
		
		var contribdate_cont = document.getElementById('contribdate');
		contribdate_cont.innerHTML = photodetails[imgid]['contribdate'];
		
		// show or hide site link
		// check this works in firefox, etc
		var contriblink_cont = document.getElementById('contribsite');
		var contriblink_elem = document.getElementById('contriblink');
		
		if (photodetails[imgid]['contribsite'] != '') {
			contriblink_cont.style.display = 'block';
			contriblink_elem.href = photodetails[imgid]['contribsite'];
			contriblink_elem.title = '...click here to visit the web site of ' + photodetails[imgid]['contribname'];
			contriblink_elem.innerHTML = photodetails[imgid]['contribsite']; // strip http:// and trailing slash
		}
		else {
			//contriblink_cont.innerHTML = '';
			contriblink_cont.style.display = 'none';
		}
				
		/*
		*/
		
		// ourrating	
		// orientation
		
		// contribid
		// if three or more images by this contributor show a link to "see all photos by this contributor"
		
		//return false;
		
	} // if (isArray(photodetails[imgid]))
	
	else alert('No array');
		
} // function swapgallerypic(imgid)




// function YY_ImageGauge //
function YY_ImageGauge(bgg, bss, fc,wi, he, yyhide, pc, js){ //v4.03
	//copyright (c)1998-2003 Yaromat.com
	
	var ok = true; idiv = ''; pp = 0; sc = 0; i = 0; d = document; ff = 'Arial, sans-serif';
	var yyg = (d.all) ? d.all['yyg'] : ( (d.getElementById) ? d.getElementById('yyg') : ( (d.layers) ? d.layers['yyg'] : false));
	// get element by id
	
	if (d.images)with(d) {
		
		if (d.preloadArray == null) d.preloadArray = [];
		
		i=preloadArray.length;
		
		for (var j=8;j<YY_ImageGauge.arguments.length-1;j++){
			preloadArray[i]=new Image;preloadArray[i].src=YY_ImageGauge.arguments[j];i++;
		}
		
		if (preloadArray){
		var howmany=0;
		for (var j=0; j < preloadArray.length; j++) {
		ok=ok&&preloadArray[j].complete;
		if(preloadArray[j].complete)howmany++;
		}
		sc=Math.round(howmany*100/preloadArray.length);
		if (d.all||d.getElementById){
		pp=Math.round(howmany/preloadArray.length*wi);
		idiv='<table width='+wi+' height="'+he+'" bgcolor='+bgg+' border=0 cellpadding=0 cellspacing=0><tr><td bgcolor='+bss+' width='+pp+' style="font-size: 2pt">&nbsp;</td>'+
		'<td width='+(wi-pp)+' style="font-size: 2pt">'+((wi-pp)>1?'&nbsp;':'')+'</td></tr></table>';
		if (pc){idiv+='<center><font size=1 face='+ff+'" color="'+fc+'">'+sc+'%</font></center>'}
		if(d.all){d.all['yyg'].innerHTML=idiv;if(ok&&yyhide)setTimeout('d.all[\'yyg\'].style.visibility="hidden"',1000);
		}else if(d.getElementById){
		d.getElementById('yyg').innerHTML=idiv;
		if (ok&&yyhide)setTimeout('d.getElementById("yyg").style.visibility="hidden"',1000);
		}}
		if (d.layers){
		var np='<span style="font-size:11px;font-family:'+ff+';color:'+fc+'">'+sc+'% </span>';
		if (!yyg.document.layers['yynv']){
		idiv='<layer id="yynb" left="0" top="0" width="'+wi+'" height="'+he+'" bgcolor='+bgg+'><font face="'+ff+'" size="1"></font></layer>';
		idiv+='<layer id="yynv" left="-'+wi+'" top="0" width="'+wi+'" height="'+he+'" bgcolor='+bss+'></layer>';
		if (pc){idiv+='<layer id="yypc" left="'+(wi/2-15)+'" top="'+he+'" width="30" height="15">'+np+'</layer>'}
		yyg.document.open();yyg.document.write(idiv);yyg.document.close();
		}else{
		pp=Math.round(howmany/preloadArray.length*wi-wi);
		var nl=yyg.document;nl.layers['yynv'].left=pp;
		if(pc){nl.layers['yypc'].document.write(np);nl.layers['yypc'].document.close();}
		}
		
		if (ok && yyhide) {
			setTimeout('d.layers[\'yyg\'].visibility="hide"',1000);}
		}
		
		if (ok&&js!='#') d.location = js;
		
		else {
			setTimeout('YY_ImageGauge("'+bgg+'","'+ bss+'","'+ fc+'",'+wi+','+he+','+yyhide+','+pc+',"'+ js+'")',350);}
		}
		
		else {
			setTimeout('YY_ImageGauge("'+bgg+'","'+bss+'","'+ fc+'",'+wi+','+he+','+yyhide+','+pc+',"'+ js+'")',100)
		}
		
	} // if (d.images)with(d)
	
} // function YY_ImageGauge(

//-->

