im_path = "im/"
var t2 = 0

hasFlash = DetectFlashVer(7, 0, 0);
flash_announcement = "<br><img src=\"" + im_path + "logo_flash.gif\" alt=\"\" align=\"left\"><span class=\"tiny1\" align=\"right\">This site looks better with Flash. <a href=http://www.adobe.com/go/getflash/>Get Flash ></a></span>"

noflash_menu = "<img name=\"menu1\" src=\"im/menu1.gif\" border=\"0\" usemap=\"#m_menu1\" alt=\"\"><map name=\"m_menu1\"><area shape=\"poly\" coords=\"17,75,147,75,147,95,17,95,17,75\" href=\"south_oswald_road1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,55,147,55,147,75,17,75,17,55\" href=\"cluny_gardens1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,337,147,337,147,357,17,357,17,337\" href=\"murrayfield_avenue1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,317,147,317,147,337,17,337,17,317\" href=\"hartington_gardens1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,494,147,494,147,514,17,514,17,494\" href=\"urban_angel_hanover_st1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,474,147,474,147,494,17,494,17,474\" href=\"plaisir_du_chocolat1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,454,147,454,147,474,17,474,17,454\" href=\"argyle_place_offices1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,434,147,434,147,454,17,454,17,434\" href=\"callum_innes_studio1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,414,147,414,147,434,17,434,17,414\" href=\"urban_angel_forth_st1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,394,147,394,147,414,17,414,17,394\" href=\"ingleby_gallery1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,175,147,175,147,195,17,195,17,175\" href=\"viewforth_terrace1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,155,147,155,147,175,17,175,17,155\" href=\"st_ronans_terrace1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,135,147,135,147,155,17,155,17,135\" href=\"fountainhall_road1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,115,147,115,147,135,17,135,17,115\" href=\"frisealach_bridge1.htm\" alt=\"\" ><area shape=\"rect\" coords=\"17,0,147,28\" href=\"about_us.php\" alt=\"\" ><area shape=\"poly\" coords=\"17,297,147,297,147,317,17,317,17,297\" href=\"royal_terrace1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,277,147,277,147,297,17,297,17,277\" href=\"leamington_terrace1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,257,147,257,147,277,17,277,17,257\" href=\"charterhall_road1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,237,147,237,147,257,17,257,17,237\" href=\"braid_road1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,217,147,217,147,237,17,237,17,217\" href=\"viewforth1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,195,147,195,147,217,17,217,17,195\" href=\"hillend_house_north1.htm\" alt=\"\" ><area shape=\"poly\" coords=\"17,95,147,95,147,115,17,115,17,95\" href=\"frisealach1.htm\" alt=\"\" ></map>"
noflash_menu += flash_announcement
noflash_image1 = "<img src=\"" + im_path + "home_page_no_flash.jpg\" alt=\"Helen Lucas Architects\">"


//image names
//out_array = new Array('but_home', 'but_intro', 'but_pc')

//button over images
//preload_array = new Array('but_home_f2.gif', 'but_intro_f2.gif', 'but_pc_f2.gif', 'man1.gif')

function preload() {
    im = new Array()
    for (n = 0; n < preload_array.length; n++) {
        im[n] = new Image()
        im[n].src = im_path + preload_array[n]
    }
}

/*
 function show_button()
 {
 t2 = setTimeout("over(page_button_name)", "100")
 }


 function out(mode)
 {
 clearTimeout(t2)
 for (n=0; n<out_array.length; n++)
 {
 document.images[out_array[n]].src = im_path + out_array[n] + '.gif'
 }
 //  if (mode == "reshow") show_button()
 }
 */

function over(button) {
    document.images[button].src = im_path + button + '_f2.gif'
}

function out(button) {
    document.images[button].src = im_path + button + '.gif'
}


function show_man() {
    t3 = setTimeout("show_man1()", "5000")
}

function show_man1() {
    document.images['man'].src = "im/man1.gif"
    t4 = setTimeout("show_man2()", "100")
}

function show_man2() {
    document.images['man'].src = "im/shim.gif"
}


//initialise accmenu

if (typeof(lev3_open) == "undefined") lev3_open = '';
if (typeof(lev4_open) == "undefined") lev4_open = '';

ddaccordion.init({
    headerclass:"lev3_header", //Shared CSS class name of headers group that are lev3_header
    contentclass:"lev3_items", //Shared CSS class name of contents group
    revealtype:"click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    mouseoverdelay:200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    collapseprev:true, //Collapse previous content (so only one open at any time)? true/false
    defaultexpanded:[lev3_open], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
    onemustopen:false, //Specify whether at least one header should be open always (so never all headers closed)
    animatedefault:false, //Should contents open by default be animated into view?
    persiststate:false, //persist state of opened contents within browser session?
    toggleclass:["lev3_header_closed", "lev3_header_open"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml:["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    animatespeed:"normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    oninit:function (headers, expandedindices) { //custom code to run when headers have initalized
        //do nothing
    },
    onopenclose:function (header, index, state, isuseractivated) { //custom code to run whenever a header is opened or closed
        //do nothing
    }
})

//2nd level headers initialization
ddaccordion.init({
    headerclass:"lev4_header",
    contentclass:"lev4_items",
    revealtype:"click",
    mouseoverdelay:200,
    collapseprev:true,
    defaultexpanded:[lev4_open],
    onemustopen:false,
    animatedefault:false,
    persiststate:false,
    toggleclass:["lev4_header_closed", "lev4_header_open"],
    togglehtml:["none", "", ""],
    animatespeed:"normal",
    oninit:function (headers, expandedindices) {
    },
    onopenclose:function (header, index, state, isuseractivated) {
    }
})


function init_page() {
    if (typeof(accmenu_highlight) != "undefined") {
        accmenu1 = accmenu_highlight.split(",");

        for (i = 0; i < accmenu1.length; i++) {
            $(accmenu1[i]).addClass('selected');
        }
    }

    if (typeof(init_homepage) != "undefined") {
        $("h3 a").click(function () {
            $("#hp_text1").fadeOut();
        });
    }

    $(".mainImg").animate({ opacity:1.0 }, "fast");

    $("#readMoreButton").click(function () {
        $("#readMoreSlide").slideToggle("fast");
        return false;
    });

    $("map#m_staff area").mouseenter(function () {
        $('#' + $(this).attr('id') + '_div').css({'visibility':'visible'}); //, 'background-image':'url(../im/staff_profile_arr_' + $(this).attr('id') + '.png)'
        $('div#us_text').css({'visibility':'hidden'});
    });

    $("map#m_staff area").mouseleave(function () {
        $('#' + $(this).attr('id') + '_div').css({'visibility':'hidden'});
        $('div#us_text').css({'visibility':'visible'});
    });

}


$(document).ready(function () {
    init_page();
});	


