$(document).ready(function(){
	
		   $('img[data-hover]').hover(function() {
					$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
					}).each(function() {
						$('<img />').attr('src', $(this).attr('data-hover'));
				});
		
		
		
			//image rollovers
			 
			$("img.a").hover(
			function() {
			$(this).stop().animate({"opacity": "0"}, "slow");
			},
			function() {
			$(this).stop().animate({"opacity": "1"}, "slow");
			});
			
			$("#portfolio ul li a img").hover(
			function() {
			$(this).stop().animate({"opacity": "0.5"}, "slow");
			},
			function() {
			$(this).stop().animate({"opacity": "1"}, "slow");
			});
			
			//$('#bm_nav_astreya').hide();
			$('#bm_nav_revenew, #bm_nav_taleo, #bm_nav_skire, #bm_nav_netapp, #bm_nav_ha, #bm_nav_adrf, #bm_nav_vox, #bm_nav_boa, #bm_nav_astreya, #bm_nav_ariba, #bm_nav_securetradein').stop().animate({"opacity": "0"}, 10);
			
			$("#nav_revenew a").hover(			
				function() {
					$('#bm_nav_revenew').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_revenew').stop().animate({"opacity": "0"}, 500);
			});
			$("#nav_taleo a").hover(			
				function() {
					$('#bm_nav_taleo').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_taleo').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_skire a").hover(			
				function() {
					$('#bm_nav_skire').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_skire').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_netapp a").hover(			
				function() {
					$('#bm_nav_netapp').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_netapp').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_adrf a").hover(			
				function() {
					$('#bm_nav_adrf').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_adrf').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_vox a").hover(			
				function() {
					$('#bm_nav_vox').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_vox').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_boa a").hover(			
				function() {
					$('#bm_nav_boa').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_boa').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_astreya a").hover(			
				function() {
					$('#bm_nav_astreya').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_astreya').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_ariba a").hover(			
				function() {
					$('#bm_nav_ariba').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_ariba').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_securetradein a").hover(			
				function() {
					$('#bm_nav_securetradein').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_securetradein').stop().animate({"opacity": "0"}, 500);
			});
			
			$("#nav_ha a").hover(			
				function() {
					$('#bm_nav_ha').stop().animate({"opacity": "1"}, 500);
				},
				function() {
					$('#bm_nav_ha').stop().animate({"opacity": "0"}, 500);
			});
			
						
			
			//section faedIns
			
			$('#twoColumn').stop().fadeTo('slow',1.0); 
			$('#WordsorLessColumn').stop().fadeTo('slow',1.0); 
			$('#hearSayColumn').stop().fadeTo('slow',1.0); 
			$('#ReaditColumn').stop().fadeTo('slow',1.0);
			$('#pressArticle').stop().fadeTo('slow',1.0); 			 			
			$('.home').stop().fadeTo('slow',1.0); 
			
			//click functions			
			
			
			$("h1.logo").click(function(event) {
					  event.preventDefault();
					  window.location = $(this).attr("url");
					  
				});				
			$(".newsItem").click(function(event) {
					  event.preventDefault();
					  window.location = $(this).attr("url");
					  
				});
			$("#press").click(function(event) {
					  event.preventDefault();
					  window.location = $(this).attr("url");
					  
			});
			$("#sa").click(function(event) {
					  event.preventDefault();
					  window.location = $(this).attr("url");
					
					  
			});	
			$("#sa").attr("target","_blank");
				
			
			//cycle animation stuff
			
			$('#hearSayColumn').cycle({
				fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
				timeout: 7000
			});
			
			$('#newsscroll').cycle({
			    fx:     'scrollUp',
			    timeout: 6000,
			    delay:  -2000
			});
			

			
					$("a[rel=portImages]").fancybox({
						'transitionIn'	:	'elastic',
						'transitionOut'	:	'elastic',
						'speedIn'		:	600, 
						'speedOut'		:	200, 
						'overlayShow'	:	false,
						'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
						    return '';
						}
					});
					
					$("a[rel=broImages]").fancybox({
						'transitionIn'	:	'elastic',
						'transitionOut'	:	'elastic',
						'speedIn'		:	600, 
						'speedOut'		:	200, 
						'overlayShow'	:	false,
						'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
						    return '';
						}
					});

				
					$("a#various5, a[rel=portFrames], a[rel=portFrames11], a[rel=portFrames2], a[rel=portFrames3], a[rel=portFrames4], a[rel=portFrames5]").fancybox({
						'transitionIn'		: 'elastic',
						'transitionOut'		: 'elastic',
						'autoScale'     	: false,
						'type'				: 'iframe',
						'width'				: 855,
						'height'			: 645,
						'scrolling'   		: 'no'
					});
			
			
			
			});//last

