
function browserInfo()
{
   if (   navigator.platform.indexOf("Win")>=0 
       && navigator.appVersion.indexOf("MSIE")>=0
      ) return "WinIE";


   if (   navigator.platform.indexOf("Mac")>=0 
       && navigator.appVersion.indexOf("MSIE")>=0
      ) return "MacIE";


   return "Other";
}


function projNo(proj,pList)
{
  for (i=0;i<pList.length;i++)
  {
     if (proj==pList[i]) return (i+1);
  }
  return 0;
}



function showProjNav(proj,pList,nList)
{
  var params = "?ProjectNumS="+pList.length+"&MarkedProjectS="+projNo(proj,pList);

  for (i=0;i<pList.length;i++)
  {
     params += "&PN"+(i+1)+"="+nList[i];
  }

  var objString = 
      "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
    + " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'"
    + " WIDTH=640 HEIGHT=64>"
    + "<PARAM NAME=movie VALUE='../SystemFlashs/ProjectNav.swf"
    + params
    + "'>" 
    + "<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>" 
    + "<EMBED src='../SystemFlashs/ProjectNav.swf"
    + params
    + "' quality=high bgcolor=#FFFFFF"
    + " WIDTH=640 HEIGHT=64"
    + " TYPE='application/x-shockwave-flash'"
    + " PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>"
    + "</EMBED></OBJECT>";


   document.write (objString);
}





function nextProject(proj,pList)
{
   if (pList[pList.length-1]==proj)
   {
      return pList[0];
   }

   for (i=0;i<pList.length-1;i++)
   {
      if (pList[i]!=proj) continue;
      return pList[i+1];      
   }

   return "";
}





function setCookie2(name,value)
{
  var td = new Date();
  var d = new Date();
  d.setTime(td.getTime()+1000*60*60*24*30); //One month
  document.cookie = name + "=" + escape(value) + "; expires=" + d.toGMTString();
}



function setCookie(name,value)
{
//  var td = new Date();
//  var d = new Date();
//  d.setTime(td.getTime()+1000*60*60*24*30); //One month
//  document.cookie = name + "=" + escape(value) + "; expires=" + d.toGMTString();
   document.cookie = name + "=" + escape(value);
}

function getCookie(name)
{
  search = name+"=";
  if (document.cookie.length>0)
  {
    offset = document.cookie.indexOf(search);
    if (offset == -1) return "";
    offset += search.length;
    end = document.cookie.indexOf(";",offset);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(offset,end));
  }
  return "";
}

