var n = 1;
var b = 1;
var c = 1;
var d = 1;
var sort_col;

function MM_swapImage() { //v3.0
  
  var tmpobj;
  var test = new Array(2);
  test[0]="/myoffice/jsp/images/down_triangle.gif";
  test[1]="/myoffice/jsp/images/up_triangle.gif";
  test[3]="/myoffice/jsp/images/transparent.gif";
  
   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; 
     
       x.oSrc=x.src; 
   	
   	   if ( a[i] == "Image1" )
   	   {  
	     tmpobj=MM_findObj("Image2");
             if (tmpobj)
              tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image3");
             if (tmpobj)
              tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image4");
             if (tmpobj)
              tmpobj.src=test[3];

   	     if (sort_col != a[i])
   	     	n = 1;
   	     
   	     if ( n == 0 )
   	     {  
   	       x.src=test[0];
   	       n = 1;
   	     }
   	     else if ( n == 1 )
   	     {
   	       x.src=test[1];
   	       n = 0;
   	     }
   	   }
   	   else if ( a[i] == "Image2" )
   	   {  
	     tmpobj=MM_findObj("Image1");
             if (tmpobj)
              tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image3");
             if (tmpobj)
                tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image4");
             if (tmpobj)
                tmpobj.src=test[3];

   	     if (sort_col != a[i])
   	     	b = 1;
   	     
   	     if ( b == 0 )
   	     {  
   	       x.src=test[0];
   	       b = 1;
   	     }
   	     else if ( b == 1 )
   	     {
   	       x.src=test[1];
   	       b = 0;
   	     }
   	   }
   	   else if ( a[i] == "Image3" )
   	   {  
	     tmpobj=MM_findObj("Image1");
             if (tmpobj)
                tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image2");
             if (tmpobj)
                tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image4");
             if (tmpobj)
                tmpobj.src=test[3];

   	     if (sort_col != a[i])
   	     	c = 1;
   	     
   	     if ( c == 0 )
   	     {  
   	       x.src=test[0];
   	       c = 1;
   	     }
   	     else if ( c == 1 )
   	     {
   	       x.src=test[1];
   	       c = 0;
   	     }
   	   }
   	   else if ( a[i] == "Image4" )
   	   {  
	     tmpobj=MM_findObj("Image1");
             if (tmpobj)
                 tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image2");
             if (tmpobj)
               tmpobj.src=test[3];
	     tmpobj=MM_findObj("Image3");
             if (tmpobj)
               tmpobj.src=test[3];

   	     if (sort_col != a[i])
   	     	d = 1;
   	     
   	     if ( d == 0 )
   	     {  
   	       x.src=test[0];
   	       d = 1;
   	     }
   	     else if ( d == 1 )
   	     {
   	       x.src=test[1];
   	       d = 0;
   	     }
   	   }

   	   sort_col = a[i];
     }
   }
}
