/* Virtual KeyBoard Application */

var _cursor="hand"; /* Specify the Cursor needed in the Virtual KeyBoard*/

/* Key Board Color Specifications */
// FONT 
var font_name="Arial Western";              // font name ("" == system default)
var font_size="12pt";				  // font size 
var font_dec="normal";				  // font weight
var font_spec_weight="bold";		  // font weight of specific keys like CAPS,CLEAR
var dead_color="#ffffff";			  // font color for the dead keys
// END FONT 
// the font-color and mouse_over bg color is differnt for Doha and Islamic  05.04.2007
var font_color;			// font color
var mouse_over_bg_color;// Mouse Over Background Color
var TabBorCol;			// border color of the Main Tab keyboard base  
//--------------

var kb_bg_color="#fef3de";						// keyboard base background color
var key_bg_color="#fef3de";						// keys' background color
//var kb_bg_color="#ffffff";						// keyboard base background color
//var key_bg_color="#ffffff";						// keys' background color
var sel_item_color="#fff";						// background color of switched/selected item
var border_color="#DDDDDD";						// border color
var inactive_border_color="#DDDDDD";			// border/font color of "inactive" key (key with no value/disabled)
var lang_sel_brd_color="#DDDDDD";				// border color of the language s
var mouse_over_font_color="white";


var _txtField="txtPassword"; //to maintain the - and _ symbols check

var _optVal ="1";
var _caps=false;



function VKeyboard(container_id, callback_ref, create_numpad)
               
{
	if (Islamic=="i")
	{
		mouse_over_bg_color="#096826";	//Mouse Over BackGround Color 
		font_color="#096826";			// font color
		TabBorCol="#096826";			// border color of the Main Tab keyboard base  
	}
	else
	{
		mouse_over_bg_color="#000080";	//Mouse Over BackGround Color 
		font_color="#000080";			// font color
		TabBorCol="#000080";			// border color of the Main Tab keyboard base  
	}

 return this._construct(container_id, callback_ref, create_numpad,
                         font_name, font_size, font_color, dead_color,
                         kb_bg_color, key_bg_color, sel_item_color, border_color,
                         inactive_border_color, lang_sel_brd_color);
}
//Shuffle function 

	function shuffle(v)
				{
					for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
					return v;
				}

// Callback function:
   function keyb_callback(ch)
   {
     /* Specify the field to which the Keyboard is to be Mapped */
     // Change the textbox dynamic so that it can input to multiple fields 
     var text = document.getElementById(Field), val = text.value;

     // alert("HAI")
     switch(ch)
     {
       case "Clear":
         //var min = (val.charCodeAt(val.length - 1) == 10) ? 2 : 1;
         //text.value = val.substr(0, val.length - min);
         text.value="";
         break;

       case "Enter": case "Entr":
       if  (funcPost())
			{
				//<%Viewstate("Load")="yes"%>
				document.getElementById("hideLog").value="yes";
				document.getElementById("frmLogin").submit();
			}
			else
			{
				document.getElementById("hideLog").value="no";
			}
        // text.value += "\n";
         break;

       default:
         text.value += ch;
     }

    // text.focus();//to focus to other fields disable this

     // The following piece of code is intended to
     // correctly position the insertion marker for
     // both left-to-right and right-to-left languages:
     //
     var l = text.value.length;
     if(text.setSelectionRange)
     {
       text.setSelectionRange(l, l);
     }
     else if(document.selection)
     {
       var Sel = document.selection.createRange();

       if(Sel.moveToElementText)
       {
         /*Sel.moveToElementText(text);*/
         Sel.collapse(true);
         Sel.move('character', l);
         Sel.select();
       }
     }
   }
//---------------


