// JavaScript Document

$(document).ready(function(){

		
			$('#featured ul li a').hover(                  	// Index Featured Issues Behaviors
					
					function() {
						var currentBigImage = $('#featured_image a img').attr('src');
						/*var newBigImage = $(this).attr('href');*/
						var newBigImage = $(this).attr('name');
						var currentThumbSrc = $(this).attr('rel');
						var newBigImageLink = $(this).attr('href');
						switchImage(newBigImage, currentBigImage, currentThumbSrc, newBigImageLink);

					},

					function() {
					});

					function switchImage(imageHref, currentBigImage, currentThumbSrc, newBigImageLink) {
			 
					var theBigImage = $('#featured_image a img');
					
					if (imageHref != currentBigImage) {
			
						theBigImage.fadeOut(500, function(){
						theBigImage.attr('src', imageHref).attr('href', newBigImageLink).fadeIn(500);
					
					
					/*var newImageHref = $("#featured_image a[href='"+newBigImageLink+"']").attr('href');*/
					/*var newImageDesc = $("#thumbs ul li a img[src='"+currentThumbSrc+"']").attr('alt');*/
					
						});
							
					}
						
				}
			
			$('#indicators_area_1 a, #indicators_area_2 a, #indicators_area_3 a, #indicators_area_4 a').hover(
					function (){
						
						$(this)
						.find('h3')
						.stop()	
						.animate({color:'#000'},{queue:true,duration:300});
							
						$(this)
						.find('p')
						.stop()	
						.animate({color:'#f99d2d'},{queue:true,duration:300});
										
					
					},
					function(){	

						$(this)
						.find('h3')
						.stop()	
						.animate({color:'#999'},{queue:true,duration:300});

						$(this)
						.find('p')
						.stop()
						.animate({color:'#000'},{queue:true,duration:300});
						
						
					});
			
			
			$('#freesample_label').hover(					// Index Free Sample Label Behaviors
					function(){
										
						$('#bottom_publication')
							.find('img')	
							.animate({opacity:'0.6'},{queue:true,duration:400});
						
						$('#freesample_link')
							.animate({color:'#164b75'},{queue:true,duration:400});
					},
					function(){
						
						$('#bottom_publication')
							.find('img')
							.animate({opacity:'1'},{queue:true,duration:400});
						
						$('#freesample_link')
							.animate({color:'#FFF'},{queue:true,duration:400});	
			});
		
			$('#more_1').hover(								// Index About FE Behaviors
					function(){
						
						$('#focus_featured_1')
							.find('p')
							.animate({color:'#000000'},{queue:true,duration:400});

						$('#footer_title_1')
							.animate({color:'#CC0000'},{queue:true,duration:400});
					},
					function(){

						$('#focus_featured_1')
							.find('p')
							.animate({color:'#37819c'},{queue:true,duration:400});

						$('#footer_title_1')
							.animate({color:'#164b75'},{queue:true,duration:400});

						$('#focus_featured_1 span.plus_sign')
							.animate({color:'#FFF'},{queue:true,duration:400});
			});
			
			$('#more_2').hover(
					function(){
						
						$('#focus_featured_2')
							.find('p')
							.animate({color:'#000000'},{queue:true,duration:400});

						$('#footer_title_2')
							.animate({color:'#CC0000'},{queue:true,duration:400});
					},
					function(){

						$('#focus_featured_2')
							.find('p')
							.animate({color:'#37819c'},{queue:true,duration:400});

						$('#footer_title_2')
							.animate({color:'#164b75'},{queue:true,duration:400});

						$('#focus_featured_2 span.plus_sign')
							.animate({color:'#FFF'},{queue:true,duration:400});
			});

			$('#store_button').hover(						// Index Online Store Behaviors
					function(){
							
						$(this)
							.find('a')	
							.animate({color:'#bad8e0'},{queue:true,duration:400});

						/*$(this)
							.find('p')
							.slideToggle('slow');*/
					},
					function(){
						
						$(this)
							.find('a')	
							.animate({color:'#FFF'},{queue:true,duration:400});

						/*$(this)
							.find('p')
							.slideToggle('slow');*/
			});

			/*$('#store_button a span').add('#store_button a img').hover(		
					function(){

						$('#store_button a span')
							.animate({color:'#C00'},{queue:true,duration:400});
					},
					function(){
						
						$('#store_button a span')
							.animate({color:'#FFF'},{queue:true,duration:400});	
			});*/

			$('#net_icon_1').hover(function () {				// Index Right Buttons Behaviors

						$(this)
							.fadeTo("fast", 0.6);
					},
					function(){
						
						$(this)
							.fadeTo("fast", 1);
			});

			$('#net_icon_2').hover(function () {

						$(this)
							.fadeTo("fast", 0.6);
					},
					function(){
						
						$(this)
							.fadeTo("fast", 1);
			});
			
			$('#net_icon_3').hover(function () {

						$(this)
							.fadeTo("fast", 0.6);
					},
					function(){
						
						$(this)
							.fadeTo("fast", 1);
			});
			
			$('div.right_button').hover(		
					function(){
										
						$(this)
							.stop()	
							.animate({width:'198px'},{queue:true,duration:200});
						$(this)
							.find('a')
							.stop()			
							.animate({left:'10px', color:'#CC0000'},{queue:true,duration:200});
					},
					function(){
						
						$(this)
							.stop()	
							.animate({width:'188px'},{queue:true,duration:200});	
						$(this).find('a')
							
							.stop()		
							.animate({left:'0px', color:'#164b75'},{queue:true,duration:200});
			});
					
			$('#right_banner1').hover(						// Index Right Banners Behaviors
					function(){
										
						$(this)
							.find('img')
							.stop()			
							.animate({left:'110px'},{queue:true,duration:200});
						$(this)
							.find('span')
							.animate({color:'#CC0000'},{queue:true,duration:200});
					},
					function(){
										
						$(this)
							.find('img')	
							.stop()			
							.animate({left:'102px'},{queue:true,duration:200});
						
						$(this).find('span')
							.animate({color:'#000000'},{queue:true,duration:200});
			});
		
			$('#right_banner2').hover(function () {

						$('#network_img')
							.fadeTo("slow", 0.33);
						
						$(this)
							.find('a')
							.animate({color:'#CC0000'},{queue:true,duration:200});
					},
					function(){
						$('#network_img')
							.fadeTo("slow", 1);

					$(this)
							.find('a')
							.animate({color:'#000000'},{queue:true,duration:200});
			});

	});


