// get form buttons on page (excluding action bar) & generate html for left & right caps	
function formButtonBg() {
    //var formButtons = $$('input.lw-form-button');
    var formButtons = $('page-content').select('input.lw-form-button','input.lw-form-button-delete');
    var btnLeft = "<img src=\"/images/svc-button-left.gif\" class=\"svc-btn-left\" \/>";
    var btnRight = "<img src=\"/images/svc-button-right.gif\" class=\"svc-btn-right\" \/>";

    formButtons.each(function(fb) {
	    fb.insert({before:btnLeft});
	    fb.insert({after:btnRight});	
	});	
}
	
/*
  addButtonPipes() draws the pipes between <li> buttons
*/
function addButtonPipes() {
    // look for message buttons <li class="button">
    var msgButtons = $$('.lw-content-col li.button');
    msgButtons.each(drawPipes); 
		
    // add pipes to page buttons in site-header as well
    var pageButtons = $$('.lw-page-buttons li.button');
    pageButtons.each(drawPipes); 	
}
	
var drawPipes = function(theButton) {
    // clean leading/trailing spaces & text nodes from <li>
    theButton.innerHTML.strip();
    theButton.cleanWhitespace();
    // add pipe to all <li>'s except the first <li>
    if(theButton.previous()) {
	theButton.innerHTML = "&nbsp;|&nbsp;" + theButton.innerHTML;
    } else {
	// if this is the first <li> in the <ul>, get the parent ul & strip text nodes
	theButton.up().cleanWhitespace();
    }
}

