function show_status(msg)
{
   window.status = msg
   return true
}
function ss1(index1)
{  
   ss2(index1)
   return true
}
function ss2(index2)
{
   window.status=theElement[index2].statmsgX
}
function show_csoon()
{
   alert('Under construction ... Coming Soon')
}
function MakeArray(n)
{
	this.length = n
	return this
}
function anElement(name,sname,allwN,statmsgX)
{
   this.name      = name
   this.sname     = sname
   this.allwN     = allwN
   this.statmsgX  = statmsgX
}
function val_allwN(form)
{
   for (var i=0; i<form.elements.length; i++) {
      if (form.elements[i].type == "text" || form.elements[i].type == "password" || form.elements[i].type == "hidden" || form.elements[i].type=='textarea' || form.elements[i].type == "select-one" || form.elements[i].type == "radio" || form.elements[i].type == "checkbox" || form.elements[i].type == "select-multiple")
      {
         if(theElement[i].name == form.elements[i].name) {
            var v_isnull=true
            if (form.elements[i].type == 'radio')
            {
               var which_group = eval("form."+form.elements[i].name)
               var v_isnull=(getSelectedButton(which_group)== 'nonexx' ) ? true: false
            }
            else
            {
               var v_isnull=isnull(form.elements[i])
            }
            var msg     = 'Please '
            var msg_mid = 'enter ' // or 'select '
            var msg_end = '. Thank you.'

            if (v_isnull == true)
            {
               if (theElement[i].allwN == 'N') {

                  if (form.elements[i].type.indexOf('select') != -1 || form.elements[i].type.indexOf('radio') != -1 || form.elements[i].type.indexOf('checkbox') != -1)
                  {
                     msg_mid='select '
                  }
                  form.elements[i].focus()
                  alert(msg+msg_mid+theElement[i].sname+msg_end)
                  return false
               }
               continue
            }
         }
      }
   }
   return true
}
function novalue(thisstring)
{
   var thisstring_length= thisstring.length
   if (window.RegExp) {
      var regstr = "^\\*+$|^<[\\w\\s\\D]+>$"
      var reg = new RegExp(regstr)
      if (reg.test(thisstring)) { return true }
   }
   if (thisstring_length == 0)
   { 
      return true
   }
   else
   {
      for (i=0; i<thisstring_length; i++)
      {
         var thischar = thisstring.charAt(i)
         if (thischar != " " && thischar != "\n" && thischar != "\r")
         {
            return false
         }
      }
      return true
   }
}
function isnull(field)
{
   if (field.type == 'text' || field.type == 'password' || field.type == 'textarea' || field.type == 'hidden')
   {
      return novalue(field.value)
   }
   else if (field.type == 'select-one')
   {
      if (field.options[field.selectedIndex].value == 'nonexx') 
      { return true; }
      return ((field.selectedIndex == null || field.selectedIndex == -1) ? true: false)
   }
   else if (field.type == 'select-multiple')
   {
      return ((field.selectedIndex == -1) ? true: false)
   }
   else if (field.type == 'checkbox')
   {
      return !(field.checked)
   }
   return false
}
function inval_e(strg)
{
   if (window.RegExp) {
   re = /^[\w]{1}[\w\-]*\@{1}([\w\-]+\.{1})+[a-z]{2,}$/i
   if(! re(strg) ) {
      return true
   }
   return false
   }
   return true
}
function ifHitPhone(e)
{
   var ascii_code = hit_which_key(e)
   if (ascii_code > 47 && ascii_code < 58)
   {
      return true
   }
   else if (ascii_code < 14)
   {
      return true
   }
   else if (ascii_code == 40 || ascii_code == 41 || ascii_code == 45 || ascii_code == 32) {
      return true
   }
   else
   {
      return false
   }
}