/*
 * Project: Kermode Resources Ltd.
 * Author: Rudy Affandi
 * Created: 09/13/2011
 * File name: functions.js
 */

// Basic settings
var companyName = 'Kermode Resources Ltd.';

// Main navigation drop down, 3rd level settings (please enter 'yes' or 'no')
var allow_main_3rd_level = 'no';

// Side navigation drop down, 3rd level settings (please enter 'yes' or 'no')
var allow_side_3rd_level = 'yes';

//Grab language selector from scripts alias
var lang_selector = jQuery.url.segment(0);

// Cufon usage in main navigation
var cufon_nav = 'yes';

// jQuery initialization and CSS settings, waiting for DOM tree to initialize
$(document).ready(function(){

   // Preload images
   $.preLoadImages('/i/common/front_bg.jpg', '/i/common/front_content_bg_long.png', '/i/common/main_bg.jpg');

   // Front map
   $('.map').maphilight({
      fill: true,
      fillColor: '000000',
      fillOpacity: 0.2,
      stroke: false,
      fade: true
   });

   // Fix Cufon refresh issue with navigation colour
   if (cufon_nav == 'yes')
   {
		$('.dropdown li a, .dropdown li a.active, .dropdown li a:hover, .dropdown li a:visited').ready(function(){
			Cufon.refresh();
		});

		$('.dropdown li').mouseout(function(){
			Cufon.refresh();
		});
   }

	// prettyPhoto set up
	$("a[rel^='prettyPhoto']").prettyPhoto();

	// Table cleanup
	$('table.table1 td[rowspan]').css('background', '#f0f0f0');

   // Flush 1st occurence of h tag margin
   $('.content_body h2:first, .content_body h3:first' ).css('margin-top', '0');
});
