$(document).ready(function(){

// initialize scrollable
	$(".scrollable").scrollable({circular: 'true'}).autoscroll({autoplay: 'true', autopause: 'true', interval: 8000 });
	
	
	$(function(){
			$('.wide').columnize({ width: 400 });
		$('.thin').columnize({ width: 200});
	});
	
	
	
//$('img.folder1').css("top","-20px");

//$("img.folder1").hover(function () {
  //  $(this).css("top","-20px");
  //});



$("div.files img").hover(
  function () {
    $(this).animate({"top": "-=40px"}, "medium");    
  }, 
  function () {
   $(this).animate({"top": "+=40px"}, "fast"); 
  }
);
/*

$("img.folder1").hover(
  function () {
    $(this).animate({"top": "-1260px"}, "medium");    
  }, 
  function () {
   $(this).animate({"top": "-1220px"}, "fast"); 
  }
);


$("img.folder2").hover(
  function () {
    $(this).animate({"top": "-955px"}, "medium");
  }, 
  function () {
     $(this).animate({"top": "-915px"}, "fast");
  }
);


$("img.folder3").hover(
  function () {
     $(this).animate({"top": "-650px"}, "medium");
  }, 
  function () {
  $(this).animate({"top": "-610px"}, "fast");
   
  }
);


$("img.folder4").hover(
  function () {
     $(this).animate({"top": "-345px"}, "medium");
  }, 
  function () {
  $(this).animate({"top": "-305px"}, "fast");
   
  }
);


$("img.folder5").hover(
  function () {
     $(this).animate({"top": "-40"}, "medium");
  }, 
  function () {
  $(this).animate({"top": "0px"}, "fast");
   
  }
);
*/






 
 $("img.folder1").click(function() {
     $(".caseStudyText p").fadeOut("slow", function() { $(this).empty().append("Content for case study 1"); });
     $(".caseStudyText p").fadeIn("slow");
 });
 
 $("img.folder2").click(function() {
     $(".caseStudyText p").fadeOut("slow", function() { $(this).empty().append("Content for case study 2"); });
     $(".caseStudyText p").fadeIn("slow");
 });
 
 $("img.folder3").click(function() {
     $(".caseStudyText p").fadeOut("slow", function() { $(this).empty().append("Content for case study 3"); });
     $(".caseStudyText p").fadeIn("slow");
 });
 
 
 $("img.folder4").click(function() {
     $(".caseStudyText p").fadeOut("slow", function() { $(this).empty().append("Content for case study 4"); });
     $(".caseStudyText p").fadeIn("slow");
 });
 
 
 $("img.folder5").click(function() {
     $(".caseStudyText p").fadeOut("slow", function() { $(this).empty().append("Content for case study 5"); });
     $(".caseStudyText p").fadeIn("slow");
 });
 
 
 
 

$(".mapControlButton img").hover(
 function()
 {
  this.src = this.src.replace("_off","_on");
 },
 function()
 {
  this.src = this.src.replace("_on","_off");
 }
);






 $(".ctaButton img").hover(
  function()
  {
   this.src = this.src.replace("_off","_on");
  },
  function()
  {
   this.src = this.src.replace("_on","_off");
  }
 );





 $(".globeText img").hover(
  function()
  {
   this.src = this.src.replace("_off","_on");
  },
  function()
  {
   this.src = this.src.replace("_on","_off");
  }
 );


 $(".shopButton img").hover(
  function()
  {
   this.src = this.src.replace("_off","_on");
  },
  function()
  {
   this.src = this.src.replace("_on","_off");
  }
 );








/*global solutions code for map*/



//adds the map - Fade in the map div
$('#map').fadeIn(2000);
//adds the map control - Fade in the mapControl div
$('#mapControl').fadeIn(2000);



	 
	 $(".globalMaufacButton").click(function() {
	     $("#map>div").fadeOut(1000 , function() { $().remove(this); });
	    $('#manufac').fadeIn(1000);
	
	 	 });
	 
	 
	 $(".globalDistraButton").click(function() {
	     $("#map>div").fadeOut(1000 , function() { $().remove(this); });
	    $('#locationDots').fadeIn(1000);
	 });
	 
	 
	 $(".distraNetworkButton").click(function() {
	     $("#map>div").fadeOut(1000 , function() { $().remove(this); });
	    $('#network').fadeIn(1000);
	 });
	 






$(".tip").tooltip({ effect: 'slide'});








	/*If browser is IE */
	
	if($.browser.msie) {
			
			
			
					/*If browser is IE version 8 or below */	
					if($.browser.version<=8) {
							
							
							
							
							$(".tagIE img").hover(
							 function()
							 {
							  this.src = this.src.replace("1","1s");
							 },
							 function()
							 {
							  this.src = this.src.replace("1s","1");
							 }
							);
							
						}
						/*If browser is IE version above 8 */
						else {
							
							$(".tag1contain").hover(
							 function()
							 {
							  $('.tag1contain .tags').fadeIn(800);
							  $('.tag1contain .tag').fadeOut(1000);
							 },
							 function()
							 {
							 $('.tag1contain .tag').fadeIn(800);
							 $('.tag1contain .tags').fadeOut(1000);
							 }
							);
							
						}
		
			
		}
			/*Every other browser */
		else {
			
			$(".tag1contain").hover(
			 function()
			 {
			  $('.tag1contain .tags').fadeIn(800);
			  $('.tag1contain .tag').fadeOut(1000);
			 },
			 function()
			 {
			 $('.tag1contain .tag').fadeIn(800);
			 $('.tag1contain .tags').fadeOut(1000);
			 }
			);
			
		}
		
		
	
		
	
	$('.tagConHover1 .tag1B').css("display","none");	
		
	$('.tagConHover1 .tag1S').css("display","inline");		
	
	
	$(".tagConHover1").hover(
	 function()
	 {
	 $(this).children('.tag1B').fadeIn(800);
	 $(this).children('.tag1S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag1S').fadeIn(500);
	 $(this).children('.tag1B').fadeOut(1000);
	 }
	);
	
	
	
	$('.tagConHover2 .tag2B').css("display","none");	
		
	$('.tagConHover2 .tag2S').css("display","inline");	
	
	$(".tagConHover2").hover(
	 function()
	 {
	 $(this).children('.tag2B').fadeIn(800);
	 $(this).children('.tag2S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag2B').fadeOut(1000);
	  $(this).children('.tag2S').fadeIn(500);
	 }
	);
	
	
	
	
	$('.tagConHover3 .tag3B').css("display","none");	
		
	$('.tagConHover3 .tag3S').css("display","inline");	
	
	$(".tagConHover3").hover(
	 function()
	 {
	 $(this).children('.tag3B').fadeIn(800);
	 $(this).children('.tag3S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag3B').fadeOut(1000);
	  $(this).children('.tag3S').fadeIn(500);
	 }
	);
		
	
	
	
	$('.tagConHover4 .tag4B').css("display","none");	
		
	$('.tagConHover4 .tag4S').css("display","inline");	
	
	$(".tagConHover4").hover(
	 function()
	 {
	 $(this).children('.tag4B').fadeIn(800);
	 $(this).children('.tag4S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag4B').fadeOut(1000);
	  $(this).children('.tag4S').fadeIn(500);
	 }
	);
	
	
	$('.tagConHover5 .tag5B').css("display","none");	
		
	$('.tagConHover5 .tag5S').css("display","inline");	
	
	$(".tagConHover5").hover(
	 function()
	 {
	 $(this).children('.tag5B').fadeIn(800);
	 $(this).children('.tag5S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag5B').fadeOut(1000);
	  $(this).children('.tag5S').fadeIn(500);
	 }
	);
	
	
	
	$('.tagConHover6 .tag6B').css("display","none");	
		
	$('.tagConHover6 .tag6S').css("display","inline");	
	
	$(".tagConHover6").hover(
	 function()
	 {
	 $(this).children('.tag6B').fadeIn(800);
	 $(this).children('.tag6S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag6B').fadeOut(1000);
	  $(this).children('.tag6S').fadeIn(500);
	 }
	);
	
	
	
	$('.tagConHover7 .tag7B').css("display","none");	
		
	$('.tagConHover7 .tag7S').css("display","inline");	
	
	$(".tagConHover7").hover(
	 function()
	 {
	 $(this).children('.tag7B').fadeIn(800);
	 $(this).children('.tag7S').fadeOut(1000);
	 },
	 function()
	 {
	 $(this).children('.tag7B').fadeOut(1000);
	  $(this).children('.tag7S').fadeIn(500);
	 }
	);	
	
		
	
	
});







