$(document).ready(function(){
	/* The following code is executed once the DOM is loaded */
	
	// Calling the jQuery plugin and splitting the
	// #holder UL into pages of 3 LIs each:
  //$('#cycle li').fadeTo("fast", 0.53);	
	
	$('#panel2').hide();	


	$('.mover').hover(
					function(){
						var $this = $(this);
						//var $this = $(this).next('.portitem');
						//$this.stop().animate({'background-position':'0px 0px'}, { duration: "slow" });
						//$this.stop().animate({'opacity':'0.0','top': '+=50'});
						//$this.closest('.portitem').stop().animate({'top': '230'});
						$this.children('.portitem').stop().animate({'top': '0'});
						//$this.stop().animate({'top': '230'});).closest("li").
						//$this.stop().slideDown("slow");

					},
					function(){
						//var $this = $(this).next('.portitem');
						var $this = $(this);
						//$this.stop().animate({'background-position':'0px -230px'}, { duration: "slow" });
						$this.children('.portitem').stop().animate({'top': '230'});
						
						//$this.stop().animate({'top': '0'});
						//$this.stop().animate({'opacity':'1.0'});
					}
				);




/*
	$('.portitem').hover(
					function(){
						var $this = $(this);
						//var $this = $(this).next('.portitem');
						//$this.stop().animate({'background-position':'0px 0px'}, { duration: "slow" });
						//$this.stop().animate({'opacity':'0.0','top': '+=50'});
						//$this.closest('.portitem').stop().animate({'top': '230'});
						$this.stop().animate({'top': '230'});
						//$this.stop().animate({'top': '230'});).closest("li").
						//$this.stop().slideDown("slow");

					},
					function(){
						//var $this = $(this).next('.portitem');
						var $this = $(this);
						//$this.stop().animate({'background-position':'0px -230px'}, { duration: "slow" });
						$this.stop().animate({'top': '0'});
						//$this.stop().animate({'top': '0'});
						//$this.stop().animate({'opacity':'1.0'});
					}
				);

*/


	$('.portitem').hover(
					function(){
						var $this = $(this);
						//var $this = $(this).next('.portitem');
						//$this.stop().animate({'background-position':'0px 0px'}, { duration: "slow" });
						//$this.stop().animate({'opacity':'0.0','top': '+=50'});
						//$this.closest('.portitem').stop().animate({'top': '230'});
						$this.stop().animate({'top': '230'});
						//$this.stop().animate({'top': '230'});).closest("li").
						//$this.stop().slideDown("slow");

					},
					function(){
						//var $this = $(this).next('.portitem');
						var $this = $(this);
						//$this.stop().animate({'background-position':'0px -230px'}, { duration: "slow" });
						$this.stop().animate({'top': '0'});
						//$this.stop().animate({'top': '0'});
						//$this.stop().animate({'opacity':'1.0'});
					}
				);

/*
$(this).stop().animate(
			{backgroundPosition:"(0 -250px)"}, 
			{duration:500})
		})

	$('#cycle li').hover(
					function(){
						var $this = $(this);
						$this.stop().animate({'opacity':'1.0'});
					},
					function(){
						var $this = $(this);
						$this.stop().animate({'opacity':'0.5'});
					}
				);
				
				*/
		$('#cycle li').click(
					function(){
						
						
						$("#cycle li").removeClass('liact');
						var $this = $(this);
						var $arrow = $('#hnav');
						//var $hcyc = $('#hcycle');
						var position = $this.attr('value');
						var imge	 = $this.attr('title');
						//$("#testh1").html(position);
						$this.addClass('liact');
						$arrow.stop().animate({'background-position':''+position+'px bottom'});
						//$hcyc.stop().animate({'background-color':'#333333'});
						//$('#hcycle').fadeTo("slow", 0);
						//$('#hcycle').animate({'background-position':'-980px center'});
				

						
					}
					
						
						
					
					
				);			

	
	$('#tableft').click(
					function(){
						
						
						//$(this).addClass('liact');
						//$("#cycle li").removeClass('liact');
						var $this = $(this);
						var $tbl = $('#tabrechts');
						$this.removeClass('inactiveleft');
						$tbl.removeClass('activerechts');
							$('#panel2').hide();	
								$('#panel1').show();	
						//$("#cycle li").removeClass('liact');
						//var $hcyc = $('#hcycle');
						//var position = $this.attr('value');
						//var imge	 = $this.attr('title');
						//$("#testh1").html(position);
						//$this.addClass('liact');
						//$arrow.stop().animate({'background-position':''+position+'px bottom'});
						//$hcyc.stop().animate({'background-color':'#333333'});
						//$('#hcycle').fadeTo("slow", 0);
						//$('#hcycle').animate({'background-position':'-980px center'});
				

						
					}
					
						
						
					
					
				);		
				
				
					$('#tabrechts').click(
					function(){
						
						
						
						//$("#cycle li").removeClass('liact');
						var $this = $(this);
						var $tbr = $('#tableft');
						$tbr.addClass('inactiveleft');
						$this.addClass('activerechts');
						$('#panel2').show();	
								$('#panel1').hide();
						//$("#cycle li").removeClass('liact');
						//var $hcyc = $('#hcycle');
						//var position = $this.attr('value');
						//var imge	 = $this.attr('title');
						//$("#testh1").html(position);
						//$this.addClass('liact');
						//$arrow.stop().animate({'background-position':''+position+'px bottom'});
						//$hcyc.stop().animate({'background-color':'#333333'});
						//$('#hcycle').fadeTo("slow", 0);
						//$('#hcycle').animate({'background-position':'-980px center'});
				

						
					}
					
						
						
					
					
				);		

});

/*
$('#cycle li').hover(function() {
     $(this).fadeTo("fast", 1); background-color:
    });
	background-position: 920px bottom;
	
	$('#cycle li').mouseenter(function() {
     $(this).fadeTo("fast", 1);
    });
	
$('#cycle li').mouseout(function() {
     $(this).fadeTo("fast", 0.5);
    });
	
			$('#hcycle').fadeTo('slow', 0, function() {
						//$('#hcycle').css("background-position",'-980px center');	
						$('#hcycle').css("background-image",'url(' + imge + ')');
						
						$('#hcycle').fadeTo("slow", 1);
      // Animation complete.
    });
});*/
