﻿function kmMoveDown(loc)
{

indx = document.fm[loc].selectedIndex;

if (indx != -1) 
{
  
if (indx < document.fm[loc].length - 1) 
{
    
var txt = document.fm[loc].options[indx].text;
    
var val = document.fm[loc].options[indx].value;
    
document.fm[loc].options[indx].text = document.fm[loc].options[indx+1].text;
    
document.fm[loc].options[indx].value = document.fm[loc].options[indx+1].value;
    
document.fm[loc].options[indx+1].text = txt;
    
document.fm[loc].options[indx+1].value = val;
    
document.fm[loc].selectedIndex++;
  
}
} 
else 
{
  
alert("Please select an entry in the " + loc + " column first.");
  
return true;

}

}
 


function kmMoveUp(loc)
{

indx = document.fm[loc].selectedIndex;

if (indx != -1) 
{
  
if (indx > 0) 
{
    
var txt = document.fm[loc].options[indx].text;
    
var val = document.fm[loc].options[indx].value;
    
document.fm[loc].options[indx].text = document.fm[loc].options[indx-1].text;
    
document.fm[loc].options[indx].value = document.fm[loc].options[indx-1].value;
    
document.fm[loc].options[indx-1].text = txt;
    
document.fm[loc].options[indx-1].value = val;
    
document.fm[loc].selectedIndex--;
  
}
} 
else 
{
    
alert("Please select an entry in the " + loc + " column first.");
    
return true;

}

}



function getDateString()

{
    
var oMonthStrings = ["يناير" , "فبراير" , "مارس" , "إبريل" , "مايو" , "يونيو" , "يوليو" , "أغسطس" , "سبتمبر" , "أكتوبر" , "نوفمبر" , "ديسمبر"];

    
var today = new Date();
    
    
var sYear = (today.getFullYear) ? today.getFullYear() : today.getYear();
    
var sMonth = oMonthStrings[today.getMonth()];
    
var sDate = today.getDate();
    
var sDateString=sDate+" : "+sMonth+" : "+sYear;
    
return sDateString;

}



function chgBg(obj,color)

{
    
if (document.layers) // Nav4
        
obj.bgColor=color;        
    
else
        
obj.style.backgroundColor=color;    

}

function getCurrentDates(smyDate)
{
var oMonthStrings = ["يناير" , "فبراير" , "مارس" , "إبريل" , "مايو" , "يونيو" , "يوليو" , "أغسطس" , "سبتمبر" , "أكتوبر" , "نوفمبر" , "ديسمبر"];

    
var mDate = Date.parse(smyDate);
    
    
var sYear = (mDate.getFullYear) ? mDate.getFullYear() : mDate.getYear();
    
var sMonth = oMonthStrings[today.getMonth()];
    
var sDate = mDate.getDate();
    
var sDateString=sDate+" : "+sMonth+" : "+sYear;
    
return sDateString;

}