// $Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $
Drupal.buttonStyle = function() {
$('input.form-submit|input.form-button:not(.cc_button)').each(function() {
var obj_pre = $(this).prev('input.form-submit|input.form-submit');
var obj_next = $(this).next('input.form-submit|input.form-submit');
$(this).addClass('cc_button');
$(this).wrap('
');
if ( this.value == obj_next[0].value )
$(this).parent().after('
');
});
$('#edit-preview').each(function() {
$(this).css({ display: "none" });
});
}
Drupal.fieldsetStyle = function() {
$('fieldset.collapsible').each(function() {
$(this).addClass('collapsed');
$(this).children('div.fieldset-wrapper').css("display","none");
});
}
Drupal.resetCatMenu = function() {
try {
var arrayObj = $('div#block-menu-610 > ul.menu > li.expanded > ul.menu > li.leaf');
var obj = arrayObj[arrayObj.length-1];
$(obj).addClass("end");
} catch (ex) {}
try {
$('div#block-menu-610 > ul.menu > li').each(function() {
tag_a = $(this).children("a");
if ( $(this).attr("class") == 'collapsed' )
tag_a.html('
' + tag_a.text());
else
tag_a.html('
' + tag_a.text());
});
} catch (ex) {}
}
Drupal.changeLang = function() {
try { // Change for Vote Widget.
$('.vote-points-label').each(function() {
$(this).html('Điểm');
});
} catch (ex) {}
try { // Change for Related Articles.
$('#block-views-ca_related_nodes > div.cc_leftTitle > h3').each(function() {
$(this).html('Bài liên quan:');
});
} catch (ex) {}
try { // Change for Related Articles.
$('div.ca_bigtitle').each(function() {
if ( $(this).text() == 'Forward this page' )
$(this).html('Gửi bạn bè');
});
} catch (ex) {}
try { // Change "More" text to "Xem thêm"
$('div.more-link > a').each(function() {
if ( $(this).text() == 'more' )
$(this).html('Xem tiếp');
});
} catch (ex) {}
}
if (Drupal.jsEnabled) {
$(document).ready(Drupal.changeLang);
$(document).ready(Drupal.buttonStyle);
$(document).ready(Drupal.fieldsetStyle);
$(document).ready(Drupal.resetCatMenu);
}