jQuery(document).ready(function(){

return false;

	jQuery('.logo_container').hover(function(){
			jQuery(this).animate({
				borderTopColor: "#ddd",
				borderRightColor: "#ddd",
				borderBottomColor: "#ddd",
				borderLeftColor: "#ddd"
			},400);
			jQuery('.logo_container .arrow').animate({
				borderTopColor: "#d5d5d5"
			},800);
		},
		function(){
		        jQuery(this).animate({
				borderTopColor: "#fff",
				borderRightColor: "#fff",
				borderBottomColor: "#fff",
				borderLeftColor: "#fff"

			}, 200);
			jQuery('.logo_container .arrow').animate({
				borderTopColor: "#fff"
			},200);
		}
	);

	jQuery('.logo_container .arrow').click(function(){

		jQuery('.logo').css({backgroundPosition: '0px -140px'});

		jQuery('.logo').animate(
			{backgroundPosition: '0px -70px'},
			800,
			function(){
				jQuery('.logo').animate({
					backgroundPosition: '0px -140px'
				},800);
			}
		);

	});
});

function destroyPage(){
	jQuery('#nav li ul li').fadeOut(500, function(){
		jQuery('#nav').fadeOut(500, function(){
			jQuery('.inner_box').animate(
				{height:0, opacity:0},
				2000,
				function(){
					jQuery('.footer_in').fadeOut(500, function(){
						jQuery('#header').fadeOut(2000, function(){
							document.location='/holding';
						});
					});
				});
			}
		);
	
	});
}

function fadeElements(opac,delay){
	var els=[
		'#header',
		'#footer',
		'#topmenu',
		'#logostrip',
		'blockquote',
		'.conbuttop',
		'.headline'
	];

	for(e in els){
		jQuery(els[e]).animate({queue:false, opacity:opac},delay);
	}
}

jQuery(document).ready(function(){

	// IE filter and and cufon don't play nice
	if(jQuery.browser.msie) return false;

	jQuery('.video_home').hover(
		function(){
			fadeElements(0.25,1000);
		},
		function(){
			fadeElements(1,200);
		}
	);
});


jQuery(document).ready(function(){

	// manage selecting of buttons on forms
	jQuery('.select_box').click(function(){
		jQuery( 'a', jQuery(this).parent() ).removeClass('active');
		jQuery( 'a', jQuery(this) ).addClass('active');
	});

	// manage fading of alerts
	fadeFeedback();
	function fadeFeedback(){
		jQuery('.feedback').animate({opacity:0.4},1000,function(){
			jQuery(this).animate({opacity:0.95},1000,function(){
				fadeFeedback();
			});
		});
	}

});

//setTimeout('destroyPage()', 4000);

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

