var heightOriginal = 0;
var heightSTAF = 405;
var stafDuration = .35;

SendToAFriend= {
	willShow: function(b, c, a){
		container = b.view._view;
		content = b.currentSection.content;
		
		if(a.id == "send-to-a-friend"){
			heightOriginal = container.getHeight();
			container.setStyle({'height':heightOriginal+'px'});
			if(AC.Detector._isIpad) { heightSTAF += 100; }
			new Effect.Morph(container, {
				style: 'height: '+heightSTAF+'px;',
				duration: stafDuration
			});
		} else {
			new Effect.Morph(container, {
				style: 'height: '+heightOriginal+'px',
				duration: stafDuration,
				afterFinish: function(){
					container.setStyle({'height':'auto'});
				}
			});
		}
	},
	
	didAppendContent:function(a,c){
		this.view=a;
		var d=a.currentSection;

		if($("shareconfirmation")) $("shareconfirmation").hide()
		
		if(d._triggers[0]){
			if(!d.close){
				d.close=new Element("a",{
					'id': 'backtovideoMessage',
					className:"close staf-button "+a.triggerClassName,href:"#"
				}).insert("Return to Movie Info<span></span>");
				d.content.insert(d.close,d.content)
			}
			var b=(a.previousSection)?a.previousSection.id:a.orderedSections[0];
	
			d.close.href="#"+b;
		}
	},
	
	didShow:function(b,c,a){
		this.didAppendContent(b,a.content);
		this.didShow=function(b,c,a){
			if(a.id == "send-to-a-friend"){
				Share.shareId = 109;
				Share.parameters = { 'trailerTitle':trailerTitle, 'trailerURL':trailerURL, 'trailerPosterURL':trailerPosterURL };
				Share.initOptions(arguments);
				Share.buildForm();
				Share.addValidation();
			}
		}
	}
};

