jQuery.noConflict();

jQuery(function($) {
	
	//product tabs
	$('#tabs').tabs();
	$('#tabs > ul > li:last').css({"margin-right":"0"});


      $(document).ready(function(){
      	 if($('.tabs-product-specifications')[0]) {
      	       var desiredHeight = 0;
      	       var actualHeight = 0;
      	       //console.log('yay!');
      	       var $spec = $('.tabs-product-specifications');
      	       
      	       var precedents = $spec.prevAll();
      	       
      	      $.each($('.tabs-product-specifications').parent().prevAll(), function(){
      	      	
      	       		actualHeight  += $(this).outerHeight();
      	       		$(this).addClass('overflowed');
      	       		desiredHeight += $(this).outerHeight();
      	       		$(this).removeClass('overflowed');
      	       		
      	       });
      	       
      	       if ($('#col3_content .buyBtn')[0] && $('#col3_content .docbtn')[0]){
      	               desiredHeight -= 36;
      	       }
      	       
               //console.log(actualHeight);
              // console.log(desiredHeight);
               
               if ( desiredHeight > actualHeight) {
               	$('#tabs').css('margin-top',desiredHeight - actualHeight);
               	}
      	 }
	});
});
