Code for override js in magento 1
Create file in skin/frontend/default/your_theme-> create here (extendedjs.js)
and change your code as per requirement
Validation.add()
Like This :-
Validation.add('validate-cemail', 'Sørg for, at dine e-mails matcher.', function(v) {
var conf = $$('.validate-cemail')[0];
var pass = false;
if ($('email')) {
pass = $('email');
}
var emailElements = $$('.validate-email');
for (var i = 0; i < emailElements.size(); i++) {
var emailElement = emailElements[i];
if (emailElement.up('form').id == conf.up('form').id) {
pass = emailElement;
}
}
if ($$('.validate-admin-email').size()) {
pass = $$('.validate-admin-email')[0];
}
return (pass.value == conf.value);
})
then apply it to local.xml -> override your handler (for knowing that which you have to override you should inspect element where you want to apply the js page then see the body element then you can got at there.)
like this :
<opc_index_index>
<reference name="head">
<action method="addItem">
<type>skin_js</type><name>js/extendedjs.js</name>
</action>
</reference>
</opc_index_index>