function validMail(eid)
{
	a=eid.indexOf('@')
	b=eid.indexOf('.')
	if(a<1 || b<1 || a==(eid.length-1) || b==(eid.length-1) || Math.abs(a-b)==1)
	{
		return false
	}
	return true
}

function validate()
{
	if(document.getElementById("txtName").value=="")
	{
		alert("Enter the name")
		document.getElementById("txtName").focus()
		return false
	}
	if(document.getElementById("txtAddress").value=="")
	{
		alert("Enter the Address")
		document.getElementById("txtAddress").focus()
		return false
	}
	if(document.getElementById("txtSubject").value=="")
	{
		alert("Enter the Subject")
		document.getElementById("txtSubject").focus()
		return false
	}
	if(document.getElementById("txtComments").value=="")
	{
		alert("Enter the Requirements")
		document.getElementById("txtComments").focus()
		return false
	}
	if(document.getElementById("txtPhone").value=="" && document.getElementById("txtMobile").value=="")
	{
		alert("Enter the Phone / Mobile number")
		document.getElementById("txtPhone").focus()
		return false
	}
	if(document.getElementById("txtEmail").value!="")
	{
		if(!validMail(document.getElementById("txtEmail").value))
		{
			alert("Enter a valid Email Address")
			document.getElementById("txtEmail").focus()
			return false
		}
	}
}

function show(tabid)
{
	var ele;
	for(i=1;i<=5;i++)
	{
		ele="tab"+i;
		document.getElementById(ele).style.display="none";
	}
	ele="tab"+tabid;
	document.getElementById(ele).style.display="block";
}

function Area(path)
{
	window.showModalDialog(path,"","dialogHeight:768;dialogWidth:1024;help:no;status:no;");
}

function showavailableplots(proj)
{
    var x = screen.height-100;
    var y = screen.width-100;
	var cy = (screen.width-y)/2;
	var cx = (screen.height-x)/2;
	if (proj==1) window.open("lakeAvlplot.html",proj,'height=' + x + ',width=' + y + ',scrollbars=yes,left=' + cy + ',top=' + cx );
	if (proj==2) window.open("ShentamilAvlplot.html",proj,'height=' + x + ',width=' + y + ',scrollbars=yes,left=' + cy + ',top=' + cx );
	if (proj==3) window.open("mullaiAvlplot.html",proj,'height=' + x + ',width=' + y + ',scrollbars=yes,left=' + cy + ',top=' + cx );
	if (proj==4) window.open("GardensAvlplot.html",proj,'height=' + x + ',width=' + y + ',scrollbars=yes,left=' + cy + ',top=' + cx );
	if (proj==5) window.open("PearlAvlplot.html",proj,'height=' + x + ',width=' + y + ',scrollbars=yes,left=' + cy + ',top=' + cx );
//	window.showModalDialog("agents/plotstatus.aspx?project="+proj,"dialogHeight:800;dialogWidth:800;help:no;status:no;");
	//window.showModalDialog("avlplot.html","dialogHeight:800;dialogWidth:800;help:no;status:no;resizable:yes");
//	window.open("avlplot.html",'','height=800,width=800,scrollbars=yes,left=10,top=10');
	
//	var diffHeight = screen.Height - screen.availHeight;
//    var diffWidth = screen.Width - screen.availWidth; 
//    window.showModalDialog("avlplot.html","dialogHeight: " + (600+diffHeight) + "px; dialogWidth: "+ (800+diffWidth) + "px; edge: Raised; center: No; help: No; scroll: No; status: Yes;");
}

