		function showYadCast(e)	{

			YAHOO.util.Event.preventDefault(e);

			var content_ = '<div style="background-color: #FFF"><iframe src="http://newmedia.yadavraham.org/yadavraham/yadcast/index.php" width="350" height="530" style="width: 350px; height: 530px;" scrolling="no" /></div>';

			Shadowbox.open({
				player:     'html',
				title: '<b>YadCaster MP3 Download module</b>',
				content:    content_,
				height:     560,
				width:      360
			});
		}

		function showVideoArchive(e)	{

			YAHOO.util.Event.preventDefault(e);
			
			var content_ = '<div style="background-color: #FFF"><iframe src="http://video.google.com/videosearch?q=rabbi+kalatsky&num=10&so=1&start=0" width="950" height="750" style="width: 950px; height: 750px;" scrolling="no" /></div>';

			Shadowbox.open({
				player:     'html',
				content:    content_,
				height:     750,
				width:      950
			});
		}

		Shadowbox.loadSkin('classic', '/Portals/0/Skins/yad/shadowbox/src/skin');
		Shadowbox.loadLanguage('en', '/Portals/0/Skins/yad/shadowbox/src/lang');
		Shadowbox.loadPlayer(['iframe','html'], '/Portals/0/Skins/yad/shadowbox/src/player');

		function signEmail(e) {

			YAHOO.util.Event.preventDefault(e);

				var content_= '';
				
			    if (!FIC_checkField(" required ", YAHOO.util.Dom.get("email")))
			    {
			    	ShowError("<h1 align='center'>Email address is required</h1>", 100, 200);
			    }
			    else if (!FIC_checkField(" validate-email ", YAHOO.util.Dom.get("email")))
			    {
			    	ShowError("<h1 align='center'>Email format is invalid</h1>", 100, 200);
			    }
			    else
			    {
				 var transaction = YAHOO.util.Connect.asyncRequest
				(
				    'POST', 
				    '/DesktopModules/LoginYad/email.aspx/AddEmail', 
				    {
						success: function(o)
						{
							var resp_ = YAHOO.lang.JSON.parse(o.responseText).d; 
							ShowError("<h1 align='center'>" + resp_.emailAddress + "</h1>", 200, 300);
						},

						failure: function(o)
						{
							ShowError("<h1 align='center'>Email Sign-Up Failure</h1><b>" + o.statusText + "</b>", 200, 300);
						},
						customevents:{
							onStart:function(eventType, args) {
			Shadowbox.open();
							},
							onComplete:function(eventType, args) {
			Shadowbox.hide();
							}
						}
				    },
				    "{'emailAdd':'" + YAHOO.util.Dom.get("email").value + "'}"
				);
			  }
		}

		function ShowError(msg_, hgt_, wdth_)
		{
			Shadowbox.open({
				player:     'html',
				title: '<b>Stay in Touch</b>',
				content:   msg_,
				height:     hgt_,
				width:      wdth_
			});		
		}
		
		function init() {

			//Initialize Yahoo Connection Manager to work with ASP.Net Web Methods
			YAHOO.util.Connect.resetDefaultHeaders();
			YAHOO.util.Connect.setDefaultPostHeader(false);
			YAHOO.util.Connect.initHeader("content-type", "application/json; charset=utf-8", true);

			YAHOO.util.Event.addListener("dvYadCast", "click", showYadCast);
			YAHOO.util.Event.addListener("VideoArchive", "click", showVideoArchive);
			YAHOO.util.Event.addListener("signEmail", "click", signEmail);

			Shadowbox.init({
				animSequence: 'sync',
				animateFade: false,
				overlayOpacity: 0.50,
				overlayColor: "#4E87C6"
			});
		}

		YAHOO.util.Event.onDOMReady(init);
