﻿$(document).ready(function(){  

$('#ctl00_searchbox_txtWord').val("Search");

$("#ctl00_searchbox_txtWord").click(function () {
     $('#ctl00_searchbox_txtWord').val(" ");
    });


$('ul#slider').css("display","inline");
$('ul#menuElem').css("display","inline");


    var pathname = window.location.href;
    
    $('.hometopboxeswrap div:nth-child(3)').css("margin-right","0px");
    $('.homeitemsbottom div:nth-child(3)').css("margin-right","0px");    
    $('#relatedcasestudies .homeitemstop:nth-child(3)').css("margin-right","0px");   
    
    $('.relatedothercasestudies .homeitemstop:nth-child(5)').css("margin-right","0px"); 
    
    $('.demovideowrap .homeitemstop:nth-child(2n)').css("margin-right","0px");    
    $('.managementouterwrap .managementitemswrap:nth-child(2n)').css("margin-right","0px");
    $('.horizontalsubCMSListMenuUL li:nth-child(3n)').css("margin-right","0px");
    
   
    $('.horizontalsubCMSListMenuUL .horizontalsubCMSListMenuLI:nth-child(3n+4)').css("clear","both"); 

   
    if (pathname.indexOf("?searchtext") != -1) {
     $('.blogtopitems').css("display","none");
    }

    
    ////// TAB SCRIPT
    
    $('#contacttabs .tabbedDiv').hide(); // Hide all divs
    $('#contacttabs #Tab_London').show(); // Show the first div
    $('#contacttabs ul li:first').addClass('active'); //Set the first link's class to active
    $('#contacttabs ul li a').click(function(){ //When any link is clicked
    $('#contacttabs ul li').removeClass('active'); // Remove active class from all links
    $(this).parent().addClass('active'); //Set clicked link class to active
    var currentTab = $(this).attr('href'); // Set variable currentTab
    $("#contacttabs .tabbedDiv:visible").hide(); //fade out visible div
    $(currentTab).show(); //fade in target div
    return false;
    });  
    });  



$(document).ready(function () {
        $("#waterwheel-carousel-horizon").waterwheelCarousel({
            startingWaveSeparation: 0,
            centerOffset: 30,
            startingItemSeparation: 72,
            itemSeparationFactor: .7,
            itemDecreaseFactor: .75,
            opacityDecreaseFactor: 1,
            autoPlay: 1500
        });
      });
      
      $(document).ready(function(){
			//Examples of how to assign the ColorBox event to elements
			$("a[rel='colourboxzoom']").colorbox({transition:"fade", photo:true});
			
			
			
			//Example of preserving a JavaScript event for inline calls.
			$("#click").click(function(){ 
				$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
				return false;
			});
		});
		
//		$("#waterwheel-carousel-horizon").waterwheelCarousel({
//  clickedCenter: function($clickedItem) {
//    // obtain the image src of the clicked center item
//    var clickedImageSrc = $clickedItem.attr('src');
//    // build a new image HTML image element, and fill in the src
//    var $imageToDisplay = $('<img />').attr('src',clickedImageSrc);
//    // display a colorbox
//    $.colorbox({html: $imageToDisplay});
//  }
//});





