﻿
// JScript File

function setImageGalleryEN(selID)
{  
    stroutput="";
    var pageID=selID;
    var imagegallerylength=imageGallery.length;
    
    var imagegallerylength = (pageID*pageLength)+pageLength;  
    if(imagegallerylength>imageGallery.length)
    {
        imagegallerylength=imageGallery.length; 
    }
    
    for(i=(pageID*pageLength);i<imagegallerylength;i++)
	{
        stroutput +="<img height='208' alt='"+imageGallery[i][0]+"' src='"+imageGallery[i][3]+"/"+imageGallery[i][4]+"' width='314'/> <br class='clear'/>";
    }  
    
    strPreNext='';
    strPreNext='<div class="navi">';
    prevpageid=pageID-1;    
    if(pageID != 0  )
    {
        strPreNext += '<a title="السابق" class="img_prev" href="#" onclick="setImageGalleryEN(' + prevpageid + ')" >السابق</a>';
    }
    else
    {
        strPreNext += '<a title="السابق" class="img_prev">السابق</a>';
        
    }
    strPreNext +='<span id="img_nos">'+(pageID+1)+'/'+imageGallery.length+'</span>';
    if(pageID!=(imageGallery.length-1))
    {  
        nextpageid=pageID + 1;
        strPreNext += '<a title="التالي" class="img_next" href="#" onclick="setImageGalleryEN(' + nextpageid + ')" >التالي</a>';     
    }  
    else
    {
        strPreNext += '<a title="التالي" class="img_next" >التالي</a>';
    }
    strPreNext+='</div>';
    document.getElementById("ImageContainer").innerHTML="";
    
    document.getElementById("ImageContainer").innerHTML = stroutput + strPreNext;
        
   }
 
 
