  $(document).ready(function(){

  jQuery.easing.def = 'easeOutCubic';


	$("#IPAD_SOBETV").click(function() {
		$("#IPAD_SOBETV div.SOBE_TV").toggleClass("transparent");
		$("#WINDOW div.WINDOW_SOBE").toggleClass("play");
	});

  $('.portfolio_highlight_new').click(function(){
      $("#PLAYER_001").html("<table width='100%' height='100%' cellpadding=0 border=0 cellspacing=0><tr><td valign='middle'><center><img src='images/loading.gif' style='top: 50%; left: 50%; margin-left: -16px; margin-top: -16px;'></center></td></tr></table>");
      $("#PLAYER_001").load("loadPortfolioItem.php?ArticleID=" + $(this).attr('id') );

      return false;
  });
  
  
$('#BROWSER_LEFT_DIV').mouseenter(function() {
  $('#BROWSER_LEFT_DIV').animate({paddingLeft: "5px", width: "35px"}, 200);
});

$('#BROWSER_LEFT_DIV').mouseleave(function() {
  $('#BROWSER_LEFT_DIV').stop().animate({paddingLeft: "15px", width: "25px"}, 200);
});

$('#BROWSER_RIGHT_DIV').mouseenter(function() {
  $('#BROWSER_RIGHT_DIV').animate({marginRight: "-10px", width: "40px", paddingRight: "0px", paddingLeft: "20px"}, 200);
});

$('#BROWSER_RIGHT_DIV').mouseleave(function() {
  $('#BROWSER_RIGHT_DIV').stop().animate({marginRight: "0px", width: "25px", paddingRight: "15px", paddingLeft: "5px"}, 200);
});

$('#dragBar').mouseenter(function() {
  $('#dragBar').animate({opacity:"1.0"}, 200);
});

$('#dragBar').mouseleave(function() {
  $('#dragBar').stop().animate({opacity:"0.5"}, 200);
});

$('#NEWS_CLOSE').mouseenter(function() {
  $('#NEWS_CLOSE').animate({opacity:"1.0"}, 200);
});

$('#NEWS_CLOSE').mouseleave(function() {
  $('#NEWS_CLOSE').stop().animate({opacity:"0.5"}, 200);
});

$('#BIO_CLOSE').mouseenter(function() {
  $('#BIO_CLOSE').animate({opacity:"1.0"}, 200);
});

$('#BIO_CLOSE').mouseleave(function() {
  $('#BIO_CLOSE').stop().animate({opacity:"0.5"}, 200);
});

$('#BROWSER_CLOSE').mouseenter(function() {
  $('#BROWSER_CLOSE').animate({opacity:"1.0"}, 200);
});

$('#BROWSER_CLOSE').mouseleave(function() {
  $('#BROWSER_CLOSE').stop().animate({opacity:"0.5"}, 200);
});


$('#wn_container').mouseenter(function() {
  $('#BROWSEHERE').stop().animate({opacity: 0.0}, 200);
  $('#BROWSER_LEFT_DIV').show();
  $('#BROWSER_RIGHT_DIV').show();
  $('#MOVEHERE').stop().animate({opacity: 0.0}, 200);
  $('#MAIN_LOWER').stop().animate({marginTop: "110px"}, 100);
  $('#REVEAL').stop().animate({marginBottom: "200px"}, 100);
});

$('#wn_container').mouseleave(function() {
  $('#BROWSEHERE').stop().animate({opacity: 1.0}, 200);
  $('#MOVEHERE').stop().animate({opacity: 1.0}, 200);
  $('#BROWSER_RIGHT_DIV').delay(200).hide();
  $('#BROWSER_LEFT_DIV').delay(200).hide();
  $('#MAIN_LOWER').stop().delay(200).animate({marginTop: "50px"}, 100);
  $('#REVEAL').stop().delay(200).animate({marginBottom: "170px"}, 100);
});



$('#wn').stop().mouseleave(function() {
  $('#BIO_PREVIEW').html("<div id='BIO_OPEN' style='position: absolute; top: 13px; right: 50px;'><img src='images/BROWSER_RIGHT.gif'></div> <img src='images/bio_preview.gif'>");  
});

$('.PORTFOLIO_SELECT_PROJ').click(function() {
  $('#PLAYER_001').show().animate({height: "540px", marginBottom: "-270px"}, 200);
  $('#PLAYER_FADE').delay(400).fadeIn(500);  
  $('#PROJECT_TITLE').fadeIn(300);  
  $('#wn_container').delay(200).fadeOut(0);
  $('#BROWSER_LEFT').animate({marginLeft: "-540px",opacity: 0.0}, 300);
  $('#BROWSER_RIGHT').animate({marginRight: "-540px",opacity: 0.0}, 300);
  $('#BROWSER_RIGHT_DIV').fadeOut(300);
  $('#BROWSER_LEFT_DIV').fadeOut(300);
  $('#BROWSER_CLOSE').fadeIn(200);   
  $('#DESIGN').fadeOut(200);    
  $('#COPYRIGHT').fadeOut(200);  
  $('#LOGO').fadeOut(200);  
});



$('#BROWSER_CLOSE').click(function() {
  $('#PLAYER_001').animate({height: "0px", marginBottom: "0px"}, 200);
  $('#PLAYER_CONTAINER').html("");  
  $('#PLAYER_FADE').fadeOut(0);  
  $('#PLAYER_001').hide();
  $('#wn_container').fadeIn(300);
  $('#BROWSER_CLOSE').hide();
  $('#PROJECT_TITLE').fadeOut(300).html("");  
  $('#BROWSER_LEFT').animate({marginLeft: "-500px",opacity: 1.0}, 300);
  $('#BROWSER_RIGHT').animate({marginRight: "-500px",opacity: 1.0}, 300);
  $('#BROWSER_CLOSE').fadeOut(200);      
  $('#COPYRIGHT').fadeIn(200);  
  $('#LOGO').fadeIn(200);  
  $('#DESIGN').fadeIn(200);   
});

$('.NEWS_HEADLINE').click(function() {
  $('#wn_container').delay(800).fadeOut(0);
  $('#BIO_PREVIEW').delay(0).fadeOut(200);
  $('#NEWS_MENU').delay(0).fadeOut(200);
  $('#PLAYER_FADE').delay(0).fadeIn(200);  
  $('#NEWS_CONTENT, #NEWS_BROWSER').delay(200).fadeIn(200);   
  $('#PLAYER_001').show().animate({height: "540px", marginBottom: "-270px"}, 200);
  $('#NEWS_CLOSE').delay(200).fadeIn(200);
  $('#NEWS').fadeIn(200);
});


$('#NEWS_CLOSE').click(function() {
   $('#MAIN_LOWER').delay(200).animate({height: "72px", marginTop: "50px"}, 0);
  $('#PLAYER_001').fadeOut();   
  $('#wn_container').delay(200).fadeIn(200);
  $('#BIO_PREVIEW').delay(200).fadeIn(200);
  $('#PLAYER_001').delay(200).animate({height: "0px", marginBottom: "0px"}, 0);
  $('#NEWS_CONTENT, #NEWS_BROWSER').fadeOut(200);
  $('#NEWS_MENU').delay(200).fadeIn(200);
  $('#PLAYER_FADE').delay(200).fadeOut(200);    
  $('#NEWS').fadeOut(200);
  $('#NEWS_MENU').delay(200).fadeIn(200);
  $('#BIO_OPEN').stop().delay(200).fadeIn(0);
  $('#BIO_CONTENT').fadeOut(0);
  $('#BROWSER_CLOSE').stop().fadeOut(0);
  $('#BIO_CLOSE').stop().fadeOut(0);  
  $('#BIMG').animate({opacity: 0.0},0);
  $('#BLINE').animate({opacity: 0.0},0);
  $('#BIO_TXT').animate({opacity: 0.0},0);
  $('#NEWS_CLOSE').hide();
  $('#BIO_IMG').animate({opacity: 0.0},0);
  
  
});


$('#BIO_PREVIEW').click(function() {
  $('#BIO_OPEN').delay(400).stop().fadeOut(200);
  $('#MAIN_LOWER').delay(400).animate({height: "540px", marginTop: "-270px"}, 600);
  $('#wn_container').delay(1000).fadeOut(0);
  $('#BIO_CONTENT').delay(1000).fadeIn(200);
  $('#BIMG').delay(1000).animate({opacity: 1.0},200);
  $('#BLINE').delay(1100).animate({opacity: 1.0},200);
  $('#BIO_TXT').delay(1200).animate({opacity: 1.0},200);
  $('#BIO_IMG').delay(1400).animate({opacity: 1.0},200);
  $('#BIO_CLOSE').stop().delay(1000).fadeIn(200);
  $('#NEWS').fadeOut(400);
});

$('#BIO_CLOSE').click(function() {
   $('#MAIN_LOWER').animate({height: "72px", marginTop: "50px"}, 200);
  $('#wn_container').fadeIn(200);
  $('#BIO_OPEN').stop().delay(200).fadeIn(0);
  $('#BIO_CONTENT').fadeOut(0);
  $('#BROWSER_CLOSE').stop().fadeOut(0);
  $('#BIO_CLOSE').hide(0);  
  $('#NEWS').delay(200).fadeIn(200);
  $('#BIMG').animate({opacity: 0.0},0);
  $('#BLINE').animate({opacity: 0.0},0);
  $('#BIO_TXT').animate({opacity: 0.0},0);
  $('#BIO_IMG').animate({opacity: 0.0},0);  

});


$('#BIO_PREVIEW').mouseenter(function() {
  $('#BIO_OPEN').animate({right: "40px", opacity: "1.0"},100);
});

$('#BIO_PREVIEW').mouseleave(function() {
  $('#BIO_OPEN').stop().animate({right: "50px", opacity: "0.5"},100);
});

        });        
