﻿// Author : Islam Elkhayat
// Last Modification: 17/5/2006 

//This Function Show any Hidden Data By ID
function ShowHide(o)
    {
      var obj = document.getElementById(o);
      if(obj.style.visibility == 'visible')
      {
         obj.style.position = 'absolute';
         obj.style.visibility = 'hidden';
        //alert('Visable '+o.id);
      }
      else
      {
         obj.style.position = 'static';
         obj.style.visibility = 'visible';
         //alert('Else '+o.id);
      }
    }
    
    function ShowAll(obj, clsname)
    {
       var ctrls = document.documentElement.getElementsByTagName('span');
       for(i=0; i < ctrls.length; i++)
       {
          if(ctrls[i].className == clsname)
          {
             if(obj.checked)
             {
               ctrls[i].style.position = 'static';
               ctrls[i].style.visibility = 'visible';
             }
             else
             {
               ctrls[i].style.position = 'absolute';
               ctrls[i].style.visibility = 'hidden';
             }
          }
       }
    }
    
    var obj
    function StartSlider(timer, o)
    {
       obj = o;       
       setTimeout(o, 5000);    
    }
    
    function SliderHelp()
    {
       __doPostBack(obj);
    }
    
    function PopUp(url)
    {
       window.open(url, 'newWindow','left=0, top=0, width=500, height=300, toolbar=0, resizable=0, scrollbars = 1, status = 0')
    }
    
    function PopUpFull(url)
    {
       window.open(url, 'FullWindow','left=0, top=0, width=800, height=600, toolbar=0, resizable=0, scrollbars = 1, status = 0')
    }
    
    function resizePopUp()
    {
       var x = document.getElementById('Content').offsetWidth;
	   var y = document.getElementById('Content').offsetHeight;
	   if(y > 500) y = 500;
	   window.window.resizeTo(x+30,y+40); 
	   
    }
    
    function RemoveConfirm()
    {
     return confirm('Are you sure you want to delete?');
    }
    //asmaa
    function AddProductConfirm(path)
    {
        var b=confirm ('This Page does not Contain Products, Do you want to add Products?');
        if (b)
        {
            PopUp(path);
        }
        return b;
    }
    //asmaa
    
    
    
