$(document).ready(function() {

  $('#id').show();

  $('.about.tab').click(function() {
    if ($('.about.content').css('margin-left')=='0px') {
      $(".about.content").animate({marginLeft:'-700px'},'slow');
      $(".about.tab").animate({marginLeft:'0px'},'slow');
    } else {
      $(".about.content").animate({marginLeft:'0px'},'slow');
      $(".about.tab").animate({marginLeft:'700px'},'slow');
/*      if ($('.portfolio.content').css('margin-left')=='0px') {
        $('.portfolio .single-option').fadeOut('fast');
        $('.portfolio .options li').removeClass('active');
        $('.portfolio .single-option .port:visible').fadeOut('fast');
        $(".portfolio.content").animate({marginLeft:'-326px'},'slow');
        $(".portfolio.tab").animate({marginLeft:'0px'},'slow');
      }
      if ($('.words.content').css('margin-right')=='0px') {
        $(".words.content").animate({marginRight:'-650px'},'slow');
        $(".words.tab").animate({marginRight:'0px'},'slow');
      } */
    }
  }); 

  $('.portfolio.tab').click(function() {
    if ($('.portfolio.content').css('margin-left')=='0px') {
      $('.portfolio .single-option').fadeOut('fast');
      $('.portfolio .options li').removeClass('active');
      $('.portfolio .single-option .port:visible').fadeOut('fast');
      $(".portfolio.content").animate({marginLeft:'-326px'},'slow');
      $(".portfolio.tab").animate({marginLeft:'0px'},'slow');
    } else { // show portfolio, hide others
      $(".portfolio.content").animate({marginLeft:'0px'},'slow');
      $(".portfolio.tab").animate({marginLeft:'326px'},'slow');
/*      if ($('.about.content').css('margin-left')=='0px') {
        $(".about.content").animate({marginLeft:'-600px'},'slow');
        $(".about.tab").animate({marginLeft:'0px'},'slow');
      }
      if ($('.words.content').css('margin-right')=='0px') {
        $(".words.content").animate({marginRight:'-650px'},'slow');
        $(".words.tab").animate({marginRight:'0px'},'slow');
      } */
    }
  }); 

  $('.words.tab').click(function() {
    if ($('.words.content').css('margin-right')=='-370px') {
      $(".words.content").animate({marginRight:'0px'},'slow');
      $(".words.tab").animate({marginRight:'370px'},'slow');
/*            if ($('.about.content').css('margin-left')=='0px') {
              $(".about.content").animate({marginLeft:'-370px'},'slow');
              $(".about.tab").animate({marginLeft:'0px'},'slow');
            }
            if ($('.portfolio.content').css('margin-left')=='0px') {
              $('.portfolio .single-option').fadeOut('fast');
              $('.portfolio .options li').removeClass('active');
              $('.portfolio .single-option .port:visible').fadeOut('fast');
              $(".portfolio.content").animate({marginLeft:'-326px'},'slow');
              $(".portfolio.tab").animate({marginLeft:'0px'},'slow');
            } */
    } else { // hide words
      $(".words.content").animate({marginRight:'-370px'},'slow');
      $(".words.tab").animate({marginRight:'0px'},'slow');
    }
  }); 

  
    $('.portfolio .options li').click(function() {
      $('.portfolio .options li').removeClass('active');
      $('.portfolio .single-option .port:visible').fadeOut('fast');
      var portClass = $(this).attr('class');
      $('.portfolio .single-option .port-'+portClass).delay(300).fadeIn('fast');
      $(this).addClass('active');
      $('.portfolio .single-option').fadeIn();
    });

  $('.portfolio .single-option .port').hide();
//  $('.portfolio .options li.liquid').click();
//  $('.about .tabin').click();

  
/*  setTimeout(function() {
      $(".portfolio.content").animate({marginLeft:'0px'},'slow');
      $(".portfolio.tab").animate({marginLeft:'326px'},'slow');
  }, 500);      
*/
    $("#id").ezBgResize();

  if($.browser.msie && $.browser.version=="6.0") {
    $('#id').css("display","none"); 
    $('body').css("background","url(../images/bg1.jpg) left top no-repeat"); 
    $('body').append('<div class="ie6div">You are using IE6. Please consider upgrading your browser, or using <a href="http://www.getfirefox.com">Firefox</a>. </div>'); 
  }

});


$(window).load(function() {
if ($.browser.webkit) {
  $("#id").ezBgResize();
 }

});


function slide(target) {
  $(target).slideToggle('1000');
}

$(window).bind("resize", function(){
    $("#id").ezBgResize();
});

