function chkForm(form)
{
	var comments= document.frmfeedback.Comments;
	var name =	document.frmfeedback.Name;
	var email =  document.frmfeedback.feedback_email;
	var date= document.frmfeedback.date_text;
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	var company = document.frmfeedback.company;
	//var position= document.frmfeedback.position.value;
	//var university= document.frmfeedback.company.value;
	if(trim(comments.value)=='')
	{
		alert("Please provide your comments");
		comments.focus();
		return false;
	}

	if(trim(name.value)=='')
	{
		alert("Please provide your name");
		name.focus();
		return false;
	}
	
	if(!email.value.match(emailRegEx))
	{
		alert("Please provide your valid email id");
		email.focus();
		return false;
	}
	if(trim(company.value)=='')
	{
		alert("Please provide your company name");
		company.focus();
		return false;
	}
	if(trim(date.value)=='')
	{
		alert("Please provide date");
		date.focus();
		return false;
	}



	
}

function chkForm_left()
{
	var left_name=document.getElementById("leftbar_name");
	var left_phone=document.getElementById("leftbar_phone");
	var left_email=document.getElementById("leftbar_email");
	
	if(trim(left_name.value)=='')
	{
		alert("Please provide your name");
		left_name.focus();
		return false;
	}
	if(trim(left_phone.value)=='')
	{
		alert("Please provide your phone number");
		left_phone.focus();
		return false;
	}
	if(!emailCheck(left_email.value))
	{
		alert("Please provide your valid email");
		left_email.focus();
		return false;
	}
	return true;
}

function get_feedback()
{
	var tableId=document.getElementById("tbl_feedback");
	var obj=tableId.getElementsByTagName("p");
	var data_set='';
	var counter=0;
	for (var i = 0; i < obj.length; i++) 
	//for (var i = 0; i <3; i++) 
	{ 
		var qst= trim(obj[i].innerHTML);
		data_set += '' + qst + '~~';
		counter=counter +1;

	}
	
	data_set =data_set.substring(0, data_set.length-3);
	document.getElementById("counter").value=counter;
	document.getElementById("feed_question").innerHTML=data_set;
}

function trim(a) {
	return a.replace(/^s*(S*(s+S+)*)s*$/, "$1");
}

function emailCheck(entry) {
    if ( (/^[a-zA-Z0-9-._]+(@[a-zA-Z0-9-.]{1,}[a-zA-Z0-9_.-]+\.)+[a-zA-Z]{2,4}$/).exec(entry) == null) {
        return false;
    }
    return true;
}

function validate_Application()
{
	if(document.frmApplication2010.fname.value.search(/\S/)==-1)
	{
		alert("Name can not be left blank");	
		document.frmApplication2010.fname.focus();
		return false;
	}
	if(document.frmApplication2010.e_mail.value.search(/\S/)==-1)
	{
		alert("E-Mail can not be left blank");	
		document.frmApplication2010.e_mail.focus();
		return false;
	}
	else 
	{
		if(!emailCheck(document.frmApplication2010.e_mail.value))
		{
			alert("E-Mail format is not valid");	
			document.frmApplication2010.e_mail.select();
			return false;
		}		
	}
	if(document.frmApplication2010.address.value.search(/\S/)==-1)
	{
		alert("Address can not be left blank");	
		document.frmApplication2010.address.focus();
		return false;
	}
	if(document.frmApplication2010.city.value.search(/\S/)==-1)
	{
		alert("City can not be left blank");	
		document.frmApplication2010.city.focus();
		return false;
	}
	if(document.frmApplication2010.state.value.search(/\S/)==-1)
	{
		alert("State can not be left blank");	
		document.frmApplication2010.state.focus();
		return false;
	}
	if(document.frmApplication2010.zip.value.search(/\S/)==-1)
	{
		alert("Zip can not be left blank");	
		document.frmApplication2010.zip.focus();
		return false;
	}
	if(document.frmApplication2010.country.value=="")
	{
		alert("Country can not be left blank");	
		document.frmApplication2010.country.focus();
		return false;
	}
	if(document.frmApplication2010.home_phone.value.search(/\S/)==-1)
	{
		alert("Phone can not be left blank");	
		document.frmApplication2010.home_phone.focus();
		return false;
	}
	if(document.frmApplication2010.fax.value.search(/\S/)==-1)
	{
		alert("FAX can not be left blank");	
		document.frmApplication2010.fax.focus();
		return false;
	}
	if(document.frmApplication2010.company_name.value.search(/\S/)==-1)
	{
		alert("Company can not be left blank");	
		document.frmApplication2010.company_name.focus();
		return false;
	}
	if(document.frmApplication2010.industry_type.value.search(/\S/)==-1)
	{
		alert("Type of Industry can not be left blank");	
		document.frmApplication2010.industry_type.focus();
		return false;
	}
	if(document.frmApplication2010.company_website.value.search(/\S/)==-1)
	{
		alert("Site name can not be left blank");	
		document.frmApplication2010.company_website.focus();
		return false;
	}
	if(document.frmApplication2010.site_url.value.search(/\S/)==-1)
	{
		alert("URL can not be left blank");	
		document.frmApplication2010.site_url.focus();
		return false;
	}
	if(document.frmApplication2010.terms.checked==false)
	{
		alert("Terms and Condition must be selected");	
		document.frmApplication2010.terms.focus();
		return false;
	}
	if(document.frmApplication2010.user_name.value.search(/\S/)==-1)
	{
		alert("User name can not be left blank");	
		document.frmApplication2010.user_name.focus();
		return false;
	}
	if(document.frmApplication2010.user_pass.value.search(/\S/)==-1)
	{
		alert("User password can not be left blank");	
		document.frmApplication2010.user_pass.focus();
		return false;
	}
	if(document.frmApplication2010.checks_to.value.search(/\S/)==-1)
	{
		alert("Checks made to can not be left blank");	
		document.frmApplication2010.checks_to.focus();
		return false;
	}
	
	var chk = 0;
	for(c=0; c<4;c++)
	{
		if(document.frmApplication2010.check_option[c].checked==true)
		{
			chk = 1;
		}
	}
	if(chk==0)
	{
		alert("Please select an option");
		return false;
	}
	if(document.frmApplication2010.tax_payer_id.value.search(/\S/)==-1)
	{
		alert("Tax Payer ID can not be left blank");	
		document.frmApplication2010.tax_payer_id.focus();
		return false;
	}
	if(document.frmApplication2010.notes.value.search(/\S/)==-1)
	{
		alert("Notes can not be left blank");	
		document.frmApplication2010.notes.focus();
		return false;
	}
	return true;
}