/* Javascript Document ------------------------ 

	*FileName: 				global.js
	*Description:			Global Javascript
	*Version:				1.0.0 (8-02-2010)
	*Website:				?????

== TOC: ================================
Select text after the $ and use find 
to go to the section on the style sheet
========================================

	$__tabs					Functionality for the tabs
	$__movie screen			Functionality for movie area
	$__accordion			Functionality for accordion
	
---------------------------------------- */
var $showMovie = false;
$(document).ready(function(){
						   
/* __tabs
---------------------------------------- */
	$("#tabs").tabs();
	
/* __movie screen
---------------------------------------- */

	
	
	if($showAha) {
		$("#ahaMovieSection, #ahaShadow").show();
		$("#ahaWrapper").addClass("bottomBorder");
		$("#clickToView").removeClass().addClass('displayNone');
		$("#close").removeClass().addClass('display');
		$showAha = false;
	} else {
		$("#ahaMovieSection, #ahaShadow").hide();
		$("#ahaWrapper").removeClass("bottomBorder");
		$("#close").removeClass().addClass('displayNone');
		$("#clickToView").removeClass().addClass('display');
		$showAha = true;
	}
	
	/*$("#ahaHeader").toggle(
		function(){
			if($showAha) {
				$("#ahaMovieSection, #ahaShadow, #movieFrame").show('blind','',500);
				$("#ahaWrapper").switchClass('', 'bottomBorder', 500);
				$("#clickToView").removeClass().addClass('displayNone');
				$("#close").removeClass().addClass('display');
				$showAha = false;
				$showMovie = true;	
				
			} else {
				$("#ahaMovieSection, #ahaShadow, #movieFrame").hide('blind','',500);
				$("#ahaWrapper").switchClass('bottomBorder', '', 500);
				$("#clickToView").removeClass().addClass('display');
				$("#close").removeClass().addClass('displayNone');
				$showAha = true;
				$showMovie = false;
			}
		},
		function() {
			if($showAha) {
				$("#ahaMovieSection, #ahaShadow, #movieFrame").show('blind','',500);
				$("#ahaWrapper").switchClass('', 'bottomBorder', 500);
				$("#clickToView").removeClass().addClass('displayNone');
				$("#close").removeClass().addClass('display');				
				$showAha = false;
				$showMovie = true;
			} else {
				$("#ahaMovieSection, #ahaShadow, #movieFrame").hide('blind','',500);
				$("#ahaWrapper").switchClass('bottomBorder', '', 500);
				$("#clickToView").removeClass().addClass('display');
				$("#close").removeClass().addClass('displayNone');
				$showAha = true;
				$showMovie = false;
			}
		}
	);*/
	
	
	
/* __accordion
---------------------------------------- */
	$("#accordion").accordion({
	  header: "h3",
	  icons: { 'header': 'arrow-side', 'headerSelected': 'ui-icon-arrow-down'},
	  autoHeight: false
	});
	
	$("#accordionMoble").accordion({
	  header: "h3",
	  icons: { 'header': 'arrow-side', 'headerSelected': 'ui-icon-arrow-down'},
	  autoHeight: false
	});
	
	$(".applyButton").bind('click', function() {
		$("#accordionMoble").accordion({
		  active: 5
		});
	});
	
/* __read more
---------------------------------------- */
	$("#readMore").click(function() {
		$('#introCopyHome').toggleClass('fullCopy', 1000);
		return false;
	});
	

/* __cycle
---------------------------------------- */
if($showCycle)
{
	$('#headerImages').before('<ul id="slidenav">').cycle(
		{
			timeout: 5000,
			pager:  '#slidenav',
			fit: 1,
			pauseOnPagerHover: 1,// true to pause when hovering over pager link
			pagerAnchorBuilder: function(idx, slide) 
			{ // callback fn that creates a thumbnail to use as pager anchor
				return '<li><a href="#">&bull;</a></li>'; 
			} 
		}
	);
}


$('#vacationImages').before('<ul id="vacanav">').cycle(
	{
		timeout: 5000,
		pager:  '#vacanav',
		fit: 1,
		pauseOnPagerHover: 1,// true to pause when hovering over pager link
		pagerAnchorBuilder: function(idx, slide) 
		{ // callback fn that creates a thumbnail to use as pager anchor
			return '<li><a href="#">&bull;</a></li>'; 
		} 
	}
);
$('#managerMovies').before('<ul id="mananav">').cycle(
	{
		timeout: false,
		pager:  '#mananav',
		fit: 1,
		pauseOnPagerHover: 1,// true to pause when hovering over pager link
		pagerAnchorBuilder: function(idx, slide) 
		{ // callback fn that creates a thumbnail to use as pager anchor
			return '<li><a href="#">&bull;</a></li>'; 
		} 
	}
);

$('#financialMovies').before('<ul id="finnav">').cycle(
	{
		timeout: false,
		pager:  '#finnav',
		fit: 1,
		pauseOnPagerHover: 1,// true to pause when hovering over pager link
		pagerAnchorBuilder: function(idx, slide) 
		{ // callback fn that creates a thumbnail to use as pager anchor
			return '<li><a href="#">&bull;</a></li>'; 
		} 
	}
);

/* ___aha-movie
---------------------------------------- */
$('#movieSelection img').bind('mouseover', function()
{
   $('#text div').each(function() {
	$(this).removeClass('display').addClass('displayNone');	   
   });
   
   var txtBox = $(this).attr('id') + '_txt';
   
   $('#' + txtBox).removeClass('displayNone').addClass('display');
   
});


});



