function loadNewsPictures(newsID){
    ///load a news story's pictures to be displayed
    //requires Prototype to make the AJAX call
    if(newsID){
        //check if this request has been fired before.. i.e if pics have been loaded
        if($('gallery_'+newsID)){
            loadLightView('gallery_'+newsID);
            return false
        }
        pars = 'action=loadnewspictures&newsID='+newsID;
        var myAjax = new Ajax.Request( '/en/newscenter/news/transport_ajax/', {method: 'post', parameters: pars, onComplete: loadNewsPicturesResp} );
        
    }
}
function loadNewsPicturesResp(resp){
     ///process response
     var reqResp = resp.responseText.evalJSON();
     
     switch(reqResp.status){
        case '1':
              
            ///successful .. we have some pictures...
            arrPicID = reqResp.picID.split(reqResp.delimiter);
            arrPictureCaption = reqResp.pictureCaption.split(reqResp.delimiter);
            arrPicURL = reqResp.picURL.split(reqResp.delimiter);
            var theBody = $$('body')[0]; 
            var a = new Element('div', { 'id': 'gallery_'+reqResp.newsID }).insert();
             theBody.insert(a);
            strHTML = "";
               
            for(i=0;i<arrPicID.length;i++){
                //alert('loop'  );
                strHTML += "<a href='/en/newscenter/"+arrPicURL[i]+"' id='gallery_"+reqResp.newsID+'_rnd'+i+"' title=\":: "+arrPictureCaption[i]+"\" class='lightview' rel='gallery[gallery_"+reqResp.newsID+"]'></a>";
                // alert(arrEventID.length);
            }
            
            $('gallery_'+reqResp.newsID).insert(strHTML);
            //alert($('gallery_'+reqResp.newsID).innerHTML);  
            //finally call the function to fire lightview
            loadLightView('gallery_'+reqResp.newsID);
        
            break;
    } 
}
function loadLightView(id){
    //alert(id);
    Lightview.updateViews();
    //alert($(id+'_rnd0'));
    Lightview.show($(id+'_rnd0'));
}
