// JavaScript Document

function do_gradient() {
   var h = $('#main_tbl').outerHeight();
//   $('table.main').css('height', h);
   $('#the_border1').css('height', h);
   $('#the_border1').gradient({
    from:      'BEC2CC',
    to:        'F0F0F0',
    direction: 'horizontal'   
   });
//   $('#the_border2').gradient({
//    from:      'BEC2CC',
//    to:        'F0F0F0',
//    direction: 'horizontal'   
//   });
}
  
 
$(document).ready(function() {
  do_gradient();  
  
  $('#hide_visible').click(function (){
    var div = $('div.left_hidden');
    if (div.css('visibility') == 'visible') {
      div.css({display: 'none', visibility: 'hidden'});
      $(this).html('+ подробней');
    } else {
      div.css({display: 'block', visibility: 'visible'});
      $(this).html('- скрыть');
    }
  });
  
  $('#city_select').change(function() {
    var s = '#' +$("#city_select option:selected").val();
    $('div.city_info').css({display: 'none', visibility: 'hidden'});
    $(s).css({display: 'block', visibility: 'visible'});
  });
  
  var s = '#' + $("#city_select option:first").val();
  $(s).css({display: 'block', visibility: 'visible'});
  
      $('img.prod_prev').mouseenter(function() {
      var rel = '#' + $(this).attr('rel');
      var pos = $(this).position();
      var x = 10;
      var y = 10;
      if ($.browser.msie) {
        var cpos = $("#main_tbl").position();
        y = y + 3 + cpos.left;
      }
      $('div.prod_prev').css({'display': 'none', 'visibility': 'hidden'});
      $(rel).css({'display': 'block', 'visibility': 'visible', 'top': pos.top-x, 'left': pos.left-y});
    });
    $('div.prod_prev').mouseout(function() {
      $(this).css({'display': 'none', 'visibility': 'hidden'});
    });
    
    $('#SlideShow').slideshow({
      width: 754,
      height: 565,
      index:0,        // start from frame number N
      time:5000,      // time out beetwen slides
      title:false,     // show title
      titleshow:false,// always show title
      callback:null,  // callback function - call when slide changed - receive index and label
      panel:true,     // show controls panel
      play:true,     // play slideshow
      loop:true,      // looping
      effect:'fade',  // aviable fade, scrollUp/Down/Left/Right, zoom, zoomFade, growX, growY
      filter:true,    // remove <br/>, empty <div>, <p> and other stuff
      nextclick:false,      // bind content click next slide
      playclick:false,      // bind content click play/stop
      playhover:false,      // bind content hover play/stop
      playhoverr:false,     // bind content hover stop/play (reverse of playhover)
      playframe:false,       // show frame "Play Now!"
      loadframe:false,       // show frame with "loading"
      fullscreen:false,     // in full window size
      imgresize:true,      // resize image to slideshow window
      imgzoom:true,         // zoom image to slideshow window (for smaller side)
      imgcenter:true,       // set image to center
      imgajax:true,         // load images from links
      imglink:true,         // go to external link by click
      linkajax:false,       // load html from links
      help: null,
      controls :{         // show/hide controls elements
        'hide':false,    // show controls bar on mouse hover
        'first':false,   // goto first frame
        'prev':false,    // goto previouse frame (if it first go to last)
        'play':true,    // play slideshow
        'next':false,    // goto next frame (if it last go to first)
        'last':false,    // goto last frame
        'help':false,    // show help message
        'counter':false  // show slide counter
      }
    }); 
    
    $('img.prod_adv').hover(function() {
      $('#prod_image').attr('src', $(this).attr('src'));
     }, function() {
      $('#prod_image').attr('src', $('#prod_image').attr('rel'));
    });
         
  
  $('a.gal').each(function(){
    $(this).attr('rel', $(this).attr('href'));
  });  
  $('a.gal').imageZoom();
});

// */
