
/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2004, Creativyst, Inc.
 *               ALL RIGHTS RESERVED
 * 
 * For more information go to:
 *   http://www.Creativyst.com/Doc/Std/JSMsg/JSMsg.htm
 * or email:
 *            Support@Creativyst.com
 * 
 * Licensed under the Open Software License version 1.1
 *
 * END ATTRIBUTION NOTICE:
 * -------
 *
 * The following version token is 
 * required by aggregators
 * -------
 * JSMsgVersion:1.0a
 * -------
 *
 * Made by: JSMFeed.pl v1.0e
*/
/* JSCpragma:StartCompress
*/
/* These functions are free software; you can redistribute 
 * them and/or modify them under the terms of the Open 
 * Software License (OSL) version 1.1 as published by
 * the Open Source Initiative;
 * 
 * This program is distributed in the hope that it will 
 * be useful, but WITHOUT ANY WARRANTY; without even the 
 * implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE. See the Open Software License
 * version 1.1 for more details.
 * 
 * For the complete details of the Open Software License
 * please visit the Open Source Initiative website.
 *
 * 
 * These functions are part of a shared convention.
 * called JSMsg.  Please see the JSMsg document
 * for more details.
 *
 * www.creativyst.com/Doc/Std/JSMsg/JSMsg.htm
 *
 * -------------------------------------------
 * Parts of this code were automatically
 * generated and may contain copyrighted
 * content from other sources as well.
 * Such content may not be used without
 * first obtaining explicit permissions
 * from their sources.
 *
 *
*/

