// function to validate  frmNewuser and frmEditUser
function frmuservalidator(theForm)
{
  if (theForm.txtFirstName.value.length < 1)
  {
    alert("Please enter valid first name.");
    theForm.txtFirstName.focus();
    return (false);
  }
  if (theForm.txtLastName.value.length < 1)
  {
    alert("Please enter valid last name.");
    theForm.txtLastName.focus();
    return (false);
  }
  if (theForm.txtUser.value.length < 2)
  {
    alert("Please enter valid user ID.");
    theForm.txtUser.focus();
    return (false);
  }

  if (theForm.txtPass.value.length < 2) 
  {
    alert("Please enter valid password.");
    theForm.txtPass.focus();
    return (false);
  }

  if (theForm.txtAddress.value.length < 1)
  {
    alert("Please enter valid address.");
    theForm.txtAddress.focus();
    return (false);
  }
  if (theForm.txtCity.value.length < 1)
  {
    alert("Please enter valid city name.");
    theForm.txtCity.focus();
    return (false);
  }
  if (theForm.txtCountry.value.length < 1)
  {
    alert("Please enter valid country name.");
    theForm.txtCountry.focus();
    return (false);
  }
  if (theForm.txtMobile.value.length < 1)
  {
    alert("Please enter valid mobile number.");
    theForm.txtMobile.focus();
    return (false);
  }

  // E-mail Validator Code
  if ((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(theForm.txtEmailID.value))) 
  {
		//  do nothing
  }
  else
  {
	alert("Invalid E-mail Address! Please re-enter.")
	theForm.txtEmailID.focus();
	return (false);
  }

  return (true);
}


// function to validate  new notification
function frmnotivalidator(theForm)
{
  if (theForm.txtMainCategoryID.value=="-")
  {
    alert("Please select main category.");
    theForm.txtMainCategoryID.focus();
    return (false);
  }
  return (true);
}

// function to validate  new notification
function frmnotitypevalidator(theForm)
{
  if (theForm.txtNotificationTypeName.value<1)
  {
    alert("Please enter valid notification type.");
    theForm.txtNotificationTypeName.focus();
    return (false);
  }
  return (true);
}

// function to validate  new notification
function frmmaincatvalidator(theForm)
{
  if (theForm.txtMainCategoryName.value<1)
  {
    alert("Please select main category.");
    theForm.txtMainCategoryName.focus();
    return (false);
  }
  return (true);
}

// function to validate  new notification
function frmsubcatvalidator(theForm)
{
  if (theForm.txtsubCategoryName.value<1)
  {
    alert("Please enter valid sub category.");
    theForm.txtsubCategoryName.focus();
    return (false);
  }
  return (true);
}

function frmmailvalidator(theForm)
{
  // E-mail Validator Code
  if ((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(theForm.txtEmailID.value))) 
  { 
   	return (true);
  }
  else
  {
	alert("Invalid E-mail Address! Please re-enter.")
	theForm.txtEmailID.focus();
	return (false);
  }
}

function fnOpenWindow(theURL)
{
 var winName = "Character";
 var features = "toolbar=0,left=50,top=50,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=400"
 window.open(theURL,winName,features);
}
function fnOpenWindow1(theURL)
{
 var winName = "Character";
 var features = "toolbar=0,left=10,top=10,location=0,status=0,menubar=1,scrollbars=1,resizable=0,width=450,height=450"
 window.open(theURL,winName,features);
}
function fnOpenWindowForPDF(theURL)
{
 var winName = "Character";
 window.open(theURL,winName);
}
function fnclose()
{
	window.close()
}





