/**
 * Pimpmygento Simplyflashzoom Js file
 *
 * @category    Pimpmygento
 * @package     Pimpmygento_Simplyflashzoom
 * @copyright   Copyright (c) 2010 Pimpmygento (http://www.pimpmygento.com)
 * @author		Cedric Michel
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
SimplyFlashZoom = Class.create();
SimplyFlashZoom.prototype = {
	initialize: function() {
		this.hookClickables('more_views');
	},
	
	sendToSwf: function(event){
		var image = event.target;
		var movie = document["EInterface"];

		movie.sendToActionScript(image.getAttribute("largesrc"), image.getAttribute("thumbsrc"));
		Event.stop(event);
	},
	
	thisMovie: function(movieName){
		return document[movieName];
	},
	
	hookClickables: function(parent){
	
    	parent = $(parent);
	    if (parent)
	    {
	        parent.select('.image-thumb').invoke('observe', 'click', this.sendToSwf.bind(this));
	    }
	}
	
}