﻿$(document).ready(function() {	

	$(".image-thumb ul li").hover(function(){ //Hover effects on list-item
			var IconName = $(this).attr("class");
			var fadeItem = $('.background-image-'+IconName);
			//$(this).toggleClass('hover'); //Add class "hover" on hover
		    //$(this).toggleClass('active');  //Add class of 'active' on the selected list
			if (fadeItem.is(':animated')) 
			{      
				// ...take it's current opacity back up to 1      
				fadeItem.stop(true,true).fadeTo(250, 1);    
			} else {      
				// fade in quickly      
				fadeItem.stop(true,true).fadeIn(250);    
			}
	}, function() {
			var IconName = $(this).attr("class");
			var fadeItem = $('.background-image-'+IconName);
			//$(this).toggleClass('hover'); //Remove class "hover" on hover out
		    //$(this).toggleClass('active');  //Add class of 'active' on the selected list
		    //alert(IconName);
			if (fadeItem.is(':animated')) {      
				fadeItem.stop(true,true).fadeTo(500, 0);    
			} else {      
				// fade away slowly      
				fadeItem.stop(true,true).fadeOut(500);    
			}    
    });
	
	
 
	//$(".main-image .desc").show(); //Show Banner
	//$(".main-image span").animate({ opacity: 0.85 }, 1 ); //Set Opacity

	$(".image-thumb ul li").click(function(){
	
		window.location.href = $(this).find('a').attr('href');
	    //Set Variables
	    //var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
	    //var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
	    //var imgDesc = $(this).find('span').html();  //Get HTML of the "block" container
	    //var imgDescHeight = $(".main-image").find('span').height(); //Find the height of the "block"

	    //if ($(this).is(".active")) {  //If the list item is active/selected, then...
	    //    return false; // Don't click through - Prevents repetitive animations on active/selected list-item
	    //} else { //If not active then...
        //Animate the Description
		//	$(".main-image img").animate({ opacity: 0}, 250 );
		//	$(".main-image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
		//		$(".main-image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
		//		$(".main-image img").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 250 );
		//	});
	    //}
    	//Show active list-item
    	//$(".image-thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items
    	//$(this).addClass('active');  //Add class of 'active' on the selected list
    	//return false;
		
	});
});


// old script

//$("#main-thumbholder .about").hover(function(){
//		//$("#content-main .background-image").stop().fadeTo(100,0);
//		//$("#content-main .main-image img.about").stop().fadeTo(300,1);
//		var fadeItemabout = $('.background-image-about');
//		if (fadeItemabout.is(':animated')) {      
//			// ...take it's current opacity back up to 1      
//			fadeItemabout.stop(true,true).fadeTo(250, 1);    
//			} else {      
//			// fade in quickly      
//			fadeItemabout.stop(true,true).fadeIn(250);    
//		}
//
//		}, function() {
//		
//		var fadeItemabout = $('.background-image-about');
//
//		if (fadeItemabout.is(':animated')) {      
//		fadeItemabout.stop(true,true).fadeTo(500, 0);    
//		} else {      
//		// fade away slowly      
//		fadeItemabout.stop(true,true).fadeOut(500);    
//		}
//
//		//$("#content-main .main-image img.about").stop().fadeTo(100,0);
//		//$("#content-main .background-image").stop().fadeTo(300,1);
//	});
//$(document).ready(function() {	


	//$("li.virtualisation span, li.sharepoint span, li.strategy span, li.about span").hide();
	//$(".main_image .desc").show(); //Show Banner
	//$(".main_image span").animate({ opacity: 0.85 }, 1 ); //Set Opacity
	//$(".image_thumb ul li").hover(function(){
    //Set Variables
    //	alert('test');
   	//	var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
   	//	var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
   	//	var imgDesc = $(this).find('span').html();  //Get HTML of the "block" container
   	//	var imgDescHeight = $(".main_image").find('span').height(); //Find the height of the "block"
		
	//	if ($(this).is(".active")) {  
		//If the list item is active/selected, then...
	//	return false; // Don't click through - Prevents repetitive animations on active/selected list-item
	//	} else { 
		//If not active then... 
		//Animate the Description

	//	$(".main_image img").animate({ opacity: 0}, 250 );

	//	$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
	//		$(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
	//		$(".main_image img").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 250 );	
	//	});
	//}
    
	//Show active list-item
    
	//$(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all list-items
	
	//$(this).addClass('active');  //Add class of 'active' on the selected list
	//return false;
	//}) .hover(function(){ 

//Hover effects on list-item
    
//$(this).addClass('hover'); //Add class "hover" on hover
    
//}, function() {
//    $(this).removeClass('hover'); 
//Remove class "hover" on hover out

//});
	
//});