function nn_JSMsg() {

this.Title = Array([this.ShortListSize]);
this.Desc = Array([this.ShortListSize]);
this.Link = Array([this.ShortListSize]);
this.DateN = Array([this.ShortListSize]);

this.MetaKeys = Array([6]);
this.MetaVals = Array([6]);



 this.ShortListSize = 10;
 this.BeenLoaded = 0;
 this.dispNumb;

 this.Msg = function(msgPart, msgOffset)
 {
    document.write( this.Get(msgPart, msgOffset) );
 }

 this.MsgDay = function(msgPart)
 {
    document.write( this.GetDay(msgPart) );
 }

 this.MsgN = function(msgPart, msgNumber)
 {
    document.write( this.GetN(msgPart, msgNumber) );
 }


 this.Get = function(msgPart, msgOffset)
 {
    if(!msgOffset) {
        msgOffset = 0;
    }
    if(!this.BeenLoaded) {
        this.BeenLoaded = 1;
        dispNumb = 
           this.getRandInt(this.ShortListSize);
    }
    return( this.GetN(msgPart, (dispNumb + msgOffset)) );
 }

 this.GetMsgN = function()
 {
	return(this.ShortListSize);
 }

 this.GetDay = function(msgPart)
 {
    var d = new Date();
    var x = d.getDate();
    return( this.GetN(msgPart, x) );
 }


 this.GetN = function(msgPart, msgNumber)
 {
    return( this.GetNCore(msgPart, msgNumber) );
 }

 this.GetNCore = function(msgPart, msgNumber)
 {
    var myTmp;

    if(!msgPart) {
        msgPart = "Body";
    }
    if(!msgNumber) {
        msgNumber = 0;
    }

    if(msgNumber >= this.ShortListSize) {
        msgNumber = msgNumber % this.ShortListSize;
    }

    if(  this.ok(msgPart,"Type") ) {
        return(this.Type[msgNumber]);
    }
    if(  this.ok(msgPart,"Title") ) {
        return(this.Title[msgNumber]);
    }
    if(  this.ok(msgPart, "Desc Description Content") ) {
        return(this.Desc[msgNumber]);
    }
    if(  this.ok(msgPart,"Body") ) {
        return(this.Body[msgNumber]);
    }
    if(  this.ok(msgPart, "Attrib Attribute Source") ) {
        return(this.Attrib[msgNumber]);
    }
    if(  this.ok(msgPart, "Author") ) {
        if(!this.Author[msgNumber]) {
            return(this.Attrib[msgNumber]);
        }
        return(this.Author[msgNumber]);
    }

    if(  this.ok(msgPart,"DayN Day2N Day") ) {
        myTmp = this.DateN[msgNumber];
        if(myTmp.length) { 
          myTmp = myTmp.substr(6,2);
          if(  this.ok(msgPart,"Day2N") ) {
            return(myTmp);
          }
          if(myTmp.charAt(0) == "0") {
            return(myTmp.substr(1,1))
          }
          return(myTmp);
        }
    }
    if(  this.ok(msgPart, "MonthN Month2N") ) {
        myTmp = this.DateN[msgNumber];
        if(myTmp.length) {
          myTmp = myTmp.substr(4,2)
          if(  this.ok(msgPart,"Month2N") ) {
            return(myTmp);
          }
          if(myTmp.charAt(0) == "0") {
            return(myTmp.substr(1,1))
          }
          return(myTmp);
        }
    }
    if(  this.ok(msgPart, "Year2N Year4N YearN Year") ) {
        if(this.DateN[msgNumber].length) {
          if(  this.ok(msgPart,"Year2N") ) {
            return(this.DateN[msgNumber].substr(2,2));
          }
          return(this.DateN[msgNumber].substr(0,4));
        }
    }

    if(  this.ok(msgPart,"Time") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(8,6));
    }
    if(  this.ok(msgPart,"Hour2N") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(8,2));
    }
    if(  this.ok(msgPart,"Minute2N") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(10,2));
    }

    if(  this.ok(msgPart,"Link") ) {
        return(this.Link[msgNumber]);
    }
    if( this.ok(msgPart,"LinkTitle") ) {
        if(this.MetaMsg(msgPart,"Link") && this.MetaMsg(msgPart,"Title") ) {
          if( !this.Link[msgNumber] ) {
              return(this.Title[msgNumber]);
          }

          if( !this.Title[msgNumber] ) {
            this.Title[msgNumber] =  this.Link[msgNumber];              
          }
          myTmp = '<A TARGET="_blank" \n'; 
          myTmp = myTmp + 'HREF="' + this.Link[msgNumber] + '">\n';
          myTmp = myTmp + this.Title[msgNumber] + '</A>\n';

          return(myTmp);

        }
        if( this.MetaMsg(msgPart,"Title") ) {
          return(this.Title[msgNumber]);
        }
        if( this.MetaMsg(msgPart,"Link") ) {
          if( this.Link[msgNumber] ) {
            myTmp = "<A TARGET=\"_blank\" \n"; 
            myTmp = myTmp + "HREF=\"" + this.Link[msgNumber] + "\">\n";
            myTmp = myTmp + this.Link[msgNumber] + "</A>\n";
            return(myTmp);
          }
        }
        return("");
    }
    if( this.ok(msgPart,"Cat Category Subject") ) {
        return(this.Cat[msgNumber]);
    }
    if( this.ok(msgPart,"Thumb") ) {
        return(this.Thumb[msgNumber]);
    }
    if( this.ok(msgPart,"Alt") ) {
        return(this.Alt[msgNumber]);
    }

    return("");
 }




 this.getRandInt = function(RandSz)
 {
    var t, t2, t3;

    t = 0;
    while(t < .000001) {
        t = Math.random();
        t = Math.abs(t);
    }
    t2 = t * 1000000;
    t2 = Math.round(t2);
    t3 = t2 % RandSz;
    return(t3);
 }



 this.ok = function(a, b)
 {
    var t, t2;

    if(!this.is(a,b)) {
        return(0);
    }
    return(this.MetaMsg(a));
 }

 this.is = function(a, b)
 {
    var t, t2;

    t = a + " ";
    t2 = b + " ";
    t2 = t2.toUpperCase();
    t = t.toUpperCase();

    if(t2.indexOf(t) == -1) {
        return(0);
    }
    return(1);
 }


 this.MetaMsg = function(msgCmd)
 {
    var i,l;

    if( this.is(msgCmd, "Title LinkTitle Desc Description Link LinkTitle DayN Day2N MonthN Month2N Year2N Year4N YearN Year Time Hour2N Minute2N ") ) {
         return(1);

    }
    else if( this.is(msgCmd, "MetaCount") ) {
        return(10);
    }
    else {
        if(this.MetaKeys) {
            l = this.MetaKeys.length;
            for(i = 0;i < l;i++) {
                if(this.MetaKeys[i] == msgCmd) {
                    return(this.MetaVals[i]);
                }
            }
        }
        return(0);
    }
 }

     

}

