///////////////////////////////////////////////////////////////////////////////////
////-->Ajax

    var x=1;
    function makeRequest(url,Place,Place1)
    {
     if(x==1)
     {

        x=2;
        document.getElementById(Place1).innerHTML = '<Table bgcolor=white style="border:1px solid #000000"><Tr><td align=center valign=middle nowrap height=20><font style="text-decoration: blink;font-family:Tahoma;font-size:12px;color:#000000;">... جاري تنفيذ المهمة</font><Td></Tr></Table>';
        //document.getElementById(Place).innerHTML='';

        var http_request = false;
         if (window.XMLHttpRequest)
        { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType)
            {
                http_request.overrideMimeType('text/xml');
            }
        }
        else if (window.ActiveXObject)
        { // IE
            try
            {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e)
            {
                try
                {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
        if (!http_request)
        {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { alertContents(http_request,Place,Place1); };
        http_request.open('GET', url, true);
        http_request.send(null);

     }
    }
    function alertContents(http_request,Place,Place1)
    {

        if (http_request.readyState == 4)
        {
            if (http_request.status == 200)
            {
               document.getElementById(Place1).innerHTML='';
               document.getElementById(Place).innerHTML=http_request.responseText;
               x=1;
            }
            else
            {
                alert('There was a problem with the request.');
            }
        }
        else
        {
          return false;
        }
    }
//-->End Ajax
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function PageLoad(Id)
{
 makeRequest('_Page.php?Action=Detail&PageID='+Id,'idDisplay','idTemp');
}

function PageDiv(Id)
{
    var curDiv=document.getElementById(Id);
    if (parseInt(navigator.appVersion)>3)
     {
          if (navigator.appName=="Netscape")
          {
           //winW = window.innerWidth-16;
           //winH = window.innerHeight-16;
           winW=screen.width-21;
           winH=screen.height-58+145;
          }
           if (navigator.appName.indexOf("Microsoft")!=-1)
           {
            //winW = document.body.offsetWidth-20;
            //winH = document.body.offsetHeight-20;
           winW=screen.width-21;
           winH=screen.height-58+150;
           }
    }
    curDiv.style.height=winH;
    curDiv.style.width=winW;
}

var topOffset = 80;
function smoothMove(Id) {

        var curDiv=document.getElementById(Id);
        if (navigator.appName.indexOf("Microsoft")!=-1)
        {
        var Dif = parseInt((document.body.scrollTop+topOffset-curDiv.offsetTop)*.1)
        if (isNaN(Dif)) Dif=0
        curDiv.style.pixelTop+=Dif
        }
        else
        {
         curDiv.style.top=document.body.scrollTop+40;

        }

}
function doLoad() {

        if (navigator.appName.indexOf("Microsoft")!=-1)
        {
          window.setInterval("smoothMove('DataPop')",1)
        }
        else
        {

              setInterval("smoothMove('DataPop')",1);

        }
}

var op=0;
var testObj;
function FadeIn()
{
        testObj = document.getElementById('DataPop');
        testObj.style.display = "block";
        testObj.style.opacity = op;
        if (navigator.appName.indexOf("Microsoft")!=-1)
        {
         testObj.style.filter = 'alpha(opacity=' + op + ')';
        }
        else
        testObj.style.MozOpacity=op/70;
    op=op+8;

    if (op <= 100)
        setTimeout(FadeIn, 1);
}

function FadeOut()
{
    testObj.style.display = "block";
    testObj.style.opacity = op;
    if (navigator.appName.indexOf("Microsoft")!=-1)
    {
     testObj.style.filter = 'alpha(opacity=' + op + ')';
    }
    else
        testObj.style.MozOpacity=op/70;
    op=op-8;

    if (op>=0)
        setTimeout(FadeOut, 1);
    else
    {
       ShowHide('Data');
       ShowHide('DataPop');
       oneclick=1;
    }

}
var osd = "جمعية خريجي المقاصد الإسلامية"
window.status = osd;
/*
var osd = "جمعية خريجي المقاصد الإسلامية"
var timer;
var msg = "";
function scrollMaster () {
msg = customDateSpring(new Date())
clearTimeout(timer)
msg += " " + showtime() + " " + osd
for (var i= 0; i < 100; i++){
msg = " " + msg;
}
scrollMe()
}
function scrollMe(){
window.status = msg;
msg = msg.substring(1, msg.length) + msg.substring(0,1);
timer = setTimeout("scrollMe()", 200);
}
function showtime (){
var now = new Date();
var hours= now.getHours();
var minutes= now.getMinutes();
var seconds= now.getSeconds();
var months= now.getMonth();
var dates= now.getDate();
var years= now.getYear();
var timeValue = ""
timeValue += ((months >9) ? "" : " ")
timeValue += ((dates >9) ? "" : " ")
timeValue = ( months +1)
timeValue +="/"+ dates
timeValue +="/"+  years
var ap="صباحا"
if (hours == 12) {
ap = "مساء"
}
if (hours == 0) {
hours = 12
}
if(hours >= 13){
hours -= 12;
ap="مساء"
}
var timeValue2 = " " + hours
timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap
return timeValue2;
}
function MakeArray(n) {
this.length = n
return this
}
monthNames = new MakeArray(12)
monthNames[1] = "كانون الثاني"
monthNames[2] = "شباط"
monthNames[3] = "أذار"
monthNames[4] = "نيسان"
monthNames[5] = "أيار"
monthNames[6] = "حزيران"
monthNames[7] = "تموز"
monthNames[8] = "أب"
monthNames[9] = "أيلول"
monthNames[10] = "تشرين الأول"
monthNames[11] = "تشرين الثاني"
monthNames[12] = "كانون الأول"
daysNames = new MakeArray(7)
daysNames[1] = "الأحد"
daysNames[2] = "الأثنين"
daysNames[3] = "الثلاثاء"
daysNames[4] = "الأربعاء"
daysNames[5] = "الخميس"
daysNames[6] = "الجمعة"
daysNames[7] = "السبت"
function customDateSpring(oneDate) {
var theDay = daysNames[oneDate.getDay() +1]
var theDate =oneDate.getDate()
var theMonth = monthNames[oneDate.getMonth() +1]
var dayth="th"
if ((theDate == 1) || (theDate == 21) || (theDate == 31)) {
dayth="st";
}
if ((theDate == 2) || (theDate ==22)) {
dayth="nd";
}
if ((theDate== 3) || (theDate  == 23)) {
dayth="rd";
}
return theDay + ", " +  + " " + theDate + ","
}
scrollMaster();
*/
