function Psend()
{
new Ajax.Request('Handler.ashx',
{
method: 'get',
onSuccess: function(transport) {
var response = transport.responseText || "no response text";
//alert("Success! \n\n" + response);
var obj = response.evalJSON(true);
for (i = 0; i < 4; i++) {
DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this)' }));
DeImg = $('MyDiv').insert(new Element('img', { 'id': "img" + obj[i].Nam, 'src': obj[i].IM, 'style': 'display = inline', 'onClick': 'Say(this)' }));
document.body.appendChild(DeCheBX);
document.body.appendChild(DeImg);
}
},
onFailure: function() { alert('Something went wrong...') }
});
SayHi = function(x) {
if ($(x).checked == true) {
// $('id').hide();
**$('img'+i).style.visibility = "hidden";**// doesnt work
}
};