var ALBUM_PIX_WIDTH=100; var ALBUM_PIX_HEIGHT=70; var sortingCriteria; var sortingOrder; folderOn=new Image(); folderOn.src='./skins/default/images/folder_on.gif'; var pixList=new Array(); function MAFolder(dir, title, date, when, where, description, image, imageWidth, imageHeight, pass){ this.dir=dir; this.title=title; this.date=date; this.when=when; this.where=where; this.description=description; this.image=image; this.imageWidth=imageWidth; this.imageHeight=imageHeight; this.pass=pass; if(image!=''){ this.imgIndex=pixList.length; pixList[this.imgIndex]=new MAImage(image, imageWidth, imageHeight, '', '', 0, 0); pixList[this.imgIndex].load(); } else{ this.pixIndex=-1; } } function displayAlbumRow(albumIndex){ if(!albumList[albumIndex]) return; document.getElementById('date'+albumIndex).innerHTML=albumList[albumIndex].date; document.getElementById('title'+albumIndex).innerHTML=''+albumList[albumIndex].title+''; document.getElementById('when'+albumIndex).innerHTML=albumList[albumIndex].when; document.getElementById('where'+albumIndex).innerHTML=albumList[albumIndex].where; document.getElementById('description'+albumIndex).innerHTML=albumList[albumIndex].description; document.getElementById('pass'+albumIndex).innerHTML='
'+((albumList[albumIndex].pass)?'':'')+'
'; } function displayAlbum(aHTMLObjectId, albumIndex){ if(!document.getElementById(aHTMLObjectId)) return; if(!albumList[albumIndex]) return; if(albumList[albumIndex].image!=''){ innerHTML=''; innerHTML+=''; innerHTML+=''; document.getElementById(aHTMLObjectId).innerHTML=innerHTML; displayImage('mini'+albumIndex, albumList[albumIndex].imgIndex, 0); } else { displayTitle(aHTMLObjectId, albumIndex); } document.getElementById(aHTMLObjectId).albumIndex=albumIndex; document.getElementById(aHTMLObjectId).status='normal'; } function displayTitle(aHTMLObjectId, albumIndex){ if(!document.getElementById(aHTMLObjectId)) return; if(!albumList[albumIndex]) return; innerHTML=''; if(albumList[albumIndex].pass!='') innerHTML+='
'; innerHTML+=albumList[albumIndex].title; innerHTML+=''; document.getElementById(aHTMLObjectId).innerHTML=innerHTML; } function displayForm(aHTMLObjectId, albumIndex){ if(!document.getElementById(aHTMLObjectId)) return; if(!albumList[albumIndex]) return; innerHTML='
'; innerHTML+='
'; innerHTML+='
'; innerHTML+=''; innerHTML+='
'; document.getElementById(aHTMLObjectId).innerHTML=innerHTML; document.getElementById(aHTMLObjectId).status='pass'; } function showAlbums(){ if(displayMode==='icons'){ for(i=0;ib[sortingCriteria])?sortingOrder:-sortingOrder); } function sortAlbumsBy(criteria){ sortingCriteria=criteria; sortingOrder=-sortingOrder; albumList.sort(compareAlbums); if(displayMode==='list'){ activImage='./skins/default/images/'+((sortingOrder>0)?'up':'down')+'_arrow.gif'; neutralImage='./skins/default/images/neutral_arrow.gif'; document.getElementById("orderByDate").src=(criteria=="date")?activImage:neutralImage; document.getElementById("orderByTitle").src=(criteria=="title")?activImage:neutralImage; document.getElementById("orderByWhen").src=(criteria=="when")?activImage:neutralImage; document.getElementById("orderByWhere").src=(criteria=="where")?activImage:neutralImage; document.getElementById("orderByDescription").src=(criteria=="description")?activImage:neutralImage; } showAlbums(); } function userClick(aHTMLObjectId){ albumIndex=document.getElementById(aHTMLObjectId).albumIndex; if(albumList[albumIndex].pass==''){ this.document.location='show_album.php?album='+albumList[albumIndex].dir; } else if(document.getElementById(aHTMLObjectId).status!='pass'){ displayForm(aHTMLObjectId,albumIndex); } } function userMouseOver(aHTMLObjectId){ //window.alert(document.getElementById(aHTMLObjectId+'Container').className); document.getElementById(aHTMLObjectId+'Container').className='folderContainerHover'; if(document.getElementById(aHTMLObjectId).status!='pass') displayTitle(aHTMLObjectId, document.getElementById(aHTMLObjectId).albumIndex); } function userMouseOut(aHTMLObjectId){ document.getElementById(aHTMLObjectId+'Container').className='folderContainer'; if(document.getElementById(aHTMLObjectId).status!='pass') displayAlbum(aHTMLObjectId, document.getElementById(aHTMLObjectId).albumIndex); }