var zIndexIe = 5;
var msgObj ;
var appletObj ;
var banglishtxt ;
var layerCreated = false ;
var ballonbackcolor = "#FFFFFF"
var tablebackcolor = "#FFFFFF"
var layerTop = 0;
function GetLeftTopIE(obj,anchorobj){
var tempobj = anchorobj;
obj.X = 0;
obj.Y = 0;
while(tempobj.parentElement)
{
if(!tempobj.parentElement) break;
tempobj = tempobj.parentElement;
if(String(":TABLE:TD:DIV:").indexOf(":"+tempobj.tagName+":") > -1 )
{
obj.X += tempobj.offsetLeft;
obj.Y += tempobj.offsetTop;
}
if( tempobj.parentElement.tagName == "BODY" ) break;
}
return ;
}
function getBaloon(obj,obj1,x,y){
msgObj = obj ;
appletObj = obj1 ;
if ( !appletObj) return false;
if ( browserWithLayers ){
this.X = x;
this.Y = y;
}
else{
GetLeftTopIE(this,msgObj);
}
//alert(layerTop);
//alert(this.Y);
if ( layerTop != this.Y ){
killBaloon();
}
layerTop = this.Y;
if ( !layerCreated )
createMsgBaloon(this.X,this.Y);
//
//document.lyrdiv["baloon"].style.visibility = "visible";
return true;
}
function createMsgBaloon(x,y){
//var obj = document.forms["input"].txtSearch ;
this.X = x;
this.Y = y;
if ( browserWithLayers )
{
this.X = x;
this.Y = parseInt(y) - 30;
}
else{
//GetLeftTopIE(this,searchObj);
this.X += msgObj.offsetLeft;
this.Y += msgObj.offsetTop;
this.Y -= 30;
}
var width = 0 ;
var height = 0 ;
var left = 0 ;
var top = 0 ;
left = parseInt(this.X);
top = parseInt(this.Y);
//get it from obj.size
width = 250;
height = 30;
createBaloon(left,top,width,height)
layerCreated = true;
return true;
}
function changeBaloon(){
var innerText;
var sContent = "";
var sExtract = "";
var sDelimiter = "";
var iNextAt ;
var state = "B";
innerText = msgObj.value;
sContent = innerText;
if ( sContent == '' )
{
hideBaloon();
return true;
}
innerText = '
| '
/*while ("" != sContent) {
iNextAt = sContent.search("[<>]");
if (iNextAt == -1){
sExtract = sContent;
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + "";
break;
}
else {
sExtract = sContent.substr(0, iNextAt);
sDelimiter = sContent.charAt(iNextAt);
sContent = sContent.substr(iNextAt + 1);
}
if ( sDelimiter == '<' ){ // end of bangla text
if ( state == 'B' )
{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + "";
state = "E";
}else
{
innerText = innerText + "" + sExtract + "<" + "";
}
}else{ // end of english text
if ( state == 'E' ){
innerText = innerText + "" + sExtract + "";
state = "B";
}
else{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + ">" + "";
}
}
}
*/
innerText = innerText + getBanglish(sContent);
innerText = innerText + ' |
'
//alert(innerText);
var baloon = document.lyrdiv["baloon"]
document.lyrdiv["baloon"].style.visibility = "hidden";
if ( !browserWithLayers ){
baloon.innerHTML = innerText;
//alert(baloon.style.clip);
//baloon.style.clip = "rect(0px " + baloon.scrollwidth + "px 20px 0px)";
}
else{
baloon.document.open();
baloon.document.write(innerText);
baloon.document.close();
baloon.clip.width = baloon.document.width;
//alert(baloon.document.width);
//alert(baloon.style.width);
}
document.lyrdiv["baloon"].style.visibility = "visible";
return true;
}
function hideBaloon(){
if (document.lyrdiv["baloon"]) document.lyrdiv["baloon"].style.visibility = "hidden";
return true;
}
function killBaloon(){
//if (document.lyrdiv["baloon"]) {
if (layerCreated) {
//document.lyrdiv["baloon"] = null;
//delete document.lyrdiv["baloon"];
layerCreated = false ;
}
return true;
}
function createBaloon(xco,yco,clipwidth,height){
if ( document.lyrdiv["baloon"] ){
//alert(xco,yco);
if(browserWithLayers) {
document.lyrdiv["baloon"].moveTo(xco,tco);
}
else
document.lyrdiv["baloon"].style.left = xco;
document.lyrdiv["baloon"].style.top = yco;
}
else{
if(browserWithLayers) // for netscape
{
var lyr = document.lyrdiv["baloon"] = new Layer(2500)
// since this layer doesnot have any parent layer - its left top actually gives the absulote position thing
lyr.left = xco ; lyr.top = yco; lyr.clip.height = height + 2 ; lyr.clip.width = clipwidth + 1;
lyr.clip.left = 0 ; lyr.clip.top = 0 ;
lyr.bgColor = ballonbackcolor;
lyr.visibility='hidden'; lyr.zIndex = 1 ;
lyr.border = 1;
document.lyrdiv["baloon"].style = document.lyrdiv["baloon"];
//alert(menuNBColor);
}
else{
var div = '\n
';
document.body.insertAdjacentHTML("BeforeEnd",div);
//alert(menuNBColor);
}
//alert('got it ');
//+ '; width:'+ (2500)
// + clip:rect( 0px '+ ( clipwidth + 1 )+'px '+ ( height + 1 ) + 'px 0px)'
}
return true;
}
function getBanglish(sContent,obj)
{
var innerText = "";
var sExtract = "";
var sDelimiter = "";
var iNextAt ;
var state = "B";
if (appletObj == null)
appletObj = obj;
if ( sContent == '' )
{
return '';
}
while ("" != sContent) {
iNextAt = sContent.search("[<>]");
if (iNextAt == -1){
sExtract = sContent;
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + "";
break;
}
else {
sExtract = sContent.substr(0, iNextAt);
sDelimiter = sContent.charAt(iNextAt);
sContent = sContent.substr(iNextAt + 1);
}
if ( sDelimiter == '<' ){ // end of bangla text
if ( state == 'B' )
{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + "";
state = "E";
}else
{
innerText = innerText + "" + sExtract + "<" + "";
}
}else{ // end of english text
if ( state == 'E' ){
innerText = innerText + "" + sExtract + "";
state = "B";
}
else{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + "" + banglishtxt + ">" + "";
}
}
}
return innerText;
}
function getBanglishRaw(sContent,obj)
{
var innerText = "";
var sExtract = "";
var sDelimiter = "";
var iNextAt ;
var state = "B";
if (appletObj == null)
appletObj = obj;
if ( sContent == '' )
{
return '';
}
while ("" != sContent) {
iNextAt = sContent.search("[<>]");
if (iNextAt == -1){
sExtract = sContent;
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + banglishtxt ;
break;
}
else {
sExtract = sContent.substr(0, iNextAt);
sDelimiter = sContent.charAt(iNextAt);
sContent = sContent.substr(iNextAt + 1);
}
if ( sDelimiter == '<' ){ // end of bangla text
if ( state == 'B' )
{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + banglishtxt ;
state = "E";
}else
{
innerText = innerText + sExtract ;
}
}else{ // end of english text
if ( state == 'E' ){
innerText = innerText + sExtract ;
state = "B";
}
else{
banglishtxt = appletObj.xliterateIt(sExtract);
innerText = innerText + banglishtxt ;
}
}
}
return innerText;
}