/*
 * Project: Brigadier Gold
 * Author: Rudy Affandi
 * Created: 01/25/2011
 * File name: functions.js
 */

// Initialize all other javascript functions

  
   // Style default RFI form (Experimental)
   // First we clean up the mess from original table formatting
   $('div.form_wrapper table').addClass('ui-helper-reset');
   $('div.form_wrapper table').removeAttr("background");
   $('div.form_wrapper table').removeAttr("border");
   // and then we apply modifier to form elements
   $('div.form_wrapper table input[type=text], div.form_wrapper table td').addClass("ui-corner-all");
   $('div.form_wrapper table input[type=submit], div.form_wrapper table input[type=reset]').button();
   $('div.form_wrapper table textarea').addClass("ui-corner-all");
   $('select, input:checkbox, input:radio, input:file').uniform();

   // Management and Directors bio slider
   $('.mgmt_info').hide();
   $('h3.trigger').click(function () {
      $(this).toggleClass('active').next().next().slideToggle("slow");
      return false;
   });


// External link warning dialog
function extLink(link) {
   var answer = confirm('You are leaving Brigadier Gold Website')
   if (answer){
      window.location = link;
   }
   else {
      return false;
   }
};

// Fix jQuery rounded corners in IE
$.uicornerfix = function(r){
  DD_roundies.addRule('.ui-corner-all', r);
  DD_roundies.addRule('.ui-corner-top', r+' '+r+' 0 0');
  DD_roundies.addRule('.ui-corner-bottom', '0 0 '+r+' '+r);
  DD_roundies.addRule('.ui-corner-right', '0 '+r+' '+r+' 0');
  DD_roundies.addRule('.ui-corner-left', r+' 0 0 '+r);
  DD_roundies.addRule('.ui-corner-tl', r+' 0 0 0');
  DD_roundies.addRule('.ui-corner-tr', '0 '+r+' 0 0');
  DD_roundies.addRule('.ui-corner-br', '0 0 '+r+' 0');
  DD_roundies.addRule('.ui-corner-bl', '0 0 0 '+r);
};
// Initiate IE rounded corners
$.uicornerfix('4px');

