var showKeyboardString = 'की-बोर्ड दिखाइए';
var hideKeyboardString = 'की-बोर्ड छुपाइए'; 	
var showKeyboardAgainString = 'पुनः की-बोर्ड दिखाइए'; 	

var tt = new Array('a','aa','i','ii','u','uu','R','e','e','o','au','M','','A','ka','kha','ga','gha','nga','ya','ra','la','va','Halant','aa','1','2','3','ca','cha','ja','jha','Ja','sha','Sa','sa','ha','i','ii','4','5','6','Ta','Tha','Da','Dha','Na','xa','tra','Ga','qa','u','uu','7','8','9','ta','tha','da','dha','na','za','dHa','DHa','R','e','ai','H','A','0','pa','pha','ba','bha','ma','fa','Space','o','au');
var v = new Array('\u0905','\u0906','\u0907','\u0908','\u0909','\u090a','\u090b','\u090f','\u0910','\u0913','\u0914','\u0902','\u0903','\u0911','\u0915','\u0916','\u0917','\u0918','\u0919','\u092f','\u0930','\u0932','\u0935','\u094d','\u093e','\u0967','\u0968','\u0969','\u091a','\u091b','\u091c','\u091d','\u091e','\u0936','\u0937','\u0938','\u0939','\u093f','\u0940','\u096a','\u096b','\u096c','\u091f','\u0920','\u0921','\u0922','\u0923','\u0915\u094d\u0937','\u0924\u094d\u0930','\u091c\u094d\u091e','\u0959','\u0941','\u0942','\u096d','\u096e','\u096f','\u0924','\u0925','\u0926','\u0927','\u0928','\u095b','\u095c','\u095d','\u0943','\u0947','\u0948','\u0901','\u0949','\u0966','\u092a','\u092b','\u092c','\u092d','\u092e','\u095e','\u0916\u093e\u0932\u0940 \u091c\u0917\u0939','\u094b','\u094c');
var temp,i,y;

var VB = "<td width=28><input type=button onclick=AppendChar(this.value) class=VowlesButton value=\"";
var CB = "<td width=28><input type=button onclick=AppendChar(this.value) class=ConsonantButton value=\"";
var CB1 = "<td width=28><input type=button onclick=AppendChar(this.value) class=ConsonantButton1 value=\"";
var Num =  "<td width=28><input type=button onclick=AppendChar(this.value) class=Numeral value=\"";

