/*

	Created by		: PANKAJ KUMAR
	Creation Date	: 08-June-2006

*/


var SMALLCHARACTER = "abcdefghijklmnopqrstuvwxyz";
var CAPITALCHARACTER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ALLCHARACTER = SMALLCHARACTER + CAPITALCHARACTER;
var NUMERICCHARACTER = "0123456789";
var ALPHANUMERICCHARACTER = ALLCHARACTER + NUMERICCHARACTER;
var DECIMALCHARACTER = "0123456789.";
var TELEPHONENUMBER = "0123456789-";
var MOBILENUMBER  = "0123456789";
var FAXNUMBER = "0123456789-";
var VOIPNUMBER = "0123456789-";
var PLCCNUMBER = "0123456789-";
var VPNNUMBER = "0123456789-";
var ORDERNUMBER =ALPHANUMERICCHARACTER + "/\-(). " ;
var ALPHANUMERICCHARACTERMSG = " Only Charcters and Numbers are allowed"
var NATURALCHARACTER = "123456789";

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
							Functions List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	1.		leftTrim(str)				
	2.		rightTrim(str)
	3.		trim(str)
	4.		isBlank(obj,msg)
	5.		isEmpty(str)
	6.		isCharsInBag(str, bag)
	7. 		isInteger(str, mode)
	8.		isReal(str, mode)
	9. 		isValidInteger(obj, mode)
	10.	isValidReal(obj, mode)
	11.	isValidNaturalNumber(obj)	
	12.	isValidAlphabate(obj)
	13.	isValidAlphaNumeric(obj)
	14.	isEmail (strInput)
	15.	inputCheck(strObjName,strInputs,intBefore,intAfter, chrOneTimeChar)
	16.	compareDate(strFirstDate,strSecondDate,strMsg)
	17.	isValidDate(obj)
	18.	renderDate(obj)
	19.	round(number,X)	
	20. isSelected(object,value,msg)	
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 1
Function name	: leftTrim
Argument List		: str: input value 				  
Purpose				: trims white spaces on left side of the input.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
Modified by		: Pankaj Kumar
Reason				: Made the method more efficient by using while loop.
Dated				: 08-June-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

