/* ============= Javascript file ============= */
function buildComment() {
//I learned how to do this sort of thing from watching http://www.jasonsantamaria.com who used code from http://www.shauninman.com
$('preview').innerHTML = '
' + '
' + $('message').value.replace(/(\r|\n)/gi,"
").replace(/
/gi,"
") + '
';
}
/* ============= Init functions ============= */
function initBuildComment() {
if(!$('message')) return;
$('message').addEvent('keydown', buildComment)
}
function initMembersAccordion() {
if(!$('members')) return; // test 'cause we need that on the hp only
var tabs = $$('#members p.navmost a');
var stretchers = $$('#members ol');
var accordion = new Accordion(tabs, stretchers, {duration:600, opacity: 0, transition: Fx.Transitions.sineInOut,
onActive: function(targetElem){
targetElem.addClass('selected');
},
onBackground: function(elem){
elem.removeClass('selected');
}
});
/* prevent default behavior */
$each(tabs, function(tab){
tab.addEvent('click', function(event){
event = new Event(event);
event.preventDefault();
});
})
}
/* ============= Launch everything ============= */
// var load_method = (window.ie ? 'load' : 'domready'); // ie fix // alreday defined in cnetscripts.htm
window.addEvent(load_method, initMembersAccordion);
window.addEvent(load_method, initBuildComment);
' + $('message').value.replace(/(\r|\n)/gi,"
").replace(/
/gi,"
") + '