/*var flashImageViewer = {

	init: function() {
	
		jQuery('.image-thumb').click(function(event){
			event.preventDefault(); event.stopPropagation();
			flashImageViewer.sendToActionScript(this.href);			
		});
			
	},
	
	sendToActionScript: function(value){
		flashImageViewer.thisMovie("EInterface").sendToActionScript(value);
	},
	
	thisMovie: function(movieName){
		return document[movieName];
	}
}*/

GoldenhookImageViewer = Class.create();
GoldenhookImageViewer.prototype = {
	initialize: function() {
		//$$('.image-thumb').observe('click', this.sendToActionScript.bind(this));
		//window.select('.image-thumb').invoke('observe', 'click', sendToActionScript);
		this.hookClickables('more_views');
	},
	
	testFct: function(element){
		var image = element.target;
		var movie = document["EInterface"];
		//alert(image.getAttribute("src"));
		//alert(image.readAttribute("largesrc")); 
		
		movie.sendToActionScript(image.getAttribute("largesrc"));
		Event.stop(element);
		//alert(this.thisMovie("EInterface").sendToActionScript(image));
		
	},
	
	thisMovie: function(movieName){
		return document[movieName];
	},
	
	hookClickables: function(parent){
    	parent = $(parent);
	    if (parent)
	    {
	        parent.select('.image-thumb').invoke('observe', 'click', this.testFct.bind(this));
	    }
	}
	
}
