    var areas = new Array("C", "W", "E", "N", "NW", "SE", "SW");
    var areasTitles = new Array();
    var from_uk_map = 0;
    areasTitles["C"] = "Central London";
    areasTitles["N"] = "North London";
    areasTitles["NW"] = "North West London";
    areasTitles["W"] = "West London";
    areasTitles["SW"] = "South West London";
    areasTitles["SE"] = "South East London";
    areasTitles["E"] = "East London";

    var areasTitlesURL = new Array();
    areasTitlesURL["C"] = conf.uk_root+"central-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["N"] = conf.uk_root+"north-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["NW"] = conf.uk_root+"north-west-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["W"] = conf.uk_root+"west-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["SW"] = conf.uk_root+"south-west-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["SE"] = conf.uk_root+"south-east-london-office-space-and-serviced-offices-to-rent.php";
    areasTitlesURL["E"] = conf.uk_root+"east-london-office-space-and-serviced-offices-to-rent.php";


    var zonesInd = 0;
    var Zones = new Array();
    var area = "";
    var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    var LondonMapsObj = '';
    var tickBoxFlashing = false;
    var postcodeFlashing = false;
    // Handle all the FSCommand messages in a Flash movie.
    function LondonMaps_DoFSCommand(command, args) {
            LondonMapsObj = isInternetExplorer ? document.all.LondonMaps : document.LondonMaps;
            if (command == "gotoAreaJS"){
                gotoAreaJS(args);
            }
            if (command == "addZoneJS"){
                addZoneJS(args);
            }
            if (command == "removeZoneJS"){
                removeZoneJS(args);
            }
            if (command == "flashIsLoadJS"){
                flashIsLoadJS(args);
            }

    }
    // Hook for Internet Explorer.
    if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
            document.write('<script language=\"VBScript\"\>\n');
            document.write('On Error Resume Next\n');
            document.write('Sub LondonMaps_FSCommand(ByVal command, ByVal args)\n');
            document.write('        Call LondonMaps_DoFSCommand(command, args)\n');
            document.write('End Sub\n');
            document.write('</script\>\n');
    }

    function gotoAreaPage(area1){
//        window.location=areasTitlesURL[area1];
    }

    function gotoAreaAS(area1)
    {
        LondonMapsObj.SetVariable("area", area1);
    }

    function removeZoneAS(name)
    {
        thisMovie("LondonMaps").removeZone(name);
    }

    function gotoAreaJS(_area)
    {
        for (i=0; i<7; i++){
            document.getElementById("london_"+areas[i]).style.display = 'none';
        }

        area = _area;
        obj = document.getElementById("london_"+area);
        obj.style.display = 'block';

        var smarty_area = document.getElementById("smarty_area");
        smarty_area.style.display = 'none';

        document.getElementById('text_1').innerHTML = "'"+areasTitles[area]+"'";
        document.getElementById('text_2').innerHTML = "'"+areasTitles[area]+"'";
        document.getElementById('bottom_text_1').innerHTML = areasTitles[area];
        document.getElementById('bottom_text_2').innerHTML = areasTitles[area];
        document.getElementById('bottom_text_3').innerHTML = areasTitles[area];
        document.getElementById('bottom_text_4').innerHTML = areasTitles[area];
        document.getElementById('bottom_text_5').innerHTML = areasTitles[area];

    }

    function addZoneJS(name)
    {
        searchStr = "r_";
        replaceStr = "";
        re = new RegExp(searchStr , "g");
        str = new String(name);
        result = str.replace(re, replaceStr);
        Zones[zonesInd] =  result;
        zonesInd++;
//        submitFlashMap();
        hidePage()

        setTimeout('submitFlashMap()',50);

//        clickPostCode();
    }

    function removeZoneJS(name)
    {
        searchStr = "r_";
        replaceStr = "";
        re = new RegExp(searchStr , "g");
        str = new String(name);
        result = str.replace(re, replaceStr);

        for (i=0; i<zonesInd; i++){
            if (Zones[i] == result){

               Zones[i] = '-';
                break;
            }
        }
        clickPostCode();
    }

    function thisMovie(movieName)
    {
        if (navigator.appName.indexOf("Microsoft") != -1)
            {
            return window[movieName]
        }
        else
            {
            return document[movieName]
        }
    }

    function submitFlashMap(){
        tmp = new Array();
        j = 0;

        var _codes = [['W1_1','W1U 8BJ'],['W1_2', 'W1T 6BA'],['W1_3','W1F'],['W1_4', 'W1K']];

        for (i=0; i<zonesInd; i++){
            if (Zones[i] != '-'){
                tmp[j] = Zones[i];
                for (var k in _codes){
                    if (_codes[k][0]==tmp[j])
                        tmp[j] = _codes[k][1];
                }
                j++;
            }
        }

//        document.getElementById("london_areas_codes").value = tmp;
        if (j == 0){
            alert('You have not selected any map areas');
        }else{
            var value = tmp.join(',');
            document.flash_map_form.action = conf.uk_root+'officespace-and-servicedoffices-'+value+'.php';
            document.flash_map_form.from_map.value = area;
            document.flash_map_form.submit();
        }
    }

    function flashIsLoadJS(){
            gotoAreaAS(global['zone']);
            gotoAreaJS(global['zone']);

    }
    function checkAreas(value, checked){
        for(i=0;i<document.map_form.elements["london_areas[]"].length;i++){
            if (document.map_form.elements["london_areas[]"][i].id == value)
                document.map_form.elements["london_areas[]"][i].checked = checked;
        }
    }


    function checkTickBoxes(){
        areas_str = '';
        j = 0;
        for(i=0;i<document.map_form.elements["london_areas[]"].length;i++){
            if (document.map_form.elements["london_areas[]"][i].checked){
                if (j>0)
                    areas_str += ','+document.map_form.elements["london_areas[]"][i].value;
                else
                    areas_str += document.map_form.elements["london_areas[]"][i].value;
                j++;
//                document.map_form.elements["from_map"].value = area;
//                document.map_form.submit();
//                return true;
            }
	    if(areas_str.length>190) 
		break;
        }
        searchStr = " ";
        replaceStr = "-";
        re = new RegExp(searchStr , "g");
        str = new String(areas_str);
        result = str.replace(re, replaceStr);

        if (from_uk_map == 1)
            url_prefix = 'uk/';
        else
            url_prefix = '';
        if (areas_str != '')
            window.location=url_prefix + 'officespace-and-servicedoffices-'+result+'-1.php';
        else
            alert('You have not ticked any areas');
        return false;
    }

    function clickTickBox(areaname){
        clicked = 0;
        for(i=0;i<document.map_form.elements["london_areas[]"].length;i++){
            if (document.map_form.elements["london_areas[]"][i].checked){
                clicked ++;
            }
        }
        if (!tickBoxFlashing && clicked == 1){
//            alert("Selected Area: "+areaname+"\r\nAfter you have finished selecting area/s please click the \r\n'view offices' button below the tickboxes");
        }
        if (clicked == 0){
            tickBoxFlashing = false;
        }
        if (clicked > 0){
            tickBoxFlashing = true;
        }


    }
    function clickPostCode(){

        tmp = new Array();
        j = 0;
        for (i=0; i<zonesInd; i++){
            if (Zones[i] != '-'){
                tmp[j] = Zones[i];
                j++;
            }
        }
        if ( j == 1 && !postcodeFlashing){
//            alert("Selected Area: "+tmp[0]+"\r\nAfter you have finished selecting postcode/s please click the \r\n'view offices' button below the map");
        }

        if (j == 0){
            postcodeFlashing = false;
        }else{
            postcodeFlashing = true;
        }

    }

    function makePostCodeFlash(){
        altSrc = conf.url_images+"view_offices_postcode_orange.gif";
        comSrc = conf.url_images+"view_offices_postcode.gif";
        if (postcodeFlashing){
            if (document.getElementById("postcodeButton").src.indexOf('view_offices_postcode_orange.gif') > 0)
                document.getElementById("postcodeButton").src = comSrc ;
            else
                document.getElementById("postcodeButton").src = altSrc;
        }
        else
            document.getElementById("postcodeButton").src = comSrc;
        setTimeout('makePostCodeFlash()',500);
    }

    function makeTickFlash(){
        altSrc = conf.url_images+"view_offices_tickboxes_orange.gif";
        comSrc = conf.url_images+"view_offices_tickboxes.gif";
        if (tickBoxFlashing){
            if (document.getElementById("areasButton").src.indexOf('view_offices_tickboxes_orange.gif') > 0)
                document.getElementById("areasButton").src = comSrc ;
            else
                document.getElementById("areasButton").src = altSrc;
        }
        else
            document.getElementById("areasButton").src = comSrc;
        setTimeout('makeTickFlash()',500);
    }