$(document).ready(function(){
	$('#animate_content1').hide();
	$('a').click(function(){
		$('#animate_content1').show('slow');   
	});
	$('a#close').click(function(){
		$('#animate_content1').hide('slow');
	})
	
		$("#interior_left #faq_accordion dd").hide();
		$("#interior_left #faq_accordion dt").click(function() {
		$(this).next("dd").slideDown().siblings("dd").slideUp();									  
	});
		
	
	fn_blipStartLoop = function(){
		/////////////////////////////////////////////////////////////////////////////////////
		////////////       THIS FUNCTION LOOPS ON ITSELF TO CREATE          /////////////////
		////////////                   THE FLASH EFFECT                    /////////////////
		////////////////////////////////////////////////////////////////////////////////////
		$(this).parent().find('img:eq(0)').fadeIn(2000, function(){
        		$(this).parent().find('img:eq(1)').fadeIn(2000, function() {
						$(this).parent().find('img:eq(0)').hide();
						$(this).parent().find('img:eq(1)').fadeOut(2000);
						$(this).parent().find('img:eq(2)').fadeIn(2000, function(){
							$(this).parent().find('img:eq(2)').fadeOut(2000, fn_blipStartLoop);								
						});
			});
								   
		})
	};
	
	fn_blipMoveIn = function(){
		/////////////////////////////////////////////////////////////////////////////////////
		////////////       THIS FUNCTION MOVES THE BLIPS ON TO THE SCREEN   /////////////////
		////////////             THEN BEGINS THE FLASH EFFECT               /////////////////
		////////////         ON COMPLETION WE CALL THE PREVIOUS FUNCTION    /////////////////
		/////////////////////////////////////////////////////////////////////////////////////
		$('.faderImageOne').show();
		$('.fader').animate({left:"+=1200"}, 1500, "linear", function() {
        		$(this).find('img:eq(1)').fadeIn(2000, function() {
						$(this).parent().find('img:eq(0)').hide();
						$(this).parent().find('img:eq(1)').fadeOut(2000);
						$(this).parent().find('img:eq(2)').fadeIn(2000, function(){
							$(this).parent().find('img:eq(2)').fadeOut(2000, fn_blipStartLoop);								
							});
					});
      		});
	};
	
	fn_blipSetLocation = function(){
		/////////////////////////////////////////////////////////////////////////////////////
		////////////       THIS FUNCTION SETS EACH BLIP'S STARTING LOCATION /////////////////
		////////////        EACH BLIP NEEDS TO BE ADJUSTED SO THE ANIMATE   /////////////////
		////////////        DISTANCE IN THE PREVIOUS FUNCTION PLACES IT AT  /////////////////
		////////////                THE DESIRED LANDING POINT               /////////////////
		/////////////////////////////////////////////////////////////////////////////////////
		$('#blipOne').css({left:"-650px"});
		$('#blipTwo').css({left:"-1120px"});
		$('#blipThree').css({left:"-515px"});
		$('#blipFour').css({left:"-900px"});
		
			
	};
	
	
	$('.hoverHit').hover(
		function(){$(this).next('div').show()},
		function(){$(this).next('div').hide()}
	)
	
	fn_equalSize = function(){
		newHeight = $('#interior_left ').height();
		$('#interior_right').css('height', newHeight);
	};
	fn_siteBrowse = function(){
		$('.browser').hover(
			function(){$('.browse_links').show(); $('.browser a').css('border-top','2px solid #d9222c')},
			function(){$('.browse_links').hide(); $('.browser a').css('border-top','0px solid #d9222c')}
		)
		$('.browse_links').hover(
			function(){$('.browse_links').show(); $('.browser a').css('border-top','2px solid #d9222c')},
			function(){$('.browse_links').hide(); $('.browser a').css('border-top','0px solid #d9222c')}
		)
	};
	fn_siteBrowse();
	fn_equalSize();
	fn_blipSetLocation();
	fn_blipMoveIn();
	
		/////////////////////////////////////////////////////////////////////////////////////
		////////////     This function fixes the breadcrumb on verticals.   /////////////////
		/////////////////////////////////////////////////////////////////////////////////////
   
   		$("a:has(span.direct)").each(function() {
		  var reflink=$(this).attr('href');
		  $(this).attr('href', function() {
		  //		alert(reflink);
			  return reflink + '?parent=corporate'
		  });								   
		});
		
		$("a:has(span.iso)").each(function() {
		  var reflink=$(this).attr('href');
		  $(this).attr('href', function() {
		  //		alert(reflink);
			  return reflink + '?parent=iso'
		  });								   
		});
		
		$("a:has(span.financial)").each(function() {
		  var reflink=$(this).attr('href');
		  $(this).attr('href', function() {
		  //		alert(reflink);
			  return reflink + '?parent=financial'
		  });								   
		});
		
		$("a:has(span.developers)").each(function() {
		  var reflink=$(this).attr('href');
		  $(this).attr('href', function() {
		  //		alert(reflink);
			  return reflink + '?parent=developers'
		  });								   
		});
	  
	$('.interior_paras p:last').css('padding-bottom', '37px');
		var config = {    
		 sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
		 interval: 200, // number = milliseconds for onMouseOver polling interval    
		 over: function(){$('.browse_links').show(); $('.browser').css('border-top','2px solid #d9222c')}, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: function(){$('.browse_links').hide(); $('.browser').css('border-top','0px solid #d9222c')} // function = onMouseOut callback (REQUIRED)    
		};

//$(".browser").hoverIntent(config);
//$(".browse_links").hoverIntent(config);

});