VKeyboard.prototype = {

  kbArray: [],

  _get_event_source: function(e)
  {
    var event = e ? e : window.event;
    return event.srcElement ? event.srcElement : event.target;
  },

  _setup_event: function(elem, eventType, handler)
  {
   //alert(eventType);
   
    return (elem.attachEvent) ? elem.attachEvent("on" + eventType, handler) : ((elem.addEventListener) ? elem.addEventListener(eventType, handler, false) : false);
  },

  _detach_event: function(elem, eventType, handler)
  {
   
    return (elem.detachEvent) ? elem.detachEvent("on" + eventType, handler) : ((elem.removeEventListener) ? elem.removeEventListener(eventType, handler, false) : false);
  },

  _setup_style: function(obj, setEvents, top, left, width, height, position, text_align, line_height, font_size, font_weight, padding_left, padding_right)
  {
     
    var os = obj.style;
    

    if(top)    os.top = top;
    if(left)   os.left = left;
    if(width)  os.width = width;
    if(height) os.height = height;

    if(position) os.position = position;

    if(text_align)  os.textAlign  = text_align;
    if(line_height) os.lineHeight = line_height;
    if(font_size)   os.fontSize   = font_size;

    os.fontWeight = (font_weight ? font_weight : font_dec);

    if(padding_left)  os.paddingLeft = padding_left;
    if(padding_right) os.paddingRight = padding_right;

    if(setEvents)
    {
		
      this._setup_event(obj, "selectstart", new Function("event", "return false;"));
      this._setup_event(obj, "mousedown",   new Function("event", "if(event.preventDefault) event.preventDefault(); return false;"));
      //this._setup_event(obj, "mouseover",new Function("event","this.bgcolor='red'"));
    }
  },

  _setup_key: function(parent, id, top, left, width, height, text_align, line_height, font_size, font_weight, padding_left, padding_right)
  {
    var exists = document.getElementById(id);
       
     var key = exists ? exists.parentNode : document.createElement("DIV");
    this._setup_style(key, !exists, top, left, width, height, "absolute");

    var key_sub = exists ? exists : document.createElement("DIV");
    key.appendChild(key_sub); parent.appendChild(key);

    this._setup_style(key_sub, !exists, "", "", "", line_height, "relative", text_align, line_height, font_size, font_dec, padding_left, padding_right);
    key_sub.id = id;

    return key_sub;
  },

  _findX: function(obj)
  { return (obj && obj.parentNode) ? parseFloat(obj.parentNode.offsetLeft) : 0; },

  _findY: function(obj)
  { return (obj && obj.parentNode) ? parseFloat(obj.parentNode.offsetTop) : 0; },

  _findW: function(obj)
  { return (obj && obj.parentNode) ? parseFloat(obj.parentNode.offsetWidth) : 0; },

  _findH: function(obj)
  { return (obj && obj.parentNode) ? parseFloat(obj.parentNode.offsetHeight) : 0; },

  _construct: function(container_id, callback_ref, create_numpad, font_name, font_size, font_color, dead_color, kb_bg_color, key_bg_color, sel_item_color, border_color, inactive_border_color, lang_sel_brd_color)
  {
    var pr = VKeyboard.prototype;
    //alert("me")
    var exists = (this.Cntr != undefined), ct = exists ? this.Cntr : document.getElementById(container_id);
    

    var changed = (font_size && (font_size != this.fontsize));

    var ff = ((font_name == "") || (font_name == undefined)) ? (this.fontname ? this.fontname : "") : font_name;
    var fs = font_size ? font_size : (this.fontsize ? this.fontsize : "12pt");
    var fc = font_color ? font_color : (this.fontcolor ? this.fontcolor : "#000");
    var bg = kb_bg_color ? kb_bg_color : (this.bgcolor ? this.bgcolor : "#FFF");
    var kc = key_bg_color ? key_bg_color : (this.keycolor ? this.keycolor : "#FFF");
    var bc = border_color ? border_color : (this.bordercolor ? this.bordercolor : "#777");
    var ibc = inactive_border_color ? inactive_border_color : (this.inactivebc ? this.inactivebc : "#CCC");
    var lsc = lang_sel_brd_color ? lang_sel_brd_color : (this.lsc ? this.lsc : "#F77");
    var lic = sel_item_color ? sel_item_color : (this.lic ? this.lic : "#DDD");
    // to not needed controlss
    var fs_N="10px";
    

    this.fontname    = ff, this.fontsize = fs, this.fontcolor = fc;
    this.bgcolor     = bg;
    this.keycolor    = kc;
    this.bordercolor = bc;
    this.inactivebc  = ibc, this.lsc = lsc, this.lic = lic;
   
    this._Callback = ((typeof(callback_ref) == "function") && ((callback_ref.length == 1) || (callback_ref.length == 2))) ? callback_ref : (this._Callback ? this._Callback : null);

    if(!exists)
    {
   
    
    
      this.Cntr = ct;
      this.Caps = this.Shift = this.Alt = false;
	
      this.DeadAction = []; this.DeadAction[1] = null;
      this.keys = [], this.mod = [], this.pad = [];

      pr.kbArray[container_id] = this;

      // Many thanks to Peter-Paul Koch (www.quirksmode.org) for the find-pos-X/find-pos-Y algorithms.
      var initX = 0, ct_ = ct;
      if(ct_.offsetParent)
      {
        while(ct_.offsetParent)
        {
          initX += ct_.offsetLeft;
          ct_ = ct_.offsetParent;
        }
      }
      else if(ct_.x)
        initX += ct_.x;

      var initY = 0; ct_ = ct;
      if(ct_.offsetParent)
      {
        while(ct_.offsetParent)
        {
          initY += ct_.offsetTop;
          ct_ = ct_.offsetParent;
        }
      }
      else if(ct_.y)
        initY += ct_.y;
    }

    var kb = exists ? ct.childNodes[0] : document.createElement("DIV");

    if(!exists)
    {
      ct.appendChild(kb);
      ct.style.display  = "block";
      ct.style.position = "absolute";
      ct.style.top      = initY + "px", ct.style.left = initX +"px";

      kb.style.position = "relative";
      kb.style.top      = "0px", kb.style.left = "0px";
    }

    kb.style.border = "1px solid " + TabBorCol; //DIV BORDER 

    var kb_main = exists ? kb.childNodes[0] : document.createElement("DIV"), ks = kb_main.style;
    if(!exists)
    {
      kb.appendChild(kb_main);

      ks.position = "relative";
      ks.width    = "1px";
      ks.cursor   = _cursor; /* "default"; */
    }

    ks.fontFamily = ff, ks.backgroundColor = bg;

    if(!exists || changed)
    {
      var mag = parseFloat(fs) / 14.0, cell = Math.floor(25.0 * mag), dcell = 2 * cell;
      var cp = String(cell) + "px", lh = String(cell - 2.0) + "px";

      var prevX = 0, prevY = 1, prevW = 0, prevH = 0;

      // Convenience strings:
      var c = "center", n = "normal", b = "bold"; r = "right", l = "left", e = "&nbsp;", pad = String(4 * mag) + "px";

      // Number row:

      var key;
      for(var i = 0; i < 13; i++)
      {
        this.keys[i] = key = this._setup_key(kb_main, container_id + "___key" + String(i), "1px", (prevX + prevW + 1) + "px", cp, cp, c, lh, fs);

        prevX = this._findX(key), prevW = this._findW(key);
      }

      prevY = this._findY(key);
      prevH = this._findH(key); // universal key height

      var kb_kbp = this._setup_key(kb_main, container_id + "___kbp", "1px", (prevX + prevW + 1) + "px", (2.96 * cell) + "px", cp, c, lh, fs_N,n,pad);
      kb_kbp.innerHTML = "Clear";
      this.mod[0] = kb_kbp;

      // Top row:
	  
	  //TAB KEY
      var kb_tab = this._setup_key(kb_main, container_id + "___tab", (prevY + prevH + 1) + "px", "1px", (1.48 * cell + 1) + "px", cp, l, lh, fs_N, n, pad);
      kb_tab.innerHTML = "Tab";
      this.mod[1] = kb_tab;

      prevX = this._findX(kb_tab), prevW = this._findW(kb_tab), prevY = this._findY(kb_tab);

      for(; i < 26; i++)
      {
        this.keys[i] = key = this._setup_key(kb_main, container_id + "___key" + String(i), prevY + "px", (prevX + prevW + 1) + "px", cp, cp, c, lh, fs);

        prevX = this._findX(key), prevW = this._findW(key);
      }

      this.kbpH = this._findX(kb_kbp) + this._findW(kb_kbp);

      // Home row:
	  //CAPS KEY
      var kb_caps = this._setup_key(kb_main, container_id + "___caps", (prevY + prevH + 1) + "px", "1px", dcell + "px", cp, l, lh, fs_N,r, pad);
      kb_caps.innerHTML = "CAPS";//"Caps";
      
      this.mod[2] = kb_caps;

      prevX = this._findX(kb_caps), prevW = this._findW(kb_caps), prevY = this._findY(kb_caps);

      for(; i < 38; i++)
      {
        this.keys[i] = key = this._setup_key(kb_main, container_id + "___key" + String(i), prevY + "px", (prevX + prevW + 1) + "px", cp, cp, c, lh, fs);

        prevX = this._findX(key), prevW = this._findW(key);
      }

      prevY = this._findY(key);
      var s = prevX + prevW + 1;

	  // ENTER KEY
      var kb_enter = this._setup_key(kb_main, container_id + "___enter_l", prevY + "px", s + "px", (this.kbpH - s) + "px", cp, r, lh, "9px", n, "", pad);
      kb_enter.innerHTML ="Enter";
      this.mod[3] = kb_enter;

      s = this._findX(this.keys[25]) + this._findW(this.keys[25]) + 1;

      var kb_enter_top = this._setup_key(kb_main, container_id + "___enter_top", this._findY(kb_tab) + "px", s + "px",(this.kbpH - s) + "px", cp, r, cp, fs);
      kb_enter_top.innerHTML = "<BR>";
      kb_enter_top.subst = "Enter"; //Special expando
      this.mod[4] = kb_enter_top;

      // Bottom row:

	  // SHIFT KEY
      var kb_shift = this._setup_key(kb_main, container_id + "___shift", (prevY + prevH + 1) + "px", "1px", (2.52 * cell) + "px", cp, l, lh, fs_N, n, pad);
      kb_shift.innerHTML = "Shift";
      this.mod[5] = kb_shift;
	  //this._setup_event(kb_shift, 'mouseover', new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor ='green'"));
      //this._setup_event(kb_shift, 'mouseout',  new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor = 'red'"));
     

      prevX = this._findX(kb_shift), prevW = this._findW(kb_shift), prevY = this._findY(kb_shift);

      for(; i < 48; i++)
      {
        this.keys[i] = key = this._setup_key(kb_main, container_id + "___key" + String(i), prevY + "px", (prevX + prevW + 1) + "px", cp, cp, c, lh, fs);

        prevX = this._findX(key), prevW = this._findW(key);
      }

      prevY = this._findY(key);

      var kb_shift_r = this._setup_key(kb_main, container_id + "___shift_r", prevY + "px", (prevX + prevW + 1) + "px", (this._findX(kb_kbp) + this._findW(kb_kbp) - prevX - prevW - 1) + "px", cp, c, lh, fs_N, n, "", pad);
      //kb_shift_r.innerHTML ="Close";// "Shift";/?CLOSE
      kb_shift_r.innerHTML ="Shift";//"<BR>";
      this.mod[6] = kb_shift_r;

      // Language selector:
      var vcell = String(1.32 * cell) + "px";

      var kb_lang =this._setup_key(kb_main, container_id + "___lang", (prevY + prevH + 1) + "px", "1px", vcell, cp, l, lh, fs_N, n, pad);
      kb_lang.innerHTML = "Ctrl";
      this.mod[7] = kb_lang;

      prevY = this._findY(kb_lang);

      ks.height = (prevY + prevH + 1) + "px";

      prevY += "px";

      var kb_res_1 = this._setup_key(kb_main, container_id + "___res_1", prevY, (this._findX(kb_lang) + this._findW(kb_lang) + 1) + "px", vcell, cp, c, lh, fs_N);
      kb_res_1.innerHTML = "#";
      this.mod[8] = kb_res_1;

      var kb_res_2 = this._setup_key(kb_main, container_id + "___res_2", prevY, (this._findX(kb_res_1) + this._findW(kb_res_1) + 1) + "px", vcell, cp, c, lh, fs_N, n);
      kb_res_2.innerHTML = "Alt";
      this.mod[9] = kb_res_2;

      // SPACE KEY TO BE ADDED TO RES CELL..6.28 initially
      var kb_space = this._setup_key(kb_main, container_id + "___space", prevY, (this._findX(kb_res_2) + this._findW(kb_res_2) + 1) + "px", (8.28 * cell) + "px", cp, c, lh, fs);
      //kb_space.innerHTML = "Close";//"SPACE for CLOSE;
      kb_space.innerHTML = "<BR>";
      this.mod[10] = kb_space;

	  // ALT KEY
      var kb_alt_gr = this._setup_key(kb_main, container_id + "___alt_gr", prevY, (this._findX(kb_space) + this._findW(kb_space) + 1) + "px", vcell, cp, c, lh, fs_N, n);
      kb_alt_gr.innerHTML ="Alt";
      this.mod[11] = kb_alt_gr;

      var kb_res_3 = this._setup_key(kb_main, container_id + "___res_3", prevY, (this._findX(kb_alt_gr) + this._findW(kb_alt_gr) + 1) + "px", vcell, cp, c, lh, fs_N);
      kb_res_3.innerHTML = "#";
      this.mod[12] = kb_res_3;

      var kb_res_4 = this._setup_key(kb_main, container_id + "___res_4", prevY, (this._findX(kb_res_3) + this._findW(kb_res_3) + 1) + "px", vcell, cp, c, lh, fs_N);
      kb_res_4.innerHTML = "Ctrl&nbsp;&nbsp;&nbsp;";
      this.mod[13] = kb_res_4;
      
      
      /* Why Virtual KeyBoard Link */      
	  var kb_res_5 = this._setup_key(kb_main, container_id + "___res_5", (this._findY(kb_res_3) + this._findH(kb_res_3)+5), this._findX(kb_shift)+"px", vcell, cp, c, lh, fs_N);
      kb_res_5.innerHTML = "<a href=# onclick='OpenWindow();' style='border:0;font-size:10px;background:white'>Why&nbsp;Virtual&nbsp;Keyboard?</a>";
      this.mod[14] = kb_res_5;
      
      
      
      
      var w = this.kbpH + 1;

      // NUMBER PAD
      if((create_numpad == undefined) ? true : create_numpad)
      {
        var w2 = this._create_numpad(container_id, kb_main);
        if(w2 > w) w = w2;
      }

      kb.style.width = ks.width = w + "px";

      if(!exists) this.CurrentLayout = pr.avail_langs[0][0];
    }

    this._refresh_layout();

    return this;
  },

  _create_numpad: function(container_id, parent)
  {
    var c = "center", n = "normal", l = "left";
    var fs = this.fontsize, bc = this.bordercolor;

    var mag = parseFloat(fs) / 14.0, cell = Math.floor(25.0 * mag);
    var dcell = 2 * cell, dp = (dcell + 1) + "px", dp2 = (dcell - 1) + "px";
    var cp = String(cell) + "px", lh = String(Math.floor(cell - 2.0)) + "px";

    var edge = (this.kbpH + cell + 1) + "px";

    var kb_pad_eur = this._setup_key(parent, container_id + "___pad_eur", "1px", edge, cp, cp, c, lh, fs);
    kb_pad_eur.innerHTML = "&#x20AC;";
    //kb_pad_eur.
   //_setup_key: function(parent, id, top, left, width, height, text_align, line_height, font_size, font_weight, padding_left, padding_right)
    this.pad[0] = kb_pad_eur;

    var edge_1 = (this._findX(kb_pad_eur) + this._findW(kb_pad_eur) + 1) + "px";

    var kb_pad_slash = this._setup_key(parent, container_id + "___pad_slash", "1px", edge_1, cp, cp, c, lh, fs);
    kb_pad_slash.innerHTML = "/";
    this.pad[1] = kb_pad_slash;
    

    var edge_2 = (this._findX(kb_pad_slash) + this._findW(kb_pad_slash) + 1) + "px";

    //var kb_pad_star = this._setup_key(parent, container_id + "___pad_star", "1px", edge_2, cp, cp, c, lh, fs);
    //kb_pad_star.innerHTML = "*";
   
    var kb_pad_star = this._setup_key(parent, container_id + "___pad_star", "1px", edge_2, cp, cp, c, lh, fs);
     kb_pad_star.innerHTML = "*";
     // this.mod[5] = kb_shift;
    this.pad[2] = kb_pad_star;
     //this._detach_event(kb_pad_star, 'mouseover', this._handle_lang_menu);


    var edge_3 = (this._findX(kb_pad_star) + this._findW(kb_pad_star) + 1) + "px";

    var kb_pad_minus = this._setup_key(parent, container_id + "___pad_minus", "1px", edge_3, cp, cp, c, lh, fs);
    if (Field==_txtField)
    {
		
		//kb_pad_minus.innerHTML = "<BR>";//for username only
		kb_pad_minus.innerHTML = "-";
    }
    else
    {
       kb_pad_minus.innerHTML = "-";
    }
    this.pad[3] = kb_pad_minus;

    this.kbpM = this._findX(kb_pad_minus) + this._findW(kb_pad_minus) + 1;

    var prevH = this._findH(kb_pad_eur), edge_Y = (this._findY(kb_pad_eur) + prevH + 1) + "px";

    var kb_pad_7 = this._setup_key(parent, container_id + "___pad_7", edge_Y, edge, cp, cp, c, lh, fs);
    var kb_pad_8 = this._setup_key(parent, container_id + "___pad_8", edge_Y, edge_1, cp, cp, c, lh, fs);
    var kb_pad_9 = this._setup_key(parent, container_id + "___pad_9", edge_Y, edge_2, cp, cp, c, lh, fs);
    
    var kb_pad_plus = this._setup_key(parent, container_id + "___pad_plus", edge_Y, edge_3, cp, dp, c, dp2, fs);
    
    if (Field==_txtField)
    {
		kb_pad_plus.innerHTML ="+";
	}
	else
	{
		kb_pad_plus.innerHTML = "_";
	}
	
    this.pad[7] = kb_pad_plus;
     
    edge_Y = (this._findY(kb_pad_7) + prevH + 1) + "px";

    var kb_pad_4 = this._setup_key(parent, container_id + "___pad_4", edge_Y, edge, cp, cp, c, lh, fs);
    //kb_pad_4.innerHTML = "4";
    //this.pad[8] = kb_pad_4;

    var kb_pad_5 = this._setup_key(parent, container_id + "___pad_5", edge_Y, edge_1, cp, cp, c, lh, fs);
    var kb_pad_6 = this._setup_key(parent, container_id + "___pad_6", edge_Y, edge_2, cp, cp, c, lh, fs);
     edge_Y = (this._findY(kb_pad_4) + prevH + 1) + "px";

    var kb_pad_1 = this._setup_key(parent, container_id + "___pad_1", edge_Y, edge, cp, cp, c, lh, fs);
    var kb_pad_2 = this._setup_key(parent, container_id + "___pad_2", edge_Y, edge_1, cp, cp, c, lh, fs);
	var kb_pad_3 = this._setup_key(parent, container_id + "___pad_3", edge_Y, edge_2, cp, cp, c, lh, fs);
    var kb_pad_enter = this._setup_key(parent, container_id + "___pad_enter", edge_Y, edge_3, cp, dp, c, dp2, parseFloat(fs) * 0.643, n);
    kb_pad_enter.innerHTML = "Entr";
    
    this.pad[14] = kb_pad_enter;

    edge_Y = (this._findY(kb_pad_1) + prevH + 1) + "px";

    var kb_pad_0 = this._setup_key(parent, container_id + "___pad_0", edge_Y, edge, dp, cp, l, lh, fs, "", 7 * mag + "px");
    var kb_pad_period = this._setup_key(parent, container_id + "___pad_period", edge_Y, edge_2, cp, cp, c, lh, fs);
    kb_pad_period.innerHTML = ".";
    this.pad[16] = kb_pad_period;
   
    
    
    /* return random array */
    var Rand_Arr = new Array("0","1","2","3","4","5","6","7","8","9");
	Rand_Arr=shuffle(Rand_Arr);	
	
    // Assign Values to NumPAD
     var _opt_No;
	 _opt_No=Rand_Arr[0];
    kb_pad_0.innerHTML = _opt_No;
     _opt_No=Rand_Arr[1];
    kb_pad_1.innerHTML = _opt_No;
     _opt_No=Rand_Arr[2];
    kb_pad_2.innerHTML = _opt_No;
     _opt_No=Rand_Arr[3];
    kb_pad_3.innerHTML = _opt_No;
     _opt_No=Rand_Arr[4];
    kb_pad_4.innerHTML = _opt_No;
     _opt_No=Rand_Arr[5];
    kb_pad_5.innerHTML = _opt_No;
     _opt_No=Rand_Arr[6];
    kb_pad_6.innerHTML = _opt_No;
     _opt_No=Rand_Arr[7];
    kb_pad_7.innerHTML = _opt_No;
     _opt_No=Rand_Arr[8];
    kb_pad_8.innerHTML = _opt_No;
     _opt_No=Rand_Arr[9];
    kb_pad_9.innerHTML = _opt_No;
    
    // Align to PADs   
	this.pad[15] = kb_pad_0;
    this.pad[11] = kb_pad_1;
    this.pad[12] = kb_pad_2;
	this.pad[13] = kb_pad_3;
    this.pad[8] = kb_pad_4;
	this.pad[9] = kb_pad_5;
    this.pad[10] = kb_pad_6;
    this.pad[4] = kb_pad_7;
    this.pad[5] = kb_pad_8;
    this.pad[6] = kb_pad_9;
     
        /* - --------------------- */
    
    
    
    

    return this.kbpM;
  },

  _set_key_state: function(key, on, textcolor, bordercolor, bgcolor)
  {
  //alert(key);
    if(key)
    {
      var ks = key.style;
      
      // Change the color of Inactive Icons 
      if (!on)
      {
		textcolor="gray";
      }
      
      if(ks)
      {
	    if(textcolor) ks.color = textcolor;
        if(bordercolor) ks.border = "1px solid " + bordercolor;
        if(bgcolor) ks.backgroundColor = bgcolor;
       
      }
		
      this._detach_event(key, 'mousedown', this._generic_callback_proc);
      
      if(on){
       this._setup_event(key, 'mousedown', this._generic_callback_proc);
       // add a new Event for Mouse Over and Mouse Out
       
       if (key.id ==  "keyboard___res_5")
       {ks.border = "0px";}else{
       this._setup_event(key, 'mouseover',new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor ='"+ mouse_over_bg_color +"';VKeyboard.prototype._get_event_source(event).style.color ='"+ mouse_over_font_color +"'"));//;this.mod[4].style.backgroundColor='"+ mouse_over_bg_color +"'
       this._setup_event(key, 'mouseout',new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor ='"+ key_bg_color +"';VKeyboard.prototype._get_event_source(event).style.color ='"+font_color+"'"));
       }
      }
    }
  },

  _refresh_layout: function()
  {
    var fc = this.fontcolor;
    var kc = this.keycolor, bc = this.bordercolor;
    var ibc = this.inactivebc, lic = this.lic;

    var pre = "VKeyboard.prototype.";

    var layout_name = pre + this.CurrentLayout;
    var arr_type = this.Alt ? (this.Shift ? "alt_shift" : "alt") : (this.Shift ? "shift" : (this.Caps ? "caps" : "normal"));

    var nkeys = this.keys.length;
	var _Option;
	var l;
	var rnd_no;
	
	//_caps is false by default
	//Once u click caps,then _caps= true and if true retain the value ...dont generate random string 
	//alert(_caps)
	if (this.Caps)
	{
		_caps = true;
		_Option=_optVal;
	}
	else
	{	//Randomly Generate a STRING modifed 10.04
		var text_st = new Array("1", "2", "3","4","5","6","7");
		text_st=shuffle(text_st);	// SHUFFLE THE ARRAY -  THE NUMBER WITH THE CHARACTER ARRAY
	
	    var No_Arr = new Array("0", "1", "2","3","4","5","6"); // ARRAY REPRESENTING THE POSITION
	    No_Arr = shuffle(No_Arr);
	    rnd_no= No_Arr[3];
	
		// Find the Length of the Array
		//l = text_st.length;
		// Get a Random Number 
		//rnd_no=Math.floor(Math.round(l-1)* Math.random);
		//rnd_no = Math.round((l-1)*Math.random());
		//alert(Math.random());
		// Get the Array for the Generated Number 
		if (_caps)
		{
			_Option=_optVal;
			_caps = false;
		}
		else
		{
	  		_Option = text_st[rnd_no];//getthe item 
	  		_optVal=_Option;   
		}
	
	}
	
	//alert(text_st[rnd_no]);
	//alert(_Option)

    if (Field==_txtField)
	{
		var norm_arr;  eval("norm_arr  = " + layout_name + "_password" + _Option);
		var caps_arr;  eval("caps_arr  = " + layout_name + "_caps_password" + _Option);
	}
    else
    {
		var norm_arr;  eval("norm_arr  = " + layout_name + "_normal" + _Option);
		var caps_arr;  eval("caps_arr  = " + layout_name + "_caps" + _Option);
    }
    
    
    
	// var caps_arr;  eval("caps_arr  = " + layout_name + "_caps");
    var shift_arr; eval("shift_arr = " + layout_name + "_shift");
    var alt_arr;   eval("alt_arr   = " + layout_name + "_alt_gr");
    var alt_shift_arr; eval("alt_shift_arr = " + layout_name + "_alt_gr_shift");
    
    
    
    

    var dead_arr; eval("dead_arr = " + (this.DeadAction[1] ? pre + this.DeadAction[1] : "null"));

    var bcaps  = (caps_arr  && (caps_arr.length  == nkeys));
    var bshift = (shift_arr && (shift_arr.length == nkeys));
    var balt   = (alt_arr   && (alt_arr.length   == nkeys));
    var baltsh = (balt      && alt_shift_arr && (alt_shift_arr.length == nkeys));

    var caps = this.mod[2], shift = this.mod[5], shift_r = this.mod[6], alt_gr = this.mod[11];alt_new=this.mod[9];
    
    
   

    if(bshift)
    {
      this._set_key_state(shift, true, fc, bc, this.Shift ? lic : kc);
      this._set_key_state(shift_r, true, fc, bc, this.Shift ? lic : kc);
    }
    else
    {
      this._set_key_state(shift, false, ibc, ibc, kc);
      this._set_key_state(shift_r, false, ibc, ibc, kc);

      if(arr_type == "shift")
      {
        arr_type = "normal";
        this.Shift = false;
      }
    }

    if(balt)
    {
      this._set_key_state(alt_gr, true, fc, bc, this.Alt ? lic : kc);
	  //this._set_key_state(alt_new, true, fc, bc, this.Alt ? lic : kc);
      if(this.Alt)
      {
       // alert("ALT BUTTON CLICKED");
        if(baltsh)
        {
          //alert("B ALT BUTTON CLICKED");
          this._set_key_state(shift, true, fc, bc);
          this._set_key_state(shift_r, true, fc, bc);
        }
        else
        {
          this._set_key_state(shift, false, ibc, ibc, kc);
          this._set_key_state(shift_r, false, ibc, ibc, kc);

          arr_type = "alt";
          this.Shift = false;
        }
      }
    }
    else
    {
      this._set_key_state(alt_gr, false, ibc, ibc, kc);
	  //this._set_key_state(alt_new, false, ibc, ibc, kc);
      if(arr_type == "alt")
      {
        arr_type = "normal";
        this.Alt = false;
      }
      else if(arr_type == "alt_shift")
      {
        arr_type = "normal";
        this.Alt = false, this.Shift = false;

        shift.style.backgroundColor = kc, shift_r.style.backgroundColor = kc;
      }
    }

    if(this.Shift && !baltsh)
      this._set_key_state(alt_gr, false, ibc, ibc, kc);
      this._set_key_state(alt_new, false, ibc, ibc, kc);

    if(bcaps && !this.Alt)
      this._set_key_state(caps, true, fc, bc, this.Caps ? lic : kc);
    else
    {
      this._set_key_state(caps, false, ibc, ibc, kc);

      this.Caps = false;
      if(arr_type == "caps") arr_type = "normal";
    }

    var arr_cur;
    switch(arr_type)
    {
      case "caps":  arr_cur = caps_arr;  break;
      case "shift": arr_cur = shift_arr; break;
      case "alt":   arr_cur = alt_arr;   break;
	  
      case "alt_shift": arr_cur = alt_shift_arr; break;

      default: arr_cur = norm_arr;
    }

    var i = nkeys;
    //alert(nkeys)
    while(--i >= 0)
    {
      var key_val = arr_cur[i]; if(!key_val) key_val = "";

      var key = this.keys[i];

      if(this.Shift && this.Caps)
      {
        var key_nrm = norm_arr[i], key_cps = caps_arr[i], key_shf = shift_arr[i];

        if((key_cps == key_shf) && (key_nrm != key_cps)) key_val = key_nrm;
      }

      if(typeof(key_val) == "object")
      {
        key.innerHTML = key_val[0], key.dead = key_val[1];
       
 
//        this._set_key_state(key, true, "#F00", bc, (this.DeadAction[0] == key_val[0] ? lic : kc));
      }
      else
      {
        key.dead = null;

        var block = false;

        if(key_val != "")
        {
          if(dead_arr)
          {
			
            for(var j = 0; j < dead_arr.length; j++) { var dk = dead_arr[j]; if(dk[0] == key_val) { key_val = dk[1]; break;}};

            if(j == dead_arr.length) block = true;
          }

          key.innerHTML = key_val;
         
                
          /* here the object gets placed in the cell */
		  		  
		  /* Added 09.04.2007 to disable buttons  for the Invalid Characters */ 
		  
		  switch(key_val)
		  {
			case "~":case ",": case "[": case "]":case "{":case "}":case "<BR>":case ";":case ":":case "-":case "+":case "<":case "?":case ">":case "/":
				block=true;
			break;
		  
		  }
		   
		   /* End Add */
    
          	
          if(block)
            this._set_key_state(key, false, ibc, ibc, kc);
          else
            this._set_key_state(key, true, fc, bc, kc);
            
        
            
        }
        else
        {
          key.innerHTML = "&nbsp;";
          this._set_key_state(key, false, ibc, ibc, kc);
        }
      }
    }

    i = this.mod.length;
   
    while(--i >= 0)
    {
      var key = this.mod[i];

      switch(i)
      {
      // the below case is to make disabled paramter - clear mouseover and all 10.04.2007
        case 1:case 5: case 6: case 8: case 9:case 10:case 11:case 12: case 13:case 4: 
		this._set_key_state(key, false, ibc, ibc, kc);
        break;
        case 7:
          key.innerHTML = "Ctrl";//this.CurrentLayout(Us);
          //alert(key.innerHTML)
          this._detach_event(key, 'mousedown', this._handle_lang_menu);
			 
          if(this.DeadAction[1])
            this._set_key_state(key, false, ibc, ibc, kc);
          else
          {
            var many = (VKeyboard.prototype.avail_langs.length > 1);

            this._set_key_state(key, false, fc, many ? this.lsc : ibc, kc);
            if(many)
              this._setup_event(key, 'mousedown', this._handle_lang_menu);
          }
          break;

        /*case 10:
        //spacebar
        key.innerHTML = this.DeadAction[1] ? this.DeadAction[0] : "&#x00A0;";*/
        
        default:
          if(this.DeadAction[1] && (i != 10))
            this._set_key_state(key, false, ibc, ibc, kc);
          else
            this._set_key_state(key, true, fc, bc, kc);

          var ks = key.style;
          switch(i)
          {
            case 4: ks.borderBottomColor = kc; break;

            //case 8: case 12: case 13: ks.borderColor = ibc; break;
            
          }
      }
    }

    i = this.pad.length;
    while(--i >= 0)
    {
	  key = this.pad[i];
      /*  Here is the Numpad Disabling for respective Items */
      var _disable=false;
      switch(key.innerHTML)
        {
			case "&#x20AC;":case "/":case "*":case "+":case ".":case "€":case "-":
				_disable=true
			break;
        }
        
        if (i==0)//Special Character
        {
			
			_disable=true;
        }
    
      if(_disable)
        this._set_key_state(key, false, ibc, ibc, kc);
      else
        this._set_key_state(key, true, fc, bc, kc);
    }
     
     
    
    
  },

  _handle_lang_menu: function(event)
  {
    var pr = VKeyboard.prototype;
    

    var in_el = pr._get_event_source(event);
    var container_id = in_el.id.substring(0, in_el.id.indexOf("___"));
    var vkboard = pr.kbArray[container_id];
     //vkboard._refresh_layout();
    var ct = vkboard.Cntr, menu = vkboard.menu;

    if(menu)
    { ct.removeChild(menu); vkboard.menu = null; }
    else
    {
      var fs = vkboard.fontsize, kc = vkboard.keycolor, bc = "1px solid " + vkboard.bordercolor;
      var mag = parseFloat(fs) / 14.0, cell = Math.floor(25.0 * mag), cp = cell + "px", lh = (cell - 2) + "px", w = String(102 * mag) + "px";
      var h1 = Math.floor(cell + mag), h2 = String(100 * mag) + "px", pad = String(4 * mag) + "px";

      var langs = pr.avail_langs.length;

      menu = document.createElement("DIV"); var ms = menu.style;
      ms.display  = "block";
      ms.position = "relative";

      ms.top = "1px", ms.left = "0px";
      ms.width = w;
      ms.border = bc;
      ms.backgroundColor = vkboard.bgcolor;

      vkboard.menu = ct.appendChild(menu);

      var menu_main = document.createElement("DIV"); ms = menu_main.style;
      ms.fontFamily = vkboard.fontname;
      ms.position   = "relative";

      ms.color  = vkboard.fontcolor;
      ms.width  = w;
      ms.height = String(langs * h1 + 1) + "px";
      ms.cursor = "default";
      menu.appendChild(menu_main);
      
      
      

      for(var j = 0; j < langs; j++)
      {
        var item = vkboard._setup_key(menu_main, container_id + "___lang_" + String(j), String(h1 * j + 1) + "px", "1px", h2, cp, "left", lh, fs, "normal", pad);
        item.style.backgroundColor = kc;
        item.style.border = bc;
        item.innerHTML = pr.avail_langs[j][1];

        vkboard._setup_event(item, 'mousedown', vkboard._handle_lang_item);
        vkboard._setup_event(item, 'mouseover', new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor ='" + vkboard.lic + "'"));
        vkboard._setup_event(item, 'mouseout',  new Function("event", "VKeyboard.prototype._get_event_source(event).style.backgroundColor = '" + kc + "'"));
      }
    }
  },

  _handle_lang_item: function(event)
  {
    var pr = VKeyboard.prototype;

    var in_el = pr._get_event_source(event);
    var container_id = in_el.id.substring(0, in_el.id.indexOf("___"));
    var vkboard = pr.kbArray[container_id];

    var ndx = in_el.id.indexOf("___lang_");
    var lng = in_el.id.substring(ndx + 8, in_el.id.length);
    var newl = pr.avail_langs[lng][0];

    if(vkboard.CurrentLayout != newl)
    {
      vkboard.CurrentLayout = newl;
      vkboard._refresh_layout();
    }
		/*vkboard.CurrentLayout = newl;
        vkboard._refresh_layout();*/

    vkboard.Cntr.removeChild(vkboard.menu);
    vkboard.menu = null;
  },
  
   _generic_callback_proc: function(event)
  {
	
    var pr = VKeyboard.prototype;
	
    var in_el = pr._get_event_source(event);
   
    var container_id = in_el.id.substring(0, in_el.id.indexOf("___"));

    var vkboard = pr.kbArray[container_id];
    var val = in_el.subst ? in_el.subst : in_el.innerHTML;

    var r = false;
    var Bool=true; // for clicking on the why virtual keyboard link 
    
   //alert(val);
    switch(val)
    {
		//case "Caps":  r = true; vkboard.Caps  = !vkboard.Caps;  break;
		case "Caps":case "CAPS":
		  r = true; vkboard.Caps  = !vkboard.Caps;  break;
		case "Shift": r = true; vkboard.Shift = !vkboard.Shift; break;
		//case "Alt": r = true; vkboard.Alt = !vkboard.Alt; break;
		//case "*": r=true;break;
		case "<BR>": val="";break;
		//case "Tab":    val = "   "; break;
		case "Tab":    val = ""; break;
		case "&nbsp;": val = "";   break;
		case "&quot;": val = "\"";  break;
		case "&lt;":   val = "<";   break;
		case "&gt;":   val = ">";   break;
		case "&amp;":  val = "&";   break;
		//case "Close": val="";break;
		case "": val=""; break;
		case "Why&nbsp;Virtual&nbsp;Keyboard?": Bool=false; break;
    }
    
    if(r) { vkboard._refresh_layout(); return; }

    if(in_el.dead)
    {

      if(in_el.dead == vkboard.DeadAction[1])
      { val = ""; vkboard.DeadAction[0] = vkboard.DeadAction[1] = null; }
      else
      { vkboard.DeadAction[0] = val; vkboard.DeadAction[1] = in_el.dead; }

      vkboard._refresh_layout();
      return;
    }
    else
    {
   		// Add Rameez 26.04.2007
		if (Bool==true)
		{
			if(vkboard.DeadAction[1]) { vkboard.DeadAction[0] = vkboard.DeadAction[1] = null; r = true; }
		    if(vkboard.Alt || vkboard.Shift || r)
			{
				vkboard.Alt = false; vkboard.Shift = false;
				vkboard._refresh_layout();
			}
      	}// end add 
    }
    
	if (Bool==true){if(vkboard._Callback) vkboard._Callback(val, vkboard.Cntr.id);}
  },

  SetParameters: function()
  {
  
    var l = arguments.length;
    if(!l || (l % 2 != 0)) return false;

    var p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10;

    while(--l > 0)
    {
      var value = arguments[l];

      switch(arguments[l - 1])
      {
        case "callback":
          p0 = ((typeof(value) == "function") && ((value.length == 1) || (value.length == 2))) ? value : this._Callback;
          break;

        case "font-name":  p1 = value; break;
        case "font-size":  p2 = value; break;
        case "font-color": p3 = value; break;
        case "dead-color": p4 = value; break;
        case "base-color": p5 = value; break;
        case "key-color":  p6 = value; break;

        case "selection-color": p7 = value; break;
        case "border-color":    p8 = value; break;

        case "inactive-border-color": p9  = value; break;
        case "lang-cell-color":       p10 = value; break;

        default: break;
      }

      l -= 1;
    }

    this._construct(this.Cntr.id, p0, (this.pad.length != 0), p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);

    return true;
  },

  Show: function(value)
  {
    var ct = this.Cntr.style;

    ct.display = ((value == undefined) || (value == true)) ? "block" : ((value == false) ? "none" : ct.display);
  },

  
  
  ShowNumpad: function(value)
  {
    var sh = ((value == undefined) || (value == true)) ? "block" : ((value == false) ? "none" : null);
    if(!sh) return;

    var kb = this.Cntr.childNodes[0];

    var i = this.pad.length;
    
    if(i)
    {
      while(--i >= 0)
        this.pad[i].parentNode.style.display = sh;

      kb.style.width = kb.childNodes[0].style.width = (sh == "none") ? (this.kbpH + 1) + "px" : this.kbpM + "px";
      
    }
    else
    {
      if(sh == "block")
      {
        kb.style.width = kb.childNodes[0].style.width = this._create_numpad(this.Cntr.id, kb.childNodes[0]);
        this._refresh_layout();
      }
    }
  },

  // Layout info:

  //avail_langs: [["Us", "English (US)"]],
avail_langs: [["Us", "English (US)"]]

,
  
///1.
Us_password1: [
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+",//13
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p","{","}","[", // 13 nos needed
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";",":","/", // 12 nos needed
				"z", "x", "c", "v", "b", "n", "m",">",",","?"]// 10 nos needed 

,
//2.
Us_password2: [
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p","{","}","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+", //13
				"z", "x", "c", "v", "b", "n", "m",">",",","?",":","/",// 12nos needed 
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";" // 10 nos needed
              ]

,

//3.
Us_password3: [
				"z", "x", "c", "v", "b", "n", "m",">",",","?",":","/","+",     // 13
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p","{","}","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", //12
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";" // 10 nos needed
				
				]
,

//4.
Us_password4: [
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";",":","/","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+",//13
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p","{","}", // 12 nos needed
				"z", "x", "c", "v", "b", "n", "m",">",",","?"// 10 nos needed 
			  ]
,

//5.
Us_password5: [
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p","{","}","[", // 13 nos needed
				"~","z", "x", "c", "v", "b", "n", "m",">",",","?", "-","+",//13
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";",":","/", // 12 nos needed
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"// 10 nos needed 
			  ]
,

//6

Us_password6: [
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0","{","}","[", // 13 nos needed
				"~","a", "s", "d", "f", "g", "h", "j", "k", "l",";",":","/",//13
				"z", "x", "c", "v", "b", "n", "m",">",",","?", "-","+",// 12 nos needed
				"q", "w", "e", "r", "t", "y", "u", "i", "o", "p"// 10 nos needed 
			  ]
,
//7

Us_password7: [
				"a", "s", "d", "f", "g", "h", "j", "k", "l",";","{","}","[", // 13 nos needed
				"~","q", "w", "e", "r", "t", "y", "u", "i", "o", "p",":","/",//13
				"z", "x", "c", "v", "b", "n", "m",">",",","?", "-","+",// 12 nos needed
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"// 10 nos needed 
			  ]
,

 Us_caps_password1: ["~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+",
            "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P","{","}","[",// 13 nos needed
             "A", "S", "D", "F", "G", "H", "J", "K", "L",";",":","/", // 12 nos needed
              "Z", "X", "C", "V", "B", "N", "M",">",",","?"]// 10 nos needed 

,

 Us_caps_password2:  [
				"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P","{","}","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+", //13
				"Z", "X", "C", "V", "B", "N", "M",">",",","?",":","/",// 12nos needed 
				"A", "S", "D", "F", "G", "H", "J", "K", "L",";" // 10 nos needed
              ]
,

 Us_caps_password3: [
				"Z", "X", "C", "V", "B", "N", "M",">",",","?",":","/","+",     // 13
				"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P","{","}","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", //12
				"A", "S", "D", "F", "G", "H", "J", "K", "L",";" // 10 nos needed
				
				]
 ,

 Us_caps_password4: [
				"A", "S", "D", "F", "G", "H", "J", "K", "L",";",":","/","[", // 13 nos needed
				"~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-","+",//13
				"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P","{","}", // 12 nos needed
				"Z", "X", "C", "V", "B", "N", "M",">",",","?"// 10 nos needed 
			  ]
                      
,

 Us_caps_password5: [
				"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P","{","}","[", // 13 nos needed
				"~","Z", "X", "C", "V", "B", "N", "M",">",",","?", "-","+",//13
				"A", "S", "D", "F", "G", "H", "J", "K", "L",";",":","/", // 12 nos needed
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"// 10 nos needed 
			  ]
                      
  ,

 Us_caps_password6: [
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0","{","}","[", // 13 nos needed
				"~","A", "S", "D", "F", "G", "H", "J", "K", "L",";",":","/",//13
				"Z", "X", "C", "V", "B", "N", "M",">",",","?", "-","+", // 12 nos needed
				"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"// 10 nos needed 
			  ]  
			   ,

 Us_caps_password7: [
				"A", "S", "D", "F", "G", "H", "J", "K", "L",";","{","}","[", // 13 nos needed
				"~","Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P",":","/",//13
				"Z", "X", "C", "V", "B", "N", "M",">",",","?", "-","+", // 12 nos needed
				"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"// 10 nos needed 
			  ]                  
};

             