function feedbackvalidation()
{

	var alertlist="";
	var fcs="";


if(!validateNotEmpty(document.feedback.your_name.value)){alertlist+="Please enter \"Your Name\"\n";fcs+="-your_name";}
	if(validateNotEmpty(document.feedback.your_name.value))
		{
			 if(document.feedback.your_name.value==0)
			{
				alert('"Name" should not have only zeroes');
				document.feedback.your_name.focus();
				return false;
			}
			if(!validateAlpha2(document.feedback.your_name.value))
			{
				alert('Please enter valid "Name"');
				document.getElementById("your_name").focus();
				return false;
			}       
		}

	if(validateNotEmpty(document.feedback.comp_name.value))
		{
			if(!validateOrg(document.feedback.comp_name.value))
			{
				alert("Please enter valid Company Name");
				document.feedback.comp_name.focus();
				return false;
			}
		}
	if(validateNotEmpty(document.feedback.address.value))
		{
			if(!validateAlphaNumeric5(document.feedback.address.value))
			{
				alert("Please enter valid Address");
				document.feedback.address.focus();
				return false;
			}
		}

	if(!validateNotEmpty(document.feedback.ph_mobnumber.value)){alertlist+="Please enter \"Phone/Mobile Number\"\n";fcs+="-ph_mobnumber";}
    if(validateNotEmpty(document.feedback.ph_mobnumber.value)) 
    {
		
		if(validate_Phonenumber('ph_mobnumber','phone','yes','','')==false)
			{
				document.getElementById("ph_mobnumber").focus();
				return false;
			}   

	}
	if(!validateNotEmpty(document.feedback.email.value)){alertlist+="Please enter \"Your email ID\"\n";fcs+="-email";}
	if(validateNotEmpty(document.feedback.email.value))
	{
		if(!validateEmail(document.feedback.email.value))
		{
			alert("Please enter valid email id");
			document.feedback.email.focus();
			return false;
		}
	}

	if(!validateNotEmpty(document.feedback.feedback1.value)){alertlist+="Please enter \"Feed back/Comments\"\n";fcs+="-feedback";}
	if(validateNotEmpty(document.feedback.feedback1.value))
		{
			
			if(!validateAlpha2(document.feedback.feedback1.value))
			{
				alert('Please enter valid "Feed back"');
				document.getElementById("feedback1").focus();
				return false;
			}       
		}
	if(alertlist!="")
	{
		
		alert(alertlist);
		fcs_splt=fcs.split("-");
		if(fcs_splt[1]!="txtrefdate")
		document.getElementById(fcs_splt[1]).focus();
		alertlist="";
		fcs="";
		return false;
	}
	if(!validateNotEmpty(document.feedback.feedback1.value))
	{
		alert("Enter Feedback/Comments");
		document.feedback.feedback1.focus();
		return false;
	}
	
	document.feedback.submit();
}
function gohomes()
{
	window.location="../index.php";
}
function length_textarea(fld,ttl,char_count,cnt)
{
	if(ttl!="disclaimer text")
	{
		
		if(document.getElementById(fld).value.length>249)
		{
			document.getElementById(fld).value=document.getElementById(fld).value.substr(0,249);
			alert("You cannot enter more than 250 Characters");
			document.getElementById(fld).focus();
			return false;
		}
	}if(ttl=="disclaimer text")
	{
		if(document.getElementById(fld).value.length>499)
		{
			document.getElementById(fld).value=document.getElementById(fld).value.substr(0,199);
			alert("You cannot enter more than 500 Characters");
			document.getElementById(fld).focus();
			return false;
		}
	}
	if(document.getElementById(fld).value.length<=cnt)
	{
		count=document.getElementById(fld).value.length;
		count=parseInt(cnt)-parseInt(count)-parseInt(1);
		document.getElementById(char_count).innerHTML=count;
	}
}
function Check_count(Str,tot,charcount_id)
{
	if(Str.value.length<=tot)
	{
		count=Str.value.length;
		if(event.keyCode=="8" && count>0)
		{
			count=parseInt(tot)-parseInt(count)+parseInt(1);
			document.getElementById(charcount_id).innerHTML=count;
		}
	}
}

function gettoupperfirst(str)
{ // code added by yogaraja this function used to change the string first char is chang to upper case and also remove the continious space
	
	return str.toUpperCase();
}

function checkPhoneNumber(e)
{

	var charcode=(e.which)?e.which:event.keyCode;
	//alert(charcode)
	if(charcode>31 && charcode!=45 &&(charcode<48 || charcode>57)){
		return false;
	}
	return true;
}
