// JavaScript Document
/*
$(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
  $('#slickbox').hide();
 // shows the slickbox on clicking the noted link  
  $('#slick-show').click(function() {
    $('#slickbox').show('slow');
    return false;
  });
 // hides the slickbox on clicking the noted link  
  $('#slick-hide').click(function() {
    $('#slickbox').hide('fast');
    return false;
  });
  
 // toggles the slickbox on clicking the noted link  
  $('#slick-toggle').click(function() {
    $('#slickbox').toggle(400);
    return false;
  });
});
*/
//Al's Code------------------------------------------------------------
// Andy Langton's show/hide/mini-accordion - updated 23/11/2009
// Latest version @ http://andylangton.co.uk/jquery-show-hide
/*
// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {

// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='In Person Bidding';
var hideText='In Person Bidding';

// initialise the visibility check
var is_visible = false;

// append show/hide links to the element directly preceding the element with a class of "toggle"
//$('.toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');

// hide all of the elements with a class of 'toggle'
$('.toggle').hide();

// capture clicks on the toggle links
$('a.toggleLink').click(function() {

// switch visibility
is_visible = !is_visible;

// change the link depending on whether the element is shown or hidden
$(this).html( (!is_visible) ? showText : hideText);

// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');

// return false so any link destination is not followed
return false;

});
});
*/


//NEW CODE 07/28/11===============================
$(document).ready(function(){
      $('.box1').hide();  
      $('.box2').hide();  
      $('.box3').hide();  
      $('.box4').hide();  
      $('.box5').hide();  
      $('.box6').hide();  
	  
  $('.ahref',this).toggle(
    function () {
      var id = $(this).attr('href');
      if($('.box'+id).text() == '') {  
        $.getJSON('json.php',{id:id},function(data){  
          $.each(data, function(i,item){  
            var user_name = item.user_name;
            var user_desc = item.user_desc;
            var html = user_name+" "+user_desc;
            $(".box"+item.id).html(html).slideDown(1000); 
          });  
        });  
//        $(this).html("hide");
        $(this).html('&nbsp;&nbsp; ' + this.id);
      } else { 
//       $(this).html('hide');  
        $(this).html('&nbsp;&nbsp; ' + this.id);  
        $('.box'+id).slideDown(1000);  
      }  
    },  
    function () {  
      var id = $(this).attr('href');
//      $(this).html('show');  
      $(this).html('&nbsp;&nbsp; ' + this.id);  
      $('.box'+id).slideUp(1000);  
    }  
  );
//-----------------------------------------------------	  
  $('.ahref2',this).toggle(
    function () {
      var id = $(this).attr('href');
      if($('.box'+id).text() == '') {  
        $.getJSON('json.php',{id:id},function(data){  
          $.each(data, function(i,item){  
            var user_name = item.user_name;
            var user_desc = item.user_desc;
            var html = user_name+" "+user_desc;
            $(".box"+item.id).html(html).slideDown(1000); 
          });  
        });  
//        $(this).html("hide");
        $(this).html('&nbsp;&nbsp; ' + this.id);
      } else { 
//       $(this).html('hide');  
        $(this).html('&nbsp;&nbsp; ' + this.id);  
        $('.box'+id).slideDown(1000);  
      }  
    },  
    function () {  
      var id = $(this).attr('href');
//      $(this).html('show');  
      $(this).html('&nbsp;&nbsp; ' + this.id);  
      $('.box'+id).slideUp(1000);  
    }  
  );
});
