//****************************************************************************************
        
        // This Hides and Shows elements based on the value of the variable 'userLocation' 
        // The Two settings are: RSA and UK
        
        var userLocation = "RSA"    //The current location setting
        
        function SetLocation(loc)   //The function that sets the location e.g. SetLocation("UK") - takes a parameter called 'loc'
        {
             if(loc != "RSA" && loc != "UK") loc = "RSA";       // paramater loc has to be "RSA" or "UK" or else it will default to "RSA"
             
             userLocation = loc;  // The main variable 'userLocation' is set to the parameter loc
             
             if (userLocation == "RSA")              //settings for "RSA"
             {
                $("#UKMenuBlocksContainer").hide();     // This is the Div that holds the artwork for UK and is now hidden
                $("#RSAMenuBlocksContainer").show();    // This is the Div that holds the artwork for RSA and is now visible 
                document.getElementById("RSAicon").src = "images/rsaicon.jpg";          // This changes the icon in the header
                document.getElementById("UKicon").src = "images/ukiconwash.jpg";        // This changes the icon in the header to show a "washed out" version of it
                $("#SAHLINK").show();  // This shows/hides the text links for each location in the header 
                $("#UKHLINK").hide(); // This shows/hides the text links for each location in the header 
             }
             
             if (userLocation == "UK") //Same process as above but for the "UK" location
             { 
                $("#RSAMenuBlocksContainer").hide(); 
                $("#UKMenuBlocksContainer").show();
                document.getElementById("RSAicon").src = "images/rsaiconwash.jpg";
                document.getElementById("UKicon").src = "images/ukicon.jpg"; 
                $("#SAHLINK").hide(); 
                $("#UKHLINK").show();
             }
             
        }
       //****************************************************************************************
        
        var ButtonHeightMin = 51;
        var ButtonWidthMin = 150; 
        var ButtonHeightMax = 51; //was 79
        var ButtonWidthMax = 150; //was 232
      
        var FadeSpeed = "fast";
        var GrowSpeed = "fast";
        
      //**************************************************************************************** 
        $(document).ready(function(){
          
            SetLocation("RSA");  
            
            $("#RSAblockA").hide();
            $("#RSAblockB").hide();
            $("#RSAblockC").hide();
            $("#RSAblockD").hide();

            $("#RSALINKSa").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#RSALINKSb").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#RSALINKSc").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#RSALINKSd").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            
            
            $("#RSALINKSa").mouseover(function(){ChangeScreen("RSALINKSa","RSAblockA")});
            $("#RSALINKSa").mouseout(function(){ChangeOut("RSALINKSa","RSAblockA")});
            
            $("#RSALINKSb").mouseover(function(){ChangeScreen("RSALINKSb","RSAblockB")});
            $("#RSALINKSb").mouseout(function(){ChangeOut("RSALINKSb","RSAblockB")});
           
            
            $("#RSALINKSc").mouseover(function(){ChangeScreen("RSALINKSc","RSAblockC")});
            $("#RSALINKSc").mouseout(function(){ChangeOut("RSALINKSc","RSAblockC")});
            
            
            $("#RSALINKSd").mouseover(function(){ChangeScreen("RSALINKSd","RSAblockD")});
            $("#RSALINKSd").mouseout(function(){ChangeOut("RSALINKSd","RSAblockD")});
            
            $("#UKblockA").hide();
            $("#UKblockB").hide();
            $("#UKblockC").hide();
            $("#UKblockD").hide();

            $("#UKLINKSa").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#UKLINKSb").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#UKLINKSc").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            $("#UKLINKSd").css({"width":""+ButtonWidthMin+"px","height":""+ButtonHeightMin+"px"});
            
            
            $("#UKLINKSa").mouseover(function(){ChangeScreen("UKLINKSa","UKblockA")});
            $("#UKLINKSa").mouseout(function(){ChangeOut("UKLINKSa","UKblockA")});
            
            $("#UKLINKSb").mouseover(function(){ChangeScreen("UKLINKSb","UKblockB")});
            $("#UKLINKSb").mouseout(function(){ChangeOut("UKLINKSb","UKblockB")});
           
            
            $("#UKLINKSc").mouseover(function(){ChangeScreen("UKLINKSc","UKblockC")});
            $("#UKLINKSc").mouseout(function(){ChangeOut("UKLINKSc","UKblockC")});
            
            
            $("#UKLINKSd").mouseover(function(){ChangeScreen("UKLINKSd","UKblockD")});
            $("#UKLINKSd").mouseout(function(){ChangeOut("UKLINKSd","UKblockD")});
            
            
               
                    
        });
        
       //****************************************************************************************
       
       
       function ChangeScreen(tabID, backId)
       {
       
                 $("#"+tabID).animate({width:ButtonWidthMax, height:ButtonHeightMax},GrowSpeed);
                 
                 $("#"+backId).fadeIn(FadeSpeed);
                 
                if (userLocation == "RSA")
                 {
                   if (tabID != "RSALINKSa") $("#RSALINKSa").fadeTo(FadeSpeed,0.4);
                   if (tabID != "RSALINKSb") $("#RSALINKSb").fadeTo(FadeSpeed,0.4);
                   if (tabID != "RSALINKSc") $("#RSALINKSc").fadeTo(FadeSpeed,0.4);
                   if (tabID != "RSALINKSd") $("#RSALINKSd").fadeTo(FadeSpeed,0.4);
                }
                
                if (userLocation == "UK")
                 {
                   if (tabID != "UKLINKSa") $("#UKLINKSa").fadeTo(FadeSpeed,0.4);
                   if (tabID != "UKLINKSb") $("#UKLINKSb").fadeTo(FadeSpeed,0.4);
                   if (tabID != "UKLINKSc") $("#UKLINKSc").fadeTo(FadeSpeed,0.4);
                   if (tabID != "UKLINKSd") $("#UKLINKSd").fadeTo(FadeSpeed,0.4);
                }
        
       
        
       
       }
       
       function ChangeOut(tabID, backId)
       {
       
            $("#"+tabID).animate({width:ButtonWidthMin, height:ButtonHeightMin},GrowSpeed);
            $("#"+backId).fadeOut(FadeSpeed);
            
               if (userLocation == "RSA")
                 {
                   $("#RSALINKSa").fadeTo(FadeSpeed,1.00);
                   $("#RSALINKSb").fadeTo(FadeSpeed,1.00);
                   $("#RSALINKSc").fadeTo(FadeSpeed,1.00);
                   $("#RSALINKSd").fadeTo(FadeSpeed,1.00);
                }
                
               if (userLocation == "UK")
                 {
                   $("#UKLINKSa").fadeTo(FadeSpeed,1.00);
                   $("#UKLINKSb").fadeTo(FadeSpeed,1.00);
                   $("#UKLINKSc").fadeTo(FadeSpeed,1.00);
                   $("#UKLINKSd").fadeTo(FadeSpeed,1.00);
                }
        
       
       
       }
       
       
       
       
       //****************************************************************************************
       
