I have not asked you or anyone to write the code for me. I just asked for help. I just asked for an example because I was fed up with trying it out on my own. There is lot of difference between an example and WRITING code. But I think your seniority does not see that.
Secondly, I am using PERL as programing language. I posted here as I had an assumption that there is code linking between PERL and Java-Script and I was not able to understand that linking. But again your seniority and experience does not see that.
Please ... Please try to remember the days when you were a Junior and had problems in coding and understanding; and some one must had helped you.