/**
 * Make areas wraped around links also clickable
 * @author Armin Harbrecht
 */

GT.ExtendedLink = new Class({
	initialize: function(linkAreas) {
	  this.linkAreas = $$(linkAreas);
	  this.linkAreas.each(function(area){
	  	var linkElems = area.getElements('a');
	  	var link = linkElems[0].get('href');
		area.addEvent('click', function(e) {
			//Checks if a html link is clicked (used srcElement for IE)
			if (!(($defined(e.target) && e.target.get('href') === link) || ($defined(e.srcElemnent) && e.srcElemnent.get('href') === link))) {
				window.location.href=link;	
			};
		});
	  }, this)
	 }
});
