//File Name.....HfMsgRoll.js
//By............Joydip Roy Chowdhury
//Date..........26/08/2000
//Use...........Standard utilities for
//..............Message RollOver layer manipulation
//..............with Cross Browser Support

B=document.all;
C=document.layers;
Yp=0;
Xp=0;
ie5X=0;
ie5Y=0;
 

function BldMsg(No,mpop,mlnk)
{
  var txt="";
  var i=0;
  for(i=0;i<mpop.length;i++)
  {
    var str= new String(mlnk[i])
    if(str.indexOf(",lnk")==-1)
    {
      txt+="<a class='clMain' onMouseOver=\"Msg_close("+No+")\" href=\"JavaScript:ShowImg(" + mlnk[i] + ")\">"+mpop[i]+"</a><br>";
    }
    else
    {
      txt+="<a class='clMain' href='JavaScript://' onMouseOver=\"BldMsg("+parseInt(No+1)+","+mlnk[i]+")\">"+mpop[i]+"</a><br>";
      i++;
    }
  }
  Msg_On(No,txt);
  return
}

function Msg_On(No,myMsg)
{
Msg_close(No);
if(No==0)
{
  document.write(myMsg);
  return
}
if(No==1){N="Lr1";}
if(No==2){N="Lr2";}
if(No==3){N="Lr3";}
txt = "<html><head></head><body><TABLE WIDTH=100% CELLPADDING='5' BORDER=1><TR><TD align='left'><FONT FACE='Verdana' COLOR='#000000' SIZE='2'>";
txt+=myMsg;
txt+="</FONT></TD></TR></TABLE></body></html>";
if(B)
{
  B[N].innerHTML=txt;
  B[N].style.left=Xp+30;
  B[N].style.top=Yp;
  B[N].style.visibility = "visible";
}
else
{
  C[N].document.write(txt);
  C[N].document.close();
  C[N].left=Xp+30;
  C[N].top=Yp;
  C[N].visibility="show";
}
}

//..............

function Msg_close(No)
{
  for(i=3;i>No;i--){Msg_Off("Lr"+i);}
}

//..............

function Msg_Off(N)
{
  B=document.all;
  C=document.layers;
  if(B)
  {
    B[N].style.visibility = "hidden";
  }
  else
  {
    C[N].visibility="hide";
  }
}
//..............

function createContainer(BC,N,Xp,Yp,W,H,At,HT,Op,St){
var hd="";
var hd1="";
if(N!="LrMain")
{
    hd="hide";
    hd1="hidden";
}
with (document){
write((!B) ? "<layer id='"+N+"' visibility='" + hd + "' text='#000000' bgcolor='"+BC+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;color:#000000;visibility:" + hd1 + ";background-color:"+BC+";left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+";");
if(St){
if (C)
write(" style='");
write(St+";' ")
}
else write((B)?"'":"");
write((At)? At+">" : ">");
write((HT) ? HT : "");
if (!Op)
closeContainer(N)
}
}

//..............

function closeContainer(){
document.write((B)?"</div>":"</layer>")
}

//..............

function ShowImgAll(parm)
{
    var needval = parm.options[parm.selectedIndex].value;
    eval("ShowImg("+needval+")");
}

//..............

function ShowImg(mNm,mConv,mSrl)
{
  document.forms["frmgreetindex"].fldNm.value=mNm;
  document.forms["frmgreetindex"].fldConv.value=mConv;
  document.forms["frmgreetindex"].fldSrl.value=mSrl;
  document.forms["frmgreetindex"].submit();
}

//..............

function ChImg(v)
{
  var txt = "<p><img src='images/greetmain.gif' border='0' align='left' hspace='8'><BR><font face='Verdana' size='2' color='#410F7D'>";
//  txt+="When a cause to wish is around, and emotions run high in the blood, one looks around to convey the right kind of expression to the loved one. Words have magic with the ability to enchant people. Word is the power highlighting emotions. So if you are looking for something to stir the mind and soul then come to this section. Choose the right words to say that you care. Be it the occasion of birthday, anniversary, a special event or even a celebration, Hifunda e-greetings section has it all. A perfect utterance for all purposes, a complete blend of passion with visual is set just to say what you have in mind.";
  txt+="</font></p>"
  if(mfldNm==""){return txt;}
  txt+="<BR><BR><BR><BR><BR><BR><BR><BR><font face='arial' size='4' color='#AB492E'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>"+mfldNm+"</B></font><p>";
  var i=1;

  txt+="<BR><Table border='0' cellpadding='0' cellspacing='0' align='center' width='80%'><tr><td align='center' width='10%'>";
  if(StPt!=mfldSrl){txt+="<a class='txt' href='JavaScript://' onMouseDown='StPt+=6;ChImg();'><font face='verdana' size=2 color='#AB492E'>Previous</font></a>";}
  else{txt+="<font face='verdana' size=2 color='#707070'>Previous</font>";}
  txt+="</td><td width='65%' valign='middle'><table border=0 height='5' valign='middle' align='center' width='90%' bgcolor='#FFE2A5'><tr><td></td> </tr></table></td><td align='right' width='5%'>"
  if(StPt>6){txt+="<a class='txt' href='JavaScript://' onMouseDown='StPt-=6;ChImg();'><font face='verdana' size=2 color='#AB492E'>Next</font></a>";}
  else{txt+="<font face='verdana' size=2 color='#707070'>Next</font>";}
  txt+="</td></tr></table><p>";

  txt+="<Table border='0' cellpadding='2' cellspacing='0' align='center' width='100%' height='400'><tr>";
  for(i=StPt;i>0;i--)
  {
      var str=new String(i);
      var z="";
      if(str.length==1){z="00"}
      if(str.length==2){z="0"}
      if(((i%2==0 && StPt%2==0)||(i%2!=0 && StPt%2!=0)) && StPt!=i){txt+="</tr><tr>";}
      txt+="<td align='center' width='50%'><a href=# onMouseDown=\"JavaScript:window.open('greetpreview.php?card="+mfldConv+"f"+z+i+"."+extn[i]+"','prvwin','resizable,scrollbars,height="+(screen.height-60)+",width="+(screen.width-10)+",left=0,top=0');\"><img name=\"img"+ i +"\" src=\"images/"+mfldConv+"t"+z+i+".gif\" Border=1></a><br><Small>"+them[i]+"<br>";
      if(stan[i]=="A"){txt+="Animated";}
      else{txt+="Static";}
      txt+="</Small></td>";
      if(i==StPt-5)
      {
          break;
      }
  }
  txt+="</tr></table>";

  var mn="LrMain";
  B=document.all;
  C=document.layers;
  if(!v)
  {
    if(B)
    {
        B[mn].innerHTML=txt;
        B[mn].style.visibility = "visible";
    }
    else
    {
        C[mn].document.write(txt);
        C[mn].document.close();
        C[mn].visibility="show";
    }
  }
  else
  {
    return txt;
  }
}

