
function ShowHideDiv(obj_id)
{
	
	if ($(obj_id).style.display=='block')
		$(obj_id).style.display='none';
	else
		$(obj_id).style.display='block';
}

function ShowHideDiv2(obj_id)
{
	obj=$j('#'+obj_id);

	if (obj.css('display')=='block')
	{
		obj.hide();
	}
	else
	{
		if (obj_id=='search_popup')
		{
	     	$j.ajax({
	     		type: "POST",
			 	url: "/usermanager.php",
  				data: "action=userrequesthistory",
				success: function(k){
     				obj.html(k);		
   				}  				
		     });
	   	}
		obj.show();
	}
}


function DeleteUserRequestHistory(q)
{
	lStr1 = 'action=deleteuserrequesthistory&q='+q;
	k=sendXmlHttpRequest('/usermanager.php', lStr1);
	$('search_popup').innerHTML=k;
}


function ChangeUserPass()
{

	f=$('ch_pass_form');
    curpass=f.curpass.value;
    pass=f.pass.value;
    pass2=f.pass2.value;
    
    if (curpass=='')
    {
    	alert('Please type your current password');
    }
    else if (pass=='')
    {
    	alert('Please type your new password');
    }
	else if (pass!=pass2)
	{
		alert('Please retype your new password again');
	}
	else
	{
		lStr1 = 'action=changePassword&curpass='+curpass+'&newpass='+pass;
		k=sendXmlHttpRequest('/usermanager.php', lStr1);
		$('changePasswordDiv').innerHTML=k;
	}
}

