2006-01-10 06:16:17 +01:00
|
|
|
function GetElementsWithClassName(elementName, className) {
|
|
|
|
var allElements = document.getElementsByTagName(elementName);
|
|
|
|
var elemColl = new Array();
|
|
|
|
for (i = 0; i < allElements.length; i++) {
|
|
|
|
if (allElements[i].className == className) {
|
|
|
|
elemColl[elemColl.length] = allElements[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return elemColl;
|
|
|
|
}
|
|
|
|
|
|
|
|
function meChecked() {
|
2006-11-19 08:56:05 +01:00
|
|
|
var undefined;
|
|
|
|
var eMe = document.getElementById('me');
|
|
|
|
if (eMe == undefined) return false;
|
|
|
|
else return eMe.checked;
|
2006-01-10 06:16:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function upit() {
|
|
|
|
var isMe = meChecked(); //document.getElementById('me').checked;
|
|
|
|
var inputColl = GetElementsWithClassName('input', 'valinp');
|
|
|
|
var results = document.getElementById('link_rel');
|
|
|
|
var linkText, linkUrl, inputs = '';
|
|
|
|
for (i = 0; i < inputColl.length; i++) {
|
|
|
|
inputColl[i].disabled = isMe;
|
|
|
|
inputColl[i].parentNode.className = isMe ? 'disabled' : '';
|
|
|
|
if (!isMe && inputColl[i].checked && inputColl[i].value != '') {
|
|
|
|
inputs += inputColl[i].value + ' ';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inputs = inputs.substr(0,inputs.length - 1);
|
|
|
|
if (isMe) inputs='me';
|
|
|
|
results.value = inputs;
|
|
|
|
}
|
|
|
|
|
|
|
|
function blurry() {
|
|
|
|
if (!document.getElementById) return;
|
|
|
|
|
|
|
|
var aInputs = document.getElementsByTagName('input');
|
|
|
|
|
2006-02-12 08:53:23 +01:00
|
|
|
for (var i = 0; i < aInputs.length; i++) {
|
2006-01-10 06:16:17 +01:00
|
|
|
aInputs[i].onclick = aInputs[i].onkeyup = upit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
addLoadEvent(blurry);
|