 function validate1()
	{
	var frm=document.frmCatagory;
	reg=frm.catagory;
	if (reg.value.length==0)
		{
		alert("Please enter the Catagory of the page where the reciprocal link can be found !!!");
		reg.focus();
		return false;
		}
	reg=frm.cata_desc;
	if (reg.value.length==0)
		{
		alert("Please enter the Catagory Description of the page where the reciprocal link can be found !!!");
		reg.focus();
		return false;
		}	
	return true;
	}
	
	 function vali()
	{
	var frm=document.frm;
	var reg=frm.username;
	if (reg.value.length==0)
		{
		alert("Please enter the username !!!");
		reg.focus();
		return false;
		}		
	var frm=document.frm;
	var reg=frm.pasword;		
	if (reg.value.length==0)
		{
		alert("Please enter the password !!!");
		reg.focus();
		return false;
		}		
	reg=frm.status;
	if (reg.value.length==0)
		{
		alert("Please select a status !!!");
		reg.focus();
		return false;
		}

	return true;
	}	
	
	
	function validate()
	{
	var frm=document.uploadform;
	reg=frm.status;
	if (reg.value.length==0)
		{
		alert("Please select a status !!!");
		reg.focus();
		return false;
		}
	var reg=frm.status;
	if (reg.value.length==0)
		{
		alert("Please enter the image !!!");
		reg.focus();
		return false;
		}		
	var frm=document.uploadform;
	var reg=frm.limage;		
	if (reg.value.length==0)
		{
		alert("Please enter the image !!!");
		reg.focus();
		return false;
		}		
	
	reg=frm.simage;
	if (reg.value.length==0)
		{
		alert("Please enter image !!!");
		reg.focus();
		return false;
		}
	reg=frm.image;
	if (reg.value.length==0)
		{
		alert("Please enter image !!!");
		reg.focus();
		return false;
		}	
	
	return true;
	}	
	
		function ft1()
		{
		 theForm=document.form1;
		
		if(theForm.T1.checked)
		 {
			theForm.T2.checked = false;
			theForm.T3.checked = false;
			theForm.Title.value = "Mr.";
			
		 }
		}
		
		
		function ft2()
		{
		 theForm=document.form1;
		
		if(theForm.T2.checked)
		 {
			theForm.T1.checked = false;
			theForm.T3.checked = false;
			theForm.Title.value = "Ms.";
		 }
		}
		
		
		function ft3()
		{
		 theForm=document.form1;
		
		if(theForm.T3.checked)
		 {
			theForm.T1.checked = false;
			theForm.T2.checked = false;
			theForm.Title.value = "Mrs.";
		 }
		}
function SelectOption(OptionListName, ListVal)
{
	for (i=0; i < OptionListName.length; i++)
	{
		if (OptionListName.options[i].value == ListVal)
		{
			OptionListName.selectedIndex = i;
			break;
		}
	}
}		


var checkflag = "false";
function check(field) {
if (checkflag == "false") {
  for (i = 0; i < field.length; i++) {
  field[i].checked = true;}
  checkflag = "true";
  return "Uncheck all"; }
else {
  for (i = 0; i < field.length; i++) {
  field[i].checked = false; }
  checkflag = "false";
  return "Check all"; }
}


function delete_confirm(id)
{
  if(confirm("Are you sure you want to Delete it!!!?"))
    return true;
  else
    return false;
}

   function checkForm(theForm){
        if(theForm.username.value == "" || IsAllSpaces(theForm.username.value)){
                alert("Please enter a your login name.");
                theForm.username.focus();
                return false;
        }
        if(theForm.password.value == "" || IsAllSpaces(theForm.password.value)){
                alert("Please enter a your password.");
                theForm.password.focus();
                return false;
        }
        return true;
   }
   function IsAllSpaces(myStr){
        while (myStr.substring(0,1) == " "){
                myStr = myStr.substring(1, myStr.length);
        }
        if (myStr == ""){
                return true;
        }
        return false;
   }
   
function checkNumeric(objName,minval, maxval,comma,period,hyphen) 
{
	var numberfield = objName;
	if (chkNumeric(objName,minval,maxval,comma,period,hyphen) == false) 
	{
		numberfield.select();
		numberfield.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function chkNumeric(objName,minval,maxval,comma,period,hyphen) 
{
  // only allow 0-9 be entered, plus any values passed 
  // (can be in any order, and don't have to be comma, period, or hyphen)
  // if all numbers allow commas, periods, hyphens or whatever, 
  // just hard code it here and take out the passed parameters
  var checkOK = "0123456789" + comma + period + hyphen;
  var checkStr = objName;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";

  for (i = 0;  i < checkStr.value.length;  i++)
  {
    ch = checkStr.value.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {	
   alertsay = "Please enter only these values \""
   alertsay = alertsay + checkOK + "\" in the \"" + checkStr.name + "\" field."
   alert(alertsay);
   return (false);
  }

  // set the minimum and maximum
  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal >= minval && prsVal <= maxval))
  {
   alertsay = "Please enter a value greater than or "
   alertsay = alertsay + "equal to \"" + minval + "\" and less than or "
   alertsay = alertsay + "equal to \"" + maxval + "\" in the \"" + checkStr.name + "\" field."
   alert(alertsay);
   return (false);
  }
}
