function codeSearch() {

        var url = '/code_search.html';

        var callback = {
        success: function (o) {
             //alert(o.responseText);
                if (o.responseText) {
                        showPanel(o.responseText);
                }
        },
        failure: function(o) {
            //alert(o.responseText);
            alert('Sorry. There was an error.');
        }
        }
        YAHOO.util.Connect.asyncRequest('POST', url, callback, '');

}

function showPanel(text) {

        myPanel.setHeader('Cerca annunci per codice');
        myPanel.setBody(text);
        //myPanel.setFooter("End of Panel #2");
        myPanel.render(document.body);
	elem = document.getElementById('code_search');
	myPanel.cfg.setProperty("context",[elem,"tr","br"]);
        myPanel.show();

}

function initPanel() {

        // Instantiate a Panel from script
        myPanel = new YAHOO.widget.Panel("panel", { width:"320px", visible:false, draggable:false, close:true } );

}

YAHOO.util.Event.addListener(window, "load", initPanel);

