/*
// 2009-11-10
// tabsheets for jQuery
// developer - Org http://qalt.ru/
*/


$(document).ready(function(){

  function Make_Tabsheet(){
		var i, j, k, iMax_height, iDT_height
    $("dl").each(function(i){
			iMax_height=0;
			iDT_height=$(this).children('dt').height();

			var bFirst_tab = true;
			$(this).children('dt').click(function(){
				Switch_sheet(this)
			})
			$(this).children('dd').each(function(j){
				if( $(this).height() > iMax_height ){
					iMax_height = $(this).height()
				}
			})
			var hh = (iMax_height + iDT_height)*1
			$(this).height(hh+"px")
			$(this).children('dd').height(iMax_height + "px")
			return true
		})
  }

  function Switch_sheet( dt ){
		$(dt).siblings('dt').removeClass('on')
		var dd=$(dt).next('dd')
		$(dt).siblings('dd').not(dd).removeClass('active').addClass('inactive')
		$(dt).addClass('on')
		$(dd).removeClass('inactive').addClass('active')
		return false
  }

  Make_Tabsheet();

  $("dl.getfirst").each(function(i){
  	$(this).children('dt').eq(0).click()
  })



})





