house_style = function () {
    var _this = this;
    _this.initialize ();
}

house_style.prototype.format = function () {
    var _this = this;
    if ($("#content").html()!==""){
        _this.do_format();
    }  
    else setTimeout(function(){_this.format()},100);
}

house_style.prototype.getTags = function (tagname) {
    var elements =  (document.getElementsByTagName("my:" + tagname).length>0) 
		? document.getElementsByTagName("my:" + tagname) 
		: document.getElementsByTagName(tagname) ;
    return elements;
}

house_style.prototype.do_format = function () {
    var _this = this;

    $(_this.getTags("page")[0]).css ({
        "background-color" : "#660066",
        "height": $(window).height(),
        "color": "white",
        "font-size" : "12px",
        "display": "block",
        "margin": "0 auto",
        "width" : "960px",
        "position":"relative"
    });
    
    $(_this.getTags("menu")).each (function () {
        $(this).find("ul").css({
            "list-style": "none"
        });
        $(this).find("li").css({
        "float": "left",
        "margin-right":"10px"
        });
        
    })
    
    
    $(".frm_house_search").css ({
        "background-color" : "#944d94"
    });
    $(".frm_house_search .lbox").css({
        "float":"left"
    });
    
    $(".frm_house_search .rbox").css({
        "float":"right",
        "padding-right": "5px"
    });
    
    $(".frm_house_search .rbox div").css({
        "clear":"both"
    });
    
    /*$(".frm_house_search > div:first").css({
        "width":"200px"
    }); */
    $(".frm_house_search select").css({
        "float":"right",
        "margin-left": "5px",
        "background-color": "#660066",
        "color": "white",
        /*"opacity": 0,*/
        "font-size" : "12px",
        "background" : "url('http://www.dsq.co.uk:93/modules/house/images/canvas-list-nav-item-arrow-.gif') no-repeat center right"
    }); 
    
    $("#header ul#menu, #header img").css({
        "float":"left"
    });
    $("#header ul#contact").css({
        "float":"right",
        "margin-right": "10px"
    })
    $("#header ul#menu, #header ul#contact").css({
        "list-style": "none"
    });
    $("#header ul#menu li").css({
        "float": "left",
        "margin-right":"10px"
    });
    $("#header  a").css({
        "text-decoration" :"none",
        "color":"white"
    });
    $("#btn_go_search img").css({
        //"position" : "absolute",
        //"left": "475px",
        "cursor":"pointer"
    });
    $("#btn_go_search span").css({
        "position" : "absolute",
        "cursor":"pointer"
    });
    

}

house_style.prototype.initialize = function () {
    var _this = this;
    $(window).ready(function ()  { _this.format();});
    $(window).resize(function () { _this.format();});
}

house_style.prototype.update_grid = function (element) {
    $(document).ready(function () {
        $("#"+ element.id).css ({
            left: $("#"+ element.id).position().left + element.loff + "px" ,
            top: $("#"+ element.id).position().top + element.toff + "px"
        })
    })
}



