<!--
// Supported by Abarkam™ Technology (Level 5)
// programmers : Abarkam Programmers & Hackers Team 
// Administrator : Reza Alaiy
// Tel : 0511- 6099424 - 6084790 
// Email : info@Abarkam.com
// Note !!
// Dont Copy This Program Without Abarkam Permission !!!!!

function onlynumber(myfield,e)
{

var key;
if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
 
 if ( key>=48 && key<=57 )
  return true;
 else
 {
   if( key == 109 || key ==77)
   {
     if( (myfield.value + "000000" ).length  <= myfield.maxLength  )      
         myfield.value = myfield.value + "000000";
   }
   else 
   if( key == 104 || key ==72)
   {
     if( (myfield.value + "000" ).length  <= myfield.maxLength  )      
         myfield.value = myfield.value + "000";
   }
   if( key == 116 || key ==84)
   {
     if( (myfield.value + "0" ).length  <= myfield.maxLength  )      
         myfield.value = myfield.value + "0";
   }
   
   return false;   
  }
}
//--------------------------------
//----------------------------------

var f= new Image();
var e= new Image();
var farsi=true;

f.src='http://www.javancd.com/images/fa.gif';
e.src='http://www.javancd.com/images/en.gif';

function led(o){
 if (farsi==true)
 {
  o.src=f.src;
  }
  else
  {
  o.src=e.src;
  }
}
//---------------------------------------------------------------
function keyup(e,o)
{
 if( e.keyCode == 145 ) 
 {
     farsi=!farsi;
 }
led(o);

 return true;
}
//-------------------------------------------------------------

function la_onclick(o)
{
 farsi=!farsi;
 led(o);
 document.form1.q.focus();
 return true;
}
//-------------------------------------------------------------

function la_onmousemove(o) {
  o.style.cursor="hand";
}
//-------------------------------------------------------------

var farsikey = [
   0x0020, 0x0021, 0x061B, 0x066B, 0x00A4, 0x066A, 0x060C, 0x06AF,
   0x0029, 0x0028, 0x002A, 0x002B, 0x0648, 0x002D, 0x002E, 0x002F,
   0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
   0x0038, 0x0039, 0x003A, 0x0643, 0x003E, 0x003D, 0x003C, 0x061F,
   0x066C, 0x0624, 0x200C, 0x0698, 0x0649, 0x064D, 0x0625, 0x0623,
   0x0622, 0x0651, 0x0629, 0x00BB, 0x00AB, 0x0621, 0x004E, 0x005D,
   0x005B, 0x0652, 0x064B, 0x0626, 0x064F, 0x064E, 0x0056, 0x064C,
   0x0058, 0x0650, 0x0643, 0x062C, 0x005C, 0x0686, 0x00D7, 0x0640,
   0x200D, 0x0634, 0x0630, 0x0632, 0x064A, 0x062B, 0x0628, 0x0644,
   0x0627, 0x0647, 0x062A, 0x0646, 0x0645, 0x067E, 0x062F, 0x062E,
   0x062D, 0x0636, 0x0642, 0x0633, 0x0641, 0x0639, 0x0631, 0x0635,
   0x0637, 0x063A, 0x0638, 0x007D, 0x007C, 0x007B, 0x007E ];

function submitenter(myfield,e)
{

var key;
if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;


if(!farsi) return true;

if (key>31)
if (key<128)
{

     if (key == 0x0020 && window.event.shiftKey) // Shift-space -> ZWNJ
       window.event.keyCode = 0x200C;
     else
       window.event.keyCode = farsikey[key - 0x0020];
     if (farsikey[key - 0x0020] == 92) {
        window.event.keyCode = 0x0698;
     }
     if (farsikey[key - 0x0020] == 8205) {
        window.event.keyCode = 0x067E;
     }

}

 return true;
}

//---------------------------------------------------------------------
var NS4 = (document.layers);    
var IE4 = (document.all);

var win = window;    
var n   = 0;

function findInPage(str) {

  var txt, i, found;

  if (str == "")
    return false;

  if (NS4) {

    if (!win.find(str))
      while(win.find(str, false, true))
        n++;
    else
      n++;

    if (n == 0)
      alert(" Not found in this page.");
  }

  if (IE4) {
    txt = win.document.body.createTextRange();

    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }

    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    }

    else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      }

      else
        alert(" Not found in this page.");
    }
  }

  return false;
}
-->