function ValidateSrchText(frm)
{
	if(frm.ktype[1].checked)
	{
		return(checkRefNo(frm));
	}
	else
	{
		return(chkSrchString(frm));
	}
}

function chkSrchString(frm)
{
	if(!checkNull(frm.txtSrch.value))
	{
		alert('Kindly Provide a Search Keywords');
		return(false);
	}
	frm.txtAction.value = 'simplesearch';
	return(true);
}
function checkRefNo(frm)
{
	var retValue = true;
	if(!checkNull(frm.txtSrch.value)) {
		alert('Reference no. field cannot be blank');
		retValue = false;
	}
	//
	if(retValue && isNaN(frm.txtSrch.value))
	{
		alert('Please enter numeric reference no.')
		retValue=false;
	}
	if(retValue)
	{
		frm.txtAction.value='refsearch'
	}
	return(retValue);
}

//function chkMemType{
//if(opener.document.MemType.value=="T")
	

function isEmp(str,fld,fldName){
	if(str.length==0)
		{
		alert(fld+" cannot be empty")
		fldName.focus();
		return true;
		}
	return false;	
}	

function isChar(str,fld,fldName){
for(i=0; i<str.length; i++)
	if((str.charAt(i)<"a" || str.charAt(i)>"z") && (str.charAt(i)<"A" || str.charAt(i)>"Z"))
	{
		alert(fld+" Invalid value; can be only characters")
		fldName.focus()
		fldName.select()
		//history.go(0)
		return false;
	}
	return true;	//outside for
}

function isSpac(str,fld,fldName){
for(i=0; i<str.length; i++)
	if((str.charAt(i)==" " ))
	{
		alert(fld+" Invalid value; cannot have spaces")
		fldName.focus()
		fldName.select()
		//history.go(0)
		return false;
	}
	return true;	//outside for
}

function isNum(str,fld,fldName){
for(i=0; i<str.length; i++)
	if((str.charAt(i)<"0" || str.charAt(i)>"9"))
	{
		alert(fld+" Invalid value; can be only numbers")
		fldName.focus()
		fldName.select()
		return false;
	}
	return true;	//outside for
}

function isHtl(str,fld,fldName){
for(i=0; i<str.length; i++)
	if((str.charAt(i) =="<" || str.charAt(i) ==">"))
	{
		alert(fld+" Invalid value; cannot have < and >")
		fldName.focus()
		fldName.select()
		return false;
	}
	return true;	//outside for
}

