$(document).ready(function() {  
/* start */

$(document).oneTime('4ds', function() {
	$("#loader").hide();
	//$("#gl").fadeIn('slow');
$("#gl").animate({'opacity':'1'},700);

	$("#menu li:last").removeClass("lin");
	$("#menu li.activ").prev().removeClass("lin");
});

/*
$(document).oneTime('5ds', function() {
	var elem = $("#hash2").attr('name');
             	      if (elem) { var targetOffset = $("#hash2").offset().top;
	      $("html:not(:animated),body:not(:animated)").animate({ scrollTop: targetOffset}, 1100 );
	}
});
*/

$("#menu li").hover(
  function () {
	$(this).prev().removeClass("lin");
	$(this).addClass('sel');
  }, 
  function () {
	if (!$(this).prev().hasClass("activ") && !$(this).hasClass("activ")) $(this).prev().addClass("lin");
	$(this).removeClass('sel');
  }
); 



function iconoff() {
$('div.zag').attr('rel', function() {
  $(this).css('background','url(/img/'+$(this).attr('rel')+'.gif) no-repeat');

});
}
iconoff();

$("#bloks td").hover(
  function () {
    $(this).addClass('sel');
    var icon = $('#bloks td.sel div.zag').attr('rel');
    $('#bloks td.sel div.zag').css({'background':'url(/img/'+icon+'act.gif) no-repeat','color':'#fff'});
    $('#bloks td.sel div.text, #bloks td.sel div.price').css('color','#fff');
	var url = $(this).attr('rel');
	if (url=='') { $(this).css('cursor','text'); }
  }, 
  function () {
    $('#bloks td.sel div.zag, #bloks td.sel div.text, #bloks td.sel div.price').css('color','');
    iconoff()
    $(this).removeClass('sel');
  }
); 

$("#bloks td").click(
  function () {
	var url = $(this).attr('rel');
	if (url!='') { location.href = url; }
  }
); 


/* кнопки  */

$("div.but a").hover(
  function () {
    $(this).parent().parent().addClass('but2').removeClass('but');
  },
  function () {
    $(this).parent().parent().addClass('but').removeClass('but2');
  }
);


/* выделение отзывов */

$("div.otzyv a").hover(
  function () {
    $(this).css('background','url(/img/otz2act.gif) no-repeat');
    $(this).parents('div.otzyv').find('span').css({'background':'url(/img/otz1act.gif) no-repeat', 'background-position':'left bottom'});

  }, 
  function () {
    $(this).css('background','url(/img/otz2.gif) no-repeat');
    $(this).parents('div.otzyv').find('span').css({'background':'url(/img/otz1.gif) no-repeat', 'background-position':'left bottom'});
  }
); 


$('#addFiles div span, #addFiles div b').click(function(){
  $(this).hide();
  $(this).parent().find('b').show();
  $(this).parent().next().slideDown();
});

$('#addFiles div b').click(function(){
  $(this).hide();
  $(this).parent().find('span').show();
  $(this).parent().next().slideUp();
});

$(document).oneTime('5ds', function() {
  $('#addFiles div:first').show();
});


/* end */
});


//<![CDATA[
hs.graphicsDir = '/js/tip/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
hs.numberOfImagesToPreload = 0;

var galleryOptions = {
    slideshowGroup: 'gallery',
    align: 'center',
    transitions: ['expand', 'crossfade']
};

if (hs.addSlideshow) hs.addSlideshow({
    slideshowGroup: 'gallery',
    forceAjaxReload: false,
    interval: 5000,
    repeat: false,
    useControls: true,
    fixedControls: 'fit',
    overlayOptions: {
    opacity: .7,
    position: 'bottom center',
    hideOnMouseOut: true
    }
});
//]]>

function printpage()
{
    print();
}
