function popup(pid){
	thepopup=window.open("details.asp?pid="+pid,"popup","scrollbars=1, resizable=1, height=500, width=500, left=200, top=50")
    thepopup.focus()
}

function editpopup(pid){
//leftpos=(screen.availWidth-600)/2
//toppos =(screen.availHeight-600)/2
	thepopup=window.open("edit2.asp?pid="+pid,"popup","scrollbars=1, resizable=1, height=700, width=700, left=150, top=10")
//	thepopup=window.open("edit2.asp?pid="+pid,"popup","")
    thepopup.focus()
}

function resetall() {
obj=document.form
obj.Family.selectedIndex = 0
obj.Species.value = ""
obj.CommonName.value = ""
}

function editresetall() {
obj=document.form
obj.Family.selectedIndex = 0
obj.Species.value = ""
obj.CommonName.value = ""
obj.Habitat.value = ""
obj.Distribution.value = ""
obj.Filename.value = ""
obj.FamilyNull.checked = false
obj.SpeciesNull.checked = false
obj.CommonNameNull.checked = false
obj.HabitatNull.checked = false
obj.DistributionNull.checked = false
}

function check(obj) {
err=""
if (obj.name.value == "" ) {
	err=err + "Fill your name\n"
}

if (obj.tel.value == "" ) {
	err=err + "Fill your contact telephone no.\n"
}

rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$")
validEmail=obj.email.value.match(rx)
if (validEmail==null) {err=err + "Email address invalid or blank\n"}

if (err != "") {
	alert("Please complete following information :\n\n"+err)
	return false
	}else{
	return true
}

}