function validat(tform)
{
	tmp=tform.FName.value;
	if((isEmp(tmp,"First Name",tform.FName)) ||(!isChar(tmp,"First Name",tform.FName)) ||(!isHtl(tmp,"First Name",tform.FName)))
		return false;
	
	tmp=tform.LName.value;
	if((isEmp(tmp,"Last Name",tform.LName))||(!isChar(tmp,"Last Name",tform.LName))||(!isHtl(tmp,"Last Name",tform.LName)))
		return false;

	tmp=tform.Org.value;
	if(!isHtl(tmp,"Organization Name",tform.Org))
		return false;
		
	tmp=tform.StAdd.value;
	if((isEmp(tmp,"Street Address",tform.StAdd)) ||(!isHtl(tmp,"Street Address",tform.StAdd)))
		return false;
		
	if (tform.drpStates.selectedIndex == 0)
	{
	alert("Please select a State.");
	tform.drpStates.focus();
	return (false);
	}		

	tmp=tform.City.value;
	if((isEmp(tmp,"City",tform.City))||(!isHtl(tmp,"City",tform.City)))
		return false;

	tmp=tform.PIN.value;
	if((isEmp(tmp,"PIN/Zip Code",tform.PIN))||(!isHtl(tmp,"PIN/ZIP Code",tform.PIN)))
		return false;

	/*
	tmp=tform.drpState.value;
	if((isEmp(tmp,"State",tform.State))||(!isHtl(tmp,"State",tform.State)))
		return false;
		*/
	
	
	tmp=tform.Country.value;
	if((isEmp(tmp,"Country",tform.Country))||(!isHtl(tmp,"Country",tform.Country)))
		return false;
		
		 
		
	//tmp=tform.drpStates.value;
	/*if((tform.drpStates.options[tform.drpStates.selectedIndex].value=='0'))
	{
		alert("Please select a state")
		return false;}		
		}
		*/

	tmp=tform.phone.value;
	if((isEmp(tmp,"Phone",tform.phone))||(!isHtl(tmp,"Phone",tform.phone)))
		return false;

	tmp=tform.FAX.value;
	if((!isHtl(tmp,"Fax",tform.FAX)))
		return false;

	tmp=tform.url.value;
	if((!isHtl(tmp,"URL",tform.url)))
		return false;

	tmp=tform.Email.value;
	if((isEmp(tmp,"Email",tform.Email))||(!isHtl(tmp,"E-mail",tform.Email)))
		return false;

	tmp=tform.Email.value;
	if(!checkMail(tmp))
	{
		alert('Please enter a valid email id');
		tform.Email.focus();
		return false;
	}

	tmp=tform.Email2.value;
	if((!isHtl(tmp,"E-mail",tform.Email2)))
		return false;

	tmp=tform.Usr.value;
	if((!isSpac(tmp,"User Id",tform.Usr)))
		return false;

	if(tmp.length < 6){ 
		alert("User Id must be atleast 6 chars long")
		tform.Usr.focus();
		return false;}

	if(tmp.length >12){ 
		alert("User Id cannot be more than 12 chars long")
		tform.Usr.focus();
		return false;}

	tmp=tform.Pass.value;
	if((!isSpac(tmp,"Password",tform.Pass)))
		return false;

	if(tmp.length < 6){ 
		alert("Password must be atleast 6 chars long")
		tform.Pass.focus(); tform.Pass.select()
		return false;}

	if(tmp.length >12){ 
		alert("Password cannot be more than 12 chars long")
		tform.Pass.focus(); tform.Pass.select()
		return false;}

	tmp=tform.confPass.value;
	if((!isSpac(tmp,"Reconfirm Password",tform.confPass)))
		return false;


	if(tform.Pass.value != tform.confPass.value){ 
		alert("Incorrect password: Please reconfirm the password"); 
		tform.confPass.focus(); tform.confPass.select();
		return false;}
}//function validat		


function getDet(rno)
{

winProp=window.open("details3.asp?sel="+rno, "detWin", "toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=620,height=450")
}//function getDet


function getDet1(rno,nno)
{
winProp=window.open("../search/details3n.asp?sel="+rno+"&sel1="+nno, "detWin", "toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=620,height=450")
}//function getDet

function getPage()
{

winProp=window.open("default.asp", "detPage", "toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=620,height=450")
}//function getPage


/*function mout()
{
style.color='purple'
}

function mover()
{
style.color='aqua'
}*/

//<td valign="TOP" style="cursor:hand" onMouseOver="this.bgColor='#A2FFA2'" onMouseOut="this.bgColor='#FFFFCE'" onClick="winProp=window.open('details3.asp?sel=<%'= rs6(0).value %>', 'detWin', 'toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=620,height=450')"><font color="red" size='-1'> Details </font></td>  -->
//<!-- <td valign="TOP"><img onClick="winProp=window.open('details3.asp?sel=<%'= rs6(0).value %>', 'detWin', 'toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=620,height=450')" src="images/envelop.gif" width=28 height=21 border=0 alt="Details"></td>  -->
//<td valign='top'><font size='-1'> <a href='details3.asp?sel=<%= rs6(0).value %>' target='detWin'>Details</a> </font>  </td> 
//<!-- <td valign='top'> <input type="Button" value="Details" align="MIDDLE" onClick="winProp=window.open('details3.asp?sel=<%= rs6(0).value %>', 'detWin', 'toolbar=0,location=0,directories=0,status=1,menubar=no,scrollbars=yes,resizable=1,width=600,height=400')"> </td> -->


