	/*function emailcheck(str) 
	{
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1)
		{
			alert("Invalid email address")
			return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
			alert("Invalid email address")
			return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
			alert("Invalid email address")
			return false
		}
		if (str.indexOf(at,(lat+1))!=-1)
		{
			alert("Invalid email address")
			return false
		}
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		{
			alert("Invalid email address")
			return false	
		}		
		if (str.indexOf(dot,(lat+2))==-1)
		{
			alert("Invalid email address")
			return false
		}
		if (str.indexOf(" ")!=-1)
		{
			alert("Invalid email address")
			return false
		}
		return true
		}*/
		
		
		function checkEmail(str) 
		{
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str))
			{
				return (true)
			}
			//alert("Invalid E-mail Address! Please re-enter.")
			return (false)
		}		
		
		
		function Email_Check(strEmail)
		{
			var idotcnt, iatcnt, j;
			idotcnt = 0;
			iatcnt = 0;
			if (strEmail.indexOf(' ') != -1)
				return false;
			var i = 1;
			var sLength = strEmail.length;
			
			if ((strEmail.indexOf("@") <= 0) || (strEmail.indexOf(".") <= 0) || ((strEmail.indexOf(".") - strEmail.indexOf("@")) <= 1) || ((strEmail.length - strEmail.lastIndexOf(".")) <= 2) || (strEmail.indexOf("'") != -1) || (strEmail.indexOf("\"") != -1))
				return false;
			else
			{
				for (j = 0; j < sLength; j++)
				{
					if (strEmail.charAt(j) == ".")
						idotcnt += 1;
			
					if (strEmail.charAt(j) == "@")
						iatcnt += 1;
				}
		
				if (idotcnt >= 1 && iatcnt == 1)
					return true;
				else
					return false;
			}
		}	
			
		function CharacterCheck(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='A' && c<='Z') || (c>='a' && c<='z') || (c>='0' && c<='9') || (c==" ") || (c=="-")))
					return false;
			}
			return true;
		}
		
		function Character(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='A' && c<='Z') || (c>='a' && c<='z')  || (c==" ") ))
					return false;
			}
			return true;
		}
		
		function Langauges(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='A' && c<='Z') || (c>='a' && c<='z')  || (c==" ") || (c==",") ))
					return false;
			}
			return true;
		}
		
		
		function Number_Check(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='0' && c<='9')))
					return false;
			}
			return true;
		}
		
		function SPNumber_Check(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='0' && c<='9') || (c=="+") ||(c == ',' )))
					return false;
			}
			return true;
		}
		
		function PNumber_Check(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='0' && c<='9')|| (c=="+") ))
					return false;
			}
			return true;
		}
		
		function Numeric_Check(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='0' && c<='9') || (c==".")))
					return false;
			}
			return true;
		}
		
		function Pincode_Check(strCharacter)
		{
			for (k=0;k<strCharacter.length;k++)
			{
				c = strCharacter.charAt(k);
				if (!((c>='0' && c<='9') || (c == " ")))
					return false;
			}
			return true;
		}
		
		function Time_Check(strCharacter)
		{
		
			if (strCharacter.length != 5)
			{return false;}
			
			var part=strCharacter.split(".");
			//alert(part[0] + "----" +part[1]);
			
			
			if (part[0] >24 )
				{ return false;}
			else if (part[1] > 59 )
				{return false;}
			else if (part[0] ==24 && part[1] >1 )
				{return false;}
			else
				{return true}
				
					
		}	
		
		function FOpen(strFile)
		{
		    window.open(strFile,"sample","width=500 ,height=435 ,toolbar=0,status=0,scrollbars=1,top=200,left=250"); 				
		   
		}
		
		function ExpOpen(strFile)
		{
		    window.open(strFile,"sample","width=700 ,height=435 ,toolbar=0,status=0,scrollbars=1,top=200,left=250"); 				
		   
		}
		
		
				
		function NavigatePage(strFile)
		{
			window.location.href = strFile;
		}
		
				
		function ChangeTextDecoration(ctlName)
		{
			document.getElementById(ctlName).style.textDecoration = "underline";
		}
		
		function GetBackTextDecoration(ctlName)
		{
			document.getElementById(ctlName).style.textDecoration = "none";
		}
		
		function ChangeRowColor()
		{
			if (this.style.backgroundColor == "#99ccff")
				this.style.backgroundColor == "white"
			else
				this.style.backgroundColor == "#99ccff"	
		}
		
			function GotoPage(pageName,navType)
			{
				if ((document.getElementById("txtGoto").value == "") || (document.getElementById("txtGoto").value == 0))
				{
					alert("Please enter the page number");
					document.getElementById("txtGoto").focus();
				}
				else if ( document.getElementById("txtGoto").value > document.getElementById("hidTotalIndexes").value)
				{
					alert("Page number should not exceed " + document.getElementById("hidTotalIndexes").value);
					document.getElementById("txtGoto").focus();
				}
				else if (document.getElementById("txtGoto").value < 0)
				{
					alert("Page number should not contain negative values");
					document.getElementById("txtGoto").focus();
				}
				else if (! Number_Check(document.getElementById("txtGoto").value))
				{
					alert("Please enter valid page no.");
					document.getElementById("txtGoto").focus();
				}
				else
				{	
					if (navType == "2")			
						window.location.href = pageName + ".aspx?CID="+ document.getElementById("hidCID").value +"&PNo=" + document.getElementById("txtGoto").value;
					else
						window.location.href = pageName + ".aspx?PNo=" + document.getElementById("txtGoto").value;
				}
			}
			
			function GoPage(pageName)
			{
				if ((document.getElementById("txtGoto").value == "") || (document.getElementById("txtGoto").value == 0))
				{
					alert("Please enter the page number");
					document.getElementById("txtGoto").focus();
				}
				else if (! Number_Check(document.getElementById("txtGoto").value))
				{
					alert("Please enter valid page no.");
					document.getElementById("txtGoto").focus();
				}
				else if ( document.getElementById("txtGoto").value > document.getElementById("hidTotalIndexes").value)
				{
					alert("Page number should not exceed " + document.getElementById("hidTotalIndexes").value);
					document.getElementById("txtGoto").focus();
				}
				else if (document.getElementById("txtGoto").value < 0)
				{
					alert("Page number should not contain negative values");
					document.getElementById("txtGoto").focus();
				}
				
				else
				{	
					
					window.location.href = pageName + ".aspx?PNo=" + document.getElementById("txtGoto").value;
				}
			}
			
			function Go(pageName)
			{
				if ((document.getElementById("txtGoto").value == "") || (document.getElementById("txtGoto").value == 0))
				{
					alert("Please enter the page number");
					document.getElementById("txtGoto").focus();
				}
				else if (document.getElementById("txtGoto").value < 0)
				{
					alert("Page number should not contain negative values");
					document.getElementById("txtGoto").focus();
				}
				else if (! Number_Check(document.getElementById("txtGoto").value))
				{
					alert("Please enter valid page no.");
					document.getElementById("txtGoto").focus();
				}
				else if (parseInt(document.getElementById("txtGoto").value) > parseInt(document.getElementById("hidTotalIndexes").value) )
				{
					alert("Page number should not exceed " + document.getElementById("hidTotalIndexes").value );
					document.getElementById("txtGoto").focus();
				}
				else
				{	
					
					window.location.href = pageName + ".aspx?Type="+ document.getElementById("hidType").value + "&PNo=" + document.getElementById("txtGoto").value;
				}
			}
