$(document).ready(function(){
	
	$('#band_footer').css('visibility','hidden');	

    var currentpage = 0;
	var pagewidth = $('.page').width();
	var position = 0;
	var marginnew = 0;
	
    var band_currentpage = 0;
	var band_pagewidth = $('.band_page').width();
	var band_position = 0;
	var band_marginnew = 0;
	
	$("div.frame a").hover(
			function(){
	            var id = this.id.replace("link", "");
				var currentLink = $(this);
				
				/*ID based hiding of the other frames*/
				hideTheRest('#frame', id);
				position = -296*id;
				
				/*Define the offset at which the page for this frame is present*/
				marginnew =  pagewidth * id * -1;
				
				/*Animate the Page Slider to the new offset*/
				$('.pageslider').stop().animate({marginLeft: marginnew}, 800);
			}, 
			function(){
				var id = this.id.replace("link", "");
//				if(id==0){
//					$('#band_footer').css('visibility','visible');
//				}
				showTheRest('#frame');
			}
	);

//	$("div.band_frame a").hover(
//			function(){
//	            var id = this.id.replace("band", "");
//				var currentLink = $(this);
//				
//				/*ID based hiding of the other frames*/
//				hideTheRest('#band_frame', id);
//				band_position = -296*id;
//				
//				/*Define the offset at which the page for this frame is present*/
//				band_marginnew =  band_pagewidth * id * -1;
//				
//				/*Animate the Page Slider to the new offset*/
//				$('.bandslider').stop().animate({marginLeft: band_marginnew}, 800);
//			}, 
//			function(){
//				var id = this.id.replace("band", "");
//				showTheRest('#band_frame');
//			}
//	);
	
	function hideTheRest(target, id){
		 for (var i=0; i<5; i++){
			if (i!=id){
				$(target + i + ' a').css('display', 'block'); 
				$(target + i).css('filter', 'alpha(opacity=90)');
				$(target + i).stop().fadeTo("fast",0);
				$(target + i + ' a').css('display', 'none');
			}	
		}				
	}
		
	function showTheRest(target){
		for (var i=0; i<5; i++){
			$(target + i).stop().fadeTo("fast",0.9);
			$(target + i).css('filter', 'alpha(opacity=90)');
		    $(target + i + ' a').css('display', 'inline');
		    $(target + i + ' a').css('display', 'block');    
		}			
	}
});
