// JavaScript Document

function WebForm_OnSubmit(thisForm)
{
	var txtDescription = thisForm.txtDescription.value;
	var txtName = thisForm.txtName.value;
	var txtEmail = thisForm.txtEmail.value;
//	var txtTuring = thisForm.txtTuring.value;

	if(txtName.length==0)
	{
		alert("Please enter Your Name");
		thisForm.txtName.focus();
		return false;
	}
	if(txtEmail.length==0)
	{
		alert("Please enter Your Email");
		thisForm.txtEmail.focus();
		return false;
	}
	if(checkEmail(txtEmail) == false)
	{
		alert("Invalid email! Please re-enter.");
		thisForm.txtEmail.select();
		return false;
	}
	if(txtDescription.length==0)
	{
		alert("Please enter Short Description");
		thisForm.txtDescription.focus();
		return false;
	}
	/*if(txtTuring.length==0)
	{
		alert("Please enter Enter the code shown above");
		thisForm.txtTuring.focus();
		return false;
	}*/
}

function checkEmail(email) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))
	{
		return (true);
	}
	return false;
}

function textLimitCheck(thisArea, maxLength, msg)
{
	if (thisArea.value.length > maxLength)
	{
		alert(maxLength + ' characters limit. \rExcessive data will be truncated.');
		thisArea.value = thisArea.value.substring(0, maxLength);
		thisArea.focus();
	}
	document.getElementById(msg).innerText = thisArea.value.length;
}
var pop = '';
function openwin(nm,width,height) {
	var name = nm;
	if (pop && !pop.closed) {
		pop.close();
	}

	pop = eval("window.open('"+name+"','NewWIN','chrome[4],toolbar=no,left=5,top=5,width="+width+",height="+height+",directories=no,menubar=no,SCROLLBARS=yes,left=2,right=2')");
	if (!pop.opener) popUpWin.opener = self;
}

function closewin()
{
	window.close();
}

function popupform(myform, windowname)
{
	if (! window.focus)return true;
	window.open('', windowname, 'height=400,width=500,scrollbars=yes');
	myform.target = windowname;
	return true;
}