$(function(){
		var baseURL = 'http://media.wmtv-online.de';
		var playlists = new Object;
		playlists.aktuell = baseURL + "/intabox_media_videos/getLatestWmtv.rss";
		playlists.sport = baseURL + "/intabox_media_videos/getLatestSport.rss";
		
		var hour = 12;
		$.get('/time.php', function(data){
		  hour = data;	 
    });  	
		
		var livestream = new Object;
		if(hour >=6 && hour < 23 ) {
		  livestream.url = "http://www.wmtv-online.de/fileadmin/mediathek/livebild.jpg";
		  livestream.sdp = "mystream.sdp"; 
    }
    else {
      livestream.url = "/fileadmin/ueber_wmtv/no-livestream.jpg";
      livestream.sdp = "/fileadmin/ueber_wmtv/no-livestream.jpg";
    }		
		
		$f("player", {
			src: baseURL + "/flash/playlist/flowplayer/flowplayer.commercial-3.2.5.swf",	
			version: [9, 115],
			onFail: function()  {
				$("#player").html('<div class="warning"><h3>Get Adobe Flash Player</h3><p>You must have the latest Flash player installed. You can <a href="http://get.adobe.com/flashplayer/">download it here</a>.</div>');				
			}					
		},
		{ 
			key: '#$8e3990e464c91bef62a',
			onClipAdd: function(clip, index){
				$('.jspPane').css('top', "0px");
				$('.jspDrag').css('top', "0px");					
				this.play(0);
			},	
			clip: {      				
      		},
			playlist: [
				{
					title: "wm.tv Livestream",
					description: "Von 6 bis 23 Uhr sehen Sie an dieser Stelle das tägliche Programm unseres Senders.",
					thumbnail: '/fileadmin/templates/wmtv/images/playlist/wmtv_live.jpg',
					url: livestream.url,
					scaling: "orig"
				},
				{
					title: "",
					description: "",
					thumbnail: 'http://www.wmtv-online.de/fileadmin/mediathek/livebild.jpg',
					url: livestream.sdp,
					live: true,
					autoPlay: false,
					provider: 'rtmp',
					scaling: 'fit',
					onPause: function(clip) {
						this.stop();
					},            
					onResume: function(clip) {
						this.play();
					}
				}
/*,
				{
				  autoPlay: false,
					autoBuffering: true,
					url: "http://www.wmtv-online.de/fileadmin/mediathek/wmaktuell.mp4",					
					thumbnail: "http://www.wmtv-online.de/fileadmin/ueber_wmtv/sendungen/wmkompakt.jpg",
					title: "wm.kompakt",
					description: "Montags bis freitags strahlen wir um 12.55 Uhr und 22.55 Uhr eine aktuelle, fünfminütige Sendung mit Kurznachrichten aus.",
					scaling: 'fit',
          provider: 'lighttpd'
				}
*/
			],
      plugins: {
				lighttpd: {
					url: baseURL + '/flash/playlist/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
				},
      			rtmp: {
      			  url: baseURL + '/flash/playlist/flowplayer/flowplayer.rtmp-3.2.3.swf',
      			  netConnectionUrl: 'rtmp://217.67.96.28/wmtv/'
      			},  
				controls: {                      
				    url: baseURL + '/flash/playlist/flowplayer/flowplayer.controls-3.2.3.swf',
				    all: false,   
				    play: true,  
				    stop: true,  
				    mute: true,  
				    time: true,  
				    volume: true,
				    scrubber: true,
					  fullscreen: true  
				}
      		}
		});
		$f("player").playlist("ul.clips", {loop:true});
		$('ul.clips li:nth-child(2)').hide();
		$('.playlist-wrapper .tabs li a[rel*=live]').addClass('active');
		$('#overlayButton').hide();
		var settings = {
			showArrows: true
		};
		var scrollPane = $('.scroll-pane');
		scrollPane.jScrollPane(settings);
		var jApi = scrollPane.data('jsp');
		var i = 1;
		var reinit = setInterval(
			function(){
				jApi.reinitialise();
				i++;				
				if(i > 5) {
					clearInterval(reinit);
				};
			},
			1000
		);			
		
		/** Share Function **/
		$( "#overlayButton" ).click(function() {
			$( ".overlay" ).dialog({
				width:550,
				height:445,
				modal: true,
				open: function() {
					$f().hide().pause();
				},
				close: function() {
					$f().show();//.resume();
				}
			});
			return false;
		});
		$("#rssOverlay").click(function() {
			$( "#rssBox" ).dialog({
				width:550,
				height:445,
				modal: true,
				open: function() {
					$f().hide().pause();
				},
				close: function() {
					$f().show();//.resume();
				}
			});
			return false;
		});
		
		$("#shareForm").submit(function(e) {

			var form = $(this);
			form.fadeTo(500, 0.1);

			$.getJSON(form.attr("action") + "?" + form.serialize() + "&format=json&jsoncallback=?", function(json) {
				form.fadeTo(500, 1);
				var info = $("#info").show();

				if (json.message) {
					info.addClass("alert").html(json.message);
				} else {
					info.removeClass("alert").addClass("info").html("Email was successfully sent");
				}
			});

			e.preventDefault();
			return false;
		});
		
		// initialize tabs
		$( "#tabs" ).tabs();
		$( "#rssTabs" ).tabs();
		/** Ende Share Function **/
		
		/** Ersetzungsarray für Videogroesen **/
		var videoGroessen = new Array();
		videoGroessen[1] = 'width="400" height="392"';
		videoGroessen[2] = 'width="400" height="408"'; 
		videoGroessen[3] = 'width="576" height="412"'; 
		videoGroessen[4] = 'width="640" height="448"'; 
		videoGroessen[5] = 'width="320" height="348"'; 
		videoGroessen[6] = 'width="400" height="312"';
		
		/** Change Playlist **/
		$('.playlist-wrapper .tabs a').click(function(){
			$t = $(this);
			var rel = $t.attr('rel');
			$('.clips').html('<li><a href="${url}"><span>${pubDate} |&nbsp; ${category}<\/span>	<img src="${thumbnail}" alt="" \/><h3>${title}<\/h3>${description}<\/a><\/li>');
			$('#player object').remove();
			$('.playlist-wrapper .tabs li a').removeClass('active');
			
			switch(rel){
				case 'sport':
					$f("player", {
						src: baseURL + "/flash/playlist/flowplayer/flowplayer.commercial-3.2.5.swf",	
						version: [9, 115],
						onFail: function()  {
							$("#player").html('<div class="warning"><h3>Get Adobe Flash Player</h3><p>You must have the latest Flash player installed. You can <a href="http://get.adobe.com/flashplayer/">download it here</a>.</div>');				
						}					
					},
					{ 
						key: '#$8e3990e464c91bef62a',
						onClipAdd: function(clip, index){
							$('.jspPane').css('top', "0px");
							$('.jspDrag').css('top', "0px");					
							this.play(0);
						},	
						clip: {
							autoPlay: false,
							autoBuffering: true,
							provider: 'lighttpd',
							onStart: function(clip) { 
								$('#tabs-2 textarea').html('&lt;iframe src="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '" ' + videoGroessen[clip.mediatype] + ' frameborder="0" noresize="noresize" scrolling="no"&gt;\n&lt;a href="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '"&gt;zum Video&lt;\/a&gt;\n&lt;\/iframe&gt;');
								if(clip.slug) {
									var href = baseURL + '/' + clip.slug + '/detail:' + clip.guid;
									$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
									$('.toolbar_links iframe').remove();									
									$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
									$('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook');
				          $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));  
        				}
								else {
									var href = baseURL + '/' + clip['media:category'] + '/detail:' + clip.guid;
									$('.toolbar_links iframe').remove();
									$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
									$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
								  $('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook');
                  $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));
                }
							}
						},
						plugins: {
							lighttpd: {
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
							},
							controls: {                      
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.controls-3.2.3.swf',  
								all: false,   
								play: true,  
								stop: true,  
								mute: true,  
								time: true,  
								volume: true,
								scrubber: true,
								fullscreen: true,
								playlist: true
							}
						},
						playlist: playlists.sport
					});
					$f("player").playlist("ul.clips", {loop:true});
					$(this).siblings('a').removeClass('active');
					$(this).addClass('active');
					$('#overlayButton').show();
					break;
					
				case 'aktuell':
					$f("player", {
						src: baseURL + "/flash/playlist/flowplayer/flowplayer.commercial-3.2.5.swf",	
						version: [9, 115],
						onFail: function()  {
							$("#player").html('<div class="warning"><h3>Get Adobe Flash Player</h3><p>You must have the latest Flash player installed. You can <a href="http://get.adobe.com/flashplayer/">download it here</a>.</div>');				
						}					
					},
					{ 
						key: '#$8e3990e464c91bef62a',
						onClipAdd: function(clip, index){
							$('.jspPane').css('top', "0px");
							$('.jspDrag').css('top', "0px");					
							this.play(0);
						},	
						clip: {
							autoPlay: false,
							autoBuffering: true,
							provider: 'lighttpd',
							onStart: function(clip) {
								$('#tabs-2 textarea').html('&lt;iframe src="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '" ' + videoGroessen[clip.mediatype] + ' frameborder="0" noresize="noresize" scrolling="no"&gt;\n&lt;a href="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '"&gt;zum Video&lt;\/a&gt;\n&lt;\/iframe&gt;');
								if(clip.slug) {
									var href = baseURL + '/' + clip.slug + '/detail:' + clip.guid;
									$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
									$('.toolbar_links iframe').remove();									
									$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
								  $('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook');
                  $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));
                }
								else {
									var href = baseURL + '/' + clip['media:category'] + '/detail:' + clip.guid;
									$('.toolbar_links iframe').remove();
									$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
									$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
								  $('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook');
                  $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));
                }
							}
						},
						playlist: playlists.aktuell,
						plugins: {
							lighttpd: {
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
							},
							controls: {                      
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.controls-3.2.3.swf',  
								all: false,   
								play: true,  
								stop: true,  
								mute: true,  
								time: true,  
								volume: true,
								scrubber: true,
								fullscreen: true,
								playlist: true
							}
						}
					});
					$f("player").playlist("ul.clips", {loop:true});
					$(this).siblings('a').removeClass('active');
					$(this).addClass('active');
					$('#overlayButton').show();
					break;
					
				default:
					$('.clips').html('<li><a href="${url}"><span><\/span><img src="${thumbnail}" alt="" \/><h3>${title}<\/h3>${description}</a><\/li>');
					$f("player", {
						src: baseURL + "/flash/playlist/flowplayer/flowplayer.commercial-3.2.5.swf",	
						version: [9, 115],
						onFail: function()  {
							$("#player").html('<div class="warning"><h3>Get Adobe Flash Player</h3><p>You must have the latest Flash player installed. You can <a href="http://get.adobe.com/flashplayer/">download it here</a>.</div>');				
						}					
					},
					{ 
						key: '#$8e3990e464c91bef62a',
						onClipAdd: function(clip, index){
							$('.jspPane').css('top', "0px");
							$('.jspDrag').css('top', "0px");					
							this.play(0);
						},	
						clip: {      				
						},
						playlist: [
							{
								title: "wm.tv Livestream",
								description: "Von 6 bis 23 Uhr sehen Sie an dieser Stelle das tägliche Programm unseres Senders.",
								thumbnail: '/fileadmin/templates/wmtv/images/playlist/wmtv_live.jpg',
								url: livestream.url,
								scaling: "orig"
							},
							{
								title: "",
								description: "",
								url: "http://www.wmtv-online.de/fileadmin/mediathek/wmaktuell.mp4",					
					            thumbnail: "http://www.wmtv-online.de/fileadmin/ueber_wmtv/sendungen/wmkompakt.jpg",
								url: livestream.sdp,
								live: true,
								autoPlay: false,
								provider: 'rtmp',
								scaling: 'fit',
								onPause: function(clip) {
									this.stop();
								},            
								onResume: function(clip) {
									this.play();
								}
							},
							{
								url: "http://www.wmtv-online.de/fileadmin/mediathek/wmaktuell.mp4",					
					            thumbnail: "http://www.wmtv-online.de/fileadmin/ueber_wmtv/sendungen/wmkompakt.jpg",
								title: "wm.kompakt",
								description: "Montags bis freitags strahlen wir um 12.55 Uhr und 22.55 Uhr eine aktuelle, fünfminütige Sendung mit Kurznachrichten aus.",
								scaling: 'fit',
                                provider: 'lighttpd'
							}
						],
						plugins: {
							lighttpd: {
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
							},
							rtmp: {
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.rtmp-3.2.3.swf',
								netConnectionUrl: 'rtmp://217.67.96.28/wmtv/'
							},  
							controls: {                      
								url: baseURL + '/flash/playlist/flowplayer/flowplayer.controls-3.2.3.swf',
								all: false,   
									 play: true,  
									 stop: true,  
									 mute: true,  
									 time: true,  
									 volume: true,
									 fullscreen: true  
							}
						}
					});
					$f("player").playlist("ul.clips", {loop:true});
					$('ul.clips li:nth-child(2)').hide();
					$('.toolbar_links iframe').remove();
					$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent('http://www.wmtv-online.de') + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
					$(this).siblings('a').removeClass('active');
					$(this).addClass('active');	
					$('#overlayButton').hide();	  
			}	
			var i = 1;
			var reinit = setInterval(
				function(){
					jApi.reinitialise();
					i++;				
					if(i > 5) {
						clearInterval(reinit);
					};
				},
				1000
			);					
			return false;			
		});
			
		/** Mediathek **/
		$('.channels h3').each(function()
		{
			$(this).click(function()
			{		 
				$('.channels h3').removeClass('active');
				$(this).addClass('active');
				elmid = ($(this).attr("id"));
				parts = elmid.split("-");
				channelid = parts[1];
				loadPiece(defaulturl+"/"+channelid,"#mediathek .videos");
				
			});
		});
				
		function loadPiece(href,divName) 
		{   
			$(divName).css('visibility', 'visible');
			$('#search').hide();
			$(divName).ajaxStart(function(){
				$(this).hide();
			});
			$(divName).ajaxStop(function(){
				$(this).fadeIn('slow');
			});
			$(divName).load('/proxy.php',{'url': href},function()
			{                                    
				$('#mediathek .pagination a').click(function() {      
					var thisHref = $(this).attr("href"); 
					loadPiece(thisHref,divName); 
					return false; 
				});
				addToPlaylist();
			});
		} 
		/** Suche **/
		$('#mediathek-wrapper form').submit(function(){
			var phrasevalue = $('#phrase').val();
			if(phrasevalue.length >= 3) { 	
				loadSearch(baseURL + "/intabox_media_videos/searchresult/"+phrasevalue,"#searchvideos");
			} 
			return false;
		});
	
		function loadSearch(href,divName) 
		{	
			$(divName).ajaxStart(function(){
				$(this).hide();
			});
			$(divName).ajaxStop(function(){
				$(this).fadeIn('slow');
			});
			$(divName).load('/proxy.php',{'url': href},function()
			{	
				$('#search').css({'position': 'absolute', 'top': '43px', 'display': 'block', 'right': '0px'});
				$('#mediathek .videos').css('visibility', 'hidden');
				$('#search .pagination a').click(function() {      
					var thisHref = $(this).attr("href"); 
					loadSearch(thisHref,divName); 
					return false; 
				});
				addToPlaylist();
			});
		}
		
		function addToPlaylist() {   
			$('.video a').click(function(){
				var clip = new Object;
				clip.url = $(this).attr('href');
				clip.cat = $(this).siblings('.cat').text();
				clip.slug = $(this).siblings('.category').text();
				clip.guid = $(this).siblings('.guid').text();
				clip.mediatype = $(this).siblings('.mediatype').text();
				clip.cTitle = $('h4',$(this)).text();
				clip.thumb = $('img', $(this)).attr('src');
				clip.date = $('span', $(this)).text();
				
				if($('.playlist-wrapper .tabs li a.active').attr('rel') == 'live') {
					$('.clips').html('<li><a href="${url}"><span>${pubDate} |&nbsp; ${category}<\/span>	<img src="${thumbnail}" alt="" \/><h3>${title}<\/h3>${description}<\/a><\/li>');
					$('#player object').remove();
					$('.playlist-wrapper .tabs li a').removeClass('active');
					
					$f("player", {
							src: baseURL + "/flash/playlist/flowplayer/flowplayer.commercial-3.2.5.swf",	
							version: [9, 115],
							onFail: function()  {
								$("#player").html('<div class="warning"><h3>Get Adobe Flash Player</h3><p>You must have the latest Flash player installed. You can <a href="http://get.adobe.com/flashplayer/">download it here</a>.</div>');				
							}					
						},
						{ 
							key: '#$8e3990e464c91bef62a',
							onClipAdd: function(clip, index){
								$('.jspPane').css('top', "0px");
								$('.jspDrag').css('top', "0px");					
								this.play(0);
							},	
							clip: {
								autoPlay: false,
								autoBuffering: true,
								provider: 'lighttpd',
								onStart: function(clip) {
									$('#tabs-2 textarea').html('&lt;iframe src="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '" ' + videoGroessen[clip.mediatype] + ' frameborder="0" noresize="noresize" scrolling="no"&gt;\n&lt;a href="' + baseURL + '\/embed\/video.php?id=' + clip.guid + '"&gt;zum Video&lt;\/a&gt;\n&lt;\/iframe&gt;');
									if(clip.slug) {
										var href = baseURL + '/' + clip.slug + '/detail:' + clip.guid;
										$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
										$('.toolbar_links iframe').remove();									
										$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
									  $('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook');
                    $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));
                  }
									else {
										var href = baseURL + '/' + clip['media:category'] + '/detail:' + clip.guid;
										$('.toolbar_links iframe').remove();
										$('.toolbar_links').append('<iframe src="http://www.facebook.com/plugins/like.php?href=' + encodeURIComponent(href) + '&amp;layout=button_count&amp;show_faces=false&amp;width=150&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true"><\/iframe>');
										$('.playlist-wrapper p a').attr('href', encodeURIComponent(href));
									  $('#tabs .facebook').attr('href', 'http://www.facebook.com/share.php?u=' + encodeURIComponent(href) + '&amp;sms_ss=Facebook'); 
                    $('#tabs .twitter').attr('href', 'http://twitter.com/home/?status=Sieht%20gerade%20' + encodeURIComponent(clip.title) + '%20-%20' + encodeURIComponent(href));
                  }
								}
							},
							playlist: playlists.aktuell,
							plugins: {
								lighttpd: {
									url: baseURL + '/flash/playlist/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
								},
								controls: {                      
									url: baseURL + '/flash/playlist/flowplayer/flowplayer.controls-3.2.3.swf',  
									all: false,   
									play: true,  
									stop: true,  
									mute: true,  
									time: true,  
									volume: true,
									scrubber: true,
									fullscreen: true,
									playlist: true
								}
							}
						});
						$f("player").playlist("ul.clips", {loop:true});
						$('.playlist-wrapper .tabs li a[rel*=aktuell]').addClass('active');
						$('#overlayButton').show();
						var tout = setTimeout(function(){timeoutTrigger(clip, jApi)}, 1500);
				}
				else {
				  var tout = setTimeout(function(){timeoutTrigger(clip, jApi)}, 10);
        }                                                                   				
				return false;
			}); 		
		}
		
		defaulturl = baseURL + "/intabox_media_channels/mediathekVideos";
		channelid = 0;
	 
		loadPiece(defaulturl,"#mediathek .videos"); 
	});	
	
	function timeoutTrigger(clip, jApi) {     
	  $f().addClip({url: clip.url, title: clip.cTitle, thumbnail: clip.thumb, pubDate: clip.date, description: "", category: clip.cat, slug: clip.slug, guid: clip.guid}, 0);		
			jApi.reinitialise();
			var i = 1;
			var rescroll = setInterval(
				function(){
					jApi.scrollTo(0,0);
					if($.browser.msie && parseInt($.browser.version) <= 7) {
						$('li li').css({'padding': 0, 'margin-left': '-16px'});
					}
					i++;				
					if(i > 10) {
						clearInterval(rescroll);
					};
				},
				100
			);								
	}
