function updateWgtshow(){ // Here we're updating the user showing their weight graph to other users
	var sh = document.getElementById('hwgraph').checked == true ? 'f' : 't';
	document.getElementById('swgtcell').innerHTML = '<small><em>updating ...</em></small>';
	document.location = ('profile.php?d=sw&s=' + sh);
}

function pPhoto(){ // Uploading a new profile photo
	document.getElementById('photoS').value = "Uploading ...";
	document.getElementById('photoS').disabled = true;
}

function udInts(){
	document.getElementById('intb').value = 'Updating ...';
}

function doUd(f){
	ctl.location.replace('/profile.php?d=addf&u=' + escape(f));
	document.getElementById('addfr').innerHTML = 'Sending invite ...';
}

function showDDown(){
    show('filter_members');
    show('go_back');
    hide('find_members');
    var fields = document.getElementsByTagName('tr');
    for (var i = 0; i < fields.length; i++) {
        if (fields[i].getAttribute('class') == 'tr_ppl' || fields[i].getAttribute('className') == 'tr_ppl') {
            fields[i].style.display = 'none';
        }
    }
}
function hideDDown(){
    hide('filter_members');
    hide('go_back');
    show('find_members');
    var fields = document.getElementsByTagName('tr');
    for (var i = 0; i < fields.length; i++) {
        if (fields[i].getAttribute('class') == 'tr_ppl' || fields[i].getAttribute('className') == 'tr_ppl') {
            fields[i].style.display = '';
        }
    }
}
function hide(id){document.getElementById(id).style.display='none';}
function show(id){document.getElementById(id).style.display='block';}

function getChecked(numItems,j){
    var total = 0;
    var values = '';

    var the_td = document.getElementById('td_' + j);
    if(the_td.getAttribute('class') == 'td_interest_selected'){
        the_td.setAttribute('class', 'td_interest');
        the_td.setAttribute('className', 'td_interest');
    }
    else{
        the_td.setAttribute('class', 'td_interest_selected');
        the_td.setAttribute('className', 'td_interest_selected');
    }

    for (i=1; i<=numItems; i++){
        if (document.getElementById('td_'+ i).getAttribute('class') == 'td_interest_selected'){
            total = total + 1;
            if(total > 3){
                alert("Please Select only three");
                the_td.setAttribute('class', 'td_interest');
                the_td.setAttribute('className', 'td_interest');
            }
            else{
                if (values != '') {
                    values += ', ';
                }
                values += i;
            }
        }
    }
    document.getElementById('int').value = values;
}