function displayKeyboard()
{
	var str="";
	str += "<table border=1 cellpadding=0 align=center cellspacing=0 style=\"border-collapse: collapse\" bordercolor=#111111 width=100% bordercolorlight=#FFFFFF bordercolordark=#FFFFFF bgcolor=#FFFFFF>";
	
	str += "<tr><td  align=right colspan=14><font size=2>&#2335&#2366&#2311&#2346 &#2325&#2352&#2344&#2375&#2306 &#2325&#2375 &#2354&#2367&#2319 &#2330&#2351&#2344&nbsp;</font>&nbsp;&nbsp;";
	str += "<font size=2 color=green><b>&#2361&#2367&#2344&#2381&#2342&#2368</font>";
	str += "<input type='radio' id='radio' name=button1 value='Hindi' onclick='return radioClick (event)' checked onmouseover=\"showtip(this,event,'Hindi')\">";
	str += "<font size=2 color=green><b>&#2309&#2306&#2327&#2381&#2352&#2375&#2332&#2368</font>";
	str += "<input type='radio' id='radio' name=button1 value='English' onclick='return radioClick (event)'  onmouseover=\"showtip(this,event,'English')\"></td></tr><tr><td colspan=14 ><img src=adsasd width=1 height=5></tr>";
	
	str += "<tr>";
	for(i=0;i<14;i++)
	{
		temp = VB  + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	str += "<td align=right>&nbsp;&nbsp;&nbsp;<!--a href ='/hi/GurujiHelpPage.html' align=right onmouseover=\"showtip(this,event,'Help Page')\">";
	str += "<font size=2>&#2327;&#2369;&#2352;&#2369;&#2332;&#2368; &#2325;&#2379; &#2325;&#2376;&#2360;&#2375; &#2313;&#2346;&#2351;&#2379;&#2327; &#2325;&#2352;&#2375;&#2306;?</font></a--></td></tr>";
	for(var z=0; z < 2; z++)
	{
		y = i + 5;
		str += "<tr>";
		for(;i<y;i++)
		{
			temp =  CB + v[i] + "\""+ "title="+tt[i] +"></td>";
			str += temp ;
		}
		for(y += 4;i<y;i++)
		{
			temp =  CB1 + v[i] + "\""+ "title="+tt[i] +"></td>";
			str += temp ;
		}
		for(y += 2;i<y;i++)
		{
			temp =  VB + v[i] + "\""+ "title="+tt[i] +"></td>";
			str += temp ;
		}
		for(y += 3;i<y;i++)
		{
			temp =  Num + v[i] + "\""+ "title="+tt[i] +"></td>";
			str += temp ;
		}
		/*if(!z)
		{
			str += "<td  align=right><font size=2>&#2335&#2366&#2311&#2346 &#2325&#2352&#2344&#2375&#2306 &#2325&#2375 &#2354&#2367&#2319 &#2330&#2351&#2344&nbsp;</font></td>";
		}
		if(z==1){
		str += "<td align=right><font size=2 color=green><b>&#2361&#2367&#2344&#2381&#2342&#2368</font>";
		str += "<input type='radio' id='radio' name=button1 value='Hindi' onclick='return radioClick (event)' checked onmouseover=\"showtip(this,event,'Hindi')\"></td>";
		}*/
		str += "</tr>";
	}
	str += "<tr>";
	for(y += 5;i<y;i++)
	{
		temp =  CB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	for(y += 3;i<y;i++)
	{
		temp =  CB1 + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	for(y += 3;i<y;i++)
	{
		temp =  VB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	for(y += 3;i<y;i++)
	{
		temp =  Num + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	/*str += "<td align=right><font size=2 color=green><b>&#2309&#2306&#2327&#2381&#2352&#2375&#2332&#2368</font>";
	str += "<input type='radio' id='radio' name=button1 value='English' onclick='return radioClick (event)'  onmouseover=\"showtip(this,event,'English')\"></td>";*/
	str += "</tr><tr>";
	for(y += 5;i<y;i++)
	{
		temp =  CB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	for(y += 3;i<y;i++)
	{
		temp =  CB1 + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}	
	for(y += 5;i<y;i++)
	{
		temp =  VB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	for(y += 1;i<y;i++)
	{
		temp =  Num + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	str += "</tr><tr>";
	for(y += 5;i<y;i++)
	{
		temp =  CB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	temp =  temp =  CB1 + v[i] + "\""+ "title="+tt[i] +"></td>";
	str += temp ;
	i++;
	//Space Bar
	temp =  "<td width=84 colspan=3><input type=button onclick=AppendChar(32) class=ConsonantButton1 value=\"" + v[i] + "\""+ "title="+tt[i] +"></td>";
	str += temp ;
	for(y += 4,i++;i<y;i++)
	{
		temp =  VB + v[i] + "\""+ "title="+tt[i] +"></td>";
		str += temp ;
	}
	//Guruji Bottom image
	str += "<td width=84 colspan=3></td></tr></table>";
	disp_keyboard.innerHTML = str;
}

function $(id)
{
        return document.getElementById(id);
}

function hideKeyboard()
{
	disp_keyboard.innerHTML = "";
}
function onfocusShowKeyboard()
{
	var head1 = $("label");
	if (head1.firstChild.nodeValue != showKeyboardAgainString && 
	    head1.firstChild.nodeValue != hideKeyboardString)
	{
		head1.firstChild.nodeValue = hideKeyboardString;
		displayKeyboard();
	}
}

function changeLabel()
{ 
	var head1 = $("label");
   	if(head1.firstChild.nodeValue != hideKeyboardString)
	{
		head1.firstChild.nodeValue = hideKeyboardString;
		displayKeyboard();
	}
	else 
	{
		head1.firstChild.nodeValue = showKeyboardAgainString;
		hideKeyboard();
	}
}