//////////////////////////////////////////////////////////////////////////////////
// Xara clientside album functions Version 0.84 Copyright 2003 Xara Ltd
var pics=0;var picn=new Array();var cap=new Array();var thmb=new Array();var ti=new Array();var base=0;var path='';var album='';var themename='';var numCols=0;var debug=false;var myids=new Array();var cp;var cs;var pw=null;var d=document;var xaf_NS7=(!d.all&&d.getElementById);var xaf_NS4=(!d.getElementById);var xaf_IE5=(!xaf_NS4&&!xaf_NS7&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1||navigator.userAgent.indexOf('MSIE 5.2')!=-1));var xaf_IE5p5=(!xaf_NS4&&!xaf_NS7&&navigator.userAgent.indexOf('MSIE 5.5')!=-1);var xaf_NS6=(xaf_NS7&&navigator.userAgent.indexOf('Netscape6')!=-1);var xaf_SAF=(navigator.userAgent.indexOf('Safari')!=-1);function xara_templatesetup(tcp,tcs){if(typeof tcp!='undefined'){cp=tcp;}if(typeof tcs!='undefined'){cs=tcs;}}function xara_albumsetup(p,a,t){var node;path=p;album=a;themename=t;xara_scanCollection("xara_albumtitle",0,function(node,i,a){node.innerHTML+=a;},a);}function xara_pic(n,tti,tcap){var leaf,ext;leaf=n.substring(0,n.lastIndexOf('.'));ext=n.substring(n.lastIndexOf('.'),n.length);picn[pics]=path+n;ti[pics]=tti;cap[pics]=tcap;thmb[pics]=path+leaf+'_thumb'+ext;pics++;}function xara_show(pc){var w,h;var cb=pc+base;var bigimg;var strsrc="";if(cb>=picn.length)return true;strsrc+='
'+ti[cb]+'';strsrc+='';strsrc+='';strsrc+='var pics='+pics+'; var c='+cb+'; var e;';strsrc+='';strsrc+='';strsrc+='';strsrc+='';strsrc+=' |
';strsrc+=' |
';strsrc+='';bigimg=new Image();bigimg.src=picn[cb];w=bigimg.width+10;h=bigimg.height+30;s=0;if(w>screen.availWidth-50){w=screen.availWidth-50;s=1;}if(h>screen.availHeight-50){h=screen.availHeight-50;s=1;}o="toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars="+s+",left=40;top=20;screenX=40,screenY=20,width="+w+",height="+h;if(pw){wd=window.open("","xaraslideshow",o,true);pw=wd;}else{wd=window.open("","",o,true);wd.name="xaraslideshow";pw=wd;}wd.document.open();wd.document.writeln(strsrc);wd.document.close();xara_nextpic(0,wd);wd.focus();}function xara_albumfill(base){var i;var timg;var tel;var trow;myids=new Array();xara_scanIndexedCollection("xara_thumb",xara_img,0);xara_scanIndexedCollection("xara_title",xara_text,ti);xara_scanIndexedCollection("xara_caption",xara_text,cap);xara_scanCollection("xara_positionpages",0,function(tel,i,a){if(base>0||picn.length>base+xara_countslots())tel.style.visibility="visible";else tel.style.visibility="hidden";},0);xara_scanCollection("xara_prevpage",0,function(tel,i,a){if(base>0)tel.style.visibility="visible";else tel.style.visibility="hidden";},0);xara_scanCollection("xara_nextpage",0,function(tel,i,a){if(picn.length>base+xara_countslots())tel.style.visibility="visible";else tel.style.visibility="hidden";},0);xara_scanCollection("xara_position",0,xara_postext,0);xara_scanIndexedCollection("xara_cell",xara_vis,0);}function xara_img(timg,i,a){if((base+i)=0)if(thmb[base+i]!=''){timg.src=thmb[base+i];timg.removeAttribute("width");timg.removeAttribute("height");}else timg.src=themename+"nothumb.gif";else timg.src=themename+"missingthumb.gif";}function xara_text(tel,i,a){if((base+i)=0)tel.innerHTML=a[base+i];else tel.innerHTML='';}function xara_postext(tel,i,a){var top=base+xara_countslots();if(top>picn.length)top=picn.length;tel.innerHTML="Showing pictures "+(base+1)+" to "+top+" of "+picn.length;}function xara_vis(tel,i,a){if((base+i)=0)tel.style.visibility="visible";else tel.style.visibility="hidden";}function xara_countslots(){var i;i=0;timg=document.getElementById("xara_thumb"+i);while(timg){i++;timg=document.getElementById("xara_thumb"+i);}return i;}function xara_prevpage(){if(base>0){base=base-xara_countslots();xara_albumfill(base);}}function xara_nextpage(){if(picn.length>base+xara_countslots()){base=base+xara_countslots();xara_albumfill(base);}}function xara_albumcreate(ncols,nrows,startslot){var posn=document.getElementById("xara_albumdisplay");var x,y;var slotnum;var row_startslot;if(posn){var oTable=document.createElement("TABLE");var oTBody0=document.createElement("TBODY");var oRow,oCell;var i,j,k;var tcell_collect;var tcell;var tcellInnerHTML;if(startslot!=-1)slotnum=startslot;else slotnum=xara_countslots();oTable.appendChild(oTBody0);oTable.border=0;oTable.width='100%';if(typeof cp!='undefined')oTable.cellPadding=cp;if(typeof cs!='undefined')oTable.cellSpacing=cs;oTable.className="xara_albumtable";for(i=0;i';}oCell.align='center';oCell.vAlign='top';oCell.width=100/ncols+'%';oCell.id="xara_cell"+slotnum;oCell.className="xara_albumcell"+k;oRow.appendChild(oCell);slotnum++;}}}tcell_collect=document.getElementsByName("xara_albumcelltemplate");for(k=tcell_collect.length-1;k>=0;k--){tcell=tcell_collect[k];if(tcell&&xara_ChildOf(posn,tcell)){var p=tcell.parentNode;p.removeChild(tcell);}}posn.appendChild(oTable);numCols=ncols;}}function xara_nextpic(d,wnd){wnd.c+=d;if(wnd.c>=pics)wnd.c=0;if(wnd.c<0)wnd.c=pics-1;if(wnd.document.images!=null){var e=wnd.document.getElementById("pic");if(e){e.src=picn[wnd.c];e.align="center";}e=wnd.document.getElementById("posn");if(e)e.innerHTML="Photo "+(wnd.c+1)+" of "+pics;e=wnd.document.getElementById("title");if(e)e.innerHTML=ti[wnd.c];e=wnd.document.getElementById("caption");if(e)e.innerHTML=cap[wnd.c];if(wnd.navigator.userAgent.indexOf('MSIE')!=-1)wnd.document.title=ti[wnd.c];}}function xara_sizetofit(wnd){if(wnd.document.images!=null){e=wnd.document.getElementById("pic");if(e){if(e.width!=0||e.height!=0){var w,h,s;w=e.width+18+32;h=e.height+56+32;s=false;if(cap[wnd.c]!='')h=h+40;if(w>screen.availWidth){w=screen.availWidth;s=true;}if(h>screen.availHeight){h=screen.availHeight;s=true;}wnd.resizeTo(w,h);if(s)wnd.moveTo(0,0);}else{wnd.setTimeout("xara_sizetofit(window)",50);}}}}function xara_ChildOf(a,n){var p;p=n.parentNode;while(p){if(p==a)return true;p=p.parentNode;}return false;}function xara_scanIndexedCollection(name,func,args){var i;var count;i=0;do{count=xara_scanCollection(name+i,i,func,args);i++;}while(count>0)}function xara_scanCollection(name,base,func,args){var tcell_collect;var tcell;var i;var count;count=0;tcell_collect=document.getElementsByName(name);if(tcell_collect.length>0){for(k=0;k