
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

  function checkSelect(objElementForm)
  {
   
    if (!this.checkResult) return false;
     
    if (this.frmName[objElementForm][this.frmName[objElementForm].selectedIndex].value == 0) {
      this.frmName[objElementForm].focus();
      this.strErrorMessage = 'Ââåäèòå èíôîðìàöèþ â ïîëå: ' + this.frmName[objElementForm].title;
      this.checkResult = false;
    } 
 
  }
  
  function trim(strText)
  {
    
    var strPattern
    
    strPattern = / +/g;
    return strText.replace(strPattern, '');
     
  }
  
  function checkTextbox(objElementForm)
  {
    
    if (!this.checkResult) return false;
    
    if (trim(this.frmName[objElementForm].value) == '') {
      this.frmName[objElementForm].focus();
      this.strErrorMessage = 'Ââåäèòå èíôîðìàöèþ â ïîëå: ' + this.frmName[objElementForm].title;
      this.checkResult = false;
    } else {
      this.checkResult = true;
    }

  }
  
  function checkCheckbox(objElementForm)
  {
    
    if (!this.checkResult) return false;
    
    if (this.frmName[objElementForm].checked == false) {
      this.frmName[objElementForm].focus();
      this.strErrorMessage = 'Click on' + this.frmName[objElementForm].title;
      this.checkResult = false;
    } else {
      this.checkResult = true;
    }    
    
  }

  function checkTextarea(objElementForm)
  {
    
    this.checkTextbox(objElementForm);
    
  }  
  
  function checker(strFormName)
  {
    
    this.frmName = document.forms[strFormName];
    this.strErrorMessage = '';    
    
    this.checkOnFutility = checkOnFutility;
    this.checkTextbox = checkTextbox;
    this.checkCheckbox = checkCheckbox;
    this.checkSelect = checkSelect;
    this.checkTextarea = checkTextarea;
    this.submitForm = submitForm;
    this.checkOnMatch = checkOnMatch;
    this.checkOnEmail = checkOnEmail;
    this.checkPasswordOnLength = checkPasswordOnLength;
    this.checkOnDelete = checkOnDelete;
    this.checkPasswordOnCorrect = checkPasswordOnCorrect;
    this.checkUsaState = checkUsaState;
    this.checkOnMessageLength = checkOnMessageLength;
    this.checkResult = true;
    
  }
    
  function checkOnFutility(arrElementForm)
  {
    
    var strField;
      
    for (strField in arrElementForm)
    {
      
      strField = arrElementForm[strField];
      
      switch (this.frmName[strField].tagName) 
      {
        case 'INPUT' :
          if ((this.frmName[strField].type == 'text') || (this.frmName[strField].type == 'password') || (this.frmName[strField].type == 'file')){
            this.checkTextbox(strField);
          } else {
            this.checkCheckbox(strField);
          }
        break;
        case 'SELECT' :
          this.checkSelect(strField);
        break;
        case 'TEXTAREA' :
          this.checkTextarea(strField);
        break;      
      }
      
      if (!this.checkResult) return false;
    
    }
  }
  
  function submitForm()
  {
    if (this.checkResult) {
      this.frmName.submit();
    } else {
      alert(this.strErrorMessage);
    }
  }
  
  function checkOnMatch(strFirstField, strSecondField, strType)
  {
    
    if (!this.checkResult) return false;
    
    if (this.frmName[strFirstField].value == this.frmName[strSecondField].value) {
      this.checkResult = true;
    } else {
      if (strType == 'email') {
        this.strErrorMessage = 'The addresses of emailboxes not match!';
      } else {
        this.strErrorMessage = 'The passwords not match!';
      }
      
      this.frmName[strFirstField].focus();
      this.checkResult = false;
    }
  }
  
  function checkPasswordOnLength(strField)
  {
    
    if (!this.checkResult) return false;
    
    if (this.frmName[strField].value.length >= 6) {
      this.checkResult = true;
    } else {
      this.strErrorMessage = 'Password can be no less six characters!';
      this.frmName[strField].focus();
      this.checkResult = false;
    }
  }  
  
  function checkOnEmail(strFieldName)
  {
    
    if (!this.checkResult) return false;
    
    var strEmail = this.frmName[strFieldName].value;
    
    var re = new RegExp("[-_a-zA-Z0-9]+@[-_a-zA-Z0-9]+\.[-_a-zA-Z0-9]+","ig");

    if (re.exec(strEmail) == strEmail) {
      this.checkResult = true;
    } else {
      this.strErrorMessage = 'Enter correct email address!';
      this.frmName[strFieldName].focus();
      this.checkResult = false;
    }
    
  }   
  
  function checkOnDelete(strFieldName)
  {
    var blnDelete = false;
    var i;
    
    if (!this.checkResult) return false;
		
    if (this.frmName[strFieldName] != null) {
      if (this.frmName[strFieldName].checked != null) {
        blnDelete = (this.frmName[strFieldName].checked) ? true : false;
      } else {
        for (i = 0; i < this.frmName[strFieldName].length; i++)
        {
          if (this.frmName[strFieldName][i].checked == true) {
            blnDelete = true;
            break;
          }
        }      
      }
    }
     
   if (blnDelete == false) {
      this.strErrorMessage = 'You need choice at least one variant!';
      this.checkResult = false;
    }
    
  }
  
  function checkPasswordOnCorrect(strField)
  {
    
    if (!this.checkResult) return false;
    
    var strPassword = this.frmName[strField].value;
    
    var re = new RegExp("^[0-9a-zA-Z;' !.,]{6,}$", "ig");

    if (re.exec(strPassword) == strPassword) {
      this.checkResult = true;
    } else {
      this.strErrorMessage = 'Enter correct password!';
      this.frmName[strField].focus();
      this.checkResult = false;
    }
  
  }  
  
  
  function checkUsaState(strUSAField, strState)
  {
	
	if (!this.checkResult) return false;
	
	if (this.frmName[strUSAField][this.frmName[strUSAField].selectedIndex].value == 2)
	 {
   	   if (this.frmName[strState][this.frmName[strState].selectedIndex].value == 0)
	   {
		 this.strErrorMessage = 'Shoice state!';
         this.frmName[strState].focus();
         this.checkResult = false;
	   } else {
         this.checkResult = true;
	   }
	 } else {
	   this.checkResult = true;
		 this.frmName[strState][this.frmName[strState].selectedIndex].value = 0;
	 }
  }
  
  function checkOnMessageLength(strMessageField, intMin, intMax)
  {
    
    if (!this.checkResult) return false;
  
    if (this.frmName[strMessageField].value.length < intMax && this.frmName[strMessageField].value.length > intMin)
    {
      this.checkResult = true;
    } else {
      this.frmName[strMessageField].focus();
      this.strErrorMessage = 'The information length could be between ' + intMin + ' and ' + intMax + ' characters!';
      this.checkResult = false;
    }
   
  }
  
  
  function messageInterval(strFormName, strMessageField, strCountField, intMin, intMax)
  {
  
    var objForm = document.forms[strFormName];
    
    objForm[strCountField].value = objForm[strMessageField].value.length;
    
    return true;
    
  }