$(function() {
    var currentURL = window.location;
    $("#topnav a").each(function(){
        $(this).css("width",eval($(this).width()+10));
        if ($(this).attr("href")==currentURL) { $(this).css({ "font-weight":"bold","letter-spacing":"-0.2px" }); }
    });
    var PhUseURL = window.location.pathname;
    if (PhUseURL!="/admin/cm/sites/162/default.phuse") {
        $("#links").wrapInner("<select id=\"select_location\"></select>");
        $("#select_location").append("<option value=\"http://staging.ph-creative.com/sites/cms/default.phuse\">Select Location</option>\n");
        $("#links a").each(function(){ var link = $(this).attr("href"); var text = $(this).text(); $("#select_location").append("<option value=\""+link+"\">"+text+"</option>\n"); }).hide();
        $("#select_location").change(function() { window.location=$("#select_location option:selected").val(); });
        $("#dropdown_submit").click(function(){ window.location=$("#select_location option:selected").val(); });
    }
    $("#left_column ul li").prepend("&gt; ");
    $("#breadcrumb").each(function() {
        $(this).html($(this).html().replace("&gt;","|"));
        $(this).html($(this).html().replace("&gt;","|"));
        $(this).html($(this).html().replace("&gt;","|"));
    });
    $(".control").click(function(){
        var thisContent=$(this).parent().parent().children(".content");
        if (thisContent.is(":hidden")) {
            thisContent.slideDown(1000,"easeOutBounce");
            $(this).attr("src","http://staging.ph-creative.com/sites/cms/res/builtin/arrow_down.png");
        } else {
            thisContent.slideUp(800,"easeInBack");
            $(this).attr("src","http://staging.ph-creative.com/sites/cms/res/builtin/arrow_up.png");
        }
    });
    $("#twitter").click(function(){ location.href="http://twitter.com/home?status=Currently reading "+currentURL+""; });
    $("#stumble").click(function(){ location.href="http://www.stumbleupon.com/submit?url="+currentURL+""; });
    $("#delicious").click(function(){ location.href="http://del.icio.us/post?url="+currentURL+""; });
    $("#facebook").click(function(){ location.href="http://www.facebook.com/sharer.php?u="+currentURL+""; });
    $("#digg").click(function(){ location.href="http://digg.com/submit?url="+currentURL+""; });
    $("#reddit").click(function(){ location.href="http://reddit.com/submit?url="+currentURL+""; });
    $("#email").click(function(){ location.href="mailto:?subject=Cheshire Moving&body="+currentURL+""; });
    $("#print").click(function(){ window.print(); });
    $("#bookmark").click(function(){
        var bookmark_url = window.location;
        if (window.sidebar) { window.sidebar.addPanel("Cheshire Moving", bookmark_url,""); }
        else if (window.external) { window.external.AddFavorite(bookmark_url, "CMS"); }
        else if (window.opera) { return false; }
        else { alert("Unfortunately, this browser does not support the requested action, please bookmark this page manually."); }
    });
    $("#contact").click(function(){ location.href="http://www.cheshiremoving.co.uk/contact-us/default.phuse"; });

    if (($.browser.msie)) {
        $("#small_right_column .MMDataCaptureForm_LabelTD span:last").css("top","-53px").css("position","relative");

        
    }

});
