// ------------------------------------- Standard Input -------------------------------------------------
// textBox Name = txt.......
// ComboBox Name = cmb.........
// DateText Box Name = Dt.....1       For Day
// DateText Box Name = Dt.....2       For Month
// DateText Box Name = Dt.....3       For Year
// Pass id as Per your Data eg. as follows.
// For String = S
// For Numeric = N
// For Date = D  and also pass CommonID = DMY.
// For ComboBox = Combo
// For MultiCombo = ComboMultiple
// For Email = E
// keep span name stadard.. eg.IF textBox name=txtclient then span name has to be client.
// call on OnBlur-Event CheckValid(vCtrl).
//--------------------------------------------------------------------------------------------------------

	function UCase(vCtrl)
	{
		vCtrl.value=vCtrl.value.toUpperCase();	
	}

	function d2h(dec) 
	{ 
	       return dec.toString(16);
	}
	
	function h2d(hex) 
	{ 
	       return parseInt(hex,16);
	}
	
	function fnSetAttributevalue(vAttributeName,vValue)
	{
		if(typeof vAttributeName=="string")
		{
			vAttributeName = document.getElementById(vAttributeName);
		}
	
		vAttributeName.setAttribute("validateid",vValue);
	}
	
	function fn_ConvertRgbToHexadecimal(vCtrl)
	{
		var vHexaDecimalCode;
		if(vCtrl.style.color.indexOf('rgb')!=-1)
			vHexaDecimalCode="#"+d2h(parseInt(vCtrl.style.color.substring(4,7)))+d2h(parseInt(vCtrl.style.color.substring(9,12)))+d2h(parseInt(vCtrl.style.color.substring(14,17)));
		else
			vHexaDecimalCode=vCtrl.style.color;
		return vHexaDecimalCode;
	}
	
	function ClearCode(vCtrl)
	{
		var vColorCode;
		vColorCode = fn_ConvertRgbToHexadecimal(vCtrl);
		if(vColorCode=="#cccccc")
		{
			vCtrl.style.color="";
			vCtrl.value="";
			vCtrl.focus()
		}
		else
		{
			vCtrl.focus()
		}
	}
	
	function CheckValid(vCtrl,vMsg)
	{
		if(typeof vCtrl=="string")
		{
			vCtrl = document.getElementById(vCtrl);
		}
		//alert(vCtrl.name);
		//try
		//{
			if(vCtrl.getAttribute("validateid")=="N")
			{
				if(!vMsg)
					vMsg="Enter Valid Numeric Value.";
				if(vCtrl.value==""||vCtrl.value=="undefined")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}	
				if(vCtrl.value=="0")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(isNaN(vCtrl.value))
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(vCtrl.value.substr(0,1)==" ")
				{
					ShowError(vCtrl.id,"Blank Spaces are Not Allowed.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;
			}	
			else if(vCtrl.getAttribute("validateid")=="Pincode")
			{
				if(!vMsg)
					vMsg="Enter Valid Numeric Value.";
				if(vCtrl.value==""||vCtrl.value=="undefined")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}	
				if(vCtrl.value=="0")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(isNaN(vCtrl.value))
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(vCtrl.value.substr(0,1)==" ")
				{
					ShowError(vCtrl.id,"Blank Spaces are Not Allowed.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(vCtrl.value.length<6)
				{
					ShowError(vCtrl.id,"Pincode number has to be six digit long.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;
			}	
			else if(vCtrl.getAttribute("validateid")=="S")
			{
				if(!vMsg)
					vMsg="Enter Valid String Value.";
				if(vCtrl.value==""||vCtrl.value=="undefined")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if(vCtrl.value.substr(0,1)==" ")
				{
					ShowError(vCtrl.id,"Blank Spaces are Not Allowed.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;		
			}
			else if(vCtrl.getAttribute("validateid")=="E")
			{
				if(!vMsg)
					vMsg="Enter Valid EmailID.";
				if(vCtrl.value==""||vCtrl.value=="undefined")
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(vCtrl.value)==false)
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;		
			}
			else if(vCtrl.getAttribute("validateid")=="DMY")
			{
				var vDateVariable=CombineTextboxForDate(vCtrl,"valid");
				if(vDateVariable==false)
					return false;
			    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))))$/;
			    if ((vDateVariable.match(RegExPattern)) && (vCtrl.value!='')) 
			    {
					ClearSpan(vCtrl.id);
			        return true;
			    }
			    else 
			    {
					if(!vMsg)
						vMsg="Enter Proper Date";
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
			    } 
			}
			else if(vCtrl.getAttribute("validateid")=="CMB")
			{
				if(!vMsg)
					vMsg="Select Any Value.";
				if(vCtrl.value.toLowerCase()=="select"||vCtrl.value=="")			
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;		
			}
			else if(vCtrl.getAttribute("validateid")=="CMBMultiple")
			{
				if(!vMsg)
					vMsg="Select Any Value.";
				if(vCtrl.value=="")			
				{
					ShowError(vCtrl.id,vMsg);
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				else if(vCtrl.value!="")
				{
					var vVal=FindMultipleSelectedValue(vCtrl);
					vVal=vVal.toLowerCase();
					if(vVal.indexOf(",")!=-1 && vVal.indexOf("all")!=-1)
					{
						ShowError(vCtrl.id,"Select Either All or remaining values.");
						document.getElementById(vCtrl.id).focus();
						return false;
					}
				}
				ClearSpan(vCtrl.id);
				return true;		
			}
			else if(vCtrl.getAttribute("validateid")=="CMBMultipleCHK")
			{
				var vVal=0;
				var vFlag=false;
				if(document.getElementById("chkControlArray1").value.toLowerCase()=="all")
				{
					if(document.getElementById("chkControlArray1").checked==true)
					{
						vFlag=true;
					}
				}
				var vControlID=document.getElementById(vCtrl.id).getElementsByTagName("input");
				for (i=0;i<vControlID.length-1;i++)
				{
					if(vControlID[i].type.toLowerCase()=="checkbox")
					{
						if(vControlID[i].checked==true)
							vVal=vVal+1;
					}		
				}
				if(vFlag==true && vControlID.length-1!=vVal)
				{
					ShowError(vCtrl.id,"You have selected All option but all check boxes are not checked.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				else if(vVal==0)
				{
					ShowError(vCtrl.id,"Please check atleast one check box.");
					document.getElementById(vCtrl.id).focus();
					return false;
				}
				ClearSpan(vCtrl.id);
				return true;		
			}
		//}
		//catch(e)
		//{
		//	alert(e.name+" : "+ e.message);
		//	return false;
		//}	
	}

	function CheckValidX(vCtrl)
	{
		if(typeof vCtrl=="string")
		{
			vCtrl = document.getElementById(vCtrl);
		}

		//try
		//{
			if(vCtrl.getAttribute("validateid")=="N")
			{
				if(vCtrl.value==""||vCtrl.value=="undefined")
					return false;
				if(vCtrl.value=="0")
					return false;
				if(isNaN(vCtrl.value))
					return false;
				if(vCtrl.value.substr(0,1)==" ")
					return false;
				ClearSpan(vCtrl.id);
				return true;
			}	
			else if(vCtrl.getAttribute("validateid")=="S")
			{
				if(vCtrl.value==""||vCtrl.value=="undefined")
					return false;
				if(vCtrl.value.substr(0,1)==" ")
					return false;
				ClearSpan(vCtrl.id);
				return true;
			}
			else if(vCtrl.getAttribute("validateid")=="E")
			{
				if(vCtrl.value==""||vCtrl.value=="undefined")
					return false;
				if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(vCtrl.value)==false)
					return false;
				ClearSpan(vCtrl.id);
				return true;
			}
			else if(vCtrl.getAttribute("validateid")=="DMY")
			{
				var vDateVariable=CombineTextboxForDate(vCtrl,"validx");
				//alert(vDateVariable);
				if(vDateVariable==false)
					return false;
			    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))))$/;
 				if ((vDateVariable.match(RegExPattern)) && (vCtrl.value!='')) 
			    {
					ClearSpan(vCtrl.id);
			        return true;
			    }
			}
			else if(vCtrl.getAttribute("validateid")=="CMB")
			{
				if(vCtrl.value.toLowerCase()=="select"||vCtrl.value=="")			
					return false;
				ClearSpan(vCtrl.id);
				return true;
			}
			else if(vCtrl.getAttribute("validateid")=="CMBMultiple")
			{
				if(vCtrl.value=="")			
					return false;
				else if(vCtrl.value!="")
				{
					var vVal=FindMultipleSelectedValue(vCtrl);
					if(vVal.indexOf(",")!=-1 && vVal.indexOf("all")!=-1)
						return false;
				}
				ClearSpan(vCtrl.id);
				return true;
			}
			else if(vCtrl.getAttribute("validateid")=="CMBMultipleCHK")
			{
				var vVal=0;
				var vFlag=false;
				if(document.getElementById("chkControlArray1").value.toLowerCase()=="all")
				{
					if(document.getElementById("chkControlArray1").checked==true)
						vFlag=true;
				}
				var vControlID=document.getElementById(vCtrl.id).getElementsByTagName("input");
				for (i=0;i<vControlID.length-1;i++)
				{
					if(vControlID[i].type.toLowerCase()=="checkbox")
					{
						if(vControlID[i].checked==true)
							vVal=vVal+1;
					}		
				}
				if(vFlag==true && vControlID.length-1!=vVal)
					return false;
				else if(vVal==0)
					return false;
				ClearSpan(vCtrl.id);
				return true;
			}
		//}
		//catch(e)
		//{
		//	alert(e.name+" : "+ e.message);
		//	return false;
		//}	
	}
	
	/*function ShowErrorX(vID,vErr)
	{
		ClearSpan(vID);
		var vTbl="<table id='div"+vID+"' border=1 style=\"border-collapse:collapse;\" bordercolor=red><tr><td bgcolor=red><font size=1px color=white face=Verdana><b>ERROR</b></font></td><td><font face=Verdana size=1px color=red>"+vErr+"</font></td></tr></table>";
		document.getElementById(vID).parentNode.innerHTML=document.getElementById(vID).parentNode.innerHTML+vTbl;
	}*/
	function ShowError(vID,vErr)
	{
		ClearSpan(vID);
		var Obj=document.getElementById("div"+vID);
		if(Obj!=null)
			return;
			
		var vOuterTbl = document.createElement("table");
		var vtblBody = document.createElement("tbody");
		
		vOuterTbl.id="div"+vID;
		vOuterTbl.border="1";
		vOuterTbl.style.borderCollapse="collapse";

		var vtr=document.createElement('tr');
		vtr.id="VALIDATIONSPAN";
		var vtd=document.createElement('td');
		vtd.style.border="thin red solid";
		vtd.style.color="white";
		vtd.align="center";
		vtd.style.backgroundColor="red";
		vtd.style.fontFamily="verdana";	
		vtd.style.fontSize="9px";
		vtd.style.fontWeight="bold";		
		vtd.innerHTML="MESSAGE";
		vtr.appendChild(vtd); 						
				
		var vtd1=document.createElement('td');
		vtd1.style.border="thin red solid";
		vtd1.style.color="red";
		vtd1.align="center";
		vtd1.style.fontFamily="verdana";	
		vtd1.style.fontSize="9px";
		vtd1.innerHTML=vErr;
		vtr.appendChild(vtd1); 						
		
		vtblBody.appendChild(vtr); 						
		vOuterTbl.appendChild(vtblBody);						
		document.getElementById(vID).parentNode.appendChild(vOuterTbl);
	}

	function ClearSpan(vID)
	{
		if(typeof document.getElementById(vID)!="undefined")
		{
			if(document.getElementById("div"+vID))
				document.getElementById("div"+vID).parentNode.removeChild(document.getElementById("div"+vID));
		}
	}

	/*
	About function :
	vDivID : ID to refer DIV
	vFlagHTML : Flag for Provided vHTML variable is Plain text or tags 
	vHTML : to embed HTML or Plain Text
	vHeight : height of DIV 
	vWidth : Width of DIV
	vTop : Position from top of screen
	vLeft : Position from left of screen
	vBackground : background color
	vBorderStyle : border style provide in this fasion "4px solid #000" ie. "size type color" 
	vDisplay : none or block or inline or ''
	vZIndex : Div priority
	vParentTagID : ID of Parent Tag where this DIV will add 
	*/
	function createDIV(vDivID,vFlagHTML, vHTML, vHeight, vWidth, vTop, vLeft, vBackground, vBorderStyle, vDisplay, vZIndex, vParentTagID)
	{
		var vOuterDiv = document.createElement("div");
		vOuterDiv.setAttribute("id",vDivID);

		if(vHeight)
			vOuterDiv.style.height = vHeight;
		else
			vOuterDiv.style.height = "300px";
		
		if(vWidth)
			vOuterDiv.style.width = vWidth;
		else
			vOuterDiv.style.width = "300px";
		
		vOuterDiv.style.position="absolute";
		
		if(vTop)
			vOuterDiv.style.top = vTop;
		else
			vOuterDiv.style.top = "0px";

		if(vLeft)
			vOuterDiv.style.left = vLeft;
		else
			vOuterDiv.style.left = "0px";
			
		if(vBackground)
			vOuterDiv.style.backgroundColor = vBackground;

		if(vBorderStyle)
			vOuterDiv.style.border = vBorderStyle;
			
		if(vDisplay)
			vOuterDiv.style.display = vDisplay;	
		
		if(vZIndex)
			vOuterDiv.style.zIndex = vZIndex;		

		if(vFlagHTML=="1")
		{
			vOuterDiv.innerHTML=vHTML;
		}	
		else if(vFlagHTML=="0")
		{
			if(document.all)
				vOuterDiv.innerText = vHTML;
			else
				vOuterDiv.textContent = vHTML;
		}
			
		vParentTagID.appendChild(vOuterDiv);	
	}

	function removeElement(vElementID)
	{
		var vC=document.getElementById(vElementID)
		document.body.removeChild(vC);
	}
	
	function findTopPos(obj) 
	{
		var curtop = 0;
		if (obj.offsetParent) 
		{
			do {
			curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
		}
		return curtop;
	}
	
	function findLeftPos(obj) 
	{
		var curleft = 0;
		if (obj.offsetParent) 
		{
			do {
			curleft += obj.offsetLeft;
			} while (obj = obj.offsetParent);
		}
		return curleft;
	}	
	function FindMultipleSelectedValue(vCtrl)
	{
		var strComputer=0,i; 
		for(i=0;i<vCtrl.options.length;i++)
		{ 
			if(vCtrl.options[i].selected)
			{
				if(strComputer=="0")
				{
			        strComputer=vCtrl.options[i].value;
			    }
			    else
			    {
			        strComputer=strComputer+","+vCtrl.options[i].value;
			    }
			}     
		}
		return strComputer;
    } 

	var stripe = function() {
		var vCnt,vCellLength;	
		var tables = document.getElementsByTagName("table");  
		for(var x=0;x!=tables.length;x++)
		{
			if(tables[x].id=="Zebra")
			{
			    var table = tables[x];
			    if (! table) { return; }
				
			    var tbodies = table.getElementsByTagName("tbody");
			    for (var h = 0; h < tbodies.length; h++) 
			    {
					var even = true;
					var trs = tbodies[h].getElementsByTagName("tr");
					for (var i = 0; i < trs.length; i++) 
					{
						//trs[i].onmouseover=function(){
						//  this.className += " ruled"; return false
						//}
						//trs[i].onmouseout=function(){
						//  this.className = this.className.replace("ruled", ""); return false
						//}
						if(trs[i].id!="VALIDATIONSPAN" && trs[i].style.display!='none')
						{
							vCellLength=trs[i].cells.length;
							if(even)
							{
								for(vCnt=0;vCnt<vCellLength;vCnt++)
								{
									trs[i].cells[vCnt].style.backgroundColor="#E9E9E9";
								}
							}
							else if(!even)
							{
								for(vCnt=0;vCnt<vCellLength;vCnt++)
								{
									trs[i].cells[vCnt].style.backgroundColor="";
								}
							} 
							even = !even;
						}
					  //trs[i].className += " even";
				    }
				}
			}
		}
	}

	function CheckString(e)
	{
		var keyid; 
		keyid=CheckKeyEvent(e);
		if(keyid==8||keyid==9||keyid==27||keyid==37||keyid==38||keyid==39||keyid==40||keyid==46)
			return true;
		if(keyid>47&&keyid<58)
			return false;
	}
	function CheckNum(e)
	{
		var keyid; 
		keyid=CheckKeyEvent(e);
		if(keyid==8||keyid==9||keyid==27||keyid==37||keyid==38||keyid==39||keyid==40||keyid==46)
			return true;
		if(keyid<47||keyid>58)
			return false;
	}
	function CheckNumX(e)
	{
		var keyid; 
		keyid=CheckKeyEvent(e);
		if(keyid==8||keyid==9||keyid==27||keyid==37||keyid==38||keyid==39||keyid==40)
			return true;
		if(keyid<47||keyid>58)
			return false;
	}
	function CheckKeyEvent(e)
	{
		if(window.event) 
			return event.keyCode; 
		else if(e.keyCode)		
			return keyid=e.keyCode;
		else
			return keyid=e.which;
	}
	function CheckSpclChar(e)
	{
		var keyid; 
		keyid=CheckKeyEvent(e);
		//alert(keyid);
		if ((keyid>64&&keyid<91) ||(keyid>96&&keyid<123) ||(keyid>47&&keyid<58) ||(keyid==32) ||(keyid==45)||(keyid==8))
			return true;
		else
			return false;
	}
	function CombineTextboxForDate(vCtrl,vStr)
	{
		var vCommonName=vCtrl.name.substr(0,vCtrl.name.length-1);
		var vLastPrefix=vCtrl.name.substr(vCtrl.name.length-1,vCtrl.name.length);
		var vOtherCtrl1,vOtherCtrl2,vOtherCtrl3;
		if(vCtrl.value=='')
		{
			if(vLastPrefix==1)
			{
				vCtrl.style.color='#cccccc';
				vCtrl.value='DD';	
			}
			if(vLastPrefix==2)
			{
				vCtrl.style.color='#cccccc';
				vCtrl.value='MM';
			}
			if(vLastPrefix==3)
			{
				vCtrl.style.color='#cccccc';
				vCtrl.value='YYYY';
			}
		}
		else
		{
			if(vCtrl.value.length=="1" && vLastPrefix!=3)
			{
				vCtrl.value="0"+vCtrl.value;
			}
		}
		
		if(vLastPrefix=="1")
		{
			vOtherCtrl1=vCtrl.value;
			vOtherCtrl2=document.getElementById(vCommonName+"2").value;
			vOtherCtrl3=document.getElementById(vCommonName+"3").value;
			vReg=/(0[1-9]|[12][0-9]|3[01])/;
			if(!vOtherCtrl1.match(vReg))
			{
				if(vStr.toLowerCase()=='valid')
				{
					ShowError(vCtrl.id,"Enter Proper Day");
					return false;
				}
				else
					return false;	
			}
			ClearSpan(vCtrl.id);
		}
		if(vLastPrefix=="2")
		{
			var abc=document.getElementById(vCommonName+"1");
			if(abc!=null)
				vOtherCtrl1=document.getElementById(vCommonName+"1").value;
			else
				vOtherCtrl1 = "01";
			vOtherCtrl2=vCtrl.value;
			vOtherCtrl3=document.getElementById(vCommonName+"3").value;
			vReg=/(0[1-9]|1[012])/;
			if(!vOtherCtrl2.match(vReg))
			{
				if(vStr.toLowerCase()=='valid')
				{
					ShowError(vCtrl.id,"Enter Proper Month");
					return false;
				}
				else
					return false;	
			}
		}
		if(vLastPrefix=="3")
		{
			var abc=document.getElementById(vCommonName+"1");
			if(abc!=null)
				vOtherCtrl1=document.getElementById(vCommonName+"1").value;
			else
				vOtherCtrl1 = "01";
			vOtherCtrl2=document.getElementById(vCommonName+"2").value;
			vOtherCtrl3=vCtrl.value;
			vReg=/(19|20)\d\d/;
			if(!vOtherCtrl3.match(vReg))
			{
				if(vStr.toLowerCase()=='valid')
				{
					ShowError(vCtrl.id,"Enter Proper Year");
					return false;
				}
				else
					return false;	
			}
		}	
		return vOtherCtrl1+"/"+vOtherCtrl2+"/"+vOtherCtrl3;
	}	
	// Removes leading whitespaces
	function LTrim( value ) {
		
		var re = /\s*((\S+\s*)*)/;
		return value.replace(re, "$1");
		
	}
	
	// Removes ending whitespaces
	function RTrim(value) {
		
		var re = /((\s*\S+)*)\s*/;
		return value.replace(re, "$1");
		
	}
	
	// Removes leading and ending whitespaces
	function Trim( value ) {
		
		return LTrim(RTrim(value));
		
	}
	function fnTrim(vVal)
	{
		return vVal.replace(/^\s*([\S\s]*)\b\s*$/, '$1');
	}
	function ReplaceCharStr(x)
	{
		var vReplaceChar;
		if(x.search(" ")>=0)
			vReplaceChar=x.replace(" ","spcspcspc");
		else
			vReplaceChar=x;
		return vReplaceChar;
	}
	function DecodeCharStr(x)
	{
		var DecodeChar;
		if(x.search("spcspcspc")>=0)
			DecodeChar=x.replace("spcspcspc"," ");
		else
			DecodeChar=x;
		return DecodeChar;
	}	