nn = new nn_JSMsg();

/* how slow is the with statement */

with( nn ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "Copyright (c) 1997-2010 TamilNet";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "TamilNet Newswire";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://www.tamilnet.com";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://www.tamilnet.com\" CLASS=\"JSMsg\">TamilNet Newswire</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "20100905020946";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "Latest 10 TamilNet reports from Sri Lanka";


/* content vaues:
*/
Title[0] = "Sri Lanka: Police arrest 2 JVP members in Jaffna";
Desc[0] = "Sri Lanka police in Jaffna arrested two members of Janatha Vimukthi Party (JVP) while they were putting up posters against the proposed 18th Constitutional Amendment at Hospital Road junction in Jaffna Saturday early morning, sources in Jaffna said. One of the men arrested is Veeraraj Lalithakumar who had contested as the chief candidate of Democratic National Party of Sarath Fonseka in Jaffna district in the last parliamentary election and lost. The police had removed all the posters pasted.";
Link[0] = "http://www.tamilnet.com/art.html?catid=13&artid=32548";
DateN[0] = "20100904000000";

Title[1] = "Sri Lanka: Hard questions for India and Eezham Tamils";
Desc[1] = "Nirupama Menon Rao expressed satisfaction at the progress in resettlement of Internally Displaced Persons (IDPs) and development activities of the North, said state-owned Colombo newspaper Daily News Thursday, titling the news as &#x93;Indian investment interest rising&#x94;. But, reporting on Nirupama&#x92;s visit, The Hindu on Friday titled the news &#x93;Political solution should be priority&#x94; and cited her saying to Colombo-based Indian journalists that &#x93;While the focus on development and rehabilitation is very welcome, a long term perspective that also includes the issues relating to the political settlement that would meet some of the needs of the minorities should also be kept in mind.&#x94;";
Link[1] = "http://www.tamilnet.com/art.html?catid=79&artid=32546";
DateN[1] = "20100904000000";

Title[2] = "Sri Lanka: Uprooted families from Vadamaraadchi East, Pa&#x92;lai to be resettled";
Desc[2] = "Sri Lanka government authorities in Jaffna have announced that uprooted families from Pa&#x92;lai Divisional Secretary area and Vadamaraadchi East in Jaffna district will be resettled in their own villages 9 and 10 September. The announcement comes in the wake of the recent meeting held on this issue between Jaffna Sri Lanka Army (SLA) Commander and Jaffna Government Agent in Palaali Military head office. Though similar announcements had been made on resettling the uprooted families from Valikaamam North SLA High Security Zone earlier, so far they had not been allowed to resettle by SLA. The uprooted families now held in interim camps said that they will believe the announcement only when it becomes a reality.";
Link[2] = "http://www.tamilnet.com/art.html?catid=13&artid=32545";
DateN[2] = "20100904000000";

Title[3] = "Sri Lanka: One-day debate, voting on 8 September in SL parliament";
Desc[3] = "The 18th Constitutional Amendment Bill will be debated and put to vote\n8 September in Sri Lanka parliament, according to decision taken at a meeting by the leaders of political parties represented in Sri Lanka parliament, presided by Speaker Chamal Rajapaksa.\n";
Link[3] = "http://www.tamilnet.com/art.html?catid=13&artid=32544";
DateN[3] = "20100904000000";

Title[4] = "Sri Lanka: Opposition groups declare September 8 Black Day";
Desc[4] = "Opposition parties&#x92; Movement Against 18th Amendment stated that 8 September, the day Sri Lanka government tables the constitutional amendment bill in Parliament, has been declared a Black Day and that a protest demostration will be held at the Borella Ayurveda Junction in Colombo on the same day. The convener of the Movement described the amendment as &#x93;undemocratic&#x94; leading to dictatorship and said it should be defeated.&#x3C;br/&#x3E;&#x3C;br/&#x3E;";
Link[4] = "http://www.tamilnet.com/art.html?catid=13&artid=32543";
DateN[4] = "20100904000000";

Title[5] = "Sri Lanka: No-confidence motion against SL Minister Peiris";
Desc[5] = "The main opposition United National Party (UNP) Friday handed over a\nNo-confidence motion to Speaker Chamal Rajapaksa against Sri Lanka External\nAffairs Minister G. L. Peiris charging him for the failure in handling\ninternational affairs.\n";
Link[5] = "http://www.tamilnet.com/art.html?catid=13&artid=32542";
DateN[5] = "20100904000000";

Title[6] = "Sri Lanka: Re-examine claimed safety of refugee returnees, AI appeals to Australia";
Desc[6] = "&#x93;The Australian government must re-examine its claims that asylum seekers returned to countries they are fleeing from are not subjected to torture and mistreatment,&#x94; Madhu Malhorta, Amnesty International&#x92;s Deputy Director for Asia said in an appeal to Sri Lanka government Friday calling on it to ensure the safety of three men who have been tortured and jailed following their forced return from Australia where they had sought asylum in 2009. Three Sinhala men, two of them brothers, seeking asylum in Austarlia had been forcibly sent back to Sri Lanka by the Australian government.";
Link[6] = "http://www.tamilnet.com/art.html?catid=13&artid=32541";
DateN[6] = "20100903000000";

Title[7] = "Sri Lanka: Ranil Wickremasinghe in India on official visit";
Desc[7] = "The leader of the main opposition United National Party (UNP) Ranil\nWickremasinghe Thursday evening left for India on an official visit.\nHe flew first to Chennai to meet Tamilnadu politicians soon\nafter meeting the visiting Indian Foreign Secretary Ms Nirupama Rao in Colombo,\nsources in Colombo said.";
Link[7] = "http://www.tamilnet.com/art.html?catid=13&artid=32540";
DateN[7] = "20100903000000";

Title[8] = "Sri Lanka: 3 UNP MPs to support Rapajaksa&#x27;s 18th Amendment";
Desc[8] = "Three parliamentarians from the main opposition United National Party\n(UNP) Friday announced in Colombo that they will support the proposed\nconstitutional amendments. Badulla District Parliamentarian Lakshman Seneviratne and Polonnaruwa District Parliamentarian Earl Gunasekera made this announcement at a joint press conference. Meanwhile Galle District UNP MP Manusha Nanaykara also said he had decided to support the proposed constitutional amendment. ";
Link[8] = "http://www.tamilnet.com/art.html?catid=13&artid=32539";
DateN[8] = "20100903000000";

Title[9] = "SLA commander invites Indian Army commander to visit Sri Lanka";
Desc[9] = "Indian Army General Vijay Kumar Singh is scheduled to visit the island 05 September on a five day visit on invitation by Sri Lanka Army commander Lt. Gen. Jagath Jayasuriya. ";
Link[9] = "http://www.tamilnet.com/art.html?catid=13&artid=32538";
DateN[9] = "20100903000000";

} // end with block
