function cf_ImageFlip(o_Image, b_MouseOver)
{
   if (b_MouseOver)
   {
      o_Image.src=o_Image.src.replace(".gif","_Flip.gif");
   }
   else
   {
      o_Image.src=o_Image.src.replace("_Flip.gif",".gif");
   }
}


function cf_GetPageCategory(s_PathName)
{
	 if (s_PathName.indexOf("ImageServer") != -1)
	 {
	 	return "Photo";
	 }
	 else
	 {
	   i_FirstChar1=-1;
	   i_FirstChar2=-1;
	   if (s_PathName.lastIndexOf("/") >= 0)
	   {
	      i_FirstChar1=s_PathName.lastIndexOf("/") + 1;
	   }
	
	   if (s_PathName.lastIndexOf("\\") >= 0)
	   {
	      i_FirstChar2=s_PathName.lastIndexOf("\\") + 1;
	   }
	   else
	   {
	      i_FirstChar2=0;
	   }
	
	   if (i_FirstChar1 > i_FirstChar2)
	   {
	      i_FirstChar = i_FirstChar1;
	   }
	   else
	   {
	      i_FirstChar = i_FirstChar2;
	   }
	   
	   if (s_PathName.indexOf("_") > 0)
	   {
	      i_LastChar=s_PathName.indexOf("_");
	   }
	   else
	   {
	      i_LastChar=s_PathName.lastIndexOf(".");
	   }
	   
	   if (((i_FirstChar > -1) && (i_LastChar > -1)) && (i_FirstChar < i_LastChar))
	   {
	      return s_PathName.substr(i_FirstChar, i_LastChar - i_FirstChar);
	   }
	   else
	   {
	      return "";
	   }
	 }
}

function cf_SetPageCategory (s_PathName, b_On, b_ForceSet)
{
   i_FirstChar=-1;
   i_LastChar=-1;
   l_LoadHeaderCategories=false;
   s_Category=cf_GetPageCategory(s_PathName);
   
   if (s_Category.length > 0)
   {
      if ((top.s_ActiveCategory != s_Category) || b_ForceSet)
      {
         my_object=eval("top.nav."+top.s_ActiveCategory+"_ideo");
         if (my_object != null)
         {
            my_object.src="images/Nav_Off.gif";
         }
         
         top.s_ActiveCategory = s_Category;

         my_object=eval("top.nav."+top.s_ActiveCategory+"_ideo");
         if (my_object != null)
         {
            my_object.src="images/Nav_On.gif";
         }
      }
   }
}

function cf_Load()
{
   if (this == top)
   {
      if (confirm("This page normally appears in a frameset.\nDo you want to open another window now to use the frameset?"))
      {
         d_Seed = new Date;
         IndexWin=window.open("index.html", "CyberFlotsam"+ d_Seed.getTime());
      }
   }
   else
   {
      cf_SetPageCategory(location.pathname, true, false);
      top.main.focus();
   }
}


function cf_SubmitRating()
{
   rating.pagetitle.value=document.title;
   rating.pagehref.value=document.location.href;
   rating.submit();
}


