// adapted from  http://javascript.internet.com/cookies/    
// deve essere usata con ToDoList.js


function ListImageElements() {
var NumImageElements = GetCookie('PT_NumImageList');
var i;
var ImageElement;
if (NumImageElements == null) {
NumImageElements = 0;
}
ShowCount = 0; SwapColour = 0;
for (i=1; i <= NumImageElements; i++) {
ImageElement = GetCookie('PT_ImageElement'+i);
if (ImageElement != null) {
PrintElement(ImageElement, i);
      }
   }
}
function DeleteElement(Count) {
DeleteCookie('PT_ImageElement'+Count);
window.location = window.location;
}
function PrintElement (ImageElement, Count) {
var color = "";
var lunghezza=ImageElement.length-4;
SwapColour = 1 - SwapColour;
if (SwapColour==1) {color = "bgcolor='#EEEEEE'"} ;
ShowCount++;
document.write("<tr " + color + ">");
document.write("<td width=10% align=center valign=top><small><b>"+ShowCount);
document.write("<td width=75% align=left  ><a href='"+ImageElement.slice(0,lunghezza)+".tzl'><img src='"+ImageElement+"'></a>");
document.write("<td width=15% align=center>"+"<a href='javascript:DeleteElement(" + Count + ")'>Delete</a>");
}


function AddElement2(ImageElement ) {
var NumImageElements = GetCookie('PT_NumImageList');
var i;
var ImageElement;
if (NumImageElements == null) {
NumImageElements = 0;
}
if (ImageElement != null) {
NumImageElements++;
SetCookie('PT_ImageElement'+NumImageElements, ImageElement, exp);
SetCookie('PT_NumImageList',NumImageElements, exp);
window.location = window.location;
   }
}



