//thanks to JqueryForDesigners.com to help me out on the script below:


$(document).ready(function () {

//Contact Form
//$('#contactform').validate();

////////////////////////////////Tweet

	$(".tweet").tweet({
	  join_text: "auto",
	  username: "justboris",
//        avatar_size: 48,
	  count: 1,
	  auto_join_text_default: "I said,", 
	  auto_join_text_ed: "we",
	  auto_join_text_ing: "we were",
	  auto_join_text_reply: "we replied",
	  auto_join_text_url: "we were checking out",
	  loading_text: "loading tweets..."
	});

////////////////////////////////footnote Popup
	$('#testimonal a.footnote').footnotepopup( ); 

////////////////////////////////Global Accordion

	$( '.accordionWidget > li ' ) 
	 
	.children( 'div' )
	.hide( )
	.end( )  
	
	.children( 'h3' ).click( function( ){
	$(this).siblings( 'div' ).slideDown( )
	.end( )
	
	.parent( ).siblings( 'li' )
	.find( 'div' )
	.slideUp({ height : 0 }, { duration: 500 } );
	})
	
	.filter( '#experience' )
	.click( );

////////////////////////////////Resume
  $('#side1 > li a').each(function () {
    $('<div class="fader" />').css('opacity', 0).prependTo(this);
  }).hover(function () {
    $('img', this).stop().animate({
      marginLeft : 5
    }, 250);
    
    $('.fader', this).stop().animate({
      opacity : 0.15
    });
    
  }, function () {

  });

  $('.sideNav').each(function () {
    var $links = $(this).find('a'),
      panelIds = $links.map(function() { return this.hash; }).get().join(","),
      $panels = $(panelIds),
      $panelwrapper = $panels.filter(':first').parent(),
      delay = 500,
      heightOffset = 40; // we could add margin-top + margin-bottom + padding-top + padding-bottom of $panelwrapper
      
    $panels.hide();
    
    $links.click(function () {
      var link = this, 
        $link = $(this);
      
      // ignore if already visible
      if ($link.is('.selected')) {
        return false;
      }
      
      $links.removeClass('selected');
      $link.addClass('selected');
      
              
      if ($.support.opacity) {
        $panels.stop().animate({opacity: 0 }, delay);
      }
      
      $panelwrapper.stop().animate({
        height: 0
      }, delay, function () {
        var height = $panels.hide().filter(link.hash).css('opacity', 1).show().height() + heightOffset;
        
        $panelwrapper.animate({
          height: height
        }, delay);
      });
    });
    
    $links.filter(window.location.hash ? '[hash=' + window.location.hash + ']' : ':first').click();
  });

////////////////////////////////work Details

	var $div = $('#more');
	var height = $div.height();
	
	$div.hide().css({ height : 0 });
	
	$('#readMore').click(function () {
	if ($div.is(':visible')) {
	$div.animate({ height: 0 }, { duration: 500, complete: function () {
	$div.hide();
	} });
	} else {
	$div.show().animate({ height : height }, { duration: 500 });
	}
	
	return false;
	});

////////////////////////////////work Details

	var tabContainersImage = $('div.tabsImage > div');
	tabContainersImage.hide().filter(':first').show();
	tabContainersImage.hide().filter(':last').show();
	
	
	$('div.tabsImage ul.tabImageNavigation a').click(function () {
		tabContainersImage.hide();
		tabContainersImage.filter(this.hash).fadeIn(300).animate({opacity: 1.0},500);
		$('div.tabsImage ul.tabImageNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	
	}).filter(':first').click();


///////////////////////images	


	var tabContainers = $('div.tabs > div');
	tabContainers.hide().filter(':first').show();
	tabContainers.hide().filter(':last').show();
	
	
	$('div.tabs ul.tabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).fadeIn(300).animate({opacity: 1.0},500);
		$('div.tabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	
	}).filter(':first').click();

///////////////////new window

	$("a[href*='http://']:not([href*='http://www.boriskan.com'])").click( function() {
	window.open(this.href);
	return false;
	});


////////////////////////////////landing
	$('#first').masonry({columnWidth: 100});

});