var imageBox = document.getElementById('mainImage');
var description = document.getElementById('imageDesc');
updateImageList =function() {	
		if (!document.getElementsByTagName){ return; }
		var anchors = document.getElementsByTagName('a');
		
		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			alert(anchor.href);
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('imageBox'))){
				anchor.onclick = function () {alert('hello'); return false;}
			}
		}
}
prepareLinks = function(links) {
	boxImages = new Array();
  for (var i=0; i<links.length; i++) {
  	//alert(links[i].className);
	 if (links[i].className == "imageBox") {
		 	if (document.images)
			{
			boxImages[i] = new Image();
			boxImages[i].src = links[i].href;
			}
      links[i].onclick = function() {
	  	if(this.href!='' && this.href!=null){
        document.images.mainImage.src = this.href;
		if(description){
			description.innerHTML = this.getAttribute('title');
		}
		}
        return false;
    	}
	  }
    }
}
prepareLinks(document.getElementsByTagName("a"));
//updateImageList();