﻿/*******************************************************
 porpuse: get the form permission
 inputs : 1.UserGroupID
		  2.the form name	
 return:  the form pemission
 comments:
*******************************************************/
function GetFormPermit(GroupID,FormName){
	
	
	
	// set the Parameters array
	var ArrParameters = new Array;
	ArrParameters[0] = "GetFormPermission";
	ArrParameters[1] = GroupID;
	ArrParameters[2] = FormName;
	
	ArrReturnParameters = XMLRPC(VIRTUAL_DIRECTORY + "App/GetServerFormsPemission.asp",ArrParameters)	
	
	if (ArrReturnParameters){
	
	
		if 	(ArrReturnParameters[0] > 1){ 
			str = ArrReturnParameters[0];
			 var retConfirm = window.showModalDialog(VIRTUAL_DIRECTORY + "Main/confirmWin.asp?str="+str+"&blnOkCancel=0"
							,null,"dialogWidth:350px;dialogHeight:120px;center=yes;status=0;help=0");
			return false;
		}
	
		if (ArrReturnParameters[0] == "N"){
			str = "אינך רשאי לצפות במסך זה";
			
			 var retConfirm = window.showModalDialog(VIRTUAL_DIRECTORY + "Main/confirmWin.asp?str="+str+"&blnOkCancel=0"
							,null,"dialogWidth:325px;dialogHeight:120px;center=yes;status=0;help=0");
			return false;
		}
		
		//return the form permit
		return  ArrReturnParameters[0];
	
	}
	
	
}


