function valid(txtvalue,txt)
{
var val=true;
var i;
var j;

tvalue=txtvalue;
//alert(txt);
//{"<", ">", "\'", "'", "}", "{", "]", "[", "%", "&", "#", "@", "$", ";", ":", "\", "|", "(", ")", "+", ",", "*"}
var arr=new Array("<",">","\\","'","}","{","]","[","%","&","#","@","$",";",":","\\","(",")","\'","\"","*",",","+","|");
tcount=tvalue.length;
acount=arr.length;
//alert(tcount);
//alert(acount);
for(i=0;i<=tcount-1;i++)
{
	for(j=0;j<=acount-1;j++)
	{
	//alert(arr[j]+"tvalue<br>"+tvalue.charAt(i));
		if(arr[j]==tvalue.charAt(i))
		{
		//alert(arr[j]);
		val=false;
		alert("Invalid Characters found");
		
		txt.value="";
		txt.focus();
		txt.select();
			return false;
		}
		else
		{
		val=true;
		}
	}
}
return true;
}
function valid_c(txtvalue,txt)
{
var val=true;
var i;
var j;

tvalue=txtvalue;
//alert(txt);
//{"<", ">", "\'", "'", "}", "{", "]", "[", "%", "&", "#", "@", "$", ";", ":", "\", "|", "(", ")", "+", ",", "*"}
var arr=new Array("<",">","\\","'","}","{","]","[","%","&","#","@","$",";",":","\\","(",")","\'","\"","*","+","|");
tcount=tvalue.length;
acount=arr.length;
//alert(tcount);
//alert(acount);
for(i=0;i<=tcount-1;i++)
{
	for(j=0;j<=acount-1;j++)
	{
	//alert(arr[j]+"tvalue<br>"+tvalue.charAt(i));
		if(arr[j]==tvalue.charAt(i))
		{
		//alert(arr[j]);
		val=false;
		alert("Invalid Characters found");
		
		txt.value="";
		txt.focus();
		txt.select();
			return false;
		}
		else
		{
		val=true;
		}
	}
}
return true;
}
//''''''''''''''''''''Email'''''''''''''
function Emailvalid(txtvalue,txt)
{
var val=true;
var i;
var j;

tvalue=txtvalue;
//alert(txt);
//{"<", ">", "\'", "'", "}", "{", "]", "[", "%", "&", "#", "@", "$", ";", ":", "\", "|", "(", ")", "+", ",", "*"}
var arr=new Array("<",">","\\","'","}","{","]","[","%","&","#","@","$",";",":","\\","(",")","\'","\"","*",",","+","|");
tcount=tvalue.length;
acount=arr.length;
//alert(tcount);
//alert(acount);
for(i=0;i<=tcount-1;i++)
{
	for(j=0;j<=acount-1;j++)
	{
	//alert(arr[j]+"tvalue<br>"+tvalue.charAt(i));
		if(arr[j]==tvalue.charAt(i))
		{
		//alert(arr[j]);
		val=false;
		alert("Invalid Characters found");
		
		txt.value="";
		txt.focus();
		txt.select();
			return false;
		}
		else
		{
		val=true;
		}
	}
}
return true;
}
function alertmesg()
{
if(val==false)
{
		alert("Invalid Characters found");
		return false;

}
return true;
}
function checkUpdate(btnName)
{
	if(btnName=="Update")
	{
	//alert(btnName);
	document.getElementById('txtUpdate').value="update";
	}
	else
	{
	document.getElementById('txtUpdate').value="";
	}
	
}
function chkFileType()
{
//alert(document.getElementById('myfile').value.lastIndexOf(".txt"));
if(document.getElementById('myfile').value=="")
{
alert("Please Upload a File...");
return false;
}
else if((document.getElementById('myfile').value.lastIndexOf(".txt"))==-1)
 {
	document.getElementById('myfile').value=" ";
   alert("Please check the file type");
   return false;
}
else
return true;
}

