/*
 * Project: Ethos Capital Corp.
 * Author: Rudy Affandi
 * Created: 05/03/2011
 * File name: functions.js
 */

// Basic settings
var companyName = 'Ethos Capital Corp.';

// Main navigation drop down, 3rd level settings (please enter 'yes' or 'no')
var allow_main_3rd_level = 'yes';

// Side navigation drop down, 3rd level settings (please enter 'yes' or 'no')
var allow_side_3rd_level = 'yes';

// Side navigation drop down, 4th level settings (please enter 'yes' or 'no')
var allow_side_4th_level = 'yes';

//Grab language selector from scripts alias
var lang_selector = jQuery.url.segment(0);

// jQuery initialization and CSS settings, waiting for DOM tree to initialize
$(document).ready(function(){
   $('.front_content h2').prepend('<span></span>');
   $('a[rel="milkbox\[corrales\]"]').attr('rel','shadowbox\[corrales\]');
   $('a[rel="milkbox\[steresa\]"]').attr('rel','shadowbox\[steresa\]');
   $('a[rel="milkbox"]').attr('rel','shadowbox');

   // Management formatting, hide empty fields
   $('div.mgmt h3 span.bold').replaceText('Consultants,','Consultants');
   $('div.mgmt h3:has:(span.value:empty)').hide();

   // Projects map tooltip
   $('area').each(function(){
      $(this).qtip(
      {
         content: $(this).attr('alt'), // Use the ALT attribute of the area map
         style: {
            name: 'dark', // Give it the preset dark style
            color: '#fff',
            background: '#00162b',
            border: {
               width: 1,
               radius: 2,
               color: '#213242'
            }, 
            tip: true // Apply a tip at the default tooltip corner
         }, 
         position: { corner: { target: 'topLeft', tooltip: 'bottomLeft' } },
         hide: { when: 'mouseout', fixed: true }
      });
   });  
});
