jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}

	$.preloadImages("../images/FMFDownloadBrochure_on", "../images/QLS0_on.gif", "../images/QLS1_on.gif", "../images/QLS2_on.gif", "../images/QLS3_on.gif", "../images/Readmore_on.gif");

function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

$(document).ready(function(){
//Hiding hidden content
$("div#FrontpageNews").hide();
$("div.QLS0Hidden").hide();
$("div.QLS1Hidden").hide();
$("div.QLS2Hidden").hide();
$("div.QLS3Hidden").hide();
$("div.QLS4Hidden").hide();

$("div#NewsMenu").animate({ "height": "0px"}, 10);
$("div#NewsMenu").animate({ "height": "300px"}, 500);
$("div#FrontpageContent").animate({ "opacity": "show"}, "slow");
/*$("div#FrontpageContentHidden").hide("slow");*/

/*READ MORE BUTTON ON THE FRONT PAGE*/
/*$("#FrontPageButton").hover(function(){
	$("div#FrontpageContentHidden").show("slow");
		},function(){
});

$("div#FrontpageContent").hover(function(){
		},function(){
	$("div#FrontpageContentHidden").hide();			
});*/

//KID Download Product Brochure
$("div .KIDDownloadBrochure").hover(function(){
          $(this).addClass("KIDDownloadBrochure_on");
			  $(this).removeClass("KIDDownloadBrochure");
		},function(){
			  $(this).removeClass("KIDDownloadBrochure_on");
          $(this).addClass("KIDDownloadBrochure");
	});

   $("div .KIDDownloadBrochure").click(function() {
	 window.location.href="../Assets/KID_factsheet.pdf"; 
   });
   
//FMF Download Product Brochure
$("div .FMFDownloadBrochure").hover(function(){
          $(this).addClass("FMFDownloadBrochure_on");
			  $(this).removeClass("FMFDownloadBrochure");
		},function(){
			  $(this).removeClass("FMFDownloadBrochure_on");
          $(this).addClass("FMFDownloadBrochure");
	});

   $("div .FMFDownloadBrochure").click(function() {
	 window.location.href="../Assets/FMF_brochure.pdf"; 
   });

//FDM Download Product Brochure
	$("div .FDMDownloadBrochure").hover(function(){
          $(this).addClass("FDMDownloadBrochure_on");
			  $(this).removeClass("FDMDownloadBrochure");
		},function(){
			  $(this).removeClass("FDMDownloadBrochure_on");
          $(this).addClass("FDMDownloadBrochure");
	});

   $("div .FDMDownloadBrochure").click(function() {
	 window.location.href="../Assets/FDM_brochure.pdf"; 
   });
   
//FPP Download Product Brochure
	$("div .FPPDownloadBrochure").hover(function(){
          $(this).addClass("FPPDownloadBrochure_on");
			  $(this).removeClass("FPPDownloadBrochure");
		},function(){
			  $(this).removeClass("FPPDownloadBrochure_on");
          $(this).addClass("FPPDownloadBrochure");
	});

   $("div .FPPDownloadBrochure").click(function() {
	 window.location.href="../Assets/FPP_factsheet.pdf"; 
   });

//DDP Download Product Brochure
	$("div .DDPDownloadBrochure").hover(function(){
          $(this).addClass("DDPDownloadBrochure_on");
			  $(this).removeClass("DDPDownloadBrochure");
		},function(){
			  $(this).removeClass("DDPDownloadBrochure_on");
          $(this).addClass("DDPDownloadBrochure");
	});

   $("div .DDPDownloadBrochure").click(function() {
	 window.location.href="../Assets/DDP_brochure.pdf"; 
   });

//QLS0 Hover/Click
	$("div .QLS0").hover(function(){
          $(this).addClass("QLS0_on");
			  $(this).removeClass("QLS0");
			      $("div.QLS0Hidden").animate({ "opacity": "show"}, "slow");
				  /*$("div#FrontpageContent").hide();*/			    
	},function(){
			  $(this).removeClass("QLS0_on");
          $(this).addClass("QLS0");
		$("div.QLS0Hidden").hide();
	  /*$("div#FrontpageContent").show();*/			    
	});

   $("div .QLS0").click(function() {
	 window.location.href="Solutions/Key-Information-Document-Manager.html"; 
   });
   
//QLS1 Hover/Click
	$("div .QLS1").hover(function(){
          $(this).addClass("QLS1_on");
			  $(this).removeClass("QLS1");
			      $("div.QLS1Hidden").animate({ "opacity": "show"}, "slow");
				  /*$("div#FrontpageContent").hide();*/			    
		},function(){
			  $(this).removeClass("QLS1_on");
          $(this).addClass("QLS1");
		$("div.QLS1Hidden").hide();			  
	  /*$("div#FrontpageContent").show();*/			    
	});

   $("div .QLS1").click(function() {
	 window.location.href="Solutions/Web-Solutions.html"; 
   });

//QLS2 Hover/Click
	$("div .QLS2").hover(function(){
          $(this).addClass("QLS2_on");
			  $(this).removeClass("QLS2");
			      $("div.QLS2Hidden").animate({ "opacity": "show"}, "slow");	  
				  /*$("div#FrontpageContent").hide();*/			  			  
		},function(){
			  $(this).removeClass("QLS2_on");
          $(this).addClass("QLS2");
		$("div.QLS2Hidden").hide();			  
	  /*$("div#FrontpageContent").show();*/			    
	});

   $("div .QLS2").click(function() {
	 window.location.href="Solutions/Fund-Masterfile.html"; 
   });

//QLS3 Hover/Click
	$("div .QLS3").hover(function(){
          $(this).addClass("QLS3_on");
			  $(this).removeClass("QLS3");
			      $("div.QLS3Hidden").animate({ "opacity": "show"}, "slow");		  
				  /*$("div#FrontpageContent").hide();*/			  
		},function(){
			  $(this).removeClass("QLS3_on");
          $(this).addClass("QLS3");
		$("div.QLS3Hidden").hide();			  
	  /*$("div#FrontpageContent").show();*/			    
	});

   $("div .QLS3").click(function() {
		window.location.href="Solutions/Data-Distribution-Service.html"; 
	});
   
//QLS4 Hover/Click
	$("div .QLS4").hover(function(){
          $(this).addClass("QLS4_on");
			  $(this).removeClass("QLS4");
			      $("div.QLS4Hidden").animate({ "opacity": "show"}, "slow");		  
				  /*$("div#FrontpageContent").hide();*/			  
		},function(){
			  $(this).removeClass("QLS4_on");
          $(this).addClass("QLS4");
		$("div.QLS4Hidden").hide();			  
	  /*$("div#FrontpageContent").show();*/			    
	});

   $("div .QLS4").click(function() {
	 window.location.href="Solutions/Fund-Document-Manager.html"; 
	});   

//ReadMore Button
	$(" .ReadMoreButton").hover(function(){
          $(this).addClass("ReadMoreButton_on");
			  $(this).removeClass("ReadMoreButton");
		},function(){
			  $(this).removeClass("ReadMoreButton_on");
          $(this).addClass("ReadMoreButton");
	});
   
//Button Click	
	$(".Button").click(function(){
      $("p.hidden").show("slow");				 
	});

//Button Click	
	$("li.HidddenButton").click(function(){
      $("ul.Hidden li").show();		
      $("ul.Hidden").removeClass("Hidden");
	 window.location.href="http://www.fundconnect.com/Solutions/EFC/index.html"; 	  
	});
	
});
