function showsub(ID) {
  try {
	  document.getElementById('sub' + ID).style.display='block';
	  document.getElementById('sa' + ID).className='mact';
	  document.getElementById('ss' + ID).className='mact';  
	}
	catch(err) { }
}

function hidesub(ID) {
	try {
    document.getElementById('sub' + ID).style.display='none';
    document.getElementById('sa' + ID).className='';
    document.getElementById('ss' + ID).className=''
	}
	catch(err) { }
}

function hideProduct() {
  jQuery('#product').hide('1000');
  jQuery('#product .title').html('');
  jQuery('#product .content').html('');
  jQuery('#product .img').attr('src','/images/spacer.gif');

}

function showProduct(id) {
  if(jQuery("#product").css('display') == 'block') {
    jQuery('#product').hide('1000', function callback() { showProduct(id); });
  } else {
    var cpos = jQuery('#container').offset(),
      pos = jQuery('.product'+id).children(".thumb").offset(),
      title = jQuery('.product'+id).children(".title"),
      img = jQuery('.product'+id).children(".img"),
      content = jQuery('.product'+id).children(".content");
    if(jQuery(window).width()-(pos.left+297) < 0) {
      jQuery('#product').css('left',jQuery(window).width()-399);
    } else if(pos.left-92 < 0) {
      jQuery('#product').css('left',10);
    } else {
      jQuery('#product').css('left',pos.left-cpos.left-92);
    }
    jQuery('#product').css('top',pos.top-100);
    jQuery('#product .img').attr('src',img.html());
    jQuery('#product .title').html(title.html());
    jQuery('#product .content').html(content.html());
    jQuery('#product').show('1000');
  }
}

function showProduct(id) {
  if(jQuery("#product").css('display') == 'block') {
    jQuery('#product').hide('1000', function callback() { showProduct(id); });
  } else {
    var cpos = jQuery('#container').offset(),
      pos = jQuery('.product'+id).children(".thumb").offset(),
      title = jQuery('.product'+id).children(".title"),
      img = jQuery('.product'+id).children(".img"),
      content = jQuery('.product'+id).children(".content");
    if(jQuery(window).width()-(pos.left+297) < 0) {
      jQuery('#product').css('left',jQuery(window).width()-399);
    } else if(pos.left-92 < 0) {
      jQuery('#product').css('left',10);
    } else {
      jQuery('#product').css('left',pos.left-cpos.left-92);
    }
    jQuery('#product').css('top',pos.top-100);
    jQuery('#product .img').attr('src',img.html());
    jQuery('#product .title').html(title.html());
    jQuery('#product .content').html(content.html());
    jQuery('#product').show('1000');
  }
} 

jQuery(function() {
  jQuery('.konsultantai').click(function() {

    jQuery('#konsultantai').show('1000');
  });
  jQuery('#konsultantai .close a').click(function() {
    jQuery('#konsultantai').hide('1000');
  });
});

jQuery(document).ready(function(){
  jQuery().piroBox({
    my_speed: 600, //animation speed
    bg_alpha: 0.5, //background opacity
    radius: 4, //caption rounded corner
    scrollImage : true, // true == image follows the page _|_ false == image remains in the same open position
                         // in some cases of very large images or long description could be useful.
    slideShow : 'slideshow', // true == slideshow on, false == slideshow off
    slideSpeed : 5, //slideshow
    pirobox_next : 'piro_next', // Nav buttons -> piro_next == inside piroBox , piro_next_out == outside piroBox
    pirobox_prev : 'piro_prev', // Nav buttons -> piro_prev == inside piroBox , piro_prev_out == outside piroBox
    close_all : '.piro_close' // add class .piro_overlay(with comma)if you want overlay click close piroBox
  });
});