function leftTrim(str)
{
	var i=0;
	while(str.charAt(i)==" ")
	{
		i++;
	}
	str=str.substring(i,str.length);
	return str;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 2
Function name	: rightTrim
Argument List		: str: input value 				  
Purpose				: trims white spaces on right side of the input.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
Modified by		: Pankaj Kumar
Reason				: Made the method more efficient by using while loop.
Dated				: 08-June-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function rightTrim(str)
{
	var len=str.length-1;
	while(str.charAt(len)==" ")
	{
		len--;
	}
	str=str.substring(0,len+1);
	return str;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 3
Function name	: trim
Argument List		: strInput: input value 				  
Purpose				: trims white spaces of the input.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function trim(str)
{
	return leftTrim(rightTrim(str));
}	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 4
Function name	    : isBlank
Argument List		: object: for which validation need to be done, msg: proper message to be displayed 				  
Purpose				: check for the blank field and show proper display message
Created by		    : Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isBlank(obj,msg)
{		
	var objValue = trim(obj.value);	
	if (parseInt(objValue.length, 10) <= 0)
	{
		alert(" Please Enter " + msg);
		obj.value = "";
		obj.focus();		
		return false;
	}
	else
	{
	    obj.value = objValue;
	}
	return true;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 4
Function name	    : isDisabledBlank
Argument List		: object: for which validation need to be done, msg: proper message to be displayed 				  
Purpose				: check for the blank field for disabled textboxes and show proper display message
Created by		    : Shweta Priya (HCL Technologies Ltd.)
Dated				: 19-March-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isDisabledBlank(obj,msg)
{		
	var objValue = trim(obj.value);	
	if (parseInt(objValue.length, 10) <= 0)
	{
		alert(" Please Click on " + msg);
		obj.value = "";
		//obj.focus();		
		return false;
	}
	return true;
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 5
Function name	: isEmpty
Argument List		: str : string
Purpose				: to check wheather a variable is empty or not.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isEmpty(str)
{
		  str=trim(str);
		  return ((str == null) || (str.length == 0))
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 6
Function name	: isCharsInBag
Argument List		: str : string ; bag : string against which the validity of string need to be checked
Purpose				: to check wheather a string is with in the given criteria or not.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isCharsInBag(str, bag)
  {
    var i;
    // Search through string's characters one by one.
    // If character is in bag return true else false .
    for (i = 0; i < str.length; i++)
    {
        // Check that current character isn't whitespace.
        var c = str.charAt(i);
        if (bag.indexOf(c) == -1) return false;
    }
    return true;
 }
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 7
Function name	: isInteger
Argument List		: str : string ; mode : 1 - Signed , 2 - Unsigned
Purpose				: to check wheather the passed value is integer or not.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isInteger(str, mode)
  {
	switch(parseInt(mode, 10))
	{
		case 1:
				var i=0;
				if(str.charAt(0)=="-" || str.charAt(0)=="+")
				{
					i = 1;
				}	  
				str = str.substring(i);
				if (isCharsInBag (str, NUMERICCHARACTER) == false)
				{
					return false;
				}		
				break;
		case 2:
				if (isCharsInBag (str, NUMERICCHARACTER) == false)
				{
					return false;
				}		
				break;
	}
    return true;
 }
 
 
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 8
Function name	: isReal
Argument List		: str : string ; mode:  1 - Signed , 2 - Unsigned
Purpose				: to check wheather the passed value is real or not.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isReal(str, mode)
  {
	switch(parseInt(mode, 10))
	{
		case 1:
				var i=0;
				if(str.charAt(0)=="-" || str.charAt(0)=="+")
				{
					i = 1;
				}	  
				str = str.substring(i);  
				if (isCharsInBag (str, DECIMALCHARACTER) == false)
				{
					return false;
				}
				if(str.indexOf(".") != str.lastIndexOf(".")) 
				{
					return false;
				}		
				break;
		case 2:
				if (isCharsInBag (str, DECIMALCHARACTER) == false)
				{
					return false;
				}
				if(str.indexOf(".") != str.lastIndexOf(".")) 
				{
					return false;
				}		
				break;
	}
    return true;
 }
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 9
Function name	: IsValidInteger
Argument List		:  obj : object for which condition need to be checked; mode: 1 - Signed , 2 - Unsigned
Purpose				: to avoid Invalid integers on Keypress itself.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isValidInteger(obj, mode)
{	
	switch(parseInt(mode, 10))
	{
		case 1:
				if((window.event.keyCode >= 48 && window.event.keyCode <= 57) || ((window.event.keyCode == 43 || window.event.keyCode == 45)  && obj.value.length == 0))
				{
					return true;
				}		
				break;
		case 2:
				if(window.event.keyCode >= 48 && window.event.keyCode <= 57)
				{
					return true;
				}
				break;
	}
	return false;	
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 10
Function name	: isValidReal
Argument List		:  obj : object for which condition need to be checked; mode: 1 - Signed, 2 - Unsigned
Purpose				: to avoid Invalid Real numbers on Keypress itself.
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isValidReal(obj, mode)
{	
	switch(parseInt(mode, 10))
	{
		case 1:
				if((window.event.keyCode >= 48 && window.event.keyCode <= 57) || (window.event.keyCode == 46 && obj.value.indexOf(".") == -1) || ((window.event.keyCode == 43 || window.event.keyCode == 45)  && obj.value.length == 0))
				{
					return true;
				}		
				break;
		case 2:
				if((window.event.keyCode >= 48 && window.event.keyCode <= 57) || (window.event.keyCode == 46 && obj.value.indexOf(".") == -1))
				{
					return true;
				}
				break;
	}
	return false;	
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 11
Function name	: isValidNaturalNumber
Argument List		:  obj : object for which condition need to be checked
Purpose				: to avoid Invalid Natural numbers on Keypress itself.
Created by		: Rakesh Kumar Kumar (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isValidNaturalNumber(obj)
{	
	if(window.event.keyCode < 48 || window.event.keyCode > 57)
	{
		return false;
	}
	
	if(window.event.keyCode == 48)
	{
		var InputLength = obj.value.length;
		if(parseInt(InputLength) == 0)
		{
			return false;
		}
	}	
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 12
Function name	: isValidAlphabate
Argument List		:  obj : object for which condition need to be checked
Purpose				: to avoid Invalid Alphabet characters on Keypress itself.
Created by		: Rakesh Kumar Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isAlphabate(obj)
{	
	var Flag = false;
	if(window.event.keyCode == 32)
	{
		var InputLength = obj.value.length;
		if(parseInt(InputLength) != 0)
		{
			Flag = true;
		}
	}

	if(window.event.keyCode >= 65 && window.event.keyCode  <=90)
	{
		Flag = true;
	}
	
	if(window.event.keyCode >= 97 && window.event.keyCode  <=122)
	{
		Flag = true;
	}
	
	if(Flag)
	{
		return true;
	}
	else
	{
		return false;
	}
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 
Function name	: isValidAlphaNumericWithSpace
Argument List		: obj : object for which condition need to be checked
Purpose				: to avoid Invalid Alphabet Numeric characters on Keypress itself.
Created by		: Arvind Kumar Singh(HCL Technologies Ltd.)
Dated				: 04-apr-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isValidAlphaNumWithSpace(obj)
{	
	var Flag = false;
	
	if(window.event.keyCode == 32)
	{
		var InputLength = obj.value.length;
		if(parseInt(InputLength) != 0)
		{
			Flag = true;
		}
	}
	if(window.event.keyCode >= 48 && window.event.keyCode  <=57)
	{
		Flag = true;
	}

	if(window.event.keyCode >= 65 && window.event.keyCode  <=90)
	{
		Flag = true;
	}
	
	if(window.event.keyCode >= 97 && window.event.keyCode  <=122)
	{
		Flag = true;
	}
	if(Flag)
	{
		return true;
	}
	else
	{
		return false;
	}
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 13
Function name	: isValidAlphaNumeric
Argument List		: obj : object for which condition need to be checked
Purpose				: to avoid Invalid Alphabet Numeric characters on Keypress itself.
Created by		: Rakesh Kumar Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isValidAlphaNumeric(obj)
{	
	var Flag = false;
	if(window.event.keyCode >= 48 && window.event.keyCode  <=57)
	{
		Flag = true;
	}

	if(window.event.keyCode >= 65 && window.event.keyCode  <=90)
	{
		Flag = true;
	}
	
	if(window.event.keyCode >= 97 && window.event.keyCode  <=122)
	{
		Flag = true;
	}
	if(Flag)
	{
		return true;
	}
	else
	{
		return false;
	}
}




/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 14
Function name	: isEmail
Argument List		: strInput: input value 				  
Purpose				: return true if strInput variable is a valid email address(syntactical).
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isEmail (strInput){   
	if(isEmpty(strInput)){
		return false;
		}
	var invalidChars = " \t\n\r\\\"\'#$%^&*()+=!~`/;:<>?,[]{}"
	var intPosFirst, intPosLast, intPosPeriod;
	strInput = trim(strInput);	
	//filter for invalid chars
	for(var i=0;i<strInput.length;i++){
		if(invalidChars.indexOf(strInput.charAt(i)) != -1){
			return false;
			}	
		}	
	//starts with alphabet
	if(ALLCHARACTER.indexOf(strInput.charAt(0)) == -1){
		return false; 
		}	
	intPosFirst = strInput.indexOf("@");
	// @ present and not first char
	if(intPosFirst == -1 || intPosFirst == 0){
		return false; 
		}	
	// multiple at present
	intPosLast = strInput.lastIndexOf("@");
	if(intPosLast != intPosFirst){
		return false; 
		}	
	intPosPeriod = strInput.lastIndexOf(".");	
	if(intPosPeriod == -1 || intPosPeriod < (intPosFirst + 2) || intPosPeriod == (strInput.length-1)){
		return false; 
		}	
	return true;
	}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: inputCheck
Argument List	: strObjName	: name of the source control with document and form name. 
				  strInputs		: allowed chracters string(e.g. "0123456789."). 	
				  intBefore		: maximum characters allowed before decimal
				  intAfter		: maximum characters allowed after decimal
				  chrOneTimeChar: One time character	
Purpose			: To check the valid/allowed characters.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2005
Example			: inputCheck("documet.form1.txt", "1234567890.","5","3",".")				  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
	function inputCheck(strObjName,strInputs,intBefore,intAfter, chrOneTimeChar){
	   	var iLengthAfterDecimal,iLengthBeforeDecimal;	   	
	   	//set the allowed characters string
	   
		if (strInputs == ""){ 
			strInputs = "0123456789.";  
			}		
			
		//get the key pressed by the user
		var cKeyPressed;
		cKeyPressed = charFromCharCode(window.event.keyCode);	
		//alert(cKeyPressed);
		//serach the character in the input string
		var iFoundChar;
		iFoundChar = findCharacter(strInputs,cKeyPressed);
		
		if (iFoundChar == -1){
			window.event.keyCode = 0;	
			return false;
		}			
		var objTextBox;
		var sValue;
		
		//get the value of text box
		objTextBox	= eval(strObjName);
		sValue		= objTextBox.value;
		
		//get the deciaml char position
		var iDecimalChar;
		iDecimalChar =findCharacter(sValue,chrOneTimeChar);		
		
		//if keypressed is chrOneTimeChar e.g. "." 
		if (cKeyPressed == chrOneTimeChar){
			// if "." character is alraedy there
			if (iDecimalChar != -1){
				window.event.keyCode = 0;	
				return false;
				}
			}
		//if "." character is alraedy there in the textbox				
		if (iDecimalChar != -1){
			var sAfterDecimal;		
			sAfterDecimal = sValue.substring(iDecimalChar + 1); 
			iLengthAfterDecimal	=  sAfterDecimal.length;
			//if allowed characters after decimal is equal to characters already there in the textbox value
			if (iLengthAfterDecimal == intAfter){
				window.event.keyCode = 0;	
				return false;
				}
			}
		//if chrOneTimeChar(e.g. ".") character is not there in the textbox				
		else{
			var sBeforeDecimal;			
			sBeforeDecimal = sValue.substring(0,(sValue.length - iDecimalChar)-1);
			iLengthBeforeDecimal	=  sBeforeDecimal.length; 
			//if allowed chararters before decimal is equal to the characters already there in the textbox value
			if ((iLengthBeforeDecimal == intBefore) && (cKeyPressed != ".")){
				window.event.keyCode = 0;	
				return false;
				}
			}		
	}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: charFromCharCode
Argument List	: charCode: Ascii value for a character. 				  
Purpose			: return the chracter value of an Ascii value.(Hexadecimal base)
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function charFromCharCode (charCode){
		return unescape('%' + charCode.toString(16));
	}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 16
Function name	: compareDate
Argument List		: strFirstDate,  strSecondDate, strMsg 
Purpose				: to campare two date.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
	function compareDate(strFirstDate,strSecondDate,strMsg){	
		var arrFirstDate = strFirstDate.split("/");
		
		var arrSecondDate = strSecondDate.split("/");		
		var strMonth = arrFirstDate[1]
		var strDay = arrFirstDate[0]
		var strYear = arrFirstDate[2]
	
		
		var strCurMonth = arrSecondDate[1]
		var strCurDay = arrSecondDate[0]
		var strCurYear = arrSecondDate[2]
		
		if ((strMonth > 12) || (strCurMonth > 12)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  
		if ((strDay > 31) || (strCurDay > 31)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  			
		if (parseFloat(strYear) > parseFloat(strCurYear)){	
			alert(strMsg);
			return false;
			}
		if(parseFloat(strYear)==parseFloat(strCurYear)){ 
			if(parseFloat(strMonth)>parseFloat(strCurMonth)){	
				alert(strMsg);
				return false;
				}		
			if(parseFloat(strMonth)==parseFloat(strCurMonth)){	
				if(parseFloat(strDay)>parseFloat(strCurDay)){	
					alert(strMsg);
					return false;
					}	
				}	
			return true;
			}
		return true;
		}
		
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 16.1
Function name		: compareDate
Argument List		: strFirstDate,  strSecondDate, strMsg 
Purpose				: to campare two date.
Created by			: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/			
	function compareDateEqual(strFirstDate,strSecondDate,strMsg){	
		var arrFirstDate = strFirstDate.split("/");
		
		var arrSecondDate = strSecondDate.split("/");		
		var strMonth = arrFirstDate[1]
		var strDay = arrFirstDate[0]
		var strYear = arrFirstDate[2]
	
		
		var strCurMonth = arrSecondDate[1]
		var strCurDay = arrSecondDate[0]
		var strCurYear = arrSecondDate[2]
		
		if ((strMonth > 12) || (strCurMonth > 12)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  
		if ((strDay > 31) || (strCurDay > 31)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  			
		if (parseFloat(strYear) > parseFloat(strCurYear)){	
			alert(strMsg);
			return false;
			}
		if(parseFloat(strYear)==parseFloat(strCurYear)){ 
			if(parseFloat(strMonth)>parseFloat(strCurMonth)){	
				alert(strMsg);
				return false;
				}		
			if(parseFloat(strMonth)==parseFloat(strCurMonth)){	
				if(parseFloat(strDay)>=parseFloat(strCurDay)){	
					alert(strMsg);
					return false;
					}	
				}	
			return true;
			}
		return true;
		}		
		
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 16.1
Function name		: compareDateWithoutMsg
Argument List		: strFirstDate,  strSecondDate
Purpose				: to campare two date.
Created by			: Dinesh Gupta (HCL Technologies Ltd.)
Dated				: 07-March-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/			
	function compareDateWithoutMsg(strFirstDate,strSecondDate){	
		var arrFirstDate = strFirstDate.split("/");
		
		var arrSecondDate = strSecondDate.split("/");		
		var strMonth = arrFirstDate[1]
		var strDay = arrFirstDate[0]
		var strYear = arrFirstDate[2]
	
		
		var strCurMonth = arrSecondDate[1]
		var strCurDay = arrSecondDate[0]
		var strCurYear = arrSecondDate[2]
		
		if ((strMonth > 12) || (strCurMonth > 12)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  
		if ((strDay > 31) || (strCurDay > 31)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  			
		if (parseFloat(strYear) > parseFloat(strCurYear)){	
			//alert(strMsg);
			return false;
			}
		if(parseFloat(strYear)==parseFloat(strCurYear)){ 
			if(parseFloat(strMonth)>parseFloat(strCurMonth)){	
				//alert(strMsg);
				return false;
				}		
			if(parseFloat(strMonth)==parseFloat(strCurMonth)){	
				if(parseFloat(strDay)>=parseFloat(strCurDay)){	
					//alert(strMsg);
					return false;
					}	
				}	
			return true;
			}
		return true;
		}		
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 17
Function name	: isValidDate
Argument List	: obj: name of the source control with document and form name. 				  
Purpose			: To validate the user input dates in dd/mm/yyyy format.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 06-Jan-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
	function isValidDate(obj){			
		var dateValue = obj.value;		
		if (trim(dateValue).length == 0){
			return true;
			} 
		if (dateValue.length != 10){
			alert("Please enter date in dd/mm/yyyy format!");
			obj.focus();
			return false;
			}
		var arrFirstDate = new Array();
		arrFirstDate = dateValue.split("/");			
		if(arrFirstDate.length != 3)
		{
			alert("Please enter date in dd/mm/yyyy format!");
			obj.focus();
			return false;
		}
		
		var strDay = arrFirstDate[0];
		var strMonth = arrFirstDate[1];		
		var strYear = arrFirstDate[2];
		
		if (isCharsInBag (strDay, NUMERICCHARACTER) == false || isCharsInBag (strMonth, NUMERICCHARACTER) == false || isCharsInBag (strYear, NUMERICCHARACTER) == false)
		{
			alert("Please enter date in dd/mm/yyyy format!");
			obj.focus();		
			return false;
		}
		
		if(parseInt(strDay, 10) == 0  || parseInt(strDay, 10) == 0  || parseInt(strDay, 10) == 0)
		{
			alert("Please enter valid date!");
			obj.focus();		
			return false;		
		}
		
/*		if(strDay.toString.length < 1 || strMonth.toString.length < 1 || strYear.toString.length < 4)
		{
			alert("Please enter date in dd/mm/yyyy format!");
			obj.focus();
			return false;			
		}*/
		
		if (strMonth > 12){
			alert("Month can not be greater than 12!");
			obj.focus();
			return false;
			}  
		if (strMonth < 1){
			alert("Month can not be less than 1!");
			obj.focus();
			return false;
			}  
		var bLeapYear = 0;
		if (((parseInt(strYear) % 4) == 0) && ((parseInt(strYear) % 100) != 0)){ 
			bLeapYear = 1;
			}
		else if ((parseInt(strYear) % 400) == 0){
			bLeapYear = 1;
			}	 
		var arrDays;
		if (parseInt(bLeapYear) == 1){
			arrDays = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
			}
		else{
			arrDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);	
			}
				
		if (parseInt(strDay) > arrDays[parseInt(strMonth)-1]){
			alert("Day can not be greater than " + arrDays[parseInt(strMonth)-1]);
			obj.focus();
			return false;
			}	
			
			
		if(parseInt(strYear, 10) < 1900)
		{
			alert("Year can't be less than 1900 ");
			obj.focus();
			return false;
		}	
			
		return true;
		}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 18
Function name	: renderDate
Argument List	: obj: this pointer of the textbox object. 				  
Description		: it will validate the user inputs and only allow dd/mm/yyyy format of date.
				  it will not allow users to enter day value greater than 31.
				  it will not allow users to enter month value greater than 12.	
				  The "/" character will come automatically.
Purpose			: checks the keystrokes entered by user for date validation.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 06-Jan-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	function renderDate(obj){
		var keyCode = window.event.keyCode;
		var dateValue = obj.value;		
		
		if(parseInt(keyCode) >= 47 && parseInt(keyCode) <= 57){							 	
			for (var intCounter=0; intCounter <= intLength; intCounter++){
					var chrChar = dateValue.charAt(intCounter);  			
					if (chrChar == "/"){
						intSlashCount = parseInt(intSlashCount) + 1
						}
					}					
				if (parseInt(intSlashCount) == 2){ 		
					return false;
					}			
			if (parseInt(keyCode) == 47){
				var intLength = dateValue.length;
				var intSlashCount = 0;						
				if (dateValue.length == 0){
					obj.value = "01";				
					}								
				else if (dateValue.length == 1){
					obj.value = "0" + obj.value;
					}								
				else  if (dateValue.length == 3){
					obj.value = obj.value + "01";
					}
				else  if (dateValue.length == 4){
					obj.value = dateValue.substr(0,3) +  "0" + dateValue.substr(3,1);
					}										
				}					
			
			if (dateValue.length == 2){									
				if(parseInt(dateValue) > 31){
					 obj.value = "";
					 return false;
					 }
				else{	 
					if (parseInt(keyCode) != 47){
						obj.value =obj.value + "/";				
						}						
					}							
				}
			if (dateValue.length == 5){							
				var monthPart = dateValue.substr(3,2);			
				if(parseInt(monthPart) > 12){
					 obj.value = dateValue.substr(0,3);
					 return false;
					 }
				else{	 
					if (parseInt(keyCode) != 47){
						obj.value = obj.value + "/";				
						}						
					}							
				}
				
			if (dateValue.length == 10){							
				var yearPart = dateValue.substr(6,4);			
				if(parseInt(yearPart) > 9999 || parseInt(yearPart) < 1900){
					 obj.value = dateValue.substr(0,6);
					 return false;
					 }
				else{	 
					if (parseInt(keyCode) != 47){
						//obj.value = obj.value + "/";				
						}						
					}							
				}
				
									
			}	
		else{
			return false;				
			}
		}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sr. No.				: 19
Function name	: round
Argument List		: number, X(decimal places)				  
Purpose				: return true if strInput variable is a valid email address(syntactical).
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated				: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function round(number,X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 20
	Function name	: isSelected
	Created by		: Ashok Kr. Singh
	Creation Date	: 03-Jan-2006
	Purpose			: To Check that Dropdown List must be selected
	Paraameter		: Dropdown object Reference, value at index 0
						(that should not be selected),and message
	Requested by	: Ashok Kr. Singh
=====================================================*/

function isSelected(object,value,msg)
{
	if ((object.value) == value)
	{
		alert(" Please Select " + msg);
		object.focus();
		return false;
	}	
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 21
	Function name	: findCharacter
	Argument List	: strValue		: string to serach. 
					chrCharacter	: charater to be find. 	
	Purpose			: to find a particular pattern in a string.
	Created by		: Rakesh Kumar (HCL Technologies Ltd.)
	Dated			: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
	function findCharacter(strValue, chrCharacter){
		var intLength;
		var intCounter;
		var chrChar;
		//alert("fFindChar:" + sValue);
		intLength = strValue.length;
		for (intCounter=0; intCounter <= intLength; intCounter++){
			chrChar = strValue.charAt(intCounter);  			
			if (chrChar == chrCharacter){
				//alert ("findCharacter:" + cChar);
				return intCounter;
			}
		}
		return -1;
	}
	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 22
	Function name	: showCalender
	Argument List	: ctlName, strParentPath
	Purpose			: to show the calender for selecting the date
	Created by		: Rakesh Kumar (HCL Technologies Ltd.)
	Dated			: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
function showCalender(ctlName, strParentPath)
{
            var ctlValue = eval('document.forms[0].'+ctlName).value;
            var pageProperty = 'left=100,top=100,width=250,height=218,menubar=0,toolbar=0,statusbar=0,scrollbars=0,resizable=0';
            var pageUrl = strParentPath + '/Include/frmCalender.aspx?ctlName='+ctlName+'&ctlValue='+ctlValue;          
            window.open(pageUrl,'NEW_WIND_CALENDAR',pageProperty)
}
	
	
	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: checkDate
Argument List	: 
Purpose			: to campare two date.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
	function checkDate(strFirstDate,strSecondDate,strMsg){	
		var arrFirstDate = strFirstDate.split("/");
		
		var arrSecondDate = strSecondDate.split("/");		
		var strMonth = arrFirstDate[1]
		var strDay = arrFirstDate[0]
		var strYear = arrFirstDate[2]
	
		
		var strCurMonth = arrSecondDate[1]
		var strCurDay = arrSecondDate[0]
		var strCurYear = arrSecondDate[2]
		
		if ((strMonth > 12) || (strCurMonth > 12)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  
		if ((strDay > 31) || (strCurDay > 31)){
			alert("Invalid Date format!(use: dd/mm/yyyy)")
			return false;
			}  			
		if (parseFloat(strYear) > parseFloat(strCurYear)){	
			alert(strMsg);
			return false;
			}
		if(parseFloat(strYear)==parseFloat(strCurYear)){ 
			if(parseFloat(strMonth)>parseFloat(strCurMonth)){	
				alert(strMsg);
				return false;
				}					
			if(parseFloat(strMonth)==parseFloat(strCurMonth)){	
				if(parseFloat(strDay)>parseFloat(strCurDay)){	
					alert(strMsg);
					return false;
					}	
				}	
			return true;
			}
		return true;
		}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openEmployeeWindow
Argument List	: 
Purpose			: Open The Employee Window as pop up.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Modified by     : Dinesh Gupta
Dated			: 26-Dec-2005
Modification Date : 20-July-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function openEmployeeWindow(ctlNames, submitForm, path, defaultCtl, focusCtl){		
	var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
	if ((path == undefined) || (path == "")) 
		var pageUrl = "../Common/frmEmployeeSearch.aspx?submitForm="+submitForm+"&ctlNames="+ctlNames+"&focusCtl="+focusCtl+"&defaultCtl="+defaultCtl;					
	else
		var pageUrl = path + "Common/frmEmployeeSearch.aspx?submitForm="+submitForm+"&ctlNames="+ctlNames+"&focusCtl="+focusCtl+"&defaultCtl="+defaultCtl;	

	window.open(pageUrl,'NEW_EMPLOYEE_WIND',pageProperty);
	return false;
	}
	
	
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openAccountWindow
Argument List	: 
Purpose			: Open The account search Window as pop up.
Created by		: Anurag Chhibber (HCL Technologies Ltd.)
Modified by     : 
Dated			: 06-Oct-2006
Modification Date : 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function openAccountWindow(ctlName,ctlName1,strParentPath){		
	var ctlValue = eval('document.forms[0].'+ctlName).value;
	var ctlValue1 = eval('document.forms[0].'+ctlName1).value;
            var pageProperty = "left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
            var pageUrl = strParentPath + 'Common/frmAccountSearch.aspx?ctlName='+ctlName+'&ctlValue='+ctlValue+'&ctlName1='+ctlName1+'&ctlValue1='+ctlValue1;          
            window.open(pageUrl,'NEW_ACCOUNT_WIND',pageProperty)
	
	}
	
	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 25
	Function name	: checkTextArea
	Argument List	: obj, len
	Purpose			: to restict the length of textarea
	Created by		: pankaj Kumar (HCL Technologies Ltd.)
	Dated			: 04-Aug-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function checkTextArea(obj, len)
	{
		if(obj.value.length >= len)
		{
			obj.value.length = len;
			return false;
		}
	}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/



/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 26
	Function name	: PhoneNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Deepika
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
 
	function isTelePhoneNo(str)
	 {
	  if (isCharsInBag(str, TELEPHONENUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}
			
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 27
	Function name	: PhoneNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Deepika
	Dated			: 17-Aug-2006
	Modified by		: Deepika
	Dated			: 21-Aug-2006
	Reason			: Made it for plcc,faxnumber,voip number also
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
 
	function isMobileNo(str)
	 {
	  if (isCharsInBag(str, MOBILENUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}
			
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*Sr. No.				: 6
Function name	: isAlphaNumericWthSpace
Argument List		: str : string ; bag : string against which the validity of string need to be checked
Purpose				: to check wheather a string is with in the given criteria or not.
Created by		: Amit Srivastava (HCL Technologies Ltd.)
Dated				: 08-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function isAlphaNumericWthSpace(obj)
{
  
	  var objValue = trim(obj.value);	
		var i;
		bag = ALPHANUMERICCHARACTER + " " + ".";
		// Search through string's characters one by one.
		// If character is in bag return true else false .
		for (i = 0; i < objValue.length; i++)
		{
			// Check that current character isn't whitespace.
			if(!(objValue.charCodeAt(i) == 13 || objValue.charCodeAt(i) == 10))
			{
				var c = objValue.charAt(i);
				if (bag.indexOf(c) == -1)
				{
				alert("Only Characters,Numbers and Dot are allowed");
				obj.focus();	
				return false;
				}
			}	
		}
	return true;
 }
 
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*Sr. No.			: 6
Function name		: isAllInOne
Argument List		: obj   : to which we want the validation 
					  allowedChar  : allowed character string like "abcd"
					  msg  : message to be displayed
Purpose				: to check wheather a string is with in the given criteria or not.
Created by			: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 18-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 function isAllInOne(obj, allowedChar, msg)
 {
	var objValue = trim(obj.value);	
	for (var i = 0; i < objValue.length; i++)
	{
		var c = objValue.charAt(i);
		if (allowedChar.indexOf(c) == -1)
		{
			alert(msg);
			obj.focus();	
			return false;
		}
	}
	return true;	
 }

 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*Sr. No.			: 6
Function name		: checkFirstCharCase
Argument List		: obj   : to which we want the validation 
					  chr  : character which need to be blocked at first place
Purpose				: to check wheather a string is with in the given criteria or not.
Created by			: Pankaj Kumar (HCL Technologies Ltd.)
Dated				: 18-Jun-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 
function checkFirstCharCase(obj,chr)
{
	var strChar;
	if(obj.value.indexOf(chr)==0)
	{
		if(chr == " ")
		{
			strChar = "Blank";	
		}
		else
		{
			strChar = chr;
		}
		alert(strChar + " can't be at 1st place !!");
		obj.focus();
		return false;
	}
	return true;
}
 
 
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 28
	Function name	: isFaxNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Ankush Sharma
	Dated			: 17-Aug-2006
	Modified by		: PANKAJ Kumar
	Dated			: 19-Aug-2006
	Reason			: mode was added without any reason(I have removed it)	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function isFaxNo(str)
	 {
	  if (isCharsInBag(str, FAXNUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}

 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 28
	Function name	: isVoipNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Ankush Sharma
	Dated			: 17-Aug-2006
	Modified by		: PANKAJ Kumar
	Dated			: 19-Aug-2006
	Reason			: mode was added without any reason(I have removed it)	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function isVoipNo(str)
	 {
	  if (isCharsInBag(str, VOIPNUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 28
	Function name	: isPlccNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Ankush Sharma
	Dated			: 17-Aug-2006
	Modified by		: PANKAJ Kumar
	Dated			: 19-Aug-2006
	Reason			: mode was added without any reason(I have removed it)	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function isPlccNo(str)
	 {
	  if (isCharsInBag(str, PLCCNUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 28
	Function name	: isVpnNo
	Argument List	: obj, mode
	Purpose			: Enter Only Numeric Field and "-"
	Created by		: Ankush Sharma
	Dated			: 17-Aug-2006
	Modified by		: PANKAJ Kumar
	Dated			: 19-Aug-2006
	Reason			: mode was added without any reason(I have removed it)	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function isVpnNo(str)
	 {
	  if (isCharsInBag(str, VPNNUMBER) == false)
		{
			return false;
		}
	  else
        {
            return true; 
        }
	}
	
	document.oncontextmenu = function(){alert("Right click is disabled !!");return false};

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 29
	Function name	: 
	Argument List	: 
	Purpose			: To call the function on body load.
	Created by		: 
	Dated			: 17-Aug-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	document.onmouseup = function(){checkForHTMLTag();}
	document.onkeypress = function(){checkForHTMLTag();}	
	//document.onblur = function(){checkForHTMLTag();}
		
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 30
	Function name	: checkForHTMLTag
	Argument List	: 
	Purpose			: Block HTML Tag on page/You should not use this function Explicitly
	Created by		: Dinesh Gupta/Rakesh Kumar
	Dated			: 18-Aug-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function checkForHTMLTag()
		 {	  
			var  elm, cNextChar;			
			if (window.event.keyCode != 32){			
				for(i = 0; i < document.forms[0].elements.length; i++){
					elm = document.forms[0].elements[i];
					//alert(elm.type);
					if (elm.type == 'text' || elm.type == 'textarea'){															
						var objValue;
						if(elm.type == 'text'){
							objValue = 	elm.value;			
						}
						else{
							objValue = 	elm.innerText;	
							//alert("Value="+	objValue);	
						}
																
						if (objValue.length > 0){
							for(var j=0;j<objValue.length;j++){		
								var c = objValue.charAt(j);							
								cNextChar = objValue.charAt(j+1);							
								if (c == "<" && cNextChar != " "){
									alert("Use one space after '<'");
									window.event.keyCode = 0;
									elm.focus();
									return false;
									} 
								}	
							}								
						}
					}
				}							
		return true;
		}			 
		 
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 28
	Function name	: validateOrderNo
	Argument List	: obj, mode
	Purpose			: Enter Order number
	Created by		: DEEPIKA
	Dated			: 18-Aug-2006
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		

	function validateOrderNo(str,msg)
	 {
	   var firstChar = str.charAt(0);  
	   if (isCharsInBag(str, ORDERNUMBER) == false)
		{
		    if(msg == undefined || msg == '')
		    {
		    alert("Please enter valid Order No.!!Only alphanumeric characters,dot,bracket,hyphen and forward slash(/) are allowed.");
		    }
		    else
		    {
		    alert(msg);
		    }
			return false;
		}
	    else if(isCharsInBag(firstChar, ALLCHARACTER)== false)
	    {
		        alert("First Character Of Order No. Should be an Alphabet !!");
		        return false;
	    }
	    else
	    {
            return true; 
        }
	}
	
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/*Sr. No.			: 6
Function name		: entityNameValidation
Argument List		: textFieldName   : to which we want the validation 
Purpose				: to check wheather a string is with in the given criteria or not.
Created by			: Ankush Sharma (HCL Technologies Ltd.)
Dated				: 21-August-2006
Explanation			:This function is made for checking (.) at first place and validation for alphanumeric is also 
					 checked within the function for entity name used throughout the project.	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 
function entityNameValidation(textFieldName)
{

				if(checkFirstCharCase(textFieldName,".")==false)return false;
				if(isAlphaNumericWthSpace(textFieldName)==false) return false;
}

function clearNoRecordLabel(obj)
{
	if(obj.innerHTML == "No Records Found")
	{
		obj.innerHTML = "";
	}
}

function firstCharAlphabetCheck(obj)
{
	var firstChar = obj.value.charAt(0);
	if(isCharsInBag(firstChar, ALLCHARACTER)== false)
	{
		alert("First character should be alphabet !!");
		obj.focus();
		return false;
	}	
	return true;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 21
	Function name	: setFocus
	Argument List	: ctlId
	Purpose			: to Set Focus On a control passed as parameter.
	Created by		: Rakesh Kumar (HCL Technologies Ltd.)
	Dated			: 1-sep-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function setFocus(ctlId)
{
	document.getElementById(ctlId).focus();
	return true;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Sr. No.			: 25
	Function name	: checkTextAreaCopyPaste
	Argument List	: obj, len
	Purpose			: to restict the length of textarea restricting copy Paste
	Created by		: Abhishek Tandon (HCL Technologies Ltd.)
	Dated			: 04-Sep-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/		
	function checkTextAreaCopyPaste(obj, len, msg )
	{
		if(obj.value.length > len)
		{
			alert('Length of '+ msg + ' can not be greater than ' + len)
			//var valStr=obj.value.substr(0,len)
			//obj.value=''
			//obj.value=valStr
			obj.focus()
			return false;
		}
	}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/*Sr. No.               : 
Function name           : firstCharCheck
Argument List           : obj   : to which we want the validation 
                          mode  : type of validation we want on first character
								AN : Alphanumeric
								AB : Alphabet
								NM : numeric		
Purpose                 : to check wheather a string first place is lying in specified criteria
Created by              : Pankaj Kumar
Dated                   : 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function firstCharCheck(obj, mode)
{
    var firstChar = obj.value.charAt(0);
	switch(mode)
	{
		case "AN":
				if(isCharsInBag(firstChar, ALPHANUMERICCHARACTER)== false)
				{
						alert("First character should be alphabet or a number !!");
						obj.focus();
						return false;
				}     		
				break;
		case "AB":
				if(isCharsInBag(firstChar, ALLCHARACTER)== false)
				{
						alert("First character should be alphabet !!");
						obj.focus();
						return false;
				}     		
				break;				
		case "NM":
				if(isCharsInBag(firstChar, NUMERICCHARACTER)== false)
				{
						alert("First character should be a number !!");
						obj.focus();
						return false;
				}     		
				break;								
	}
    return true;
}


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openOrderWindow
Argument List	: 
Purpose			: Open The Order Search Window as pop up.
Created by		: Rakesh Kumar (HCL Technologies Ltd.)
Dated			: 27-Nov-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function openOrderWindow(orderType, ctlNames, path){		
	var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
	if ((path == undefined) || (path == "")) 
		var pageUrl = "../PIS/Common/frmOrderSearch.aspx?orderType="+orderType+"&ctlNames="+ctlNames;					
	else
		var pageUrl = path + "../PIS/Common/frmOrderSearch.aspx?orderType="+orderType+"&ctlNames="+ctlNames;					

	window.open(pageUrl,'NEW_ORDER_WIND',pageProperty);
	return false;
	}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: getObject
Argument List	: Object name
Purpose			: check existance of object or return object
Created by		: Praveen Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function getObject(objectName)
{
    var obj = document.getElementById(objectName);
    if (obj==null)
    {
        alert("This ["+objectName+"] object not found."); 
    }
    return obj;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: setDisable
Argument List	: Object name
Purpose			: check disable object 
Created by		: Praveen Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function setDisable(objectName,flag)
{
    var obj = getObject(objectName); 
    var color="#ffffff";   
    if (obj!=null)
    {
       if (flag)
       {
        obj.value='';
        color="#D9D6D6"
       }
       obj.disabled=flag;
       if(obj.type=='text')
       {        
        obj.style.backgroundColor=color;        
       }
       
    }    
}







/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: getObjectValue
Argument List	: Object name
Purpose			: check existance of object and returns its value
Created by		: Praveen Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function getObjectValue(objectName)
{
    var value;
    var obj = getObject(objectName);    
    if (obj!=null)
    {
        value= obj.value;
    }
    return value;    
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: setObjectValue
Argument List	: Object name and value 
Purpose			: check existance of object and set object value
Created by		: Praveen Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function setObjectValue(objectName,value)
{
    var value;
    var obj = getObject(objectName);    
    if (obj!=null)
    {
        obj.value=value;
    }    
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: isLength
Argument List	: Object name and length 
Purpose			: check existance of object and validates length of entered text
Created by		: Praveen Kumar (HCL Technologies Ltd.)
Dated			: 26-Dec-2006
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function isTextAreaLength(objectName,len)
{
    var value=getObjectValue(objectName);   
    var msg =objectName.substr(3,len)            
    if(value.length > len)
	{		
	    /*
        var flag = confirm('Length of '+ msg + ' can not be greater than ' + len +"\nDo you want to remove extra length?") 
		if (flag)
		{
		    var valStr=value.substr(0,len);
		    var obj=getObject(objectName);
		    obj.value=valStr;
		    obj.focus()
		    			  			   
		}
		else
		{
		    var obj=getObject(objectName);
		    obj.focus()			    
		}	
		*/
		alert('Length of '+ msg + ' can not be greater than ' + len +" characters.")	
	    var obj=getObject(objectName);
		obj.focus()					
		return false;
    } 
    else
    {
        return true;
    }
	    
}


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openOrdersWindow
Argument List	: Order Type Id , Path
Purpose			: To get Order Id according to the order no selected. 
Created by		: Punya Kharkwal (HCL Technologies Ltd.)
Dated			: 02-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
function openOrdersWindow(orderType,path){	
      var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
	  if ((path == undefined) || (path == "")) 
	       var pageUrl = "../../Include/frmOrderSearch.aspx?OrderTypeID="+orderType;					
	   else
	       var pageUrl = path + "Include/frmOrderSearch.aspx?OrderTypeID="+orderType;					
	       window.open(pageUrl,'NEW_ORDERS_WIND',pageProperty);
	       return false;
	    }
	    
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openTheftSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get File_no and FIR No. according to the selected Employee
Created by		: Pankaj Kumar (HCL Technologies Ltd.)
Dated			: 19-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openTheftSearch(firCtrl, fileCtrl, submitForm, mode, path)
{
    var pageProperty ="left=70,top=60,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    
    if(mode == "FS")
    {
        if ((path == undefined) || (path == ""))
            var pageUrl = "frmTheftSearchNew.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm;
        else
            var pageUrl = path + "frmTheftSearchNew.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm;
    }
    else
    {
        if ((path == undefined) || (path == ""))
            var pageUrl = "frmTheftSearch.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm  + "&mode=" + mode;
        else
            var pageUrl = path + "frmTheftSearch.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm  + "&mode=" + mode;
    }
    window.open(pageUrl,'NEW_WIND_Theft',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openPanelPopUp
Argument List	: idCtrl, nameCtrl,feeCtrl, submitForm, path
Purpose			: To get panelId,PanelName and PanelFee according to the selected Panel
Created by		: Dinesh Gupta (HCL Technologies Ltd.)
Dated			: 22-march-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openPanelPopUp(idCtrl,nameCtrl, feeCtrl, submitForm, path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmPanelPopUp.aspx?idCtrl=" + idCtrl + "&nameCtrl=" + nameCtrl + "&feeCtrl=" + feeCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmPanelPopUp.aspx?idCtrl=" + idCtrl + "&nameCtrl=" + nameCtrl + "&feeCtrl=" + feeCtrl + "&submitForm=" + submitForm ;
//alert(path + pageUrl);
    window.open(pageUrl,'NEW_PANEL_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openAdvocatePopUp
Argument List	: idCtrl, nameCtrl, submitForm, path
Purpose			: To get panelId,PanelName and PanelFee according to the selected Panel
Created by		: Dinesh Gupta (HCL Technologies Ltd.)
Dated			: 22-march-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openAdvocatePopUp(idCtrl,nameCtrl,idPanel, submitForm, path)
{
    
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmAdvocatePopUp.aspx?idCtrl=" + idCtrl + "&nameCtrl=" + nameCtrl + "&idPanel=" + idPanel + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmAdvocatePopUp.aspx?idCtrl=" + idCtrl + "&nameCtrl=" + nameCtrl + "&idPanelCtrl=" + idPanelCtrl +  "&submitForm=" + submitForm ;
//alert( path + pageUrl);
    window.open(pageUrl,'NEW_ADVOCATE_WIND',pageProperty);
    return false;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openFamilyDetails
Argument List	: oControlName , Path
Purpose			: To get Employee Code according to the selected Employee
Created by		: Arun Kumar (HCL Technologies Ltd.)
Dated			: 14-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openFamilyDetails(empCode, path) {	
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    
    if ((path == undefined) || (path == "")) 
        var pageUrl = "../../Common/frmDtlsofFamily.aspx?EmpCode=" + empCode;					
    else
        var pageUrl = path + "Common/frmDtlsofFamily.aspx?EmpCode=" + empCode;					
        window.open(pageUrl,'NEW_FAMILY_WIND',pageProperty);        
        return false;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openNomineeDetails
Argument List	: oControlName , Path
Purpose			: To get Employee Code according to the selected Employee
Created by		: Arun Kumar (HCL Technologies Ltd.)
Dated			: 14-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openNomineeDetails(empCode, path) {	
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    
    if ((path == undefined) || (path == "")) 
        var pageUrl = "../../Common/frmDtlsofNominee.aspx?EmpCode=" + empCode;					
    else
        var pageUrl = path + "Common/frmDtlsofNominee.aspx?EmpCode=" + empCode;					
        window.open(pageUrl,'NEW_NOMINEE_WIND',pageProperty);        
        return false;
 }
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openEmployeeSearch
Argument List	: oControlName, Path
Purpose			: To get Employee Code according to the selectedEmployee
Created by		: Yogesh Sharma (HCL Technologies Ltd.)
Dated			:14-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openEmployeeSearch(oControlName, path, CadreCode, DesignationCode, LocationCode, EmploymentStatusCode, EmployeeStatusCode, SubmitParentPage, ForPromotion) {	

    var pageProperty="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var QueryString = "";
  
    if((CadreCode == undefined) || (CadreCode == ""))
        QueryString ="CadreCode=0";
    else
        QueryString = "CadreCode=" +CadreCode;
                
    if ((DesignationCode == undefined) ||(DesignationCode == ""))
        QueryString = QueryString +"&DesignationCode=0";
    else
        QueryString = QueryString +"&DesignationCode=" + DesignationCode;
        
    if ((LocationCode== undefined) || (LocationCode == ""))
        QueryString =QueryString + "&LocationCode=0";
    else
        QueryString =QueryString + "&LocationCode=" + LocationCode;
        
    if((EmploymentStatusCode == undefined) || (EmploymentStatusCode == ""))
       QueryString = QueryString + "&EmploymentStatusCode=0";
    else
       QueryString = QueryString + "&EmploymentStatusCode=" +EmploymentStatusCode;
        
    if ((EmployeeStatusCode ==undefined) || (EmployeeStatusCode == ""))
        QueryString =QueryString + "&EmployeeStatusCode=0";
    else
        QueryString =QueryString + "&EmployeeStatusCode=" + EmployeeStatusCode;
        
    if ((SubmitParentPage == undefined) || (SubmitParentPage == "") || (SubmitParentPage == "Y"))
        QueryString =QueryString + "&SubmitParent=Y"
    else
        QueryString =QueryString + "&SubmitParent=" + SubmitParentPage;
        
    if ((ForPromotion == undefined) || (ForPromotion == "") || (ForPromotion == "N"))
        QueryString =QueryString + "&ForPromotion=N"
    else
        QueryString =QueryString + "&ForPromotion=Y"
        
    if ((path ==undefined) || (path == "")) 
        var pageUrl ="../../Common/frmSearchEmployee.aspx?ControlName=" +document.getElementById(oControlName).id + "&" + QueryString;					
    else
        var pageUrl = path +"Common/frmSearchEmployee.aspx?ControlName=" +document.getElementById(oControlName).id + "&" + QueryString;					
   
    window.open(pageUrl,'NEW_EMP_WIND',pageProperty);        
    return false;
     
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openLocationSearch
Argument List	: oControlName , Path
Purpose			: To get LocationID according to the selected Location
Created by		: Yogesh Sharma (HCL Technologies Ltd.)
Dated			: 22-Feb-2007
Updated         : Vishal Koul on 23-May-2007
Purpose         : updated "openLocationSearch". The name of new pop-up window will be NEW_PAGE. 
                  This was done so that location pop-up could be opened in other pop-up pages.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openLocationSearch(oControlName, path, CompanyTypeCode, SubmitParentPage) {	
    var pageProperty ="left=50,top=50,width=750,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var CompanyType;
    var SubmitParent;
   
    if ((CompanyTypeCode == undefined) || (CompanyTypeCode == "")) 
        CompanyType = 2; 
    else
        CompanyType = CompanyTypeCode;
        
    if ((SubmitParentPage == undefined) || (SubmitParentPage == ""))
        SubmitParent = 'Y';
    else
        SubmitParent = 'N';
        
    if ((path == undefined) || (path == "")) 
        var pageUrl = "../../Common/frmSearchLocations.aspx?ControlName=" + document.getElementById(oControlName).id + "&CompanyTypeCode=" + CompanyType + "&SubmitParent=" + SubmitParent;					
    else
        var pageUrl = path + "Common/frmSearchLocations.aspx?ControlName=" + document.getElementById(oControlName).id + "&CompanyTypeCode=" + CompanyType + "&SubmitParent=" + SubmitParent;										
    window.open(pageUrl,'NEW_LOC_WIND',pageProperty);        
    return false;
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openJobSearch
Argument List	: oControlName , Path
Purpose			: To get JobNumber
Created by		: Pramod Paranjiya (HCL Technologies Ltd.)
Dated			: 20-March-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openJobSearch(oControlName, path) 
{	
  var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
  var pageUrl = path + "../../PMICS/WorkExecution/frmJobSearchPopup.aspx?ControlName=" + document.getElementById(oControlName).id;					
  window.open(pageUrl,'NEW_JOB_WIND',pageProperty);        
  return false;
}

function OpenReport(reportName)
{
   var pageProperty = 'left=250,top=100,width=500,height=500,menubar=1,toolbar=1,statusbar=0,scrollbars=1,resizable=1';            
   //alert(reportName);
   window.open(reportName,'NEW_REPORT_WIND',pageProperty)
    return false;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openServiceBookUpdationHistory
Argument List	: oControlName , Path
Purpose			: To view History Of Updation Of Service Book According to the selected Employee
Created by		: Ankit Gupta (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openServiceBookUpdationHistory(oControlName, path) {	
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    
    if ((path == undefined) || (path == "")) 
        var pageUrl = "../../PIS/Utilities/frmUpdationHistory.aspx?EmpCode=" + document.getElementById(oControlName).value;					
    else
        var pageUrl = path + "PIS/Utilities/frmUpdationHistory.aspx?EmpCode=" + document.getElementById(oControlName).value;					
        window.open(pageUrl,'NEW_SB_UPDATION_WIND',pageProperty);        
        return false;
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openLibMemberSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openLibMemberSearch(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmMemRegnPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmMemRegnPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_LIBRARY_WIND',pageProperty);
    return false;
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openLibBookSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Book Regn Id and Book Name according to the selected Registered Book of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openLibBookSearch(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmBookRegnNamePopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmBookRegnNamePopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_BOOK_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: validateDate(fld)
Argument List	: fld - Field value
Purpose			: Validate date
Created by		: Yogesh Sharma
Dated			: 01-03-2007 at 1930 HRS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
function validateDate(fld) {
    var RegExPattern = /^((((0?[1-9]|[12]\d|3[01])[\.\-\/](0?[13578]|1[02])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|[12]\d|30)[\.\-\/](0?[13456789]|1[012])[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|((0?[1-9]|1\d|2[0-8])[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?\d{2}))|(29[\.\-\/]0?2[\.\-\/]((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00)))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$/;
    var errorMessage = 'Please enter valid date as month, day, and four digit year.\nYou may use a slash, hyphen or period to separate the values.\nThe date must be a real date. 30/2/2000 would not be accepted.\nFormay dd/mm/yyyy.';
    if ((fld.value.match(RegExPattern)) && (fld.value!='')) {
        //alert('Date is OK'); 
    } else {
        alert(errorMessage);
        fld.focus();
        return false;
    } 
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: ValidateOrderNo()
Argument List	: No Arguments
Purpose			: Validate Order No fields
Created by		: Yogesh Sharma
Dated			: 02-03-2007 at 1015 HRS
Usage           : onKeyPress of the text box
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
function ValidateOrderNo() {
    var KeyCode = window.event.keyCode;
    var oControl = event.srcElement.id;
    var oEventType = event.srcElement.type;
    
    if (KeyCode == 39)  KeyCode = 0 //blocks ' (Single Quote)                
    if (KeyCode == 34)  KeyCode = 0 //blocks " (double Quote)                
    if (KeyCode == 38)  KeyCode = 0 //blocks & (Ampersand)
    if (KeyCode == 37)  KeyCode = 0 //blocks % (Percentage)
    if (KeyCode == 60)  KeyCode = 0 //blocks < (Less Than)
    if (KeyCode == 62)  KeyCode = 0 //blocks > (greater Than)
    if (KeyCode == 36)  KeyCode = 0 //blocks $ (Dollar Sign)
    if (KeyCode == 42)  KeyCode = 0 //blocks * (Astreik)
    if (KeyCode == 126) KeyCode = 0 //blocks ~ (Tilde)
    if (KeyCode == 33)  KeyCode = 0 //blocks ! (Exclamatory Sign)
    if (KeyCode == 35)  KeyCode = 0 //blocks # (Hash)
    if (KeyCode == 34)  KeyCode = 0 //blocks @ (At the Rate)
    if (KeyCode == 59)  KeyCode = 0 //blocks ; (Semi colon)
    if (KeyCode == 58)  KeyCode = 0 //blocks : (colon)
    if (KeyCode == 61)  KeyCode = 0 //blocks = (Equal To)
    if (KeyCode == 123) KeyCode = 0 //blocks { (Curly braces)
    if (KeyCode == 125) KeyCode = 0 //blocks } (Curly braces)
    if (KeyCode == 91)  KeyCode = 0 //blocks [ (Square brackets)
    if (KeyCode == 93)  KeyCode = 0 //blocks ] (Curly braces)
    if (KeyCode == 124) KeyCode = 0 //blocks | (Pipe)
    if (KeyCode == 92)  KeyCode = 0 //blocks \ (backward slash)
    if (KeyCode == 95)  KeyCode = 0 //blocks _ (under score)
    if (KeyCode == 94)  KeyCode = 0 //blocks ^ (carret)
    if (KeyCode == 43)  KeyCode = 0 //blocks + (plus sign)
    
    if (KeyCode == 64)  KeyCode = 0 //blocks @ (@ sign)
    if (KeyCode == 44)  KeyCode = 0 //blocks ` (Apostophe's)
    if (KeyCode == 63)  KeyCode = 0 //blocks ? (? sign)
    if (KeyCode == 96)  KeyCode = 0 //blocks `
    
    window.event.keyCode = KeyCode;        
}

 
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: ValidateName()
Argument List	: No Arguments
Purpose			: Validate Name
Created by		: Yogesh Sharma
Dated			: 02-03-2007 at 1015 HRS
Usage           : onKeyPress of the text box
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
function ValidateStrongName() {
    var KeyCode = window.event.keyCode;    
    if (KeyCode == 39)  KeyCode = 0 //blocks ' (Single Quote)                
    if (KeyCode == 34)  KeyCode = 0 //blocks " (double Quote)                
    if (KeyCode == 38)  KeyCode = 0 //blocks & (Ampersand)
    if (KeyCode == 37)  KeyCode = 0 //blocks % (Percentage)
    if (KeyCode == 60)  KeyCode = 0 //blocks < (Less Than)
    if (KeyCode == 62)  KeyCode = 0 //blocks > (greater Than)
    if (KeyCode == 36)  KeyCode = 0 //blocks $ (Dollar Sign)
    if (KeyCode == 42)  KeyCode = 0 //blocks * (Astreik)
    if (KeyCode == 126) KeyCode = 0 //blocks ~ (Tilde)
    if (KeyCode == 33)  KeyCode = 0 //blocks ! (Exclamatory Sign)
    if (KeyCode == 35)  KeyCode = 0 //blocks # (Hash)
    if (KeyCode == 64)  KeyCode = 0 //blocks @ (At the Rate)
    if (KeyCode == 59)  KeyCode = 0 //blocks ; (Semi colon)
    if (KeyCode == 58)  KeyCode = 0 //blocks : (colon)
    if (KeyCode == 61)  KeyCode = 0 //blocks = (Equal To)
    if (KeyCode == 123) KeyCode = 0 //blocks { (Curly braces)
    if (KeyCode == 125) KeyCode = 0 //blocks } (Curly braces)
    if (KeyCode == 91)  KeyCode = 0 //blocks [ (Square brackets)
    if (KeyCode == 93)  KeyCode = 0 //blocks ] (Curly braces)
    if (KeyCode == 124) KeyCode = 0 //blocks | (Pipe)
    if (KeyCode == 92)  KeyCode = 0 //blocks \ (backward slash)
    if (KeyCode == 95)  KeyCode = 0 //blocks _ (under score)
    if (KeyCode == 94)  KeyCode = 0 //blocks ^ (carret)
    if (KeyCode == 43)  KeyCode = 0 //blocks + (plus sign)
    if ((KeyCode >= 48) && (KeyCode <= 57))  KeyCode = 0 //blocks 0,1,2,3,4,5,6,7,8,9
    if (KeyCode == 40) KeyCode = 0 //blocks ( (Round Brackets)
    if (KeyCode == 41) KeyCode = 0 //blocks ( (Round Brackets)
    if (KeyCode == 45) KeyCode = 0 //blocks - (Minus Sign)
    if (KeyCode == 47) KeyCode = 0 //blocks / (Forward Slash)
    if (KeyCode == 96) KeyCode = 0 //blocks ` (single quotes)
    if (KeyCode == 63) KeyCode = 0 //blocks ? (Question Mark)
    window.event.keyCode = KeyCode;        
}       

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: ValidateName()
Argument List	: No Arguments
Purpose			: Validate Name
Created by		: Yogesh Sharma
Dated			: 02-03-2007 at 1015 HRS
Usage           : onKeyPress of the text box
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
function ValidateInteger() {
    var KeyCode = window.event.keyCode;
    
    if ((KeyCode < 48) || (KeyCode > 57))  
        KeyCode = 0;
        
    window.event.keyCode = KeyCode;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openProjectSearch
Argument List	: oControlName , Path
Purpose			: To get ProjectID according to the selected Location
Created by		: Abbas (HCL Technologies Ltd.)
Dated			: 06-March-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openProjectSearch(oControlName, path) 
{	
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var pageUrl;
    if ((path == undefined) || (path == "")) 
    {
        pageUrl = "../../PMICS/WorkExecution/frmProjectSearch.aspx?ControlName=" + document.getElementById(oControlName).id;					
    }
   else
   {
        pageUrl = path + "/PMICS/WorkExecution/frmProjectSearch.aspx?ControlName=" + document.getElementById(oControlName).id;    
   }
   window.open(pageUrl,'NEW_PROJECT_WIND',pageProperty);        
   return false;
}
//function openProjectSearch(oControlName) {	
//    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
//    var pageUrl = "../../PMICS/WorkExecution/frmProjectSearch.aspx?ControlName=" + document.getElementById(oControlName).id;					
//    window.open(pageUrl,'NEW_WIND',pageProperty);        
//    return false;
//}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openProjectLocSearch
Argument List	: oControlName 
Purpose			: To get ProjectID according to the selected Location
Created by		: Ankush (HCL Technologies Ltd.)
Dated			: 22-March-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openProjectLocSearch(oControlName,oLocName) 
{	
   
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var pageUrl = "../../PMICS/WorkExecution/frmProjLocPopup.aspx?ControlName=" + document.getElementById(oControlName).id + "&LOCID=" + document.getElementById(oLocName).id;	
    window.open(pageUrl,'NEW_PROJECT_LOCATION_WINDOW',pageProperty);        
    return false;
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openGrevRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Grev Regn
Created by		: Preeti Singh (HCL Technologies Ltd.)
Dated			: 20-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openGrevRegnSearch(GrevRegnNo,GrevRegnDate,GrevType,GrevBy,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmGrevRegnPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate + "&GrevType=" + GrevType + "&GrevBy=" + GrevBy  + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmGrevRegnPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate + "&GrevType=" + GrevType + "&GrevBy=" + GrevBy + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_GREV_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openMeetingSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Nagendra Kumar (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openMeetingSearch(firCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
   
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmMeetingIdPop.aspx?firCtrl=" + firCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmMeetingIdPop.aspx?firCtrl=" + firCtrl + "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_MTG_WIND',pageProperty);

    return false;
}


function isRealExactCheck(obj, prec, scale, msg, mode)
{
    if(mode == null)
    {
        mode=2;
    }
    var strNum = obj.value;
    var preDec, postDec;    
    var locPreDec=0;
    var locPostDec=0;

    preDec = parseInt(prec, 10) - parseInt(scale, 10);
    postDec = scale;
    
    if(isReal(strNum, mode)==false)
    {
        alert("Please enter valid " + msg + " !");
        obj.focus();        
        return false;
    }
    
    if(strNum.charAt(0) == "+" || strNum.charAt(0) == "-" )
    {
        strNum = strNum.substring(1);
    }
    
    if(strNum.indexOf(".") != -1)
    {
        locPreDec = strNum.split(".")[0].length;              
        locPostDec = strNum.split(".")[1].length;              
    }
    else
    {
        locPreDec = strNum.length;              
    }

    if((parseInt(preDec, 10) < parseInt(locPreDec, 10)) || (parseInt(postDec, 10) < parseInt(locPostDec, 10)))
    {
        alert("Please enter valid " + msg + " !");
        obj.focus();
        return false;    
    }
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openProgramDescription
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Abhishek Singh (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openProgramDescription(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmProgramDescPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmProgramDescPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_PRG_WIND',pageProperty);
    return false;
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openInstituteDescription
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Arun Kumar(HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openInstituteDescription(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmFillingTrainingInstituteDetails.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmFillingTrainingInstituteDetails.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_ISTT_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openProgramPOPUp
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Arun Kumar(HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openProgramPOPUp(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmTrainingProgramPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmTrainingProgramPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_PRG_POP_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDmdRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Demand Regn
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openDmdRegnSearch(GrevRegnNo,GrevRegnDate,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmDmdChtdPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate +  "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmDmdChtdPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate +  "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_DMD_REG_WIND',pageProperty);
    return false;
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openAllotmentOrderDesc
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Abhishek Singh (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openAllotmentOrderDesc(firCtrl, fileCtrl,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmAllotmentOrderPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmAllotmentOrderPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl=" + fileCtrl + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_ALLOT_ORDER_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openGrevRegnSearch In Representation 
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Grev Regn
Created by		: Nagendra kumar (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openGreivencesSearch(GrevRegnNo,GrevRegnDate,GrevType,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmGrivencesPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate + "&GrevType=" + GrevType + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmGrivencesPopUp.aspx?GrevRegnNo=" + GrevRegnNo + "&GrevRegnDate=" + GrevRegnDate + "&GrevType=" + GrevType + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_GREV_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDpCompRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Disciplinary Regn
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openDpCompRegnSearch(regnId,RegnNo,RegnDate,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmDisCmplntRegnPopUP.aspx?regnId=" + regnId + "&RegnNo=" + RegnNo + "&RegnDate=" + RegnDate +  "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmDisCmplntRegnPopUP.aspx?regnId=" + regnId + "&RegnNo=" + RegnNo + "&RegnDate=" + RegnDate +  "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_DP_COMP_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDpPrelRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Disciplinary Regn
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openDpPrelRegnSearch(regnId,comId,RegnNo,RegnDate,CaseNo,CaseFileNo,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmDisPEDetailsSearch.aspx?regnId=" + regnId + "&comId=" + comId + "&RegnNo=" + RegnNo + "&RegnDate=" + RegnDate + "&CaseNo=" + CaseNo + "&CaseFileNo=" + CaseFileNo + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmDisPEDetailsSearch.aspx?regnId=" + regnId + "&comId=" + comId + "&RegnNo=" + RegnNo + "&RegnDate=" + RegnDate + "&CaseNo=" + CaseNo + "&CaseFileNo=" + CaseFileNo + "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_DP_PREL_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDpDeptRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Disciplinary Regn
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openDpDeptRegnSearch(depId,DepCaseNo,depLocation,CompId,RegnNo,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmDisDEDetailsPopUp.aspx?depId=" + depId + "&DepCaseNo=" + DepCaseNo + "&depLocation=" + depLocation + "&CompId=" + CompId + "&RegnNo=" + RegnNo +  "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmDisDEDetailsPopUp.aspx?depId=" + depId + "&DepCaseNo=" + DepCaseNo + "&depLocation=" + depLocation + "&CompId=" + CompId + "&RegnNo=" + RegnNo +  "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_DPT_DEPT_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: Paste
Argument List	: N.A.
Purpose			: Prevents the user from pasting the data into the text box
Created by		: Yogesh Sharma
Dated			: 22-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	
function Paste() { 
   return false; 
}



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDpDeptRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Disciplinary Regn
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 7-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openDpEmpSuspensionSearch(suspId,empName,suspOrderNo,suspDate,suspTillDate,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmEmpSusPopUp.aspx?suspId=" + suspId + "&empName=" + empName + "&suspOrderNo=" + suspOrderNo + "&suspDate=" + suspDate + "&suspTillDate=" + suspTillDate +  "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmEmpSusPopUp.aspx?suspId=" + suspId + "&empName=" + empName + "&suspOrderNo=" + suspOrderNo + "&suspDate=" + suspDate + "&suspTillDate=" + suspTillDate +  "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_DSP_SUSP_WIND',pageProperty);
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openCommitteeSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Book Regn Id and Book Name according to the selected Registered Book of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openCommitteeSearch(commId,commName,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmCommitteePopUp.aspx?commId=" + commId + "&commName=" + commName + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmCommitteePopUp.aspx?commId=" + commId + "&commName=" + commName + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_COMM_WIND',pageProperty);
    return false;
}

function ResetGrid() {
    var strHMTL = "<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr class='row'><td colspan='4'>&nbsp;</td></tr><tr class='headingbg'><td align='left' colspan='4'>&nbsp;</td></tr><tr class='row'><td class='msg' align='center' colspan='4'>Please Click on Search!</td></tr><tr class='headingbg'><td align='left' colspan='4'>&nbsp;</td></tr></table>";    
    return strHMTL;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openConvictionPopUp
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Book Regn Id and Book Name according to the selected Registered Book of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openConvictionPopUp(convictId,ChrgEmployee,ConvDate,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmConvictionDtlsPopUp.aspx?convictId=" + convictId + "&ChrgEmployee=" + ChrgEmployee + "&ConvDate=" + ConvDate + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmConvictionDtlsPopUp.aspx?convictId=" + convictId + "&ChrgEmployee=" + ChrgEmployee + "&ConvDate=" + ConvDate + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_CONT_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openCaseNoSearchPopup
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Book Regn Id and Book Name according to the selected Registered Book of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openCaseNoSearchPopup(ctrlFileNo, ctrlCaseNo, submitForm, path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmCaseNoSearch.aspx?FileNo=" + ctrlFileNo + "&CaseNo=" + ctrlCaseNo + "&submitForm=" + submitForm;
    else
        var pageUrl = path + "frmCaseNoSearch.aspx?FileNo=" + ctrlFileNo + "&CaseNo=" + ctrlCaseNo + "&submitForm=" + submitForm;

    window.open(pageUrl,'NEW_CASE_NO_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openItemSearch
Argument List	: 
Purpose			: To get Item Code Item Desc Item Rate Item Unit
Created by		: Arvind K singh (HCL Technologies Ltd.)
Dated			: 17-Apr-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

 function openItemSearch(oControlName, path,SubmitParentPage) {	
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var CompanyType;
    var SubmitParent;
   

        
    if ((SubmitParentPage == undefined) || (SubmitParentPage == ""))
        SubmitParent = 'Y';
    else
        SubmitParent = 'N';
        
         if ((path == undefined) || (path == "")) 
        var pageUrl = "../MaterialProcurement/frmItemPopUp.aspx?ControlName=" + oControlName  + "&SubmitParent=" + SubmitParent;					
        window.open(pageUrl,'NEW_ITEM_WIND',pageProperty);        
    return false;
        
        
  
}
// call on keypress restrict special char
function CheckAlphaWithSpacialChar(obj)
			{
			var InputLength = obj.value.length;
		if(parseInt(InputLength) == 0)
		{
		if((event.keyCode > 47 && event.keyCode < 58)||(event.keyCode > 96 && event.keyCode < 123)||(event.keyCode > 64 && event.keyCode < 91))
		{
		
		event.returnValue = true;
		}
		else
		{
		return false;
		}
		}
			
		
		if((event.keyCode > 44 && event.keyCode < 58)||(event.keyCode > 96 && event.keyCode < 123)||(event.keyCode > 64 && event.keyCode < 91)||(event.keyCode==32)||(event.keyCode==40)||(event.keyCode==41))
		{
				             
		event.returnValue = true;
		}
		else
		{
		event.returnValue = false;
		}
			}	

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openAccountSearch
Argument List	: 
Purpose			: To get Account Code, Account Desc Item Rate Item Unit
Created by		: Nishant Kumar Pradhan (HCL Technologies Ltd.)
Dated			: 17-Apr-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

 function openAccountSearch(controlName1,controlName2,controlName3, path) 
 {	
 
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var CompanyType;
         if ((path == undefined) || (path == ""))
            var pageUrl = "frmAccountHeadSearch.aspx?controlName1=" + controlName1  + "&controlName2=" + controlName2  + "&controlName3=" + controlName3;
        else
            var pageUrl = path + "/Common/frmAccountHeadSearch.aspx?controlName1=" + controlName1  + "&controlName2=" + controlName2  + "&controlName3=" + controlName3;
    window.open(pageUrl,'NEW_ACC_WIND',pageProperty);        
    return false;
  
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openGrevRegnSearch
Argument List	: GrevRegnNo, submitForm, path
Purpose			: To get Regn No. of Grev Regn
Created by		: Preeti Singh (HCL Technologies Ltd.)
Dated			: 20-Mar-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openAssetParentWindow(AssetType,AsetParentId,AssetName,Depreciation,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmAssetParentGrpPopUp.aspx?AssetType=" + AssetType + "&AsetParentId=" + AsetParentId + "&AssetName=" + AssetName + "&Depreciation=" + Depreciation + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmAssetParentGrpPopUp.aspx?AssetType=" + AssetType + "&AsetParentId=" + AsetParentId + "&AssetName=" + AssetName + "&Depreciation=" + Depreciation + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_ASSET_WIND',pageProperty);
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openLibMemberSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected Registered member of Library
Created by		: Mumtaz Ali (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	 
function openEmplSearchPopUp(EmployeeCode, EmpName,EmpDesg,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmEmployeePopUp.aspx?EmployeeCode=" + EmployeeCode + "&EmpName=" + EmpName + "&EmpDesg=" + EmpDesg + "&submitForm=" + submitForm ;
    else
        var pageUrl = path + "frmEmployeePopUp.aspx?EmployeeCode=" + EmployeeCode + "&EmpName=" + EmpName + "&EmpDesg=" + EmpDesg + "&submitForm=" + submitForm ;

    window.open(pageUrl,'NEW_WIND',pageProperty);
    return false;
}
*/
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openEmplSearchPopUp
Argument List	: oControlName, Path
Purpose			: To get Employee Code according to the selectedEmployee
Created by		: Mumtaz ALi (HCL Technologies Ltd.)
Dated			:14-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openEmplSearchPopUp(oEmpId, oEmpName, oEmpDesg, path, oControlName, DesignationCode, CadreCode, LocationCode, EmploymentStatusCode,EmployeeStatusCode, SubmitParentPage) {	

    var pageProperty="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var QueryString = "";
  
    if((CadreCode == undefined) || (CadreCode == ""))
        QueryString ="CadreCode=0";
    else
        QueryString = "CadreCode=" +CadreCode;
                
    if ((DesignationCode == undefined) ||(DesignationCode == ""))
        QueryString = QueryString +"&DesignationCode=0";
    else
        QueryString = QueryString +"&DesignationCode=" + DesignationCode;
        
    if ((LocationCode== undefined) || (LocationCode == ""))
        QueryString =QueryString + "&LocationCode=0";
    else
        QueryString =QueryString + "&LocationCode=" + LocationCode;
        
    if((EmploymentStatusCode == undefined) || (EmploymentStatusCode == ""))
       QueryString = QueryString + "&EmploymentStatusCode=0";
    else
       QueryString = QueryString + "&EmploymentStatusCode=" +EmploymentStatusCode;
        
    if ((EmployeeStatusCode ==undefined) || (EmployeeStatusCode == ""))
        QueryString =QueryString + "&EmployeeStatusCode=0";
    else
        QueryString =QueryString + "&EmployeeStatusCode=" + EmployeeStatusCode;
        
    if ((SubmitParentPage == undefined) || (SubmitParentPage == ""))
        QueryString =QueryString + "&SubmitParent=N"
    else
        QueryString =QueryString + "&SubmitParent=N"
    
     
    QueryString =QueryString + "&oEmpId="   + oEmpId
    QueryString =QueryString + "&oEmpName="   + oEmpName
    QueryString =QueryString + "&oEmpDesg="   + oEmpDesg        
    
    oControlName = oEmpId;   
       
    var pageUrl ="frmEmployeePopUp.aspx?ControlName=" +document.getElementById(oControlName).id + "&" + QueryString;					
   
    window.open(pageUrl,'NEW_EMPL_WIND',pageProperty);        
    return false;
     
}


    function maxlenth()
	{
        if(document.getElementById("txtLoanDesc").innerText.length > 50)
        {
            alert("Description can't exceed 50 characters !!");
            document.getElementById("txtLoanDesc").focus();
            return false;
		}
	}
	
	
	function isValidateLength(ControlId, iMinNumChar, iMaxNumChar)
	{    
        var iLength = ControlId.value.length
        if(iMinNumChar <= iLength && iLength <= iMaxNumChar)
        {
            return true;     
        }
        else
        {
            return false; 
        }
	}
	/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openPurchaseSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected criteria 
Created by		: Nagendra Kumar (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 
function openPurchaseSearch(firCtrl,firCtrl1,firCtrl2,firCtrl3,submitForm,path)
{
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
   
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmPurchaseOrderPopUp.aspx?firCtrl=" + firCtrl + "&firCtrl1=" + firCtrl1 + "&firCtrl2=" + firCtrl2 +"&firCtrl3=" + firCtrl3 +"&submitForm=" + submitForm ;
    else
       var pageUrl = "frmPurchaseOrderPopUp.aspx?firCtrl=" + firCtrl + "&firCtrl1=" + firCtrl1 + "&firCtrl2=" + firCtrl2 +"&firCtrl3=" + firCtrl3 +"&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_PURCHASE_WIND',pageProperty);

    return false;
}
    function maxlenth()
	{
        if(document.getElementById("txtLoanDesc").innerText.length > 50)
        {
            alert("Description can't exceed 50 characters !!");
            document.getElementById("txtLoanDesc").focus();
            return false;
		}
	}
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Function name	: openFormulaCalculationWindow()
    Argument List	: 1.CompanyCode of the Employee, 2.TextFormula that has to be calculated, 3.txtControl control Name that has be filled with resulted value, 4.Employee Code, 5.hdnControlName in which the calculated result will be stored
    Purpose			: Open The new Window as pop up for pension calculation.
    Created by		: Ankit Garg
    Modified by     : 
    Dated			: 
    Modification Date : 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
    function openFormulaCalculationWindow(CompanyCode,TextFormula,txtControl,EmpCode,hdnControlName)
    {	               
        var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=0";
        var pageUrl = "frmPFPensionAmountCalculation.aspx?CompanyCode="+CompanyCode+"&TextFormula="+TextFormula+"&ControlName="+txtControl+"&EmpCode="+EmpCode+"&hdnControlName="+hdnControlName;					
        window.open(pageUrl,'NEW_FORMULA_CALC_WIND',pageProperty);
        return false;
    }   
    
    /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Function name	: textboxMultilineMaxNumber()
    Argument List	: txt - Reference to Text box, maxLen - Max. no. of characters allowed
    Purpose			: To limit the no of characters in the Multiline text box
    Created by		: Yogesh Sharma
    Dated			: 21-05-2007 1148 HRS
    Modified by     :     
    Modification Date : 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/	
    function textboxMultilineMaxNumber(txt,maxLen){ 
        try {
            if(txt.value.length > (maxLen-1))
                return false; 
        }
        catch(e){ 
        }
    }
    
    
    
    
    
    /*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openTenderSearch
Argument List	: 
Purpose			: To get Tender Number, FInancial Yr and Location Name
Created by		: Ankit Kumar Saxena
Dated			: 21-May-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

 function openTenderSearch(oControlName, path,SubmitParentPage) {	
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    var CompanyType;
    var SubmitParent;
   
    if ((SubmitParentPage == undefined) || (SubmitParentPage == ""))
        SubmitParent = 'Y';
    else
        SubmitParent = 'N';
        
         if ((path == undefined) || (path == "")) 
        var pageUrl = "frmTenderPopup.aspx?ControlName=" + oControlName  + "&SubmitParent=" + SubmitParent;					
        window.open(pageUrl,'NEW_TENDER_WIND',pageProperty);        
    return false;
        
}
// call on keypress restrict special char
function CheckAlphaWithSpacialChar(obj)
			{
			var InputLength = obj.value.length;
		if(parseInt(InputLength) == 0)
		{
		if((event.keyCode > 47 && event.keyCode < 58)||(event.keyCode > 96 && event.keyCode < 123)||(event.keyCode > 64 && event.keyCode < 91))
		{
		
		event.returnValue = true;
		}
		else
		{
		return false;
		}
		}
				
		if((event.keyCode > 44 && event.keyCode < 58)||(event.keyCode > 96 && event.keyCode < 123)||(event.keyCode > 64 && event.keyCode < 91)||(event.keyCode==32)||(event.keyCode==40)||(event.keyCode==41))
		{
				             
		event.returnValue = true;
		}
		else
		{
		event.returnValue = false;
		}
			}	



/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openInvoiceNumberSearch
Argument List	: path 
Purpose			: To get Invoice Number 
Created by		: Ankit Kumar Saxena
Dated			: 22-May-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openInvoiceNumberSearch(path,SubmitId) 
{
    
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    if ((path == undefined) || (path == ""))
        var pageUrl = "../../PMICS/InventoryControl/frmInvoiceNumberPopup.aspx?SubmitId=" + SubmitId;	
    else
         pageUrl = path + "/PMICS/InventoryControl/frmInvoiceNumberPopup.aspx?SubmitId=" + SubmitId;
    window.open(pageUrl,'NEW_INVOICE_WINDOW',pageProperty);  
//  window.opener.submit;      
    return false;
}


	/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openStatusSettingSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected criteria 
Created by		: Nagendra Kumar (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 


function openStatusSettingSearch(firCtrl,submitForm,path)
{
   
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
   
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmProposalSettingDisplay.aspx?firCtrl=" + firCtrl + "&submitForm=" + submitForm ;
  
    else
        var pageUrl = path + "frmProposalSettingDisplay.aspx?firCtrl=" + firCtrl1 +  "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_WIND',pageProperty);
 
    return false;
}




function openStatusSettingSearch1(firCtrl,submitForm,path,dataID)
{
   
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
   
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmProposalSettingDisplay.aspx?firCtrl=" + firCtrl + "&submitForm=" + submitForm + "&dataID=" + dataID;
  
    else
        var pageUrl = path + "frmProposalSettingDisplay.aspx?firCtrl=" + firCtrl + "&submitForm=" + submitForm + "&dataID=" + dataID;
    window.open(pageUrl,'NEW_WIND',pageProperty);
 
    return false;
}




/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openWorkOrderNumberSearch
Argument List	: path 
Purpose			: To get Work Order Number 
Created by		: Ankit Kumar Saxena
Dated			: 29-May-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openWorkOrderNumberSearch(path,SubmitId) 
{
    
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    if ((path == undefined) || (path == ""))
        var pageUrl = "../../PMICS/InventoryControl/frmWorkOrderItemPopUp.aspx?SubmitId=" + SubmitId; 		
    else
         pageUrl = path + "/PMICS/InventoryControl/frmWorkOrderItemPopUp.aspx?SubmitId=" + SubmitId;	
    window.open(pageUrl,'NEW_INVOICE_WINDOW',pageProperty);  
    
  //window.opener.submit;      
    return false;
}

	/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openDiversionOrderMcnPopUpSearch
Argument List	: firCtrl, fileCtrl, submitForm, path
Purpose			: To get Member Id and Member Name according to the selected criteria 
Created by		: Nagendra Kumar (HCL Technologies Ltd.)
Dated			: 28-Feb-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 


function openDiversionOrderMcnPopUpSearch(firCtrl,fileCtrl12,OrderCtrl,fileCtr2,fileCtr3,fileCtr4,fileCtr5,submitForm,path)
{
   
    var pageProperty ="left=50,top=50,width=700,height=500,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";
   
    if ((path == undefined) || (path == ""))
        var pageUrl = "frmDiversionOrderOrMcnPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl12=" + fileCtrl12 +  "&OrderCtrl=" + OrderCtrl + "&fileCtr2=" + fileCtr2 + "&fileCtr3=" + fileCtr3 + "&fileCtr4=" + fileCtr4 + "&fileCtr5=" + fileCtr5 +  "&submitForm=" + submitForm ;
  
    else
       var pageUrl = "frmDiversionOrderOrMcnPopUp.aspx?firCtrl=" + firCtrl + "&fileCtrl12=" + fileCtrl12 +  "&OrderCtrl=" + OrderCtrl + "&fileCtr2=" + fileCtr2 + "&fileCtr3=" + fileCtr3 + "&fileCtr4=" + fileCtr4 + "&fileCtr5=" + fileCtr5 +  "&submitForm=" + submitForm ;
    window.open(pageUrl,'NEW_WIND',pageProperty);
 
    return false;
}
    

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openInwardRegisterNumberSearch
Argument List	: path 
Purpose			: To get Inward Register Number 
Created by		: Ankit Kumar Saxena
Dated			: 1-June-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openInwardRegisterNumberSearch(path,SubmitId,ReceiptType) 
{
    
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    if ((path == undefined) || (path == ""))
        var pageUrl = "../../PMICS/InventoryControl/frmInwardRegisterPopUp.aspx?SubmitId=" + SubmitId + "&hdnReceiptType=" + ReceiptType;
    else
         pageUrl = path + "/PMICS/InventoryControl/frmInwardRegisterPopUp.aspx?SubmitId=" + SubmitId + "&hdnReceiptType=" + ReceiptType;
    window.open(pageUrl,'NEW_INVOICE_WINDOW',pageProperty);  
//  window.opener.submit;      
    return false;
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openEmpLoyeePopUpSearch
Argument List	: path 
Purpose			: To get Invoice Number 
Created by		: Ankit Kumar Saxena
Dated			: 22-May-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openEmpLoyeePopUpSearch(path,SubmitId) 
{
    
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    if ((path == undefined) || (path == ""))
        var pageUrl = "../../PMICS/MaterialProcurement/frmEmployeePopUp.aspx?SubmitId=" + SubmitId;	
    else
         pageUrl = path + "/PMICS/MaterialProcurement/frmEmployeePopUp.aspx?SubmitId=" + SubmitId;
    window.open(pageUrl,'NEW_INVOICE_WINDOW',pageProperty);  
//  window.opener.submit;      
    return false;
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function name	: openPPOSearch
Argument List	: hdnPPOID:Hidden field to fil the PPO Code,txtPPONo:text field to fill the PPO No.,path of the form
Purpose			: To get PPO No.
Created by		: Ankit Kumar Garg
Dated			: 06-June-2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/	 

function openPPOSearch(hdnPPOID,txtPPONo,path) 
{    
    var pageProperty ="left=50,top=50,width=800,height=600,menubar=0,toolbar=0,statusbar=0,scrollbars=1,resizable=1";   
    if ((path == undefined) || (path == ""))
        var pageUrl = "../../FAMS/PFAndPension/frmFAPFPPONoSearchPOPup.aspx?hdnControl=" + hdnPPOID + "&txtPPONo="+ txtPPONo; 		
    else
         pageUrl = path + "/FAMS/PFAndPension/frmFAPFPPONoSearchPOPup.aspx?hdnControl=" + hdnPPOID + "&txtPPONo=" + txtPPONo;	
         
    window.open(pageUrl,'NEW_PPO_WINDOW',pageProperty); 
    return false;
}

