/**
 * arbetarbladet.se
 * site specific javascript goes here.
 * 
 * Documentation: http://mittmediadev.adeprimo.se/core/wiki/DesignGuidelines/Javascript/Site
 * contact: Anders Ytterström, Adeprimo <anders.ytterstrom@gmail.com>
 */

// put the magic to stage. Do not alter.
Event.observe(window,'load',site_init);

/**
 * disabled features
 * 
 * Fill this array with the js-features this site should not use.  
 * 
 * The keywords is a static set, and each keyword should be separated by comma (,).
 * See mktCore wiki for the set of keywords and directions how to use.
 *
 * Leave array blank if all features should be used. Do NOT remove it!
 */
var disabledFeatures = [ 'ImageCaption' ];

/**
 * Called on page load, put init methods here.
 */
function site_init() {
	
	// Disable (modal) click on wide (>= 800px) images, ADEPRIMO-3442
	(function() {
		var topImageWrapper = $$(".imageWrapper.top");
		
		if (!topImageWrapper) {
			return; // Exit
		}
		
		
		var topImage = topImageWrapper[0].down(".articleImage");
		
		if (!topImage) {
			return; // Exit
		}
		
		
		var topImageWidth = topImage.getWidth();
		
		if (topImageWidth < 800) {
			return; // Exit
		}
		
		
		var topImageLink = topImage.up("a");
		
		topImageLink.observe("click", function(event) {
			Event.stop(event);
		});
		
		topImage.observe("mouseover", function(event){
			topImage.setStyle({cursor:"default"});
		});
			 
	})();
	
}
