function hasValidChars(str,fieldName)
{
	str = str.toLowerCase();
	var code;
	var tmpArray = str.split("");

	for(var i=0;i<tmpArray.length;i++)
	{
		/* 97-122 small abcd , 30-39 numbers, 45,95 = -,_ 
		if(!((code>=97&&code<=122)||(code>=48&&code<=58)||code==45||code==95||code==32||code==44||code==46))
			return false;
		*/
		code = tmpArray[i].charCodeAt(0);
		if(code==33||code==35||code==36||code==37||code==42||code==64||code==94)
		{
			alert('The following characters are not permitted for '+fieldName+'\n!,@,$,%,^,*');		
			return false;
		}
	}
	
	return true;
}

function checkExtension(fileName,index)
{
	if(fileName.length<=0)
		return;
	var tmpArray = fileName.split(".");
	if(tmpArray.length>2)
	{
		alert('The file has invalid extension(s)');
		return false;
	}
	
	var ext = tmpArray[1].toLowerCase();
	if(index==1)
	{
		switch(ext)
		{
			case 'jpg':
			case 'jpeg':
			case 'gif':
			case 'png':
				break;
			default:
				alert('You can upload files with the following extensions only:\n[1] .jpg\n[1] .jpeg\n[1] .gif\n[1] .png');
				return false;
				break;
		}
	}
	else if(index==2)
	{
		switch(ext)
		{
			case 'pdf':
			case 'doc':
			case 'txt':
			case 'rtf':
				break;
			default:
				alert('You can upload files with the following extensions only:\n[1] .pdf\n[1] .doc\n[1] .txt\n[1] .rtf');
				return false;
				break;
		}
	}
	
	return true;
}

function echeck(email)
{
	var retValue = false;
	var tmpArray = email.split("@");
	if(tmpArray.length==2)
	{
		var tmpArray1 = tmpArray[1].split(".");
		if(tmpArray1.length==2)
		{
			retValue = true;
		}
	}
	
	return retValue;
}

function checkphone(field,fieldType)
{
	return true;
}