﻿var share = {	//	shareAlphaOff:0.6,	icons:new Array(		{			icon:'<img src="' + env.applicationPath + '/imgs/share/email_off.png" width="20" height="14" alt="' + ((env.lang == 'IT') ? 'invia via email' : 'send via email') + '" title="' + ((env.lang == 'IT') ? 'invia via email' : 'send via email') + '" />',			onclick:function(){				document.location = 'mailto:?Subject=Boffi cucine - bagni - sistemi&Body=' + document.URL;			}		},		{			icon:'<img src="' + env.applicationPath + '/imgs/share/print_off.png" width="20" height="19" alt="' + ((env.lang == 'IT') ? 'stampa' : 'print') + '" title="' + ((env.lang == 'IT') ? 'stampa' : 'print') + '" />',			onclick:function(){				window.print();			}		}	),	//	settings:null,	//	container:null,	content:null,	share:null,	items:null,	//	show:function(settings)	{		// visible in preview mode only		//if(!env.preview) return;		//		this.settings = settings;		if(this.settings.zindex == null) this.settings.zindex = 50;		// create obj		if(this.obj == null)		{			/*			zIndex				(the contaner gets this value, the content -?-)			container:				top				left				width				padding left			content:				contentWidth			*/			// container			this.container = $('<div id="share_container"></div>');			$('body').prepend(this.container);			this.container.css('position', 'absolute').css('z-index', this.settings.zindex);			this.container.height(26);			// content			this.content = $('<div id="share_content" class="clearfix"></div>');			this.container.append(this.content);			this.content.css('z-index', this.settings.zindex + 1);			// share			this.share = $('<div id="share">Share</div>');			this.content.append(this.share);			this.share.css('opacity', share.shareAlphaOff);			this.shareImg = $('<img src="' + env.applicationPath + '/imgs/arrow_right.png" width="14" height="13" class="arrow" />');			this.content.append(this.shareImg);			// items			this.items = $('<div id="items"></div>');			this.content.append(this.items);			this.items.css('opacity', 0.0);			// add items			for(var i = 0; i < this.icons.length; i++)			{				var cursor = this.icons[i];				var icon = $('<span class="icon"></span>');				this.items.append(icon);				if(cursor.onclick != null) icon.click(cursor.onclick);				//				var icon_off = $(cursor.icon);				icon.append(icon_off);				var icon_on = $(cursor.icon.split('_off.png').join('_on.png'));				icon.append(icon_on);				var image_width = icon_on.width();				icon_on.css('opacity', 0.0).css('position', 'relative').css('margin-left', -image_width);				//				icon.mouseenter(function(){					$(this).find('img[src$="_off.png"]').animate({'opacity': 0.0}, {queue:false, duration:settings.animFast});					$(this).find('img[src$="_on.png"]').animate({'opacity': 1.0}, {queue:false, duration:settings.animFast});				});				icon.mouseleave(function(){					$(this).find('img[src$="_off.png"]').animate({'opacity': 1.0}, {queue:false, duration:settings.animFast});					$(this).find('img[src$="_on.png"]').animate({'opacity': 0.0}, {queue:false, duration:settings.animFast});				});			}			// actions			this.container.data('share', this);			this.container.mouseenter(function(){				var share = $(this).data('share');				share.share.animate({'opacity': 1.0}, {duration:settings.animFast, queue:false});				share.items.animate({'opacity': 1.0}, {duration:settings.animFast, queue:false});				if(share.settings.widthOpen != null)					share.container.animate({'width': share.settings.widthOpen + resizeManager.getSize().marginH}, {duration:settings.animFast, queue:false});			}).mouseleave(function(){				var share = $(this).data('share');				share.share.animate({'opacity': share.shareAlphaOff}, {duration:settings.animSlow, queue:false});				share.items.animate({'opacity': 0.0}, {duration:settings.animSlow, queue:false});				if(share.settings.widthOpen != null)					share.container.animate({'width': share.settings.width + resizeManager.getSize().marginH}, {duration:settings.animSlow, queue:false});			});			//			this.onresize(resizeManager.getSize());			resizeManager.addListener(this);		}	},	onresize:function(size){		//		this.container.css('margin-top', this.settings.top + size.marginV);		this.container.css('margin-bottom', this.settings.top + size.marginV);		this.container.width(size.marginH + this.settings.width);		//		this.content.css('margin-left', size.marginH + this.settings.contentLeft);	}};
