// JavaScript Document

countArticle = 0;
var mySlideData = new Array();
mySlideData[countArticle++] = new Array(
'images/slideShowImage8.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Fun@Zoo',
'A joint activity with Cheyutha Foundation to identify kids for sponsoring education'
); 
mySlideData[countArticle++] = new Array(
'images/slideShowImage9.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Eye Screening...',
'At St. Isaac School, Hafeezpet'
); 
mySlideData[countArticle++] = new Array(
'images/slideShowImage1.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Christmas Celebrations',
'An event with Satyam Foundation to celebrate Christmas with 6 NGOs'
); 

mySlideData[countArticle++] = new Array(
'images/slideShowImage2.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Masti mania',
'celebrations with Auxillium'
); 

mySlideData[countArticle++] = new Array(
'images/slideShowImage3.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Sakshum Light A Life project',
'Eye donation in Light A life project at Kondapur'
); 
mySlideData[countArticle++] = new Array(
'images/slideShowImage4.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Busy@Volunteering...',
'Eye Screening at St. Isacc School'
); 
mySlideData[countArticle++] = new Array(
'images/imageSlideShow5.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'Dance... we love it..',
'A kid with CP dancing and filling joy in the air'
); 

mySlideData[countArticle++] = new Array(
'images/slideShowImage7.JPG',
'http://picasaweb.google.com/neeti.pari/20090207PatientsAndEyeScreeningDay#',
'I Care I Care...',
'A relaxing moment at St. Isaac school during I care I care project'
); 
//getImages();

function getImages(){
 if (window.XMLHttpRequest) //other
        xhr = new XMLHttpRequest();
   
    xhr.open("GET","http://sakshum.in/news.xml",true);

    xhr.setRequestHeader("Cache-Control", "no-cache");
    xhr.setRequestHeader("Pragma", "no-cache");

    xhr.onreadystatechange = function() {
        if (xhr.readyState == 4)
        {
            if (xhr.status == 200)
            {
                if (xhr.responseText != null)
				{
					var dom = xhr.responseXML
					var newsItem = dom.getElementsByTagName("item");
					var newsUrl = dom.getElementsByTagName("url");

// Specify how many items we should add to the menu
				var numItemsToAdd = newsItem.length;

				for(var i=0; i<numItemsToAdd; i++)
				{
					var url = newsUrl.item(i).firstChild.nodeValue;				
						mySlideData[countArticle++] = new Array(
															'images/gvd2007 443.jpg',
															'article1.html',
															countArticle,
															'Item 1 Description'
															);		
				}
				}
                else
                {
                    //failed to get data
					alert("Failed to receive RSS file from the server - file not found.");
                    return false;
                }
            }
            else
                alert("Error code " + xhr.status + " received: " + xhr.statusText);
        }
    }

    /*E*/
    xhr.send(null);
}
