//******* DOCUMENT READY *******
$(document).ready(function(){

  // open prices popup
  $("#formatprice a").click(function(){
    popupPrices.dialog('option', 'modal', true);
    popupPrices.dialog('option', 'position', ['center','center']);
    popupPrices.dialog('open');
    return false;
  });

  // prices popup instance
  var popupPrices = $("#popupPrices").dialog({
    autoOpen: false,
    bgiframe: true,
    width: 450,
    height: 400,
    minWidth: 450,
    minHeight: 200,
    modal: true,
    position: ['center','center']
  });

  // open feed popup
  $("#rss a").click(function(){
    popupFeed.dialog('open');
    return false;
  });

  // feed popup instance
  var popupFeed = $("#popupFeed").dialog({
    autoOpen: false,
    bgiframe: true,
    width: 445,
    height: 145,
    minWidth: 350,
    minHeight: 100,
    position: ['center','center'],
    modal: true
  });
  
  // open options
  $('#option a').click(function(){
    $('#options2').toggle();
    return false;
  });

  // copyright popup instance
  $("#popupCopyright").dialog({
    autoOpen: false,
    bgiframe: true,
    width: 400,
    height: 140,
    minWidth: 200,
    minHeight: 100,
    position: ['center','center'],
    modal: true
  });
  
  // copyright
  $('img.img-small, a.preview img').live('contextmenu', function(){
    $("#popupCopyright").dialog('open');
    return false;
  });
  
  // tooltips
  $('.bag a').mouseover(function(){ $(this).children('.tooltip').show(); });
  $('.bag a').mouseout(function(){ $(this).children('.tooltip').hide(); });

});
