window.addEvent('load', function(){
	
	////////////////////////////////////////////////////////
	/// Rainmaker Video Links //////////////////////////////
	////////////////////////////////////////////////////////
	
	
		
	assignVideoLinks();
	////////////////////////////////////////////////////////
	
	});
	
	
function assignVideoLinks() {
	videos = $$("body")[0].getElements("a[href^=http:\/\/www.rainmakeritv.com\/]")
	
	if(videos) {
		videos.each(
			function (el) {
				
				el.removeEvent("click");
				el.addEvent("click", function (ev) {
					new Event(ev).stop();
					
					if (!$("site-mask")) {

						mask = createMask("rainmaker-video", "" );
						mask.addClass("rainmaker-video");
						mask.setOpacity(0);
						mask.injectInside($$("body")[0]);
						$("cover").setOpacity(0.4);
						
						new Element("iframe", {"src" : el.href, "width" : "975", "height" : "485", "frameborder" : "0", "scrolling" : "no", "style" : "background-color:#fff"}).injectInside($("site-mask").getElement("div[class=body]"));
						new Element("p").set("html", '<input type="button" id="close-mask" value="Close" />').injectInside($("site-mask").getElement("div[class=footer]"));
						

						var fx = new Fx.Morph(mask, {
										duration: 200, 
										wait: true,
										onComplete : function () {
											
											if ($("close-mask")) {
												$("close-mask").addEvent("click", function () {
													//alert("");
													closeMask();
													});
												}
												
											}
										}).start({"opacity":1});
						}
					});
				}
			);
		}
		
	}