/**
 * @author Sonic
 */

 
 

function getFlashMovie(movieName) 
{
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

function callToActionscript(flash, ind) {

	getFlashMovie(flash).sendToActionscript(ind);
}

function sendToJavaScript(val)
{

	var api = $("#scroller").data("scrollable");
	//document.getElementById('boxX').value = val;
	//alert(val);

	/*
	var api = $("#scroller").data("scrollable");
	index = api.getIndex();
	*/

	$('.scrollthumb').removeClass('active').css('background-position','0 -93px');
	
	$('.scrollthumb[title='+val+']').css('background-position','0 0px').addClass('active');
	
	
			
}




$(document).ready(function(){

		var i = 0;
		
		if(Get_Cookie("passlda")=="true"){
		     $('#ldaholder').hide();
		}else{
			$('#ldaholder').show();
		}
		/*
		$('#copy .event').each(function(){		
			var child = $(this);
			$('#scroller .items .page').append(
				'<div class="scrollthumb" title="'+i+'" style="width: 245px;height: 93px;display: block;background:url('+$(this).find('.thumb').attr('src').replace("'", "")+')  no-repeat;background-position: 0 -93px "></div>'
			);
			
			i++;
		});
		*/
		
		$(".scrollable").scrollable({circular: true,size: 1,keyboard: false});
		
		
		$('.scrollthumb').click(function(){
			
			$('.scrollthumb').removeClass('active');
			$('.scrollthumb').css('background-position','0 -93px');
			
			$('.scrollthumb').addClass('active');
			
			//var api = $("#scroller").data("scrollable");
			//callToActionscript('flashcontent', $(this).attr('title'));
			document.location = 'index.html#/home/panel_'+ $(this).attr('title');
			 
			$(this).css('background-position','0 0px');
			
		});
		
		
		$('.scrollthumb').hover(
			function(){
				if(!$(this).hasClass('active')){
					$(this).css('background-position','0 0');
				}
				
			},
			function(){
				if(!$(this).hasClass('active')){
					$(this).css('background-position','0 -93px');
				}
			}
		);
	
});


