//
//	Image Preloading
//	


//<![CDATA[
    jQuery.preloadImages = function()
	{
  	for(var i = 0; i<arguments.length; i++)
  	{
    jQuery("<img>").attr("src", arguments[i]);
  	}
	}

	$.preloadImages( 
		"/assets/img/page-elements.gif",
		"/assets/img/nav/nav-tab.gif",
		"/assets/img/nav/nav-tab2.gif",
		"/assets/img/tools/text-resize.gif",
		"/images/zoommap/bc-full.gif",
		"/images/zoommap/cariboo_base.gif",
		"/images/zoommap/kootenay_base.gif",
		"/images/zoommap/mainland_base.gif",
		"/images/zoommap/northeast_base.gif",
		"/images/zoommap/thompsonokanagan_base.gif",
		"/images/zoommap/vancouverisland_base.gif"
	);
//]]>




$(document).ready(function() 
{

//
//	Tool Tips
//	

$('.entry a[rel]').each(function()
   {
      $(this).qtip(
      {
         content: {
            text: '<img class="throbber" src="/assets/img/throbber.gif" alt="Loading..." />',
            url: $(this).attr('rel'),
            title: {text: '' + $(this).text()}
         },
         position: {
         corner: {
            target: 'topRight',
            tooltip: 'bottomLeft'
         }
      },
      style: {
         name: 'dark',
         padding: '7px 13px',
         width: {
            max: 570,
            min: 570
         },
         tip: true
      }

      })
   });

$('.content-secondary a[title]').qtip({ 
																			style: { 
																					name: 'dark', 
																					tip: true,
																					padding: '7px 13px',
																					width: { max: 400, min: 400 },
																					classes: { content: 'popup' }
																					}, 
																			position: {
																					corner: { target: 'topRight', tooltip: 'bottomLeft' }
																				}
																			})

//
//	Accordian Menu
//	

	$('#sub-nav').accordion({
           header: '.header',
   		   collapsible: true,
           clearStyle: true,
           autoHeight: false,
           selectedClass: 'current',
           navigation: true,
           fillSpace: false
   		});	
		
		$( ".txt-resize a" ).textresizer({
     	 target: "#resizecontent",
		 type: "cssClass",
         sizes: [ 
            "small-text", 
            "medium-text",
			"large-text"
         ],
		 selectedIndex: 1
   		});

//
//	Hint Overlay
//	


$("form#search_services,form#search_locations").inputHintOverlay(7, 32);

});
