function mywrk(arg) 
{
var x;
var l=arg-13;
x='<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="105"><TR valign="bottom"><TD>';
x=x+'<table width="100%" border="0"><tr valign="bottom">'
for(i=0;i<26;i++)
	{
	if(l>25){l=0};if(l<0){l=26+l}
	x=x+'<td><table border="0" height="0" bordercolor="#000000" ><tr>'
	x=x+'<td bgcolor="red" height='+hgt[which_butt_clicked][l]*4+'></td>'+'</tr>'
	x=x+'<tr><td height="0"><font face="courier" size="1" color="#cccccc"><b>'+letter.charAt(l)+'</b></font></td></tr></table></td>';
	l++;
	}

x=x+'</TD></TR></TABLE>';

document.all['graphLayer'].innerHTML=x;

if(l>25){l=26-l}
//////////////////
breakkey(l);		
}//end of function
///////////////////////////////////////////////////////////////////////////////////////
var my_plaintext=new Array();
function breakkey(arg_ofmywrk)//this function is breaking the keyword
{
var key_value=arg_ofmywrk;//collecting the key chars index
var charsettext="";
var ciphar_value="";
var plain_value="";
//var key_value="";

for(var j=0;j<array_ofcharset.length;j++)
	{
	
	my_plaintext[j]="";
	charsettext=array_ofcharset[j];
	for(k=0;k<charsettext.length;k++)
		{
		cipher_value=letter.indexOf(charsettext.charAt(k))
		plain_value=cipher_value-key_value;
		if(plain_value<0)
		{
		plain_value=26+plain_value
		}
		my_plaintext[j]=my_plaintext[j]+letter.charAt(plain_value);
		
		}	
	}
deciphered_text_onlayer(which_butt_clicked) ;

var doc=eval("document.form1.L"+which_butt_clicked);
doc.value=letter.charAt(key_value);

document.form1.textfield.value=deciphered
}//func


var flag=0;
var deciphered;
var decipher_array=new Array()
function deciphered_text_onlayer(buttnum)
{
var counter=0;
var x=my_plaintext[buttnum];
if(flag==0)
{
for(var i=0;i<my_cipher_text.length;i++)
	{
	decipher_array[i]="*"
	}
flag=1;
}
for(var i=0;i<my_cipher_text.length;i++)
	{
	if(i%our_key_length==buttnum)
		{
		 decipher_array[i]=x.charAt(counter);
		 counter++;
		}	
	}
deciphered=decipher_array.join("");
}//function