		function checkFileType() 
		{
				var ext = document.f.pic.value;
				ext			= ext.substring(ext.length-3,ext.length);
				ext			= ext.toLowerCase();
				if((ext != 'jpg') || (ext != 'gif'))
				 {
					alert('You selected a .' + ext +	' file; please select a .jpg file instead!');
					return false;
				 }
				else
					return true; 
		}
/*
			function validate()
			{
				if (!checkMaxCheckbox(chkBox,2))
					{
								alert('Select two check box');
								return false;
					}
				if (!checkMaxCheckbox(CheckBoxList1,3))
					{
								alert('Select three check box');
								return false;
					}
				return true;
			}
*/		

/*  Check box section   */
			/* -- To check on the check box in control list */	
			function chk_Max(csID, inTotCount, inMaxSelected)
			{ 
				var inCtr; var inCheckMaxCtr = 0;
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csID + inCtr;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr > inMaxSelected)
						{
						alert("You may not select more then "  + inMaxSelected + " number. ");
						return false;
						}
				} 
				return true;
			}

			/*  set single radio to be selected */
			function Set_Single_Radio(csRadioButtonID, csSelectedRadioButtonID, inTotCount)
			{
				var inCtr;
				if (inTotCount > 0)
				{
					for (inCtr=1; inCtr <= inTotCount; inCtr++)
						{ 
							var csCreateRadioButtonID = csRadioButtonID + inCtr;
							if (csCreateRadioButtonID==csSelectedRadioButtonID)
							{
								document.getElementById(csCreateRadioButtonID).checked=true;	
							}
							else
							{
								document.getElementById(csCreateRadioButtonID).checked=false;	
							}
						}
				} 
			}


			/* -- To check on the check box / radio button in control list */	
			function chk_OnCtrl_Max(csParentID, csID, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csParentID + "__ctl" + inCtr + "_" + csID;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr > inMaxSelected)
						{
						alert("You may not select more then "  + inMaxSelected + " number. ");
						return false;
						}
				} 
				return true;
			}


			/* -- To check on the check box / radio button in control list, from start point in list can be different */	
			function chk_OnCtrl_Max_WithStart(csParentID, csID, inStartCount, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				
				if (inTotCount > 0)
				{
					for (inCtr=inStartCount; inCtr < inTotCount + inStartCount - 1; inCtr++)
						{ 
							var csCreatedID = csParentID + "__ctl" + inCtr + "_" + csID;
							alert(csCreatedID);
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr > inMaxSelected)
						{
						alert("You may not select more then "  + inMaxSelected + " number. ");
						return false;
						}
				} 
				return true;
			}

			/* -- On the check box Button list */	
			function chkList_Max(csListCheckBoxID, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreateCheckBoxID = csListCheckBoxID + "_" + inCtr
							if(window.document.getElementById(csCreateCheckBoxID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr > inMaxSelected)
						{
						alert("You may not select more then "  + inMaxSelected + " number. ");
						return false;
						}
				} 
				return true;
			}

			/* -- To check checkbox in control on the button */
			function chk_OnCtrl_Min_OnBtn_WithStart(csParentID, csID, inStartCount, inTotCount, inMinSelected)
			{
				var inCtr;
				var inCheckMinCtr = 0;
				
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csParentID + "__ctl" + (inStartCount + inCtr) + "_" + csID;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMinCtr	= inCheckMinCtr + 1;
							}
						}
						if(inCheckMinCtr < inMinSelected) return false;
				return true;
			}

			/* -- To check checkbox in control on the button */
			function chk_OnCtrl_Max_OnBtn(csParentID, csID, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csParentID + "__ctl" + inCtr + "_" + csID;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr != inMaxSelected) return false;
				} 
				return true;
			}


			/* -- To check checkbox in control on the button where parent itself is check box.*/
			function chk_WithPrnt_OnCtrl_Max_OnBtn(csParentChkID, csParentID, csCheckBoxID, inTotCount, inMaxSelected)
			{
				if (window.document.getElementById(csParentChkID).checked==true)
				{
						var inCtr;
						var inCheckMaxCtr = 0;
						
						if (inTotCount > 0)
						{
							for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
								{ 
									var csCreateCheckBoxID = csParentID + "__ctl" + inCtr + "_" + csCheckBoxID;
									if(window.document.getElementById(csCreateCheckBoxID).checked==true)
									{
										inCheckMaxCtr	= inCheckMaxCtr + 1;
									}
								}
								if(inCheckMaxCtr != inMaxSelected) return false;
						}
				} 
				return true;
			}

			/* -- To check checkbox in control on the button where parent itself is check box.*/
			function chk_WithGprnt_WithPrnt_OnCtrl_Max_OnBtn(csGrandParentChkID, csParentChkID, csParentID, csCheckBoxID, inTotCount, inMaxSelected)
			{
				if (window.document.getElementById(csGrandParentChkID).checked==true)
				{
					if (window.document.getElementById(csParentChkID).checked==true)
					{
							var inCtr;
							var inCheckMaxCtr = 0;
							
							if (inTotCount > 0)
							{
								for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
									{ 
										var csCreateCheckBoxID = csParentID + "__ctl" + inCtr + "_" + csCheckBoxID;
										if(window.document.getElementById(csCreateCheckBoxID).checked==true)
										{
											inCheckMaxCtr	= inCheckMaxCtr + 1;
										}
									}
									if(inCheckMaxCtr != inMaxSelected) return false;
							}
					}
				} 
				return true;
			}

			/* -- Checkbox List / Radio Button List on the button */
			function chkList_Max_OnBtn(csListID, inTotCount, inMaxSelected)
			{
				var inCtr;
				var inCheckMaxCtr = 0;
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
						{ 
							var csCreatedID = csListID + "_" + inCtr;
							if(window.document.getElementById(csCreatedID).checked==true)
							{
								inCheckMaxCtr	= inCheckMaxCtr + 1;
							}
						}
						if(inCheckMaxCtr != inMaxSelected) return false;
				} 
				return true;
			}

			/* -- Checkbox List on the button  with parent need to be checked.*/
			function chkList_WithPrnt_Max_OnBtn(csParentChkID, csListCheckBoxID, inTotCount, inMaxSelected)
			{
				if (window.document.getElementById(csParentChkID).checked==true)
				{
						var inCtr;
						var inCheckMaxCtr = 0;
						
						if (inTotCount > 0)
						{
							for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
								{ 
									var csCreateCheckBoxID = csListCheckBoxID + "_" + inCtr;
									if(window.document.getElementById(csCreateCheckBoxID).checked==true)
									{
										inCheckMaxCtr	= inCheckMaxCtr + 1;
									}
								}
								if(inCheckMaxCtr != inMaxSelected) return false;
						}
				} 
				return true;
			}

			function chkList_WithGprnt_WithPrnt_Max_OnBtn(csGrandParentChkID, csParentChkID, csListCheckBoxID, inTotCount, inMaxSelected)
			{
				if (window.document.getElementById(csGrandParentChkID).checked==true)
				{
					if (window.document.getElementById(csParentChkID).checked==true)
					{
							var inCtr;
							var inCheckMaxCtr = 0;
							
							if (inTotCount > 0)
							{
								for (inCtr=0; inCtr <= inTotCount - 1; inCtr++)
									{ 
										var csCreateCheckBoxID = csListCheckBoxID + "_" + inCtr;
										if(window.document.getElementById(csCreateCheckBoxID).checked==true)
										{
											inCheckMaxCtr	= inCheckMaxCtr + 1;
										}
									}
									if(inCheckMaxCtr != inMaxSelected) return false;
							}
					}
				} 
				return true;
			}
			

/*  Radio Button section   */
			/*  set single radio in control to be selected */
			function Set_Single_Radio_OnCtrl(csParentID, csRadioButtonID, csSelectedRadioButtonID, inTotCount)
			{ 
				var inCtr; 
				if (inTotCount > 0)
				{
					for (inCtr=0; inCtr <= inTotCount-1; inCtr++)
						{ 
							var csCreatedID = csParentID + "__ctl" + inCtr + "_" + csRadioButtonID;
							if (csCreatedID==csSelectedRadioButtonID)
							{
								document.getElementById(csCreatedID).checked=true;	
							}
							else
							{
								document.getElementById(csCreatedID).checked=false;	
							}
						}
				} 
			}

/* -- To check Drop Down on the button */	
			function chk_DropDown_OnButton(cmbName)	{var cmbObject = window.document.getElementById(cmbName); if((cmbObject.selectedIndex) == -1) {return false;} return true; }
			
			

/*  Radio Button section   */
	function chk_Required(csID, csDispName)
	{ 
		var bt = document.getElementById(csID);
		if (bt != null)
		{
			if (typeof bt == 'object')
			{
				if (bt.value != "") return true;
			}
		}
		alert(csDispName + " is required!");
		return false;
	}

