// بسم الله الرحمن الرحيم
//اللهم صلّ على محمد وآل محمد
// وارحمنا بمحمد وآل محمد
// wrote by: Moh'd Marhoon 

function mymenu(id)
{
var target = document.getElementById('menu'+id);
if(target.style.display =='inline')
{
target.style.display = 'none';
}
else 
{

for (var i=1; i<=5; i++)
{
 //--------------------------
 // Close All Open Menu......
 var check = document.getElementById('menu'+i);
 if(check.style.display =='inline')	
 {
 check.style.display = 'none';
 }
 //--------------------------
 // Open Select Menu.........
 target.style.display = 'inline';
}

}

}



function myselect()
  {
  document.getElementById("mybtn").select()
  }

function showmenu(id)
{
var target = document.getElementById('menu'+id);
target.style.display = 'inline';
}

function gopage(cat,page)
        {
        url = "section.php?cat=" + cat + "&location=" + page;
        window.location = url;
        }
		
function gopagem(cat,page)
        {
        url = "secmedia.php?cat=" + cat + "&location=" + page;
        window.location = url;
        }
		
function gopphoto(cat,page,ptype)
        {
        url = "gallery.php?year=" + cat + "&location=" + page + "&sec=" + ptype;
        window.location = url;
        }



function photo_arch()
{

url = "gallery.php?sec="+ gotophoto.gotophoto.options(gotophoto.gotophoto.selectedIndex).id +"&year=" + gotophoto.gotophoto.options(gotophoto.gotophoto.selectedIndex).value;
window.location = url;
}


function send(id)
        {
                var w = 400;
                var h=220;
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'
                win = window.open('articlesend.php?id='+id, 'mywindow', winprops)
        }

function prints(id)
        {
                var w = 770;
                var h=550;
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'
                win = window.open('print.php?id='+id, 'mywindow2', winprops)
        }
		
function viewsound(id)
        {
                var w = 630;
                var h=468;
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'
                win = window.open('viewsound.php?id='+id, 'mysound', winprops)
        }
		
function viewsoundv(id)
        {
                var w = 630;
                var h=510;
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'
                win = window.open('viewsoundv.php?id='+id, 'mysound', winprops)
        }
		
function child(id)
        {
                var w =610;
                var h=240;
                var winl = (screen.width - w) / 2;
                var wint = (screen.height - h) / 2;
                winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0'
                win = window.open('dphchild.php?id='+id, 'photochild', winprops)
        }		

function testsearch()
        {
        searchBox = formSearch.sword
        if (searchBox.value=="")
                alert ("عفوا.. لا يمكن البحث عن فراغ")
        else if ((searchBox.value) == " ")
                alert ("عفوا.. الرجاء كتابة كلمة للبحث")
        else if ((searchBox.value).length < 4)
                alert ("عفوا.. لا يمكن البحث عن كلمة أقل من أربعة أحرف")
		else if (document.formSearch.stype.value==0)
		        alert ("عفوا.. لم تختر طريقة البحث..!!")
        else
            return true;

        searchBox.focus();
        return false;		
        }
		
// photo Gallery
nereidFadeObjects = new Object(); 
nereidFadeTimers = new Object(); 

function nereidFade(object, destOp, rate, delta){ 
if (!document.all) 
return 
    if (object != "[object]"){ 
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0); 
        return; 
    } 

    clearTimeout(nereidFadeTimers[object.sourceIndex]); 

    diff = destOp-object.filters.alpha.opacity; 
    direction = 1; 
    if (object.filters.alpha.opacity > destOp){ 
        direction = -1; 
    } 
    delta=Math.min(direction*diff,delta); 
    object.filters.alpha.opacity+=direction*delta; 

    if (object.filters.alpha.opacity != destOp){ 
        nereidFadeObjects[object.sourceIndex]=object; 
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate); 
    } 
} 
