var ajaxContent=new Array();$(document).ready(function(){buildOnClick();});function swapImages(id){$(id).each(function(i){$(this).bind("click",function(){var src=$(this).attr('src');var iPos=src.lastIndexOf('\/');var dir=src.substr(0,iPos+1);var file=src.substr(iPos+1);var srcSwap=(file.substr(0,2)=='t_')?file.substr(2):'t_'+file;srcSwap=dir+srcSwap;$(this).attr({src:srcSwap}).load(function(){if(file.substr(0,2)=='t_')
this.scrollIntoView(true);});});});}
function m(file,divid){var toLoad=file;var id='#'+divid;if(ajaxContent[divid]!=true){$.ajax({type:"GET",url:file,success:function(response){$(id).is(":hidden")?$(id).html(response).slideDown("slow"):$(id).slideUp(10);ajaxContent[divid]=true;swapImages(id+' div.pics img');}});}}
function buildOnClick(){var span=document.getElementsByTagName('span');for(var i=0;i<span.length;i++)
if(span[i].className=='folder'){for(var j=0;j<span[i].childNodes.length;j++){if(span[i].childNodes[j].tagName=="A"){var href=span[i].childNodes[j].getAttribute('href');var idx=href.indexOf("content");if(idx>=0){var idx_htm=href.indexOf(".php",idx);if(idx_htm>=0){var len=idx_htm-idx;var file=href.substr(idx,len)+".html";var text=span[i].childNodes[j].innerHTML;span[i].removeChild(span[i].childNodes[j]);span[i].innerHTML=text;var parent=span[i].parentNode;for(var x=0;x<parent.childNodes.length;x++)
if(parent.childNodes[x].nodeName=="UL"){for(var y=0;y<parent.childNodes[x].childNodes.length;y++)
if(parent.childNodes[x].childNodes[y].nodeName=="LI")
var divId=parent.childNodes[x].childNodes[y].id;}
var onclick="m('"+file+"','"+divId+"')";}}}}}}