se ho capito bene cosa vuoi fare:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form di registrazione</title>
<script language="javascript" type="text/javascript">
<!--
window.onload = function(){
//cosi imposto a 6 la classe se voglio invertire l'operazione nel if cambia da != a ==
if(self.location.href.indexOf("7")!=-1){

var linkUp = self.location.href.replace("7","6")
var linkDown = self.location.href.replace("7","6")
}else{
var linkUp = self.location.href.replace("6","7")
var linkDown = self.location.href.replace("6","7")
}
document.getElementById("up").href=linkUp
document.getElementById("down").href=linkDown

}
//-->
</script>
</head>

<body>
up
down
</body>
</html>
Testato e funzionante su ff 3.0, ie 7, chrome, safari