﻿// 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 = 1')
    }
    
    function PopUpFull(url)
    {
       window.open(url, 'FullWindow','left=0, top=0, width=800, height=600, toolbar=0, resizable=0, scrollbars = 1, status = 1')
    }
    
    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?');
    }
 
    function MM_findObj(n, d) { //v4.01
      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_showHideLayers() { //v6.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
        obj.visibility=v; }
    }   
