﻿
function ShowUsers(pageNumber, fromCache){
	CommonShowList("User", pageNumber, fromCache);
}


function User_filter()
{
	CommonShowListUserfilter();
}

function GetAllUsers()
{
	CommonShowGetAllUsers();
}

function AddUser() {
	CommonAdd("User");
}

function ShowUser(lngUserID){
	//alert('dali idat do ovde');
	CommonShow("User", lngUserID);
}

function ShowUserByIndex(index){
	CommonShowByIndex("User", index);
}

function DeleteUser(lngUserID){   
    if (confirm("Are you sure you want to delete this user?")){
		CommonDelete("User", lngUserID);
    }
}

function LinkUser(lngUserID) {
	if(confirm("Do you want to discard any changes you made and go to this user's page?")) {
		ShowUser(lngUserID);
	}
}

function Showinputs(visibility)
{
	document.getElementById('filter').style.display = visibility;	
	
}

function SaveUserDetails(){
	if(ValidForm("userDetailsForm")) {
		UpdateNavigation("ShowUsers()");

		var soapData = SoapDataBuilder("SaveUserDetails",parseForm('userDetailsForm'));
		AjaxRequest("User.asmx",soapData,"user.xsl");

		glbListCacheXml = null;
	}
}

function SaveUserGroups() {
	var	soapData = SoapDataBuilder("SaveUserGroups", parseForm('userGroupsForm'));
	AjaxRequest("User.asmx",soapData,"user.xsl",null,"userGroupsMessage");
}

//Added by hiren to send the verification mail
function User_SendVerification()
{
	var soapData = SoapDataBuilder("SendUserVerification", parseForm('userSendVerification'));
	AjaxRequest("User.asmx", soapData, "user.xsl", null, "verificationMessage");
}


function CheckBoxVisibility(visibility)
{
    var chks = document.getElementsByName("chkVerificationMail");
    var item = 0;
    for (item = 0; item < chks.length; item++)
        chks[item].style.display = visibility;
}