//	Shadowbox.loadSkin('classic', '/Portals/shirhalev/Skins/ultimateweb20/shadowbox/src/skin');
//	Shadowbox.loadLanguage('en', '/Portals/shirhalev/Skins/ultimateweb20/shadowbox/src/lang');
//	Shadowbox.loadPlayer(['iframe','wmp'], '/Portals/shirhalev/Skins/ultimateweb20/shadowbox/src/player');

	YAHOO.util.Event.onDOMReady(function() {
//		var tabs = new YAHOO.yodeler.widget.ScrollTabView('canvas', { duration: 0.5, easing: YAHOO.util.Easing.easeIn, width: 750, height: 600, direction: 'vertical' });
//		tabs.set('activeTab', tabs.getTab(0));

//		Shadowbox.init({
//			overlayOpacity: 0.50,
//			overlayColor: "#4E87C6"
//		});

		YAHOO.util.Dom.addClass("Body", "yui-skin-sam");
	});
/*
	function PlaySong(e)	{

		YAHOO.util.Event.preventDefault(e);

		Shadowbox.open(this, {
			player:     'wmp',
			height:     50,
			width:      400
		});
	}

	function ShowPdf(e)	{

		YAHOO.util.Event.preventDefault(e);

		Shadowbox.open(this, {
			player:     'iframe',
			height:     750,
			width:      950
		});
	}
*/	
			/* -------------------------------------------------------------------------- */
			/*  Set up the TF namespace.                                                  */
			/* -------------------------------------------------------------------------- */
			
			var TF = window.TF || {};
				
			/* -------------------------------------------------------------------------- */
			/*  Functions to initialize and perform the scrolling anchor links.           */
			/* -------------------------------------------------------------------------- */
			
			TF.Scroller = function () {
			
				var stepIncrement = 100;	// The number of pixels that each step moves the window.
				var stepDelay = 3;	// The number of milliseconds between steps.
				var limit = 6 * 1000;	// After 6 seconds the scroll is killed.
				
				var running = false;
				
				/* Recursive scrolling method. Steps through the complete scroll. */
					
				function scrollStep(to, dest, down) {
				
					if(!running || (down && to >= dest) || (!down && to <= dest)) {
						TF.Scroller.killScroll();
						return;
					}
			
					if((down && to >= (dest - (2 * stepIncrement))) ||
					   (!down && to <= (dest - (2 * stepIncrement)))) {
						stepIncrement = stepIncrement * .55;
					}
			
					window.scrollTo(0, to);
					
					// Assign the returned function to a public method.
					
					TF.Scroller.nextStep = callNext(+to + stepIncrement, dest, down);
			
					window.setTimeout(TF.Scroller.nextStep, stepDelay);
				}
				
				/* Create a closure so that scrollStep can be accessed by window.setTimeout(). */
				
				function callNext(to, dest, down) {
				
					return function() { scrollStep(to, dest, down); };
				}
			
				return {
				
					nextStep: null,
					killTimeout: null,
				
					/* Sets up and calls scrollStep. */
				
					anchorScroll: function(e, obj) {
			
						var clickedLink = YAHOO.util.Event.getTarget(e);
						var anchorId = clickedLink.href.replace(/^.*#/, '');
						var target = YAHOO.util.Dom.get(anchorId);
						
						if(target) {
						
							YAHOO.util.Event.stopEvent(e);
							running = true;
							
							var yCoord = ((YAHOO.util.Dom.getY(target) - 6) < 0) ? 0 : YAHOO.util.Dom.getY(target) - 6;
							var currentYPosition = (document.all) ? document.body.scrollTop : window.pageYOffset;
							var down = true;
				
							if(currentYPosition > yCoord) {
								stepIncrement *= -1;
								down = false;
							}
				
							// Stop the scroll once the time limit is reached.
				
							TF.Scroller.killTimeout = window.setTimeout(TF.Scroller.killScroll, limit);
				
							scrollStep(currentYPosition + stepIncrement, yCoord, down);	
						}
					},
					
					/* Kill the scroll after a timeout, to prevent an endless loop. */
					
					killScroll: function() {
						window.clearTimeout(TF.Scroller.killTimeout);
						running = false;
						stepIncrement = 50;			
					},
				
					/* Attach the scrolling method to the links with the class 'scrolling-link'. */
			
					init: function() {
					
						var links = YAHOO.util.Dom.getElementsByClassName('scrolling-link', 'a');
						YAHOO.util.Event.addListener(links, 'click', TF.Scroller.anchorScroll, TF.Scroller, true);
					}
				}
			
			} ();
			
			YAHOO.util.Event.onAvailable('doc', TF.Scroller.init, TF.Scroller, true);	
	