var index = {
	currentDays: null,
	targetDate: new Date('01/21/2010 18:00:00'),
	serverNow: new Date(),
	countdownTickFlag: true,
	intervalLessons: '',
	animationHideFlag: true,
	introFlag: true,
	videoSettings: {
		clip: {  
			url: 'http://e1.simplecdn.net/thecode/VideoSeries_Intro_New.flv',  
			autoPlay: true,
			accelerated: true,
			width: 328,
			height: 185,
			onFinish: function() {
				core.featureList = true;
			
				index.startLessonAnimation();
				
				index.introFlag = true;
				
				$f("videoflv").unload();
				//index.videoSettings.clip.url = $('#video table td a.selected').attr("href");
				VSLT('VideoSeries_END');
			},
			onStart: function() {
				core.featureList = false;
				index.introFlag = false;
				index.animationHideFlag = false;
				window.clearInterval(index.intervalLessons);
				
				VSLT('VideoSeries_START');
			},
			onCuepoint: [[264000, 480600], function(clip, cuepoint) { 
				if (cuepoint == 264000){
					VSLT('VideoSeries_MID');
				};
				
				if (cuepoint == 480600){
					VSLT('VideoSeries_BeforeEND');
				};
			}]
		}, 
		canvas: {
			backgroundColor: '#000000'	
		},
		// streaming plugins are configured under the plugins node  
		plugins: { 
			/*simplecdn: {  
				url: 'javascript/flowplayer.rtmp-3.1.2.swf',  
				netConnectionUrl: 'rtmpt://e1f1.simplecdn.net/play'  
			},*/
			controls: {
				autoHide: 'always',
				hideDelay: 2000,
				progressGradient: 'medium',
				buttonColor: '#e66700',
				sliderColor: '#555555',
				sliderGradient: 'none',
				volumeSliderGradient: 'none',
				buttonOverColor: '#fa8900',
				backgroundGradient: 'none',
				timeBgColor: '#555555',
				bufferGradient: 'none',
				progressColor: '#d07301',
				tooltipTextColor: '#ffffff',
				tooltipColor: '#e66700',
				timeColor: '#ffffff',
				backgroundColor: '#000000',
				volumeSliderColor: '#555555',
				durationColor: '#ff890f',
				bufferColor: '#b6b6b6',
				borderRadius: '5',
				height: 25,
				opacity: 1,
				tooltips: { 
					buttons: true, 
					play: 'נגן', 
					pause: 'עצור', 
					mute: 'השתקת קול',
					unmute: 'החזרת קול',
					fullscreen: 'מסך מלא',
					fullscreenExit: 'יציאה ממסך מלא'
				}
			}
		},
		play: {
			replayLabel: ' '
		},
		onLoad: function(){
			this.setVolume(100); 
		}
	},
	successSettings: {
		clip: {  
			url: 'http://e1.simplecdn.net/thecode/video_alina10.flv',  
			/*baseUrl: 'thecode',
			provider: 'simplecdn',  */
			autoPlay: true,
			accelerated: true,
			width: 268,
			height: 151,
			onFinish: function() {
				$f("slideCVideo").unload();
				core.featureList = true;
				core.nowPlaying = false;
				
				index.startLessonAnimation();
				
				//index.videoSettings.clip.url = $('#video table td a.selected').attr("href");
				VSLT('Home_Alina_END');
			},
			onStart: function() { 
				core.featureList = false;
				core.nowPlaying = true;
				index.introFlag = true;
				index.animationHideFlag = false;
				window.clearInterval(index.intervalLessons);
				
				VSLT('Home_Alina_START'); 
			}
		}, 
		canvas: {
			backgroundColor: '#000000'	
		},
		// streaming plugins are configured under the plugins node  
		plugins: { 
			/*simplecdn: {  
				url: 'javascript/flowplayer.rtmp-3.1.2.swf',  
				netConnectionUrl: 'rtmpt://e1f1.simplecdn.net/play'  
			},*/
			controls: {
				autoHide: 'always',
				hideDelay: 2000,
				progressGradient: 'medium',
				buttonColor: '#e66700',
				sliderColor: '#555555',
				sliderGradient: 'none',
				volumeSliderGradient: 'none',
				buttonOverColor: '#fa8900',
				backgroundGradient: 'none',
				timeBgColor: '#555555',
				bufferGradient: 'none',
				progressColor: '#d07301',
				tooltipTextColor: '#ffffff',
				tooltipColor: '#e66700',
				timeColor: '#ffffff',
				backgroundColor: '#000000',
				volumeSliderColor: '#555555',
				durationColor: '#ff890f',
				bufferColor: '#b6b6b6',
				borderRadius: '5',
				height: 25,
				opacity: 1,
				tooltips: { 
					buttons: true, 
					play: 'נגן', 
					pause: 'עצור', 
					mute: 'השתקת קול',
					unmute: 'החזרת קול',
					fullscreen: 'מסך מלא',
					fullscreenExit: 'יציאה ממסך מלא'
				}
			}
		},
		play: {
			replayLabel: ' '
		},
		onLoad: function(){
			this.setVolume(100); 
		}
	},
	autismSettings: {
		clip: {  
			url: 'http://e1.simplecdn.net/autismcode/Barlay-10Mins-200.flv',  
			/*baseUrl: 'thecode',
			provider: 'simplecdn',  */
			autoPlay: true,
			accelerated: true,
			width: 268,
			height: 151,
			onFinish: function() {
				$f("slideDVideo").unload();
				core.featureList = true;
				core.nowPlaying = false;
				
				index.startLessonAnimation();
				
				//index.videoSettings.clip.url = $('#video table td a.selected').attr("href");
				VSLT('Home_Barlay_10Mins_END');
			},
			onStart: function() { 
				core.featureList = false;
				core.nowPlaying = true;
				index.introFlag = true;
				index.animationHideFlag = false;
				window.clearInterval(index.intervalLessons);
				
				VSLT('Home_Barlay_10Mins_START'); 
			}
		}, 
		canvas: {
			backgroundColor: '#000000'	
		},
		// streaming plugins are configured under the plugins node  
		plugins: { 
			/*simplecdn: {  
				url: 'javascript/flowplayer.rtmp-3.1.2.swf',  
				netConnectionUrl: 'rtmpt://e1f1.simplecdn.net/play'  
			},*/
			controls: {
				autoHide: 'always',
				hideDelay: 2000,
				progressGradient: 'medium',
				buttonColor: '#e66700',
				sliderColor: '#555555',
				sliderGradient: 'none',
				volumeSliderGradient: 'none',
				buttonOverColor: '#fa8900',
				backgroundGradient: 'none',
				timeBgColor: '#555555',
				bufferGradient: 'none',
				progressColor: '#d07301',
				tooltipTextColor: '#ffffff',
				tooltipColor: '#e66700',
				timeColor: '#ffffff',
				backgroundColor: '#000000',
				volumeSliderColor: '#555555',
				durationColor: '#ff890f',
				bufferColor: '#b6b6b6',
				borderRadius: '5',
				height: 25,
				opacity: 1,
				tooltips: { 
					buttons: true, 
					play: 'נגן', 
					pause: 'עצור', 
					mute: 'השתקת קול',
					unmute: 'החזרת קול',
					fullscreen: 'מסך מלא',
					fullscreenExit: 'יציאה ממסך מלא'
				}
			}
		},
		play: {
			replayLabel: ' '
		},
		onLoad: function(){
			this.setVolume(100); 
		}
	},
	init: function() {
		$('.ifixpng').pngfix();
		if ($.browser.msie && $.browser.version == "6.0") {
			$('#rightContent #codeMain #codeButtons').css('margin-top','5px');
		}
		if ($.browser.msie) {
			$('#output #slideA #lessonsLink').css('margin-top','17px');	
			if ($.browser.version == "6.0" || $.browser.version == "7.0") {
				$('#output #slideA a.lessonsFormLink').css('background','url(img/base/arrow_l.gif) 0 4px no-repeat');
				$('#output #slideA #lessonsLink').css('background','url(img/base/arrow_l.gif) 0 5px no-repeat');
			}
		};
		
		$('#tabs li a').featureList({
			output		: '#output li',
			start_item	: 0,
			transition_interval : 15000,
			pause_on_hover : true
		});

		$('#output li').hover(
		function(){
			core.featureList = false;
		},
		function(){
			if (!core.nowPlaying){
		  		core.featureList = true;
			};
		});
		
		$('#tabs li a').click(function(event){
			 event.preventDefault();						   
		});
		
		//videos
		$f('videoflv',"js/flowplayer-3.1.3.swf", index.videoSettings);

		$('#videoflv .video_start').live('mouseover',function(){
			$(this).attr({"src":"img/home/video_start_on.jpg"});
		});
		$('#videoflv .video_start').live('mouseout',function(){
			$(this).attr({"src":"img/home/video_start.jpg"});
		});
		
		$f('slideCVideo',"js/flowplayer-3.1.3.swf", index.successSettings);

		$('#slideCVideo .video_start').live('mouseover',function(){
			$(this).attr({"src":"img/home/video_alina_on.jpg"});
		});
		$('#slideCVideo .video_start').live('mouseout',function(){
			$(this).attr({"src":"img/home/video_alina.jpg"});
		});
		
		$f('slideDVideo',"js/flowplayer-3.1.3.swf", index.autismSettings);

		$('#slideDVideo .video_start').live('mouseover',function(){
			$(this).attr({"src":"img/home/video_barlay_on.jpg"});
		});
		$('#slideDVideo .video_start').live('mouseout',function(){
			$(this).attr({"src":"img/home/video_barlay.jpg"});
		});

	}
};
$(document).ready( function() {	
	index.init();
});