function focusMe()
{
	document.getElementById("txtname").focus()
}

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 your name")
		document.getElementById("txtname").focus()
		return false
	}
	if(document.getElementById("txtalbums").value=="")
	{
		alert("Select an album")
		document.getElementById("txtalbums").focus()
		return false
	}
             if(document.getElementById("txtquantity").value=="")
	{
		alert("Enter the quantity")
		document.getElementById("txtquantity").focus()
		return false
	}
             if(document.getElementById("txtpayment").value=="")
	{
		alert("Select the mode of payment")
		document.getElementById("txtpayment").focus()
		return false
	}
            
	if(document.getElementById("txtAddress").value=="")
	{
		alert("Enter the Address")
		document.getElementById("txtAddress").focus()
		return false
	}
	if(document.getElementById("txtNo").value=="")
	{
		alert("Enter the Contact No")
		document.getElementById("txtNo").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
		}
	}
	
	if(document.getElementById("txtRequirements").value=="")
	{
		alert("Enter the Requirements")
		document.getElementById("txtRequirements").focus()
		return false
	}
	
	document.forms[0].submit()
}

