var headerimages = [];
$(document).ready(function(){
    if($("#front-image img").length > 1){
        window.setTimeout('switchImage(0)', 4000);
    }
    $("#house-image a, .highlighted a").hover(function(){
        $(this).find("span").css({backgroundColor:"#999999"});
    },
    function(){ 
        $(this).find("span").css({backgroundColor:"transparent"});
    });
    $("a.review").each(function(ix, el){
        el.target = '_blank';
    });
    $("form").submit(function(){
        $("#id_lkjhgf").val("fghjkl");
        $("#id_asdfgh").val("hgfdsa");
        var a = $(this)[0].action.split("/");
        $(this)[0].action = window.location.href + "/" + a[a.length-1];
        return true;
    });
});
function switchImage(ix) {
    var imgs = $("#front-image img"); 
    var current = ix;
    if(++ix >= imgs.length) { ix = 0; }
    $("#front-image-" + current).fadeOut("slow");
    $("#front-image-" + ix).fadeIn("slow");
    window.setTimeout('switchImage(' + ix + ')', 4000);
}
