fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=50;          
_subOffsetTop=2;
_subOffsetLeft=-2;

function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
        begin += 2;
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
        end = dc.length;
    return unescape(dc.substring(begin + prefix.length, end));
}

function setFieldFromCookie(formfield, initialValue)
   {
   if (initialValue==null)
      formfield.value = "";
   else
      formfield.value = initialValue;
   }

with(menuStyle=new mm_style()){
bordercolor="#000000";
borderwidth=0;
fontfamily="Arial";
align="left";
fontsize= "12"; //"80%";
fontstyle="normal";
fontweight="bold";
itemheight=22;
//menubgimage="/tramline/yellow_back.gif";
offbgcolor="transparent";
offcolor="#FFFFFF";
onbgcolor= "#E4E9C5"; //"transparent"; 
oncolor="#000000";
outfilter="fade(duration=0.5)";
overfilter="Fade(duration=0.5);"; //Shadow(color=#ADAEAD,Direction=180,Strength=6";
rawcss="padding-left:10px;padding-right:10px";
}

with(submenuStyle=new mm_style()){
styleid=1;
bordercolor="#000000";
borderwidth=1;
align="left";
fontfamily="Arial";
fontsize= "10"; //"80%";
fontstyle="normal";
//fontweight="bold";
headercolor="#000000";
//image="mac_trans.gif";
//menubgimage="/tramline/yellow_back.gif";
offbgcolor="#E4E9C5"; //"transparent";
offcolor="#000000";
onbgcolor="#8ABD3E";
oncolor="#000000";
onsubimage="/tramline/11x9arrow.gif";
//outfilter="fade(duration=0.5)";
//overfilter="Fade(duration=0.5);Shadow(color=#ADAEAD,Direction=180,Strength=6";
padding=2;
rawcss="padding-left:5px;padding-right:5px;";
separatorcolor="#888888";
separatorpadding=5;
subimage="/tramline/11x9arrow.gif";
}

with(milonic=new menuname("MyPages"))
  {
  top="offset=0";
  style=submenuStyle;
  separatorsize=1;

  //aI("image=/tramline/ic_register.gif;status=Registration is required to post scores and videos.;text=Register Now (It's Free!);url=/register.php;");   
  var my_uid = getCookie("user_id");
  if (!(my_uid == null || my_uid == ""))
     userName = getCookie("first_name") + " " + getCookie("last_name");
  else
     userName = "";
  menuText = "separatorsize=1;image=/tramline/ic_keyboard.gif;status=Logout " + userName + ";text=Logout " + userName + ";url=/logout.php;";
  aI(menuText);
  aI("image=/tramline/ic_locker.gif;text=My Locker;status=;url=/myaccount.php");   
  aI("image=/tramline/ic_mail.gif;text=My Inbox;status=;url=/emailinbox.php");  
  aI("image=/tramline/ic_rssgreen.gif;text=My PowerPage;status=;url=/myblog.php");  
  aI("image=/tramline/ic_group.gif;status=;text=My Friends;url=/myfriends.php"); 
  aI("separatorsize=1;image=/tramline/ic_mygroup.gif;text=My Groups;url=/groups_more.php"); 
  aI("separatorsize=1;image=/tramline/ic_plusgroup.gif;text=Refer PowerChalk;url=/invite.php?ref=2"); 
  aI("image=/tramline/ic_goldstar.gif;status=Become eligible for prizes by upgrading.;text=Upgrade to Pro;url=/Pricing;");
  }

  
with(milonic=new menuname("People"))
  {
  top="offset=0";
  style=submenuStyle;
  separatorsize=1;

  aI("image=/tramline/ic_search.gif;status=;text=Find People;url=/people.php");
  aI("separatorsize=1;image=/tramline/ic_coach.gif;text=Find a Coach;url=/findCoaches.php"); //?load=coach"); 
  aI("separatorsize=1;image=/tramline/ic_plusgroup.gif;text=Invite Members;url=/invite.php?ref=2"); 
  aI("image=/tramline/ic_search.gif;text=Find a Group;url=/groups.php"); 
  aI("image=/tramline/ic_mygroup.gif;text=My Groups;url=/groups_more.php"); 
  //aI("image=/tramline/ic_creategroup.gif;text=Create a Group;url=/addgroup.php");  
  }

  
with(milonic=new menuname("Tools"))
  {
  style=submenuStyle;
  top="offset=0";
  
  aI("image=/images/silkIcons/monitor.png;text=SendTo Uploader;status= Right-mouse Windows helper application.;url=/sendToDownload.php");
  aI("separatorsize=1;image=/images/silkIcons/monitor.png;text=PowerChalk Explorer;status=Windows Explorer style application for uploading videos.;url=/pcExplorerDownload.php");
  aI("image=/images/silkIcons/iphone16.png;text=iPhone Uploader;status=Upload iPhone 3GS videos straight to PowerChalk.;url=/powerTools.php?page=iphone_uploader&title=iPhone%20Uploader");
  aI("separatorsize=1;image=/images/silkIcons/iphone16.png;text=iPhone Pitch Count;status=Counts balls and strikes. Builds database and sends emails.;url=/powerTools.php?page=iphone_pitchCount&title=PowerChalk%20PitchCount");
  //aI("image=/tramline/ic_iphone.gif;text=iPhone Pitch Count;status=Counts balls and strikes. Builds database and sends emails.;url=/iphone/pitchcount.php");
  
  }
  
with(milonic=new menuname("Videos"))
  {
  style=submenuStyle;
  top="offset=0";
  
  aI("separatorsize=1;image=/tramline/ic_myvideos.gif;text=Manage My Videos;status=Show videos uploaded by you.;url=/seemore.php?load=myvids");
  aI("image=/tramline/ic_group.gif;text=My Friends' Videos;status=Videos marked as public by your roster members.;url=/seemore.php?load=myfriends");
  aI("separatorsize=1;image=/tramline/ic_favvideo.gif;text=My Favorite Videos;status=Videos marked by you as favorites;url=/seemore.php?load=myfavs");
  aI("image=/tramline/ic_earth.gif;text=Public Videos;status=Browse the latest uploaded videos.;url=/seemore.php?load=recent");
  aI("image=/tramline/ic_privVideo.gif;text=Private Videos;status=Browse the latest uploaded videos.;url=/seePrivate.php");
  aI("separatorsize=1;image=/tramline/ic_baseball22.png;text=Videos by Sport;status=Videos sorted by sport;url=/category.php");
  aI("image=/tramline/ic_video.gif;text=Upload a Video;status=Upload new videos to your account;url=/uploader.php");
  aI("image=/tramline/ic_upload2.gif;text=Upload Multiple Videos;status=Upload new videos to your account;url=/multiVideoUpload.php");
  aI("separatorsize=1;image=/tramline/ic_youtube.gif;text=Grab Web Videos;status=Upload videos from YouTube.;url=/youtubeUpload.php");
  aI("image=/tramline/ic_search.gif;text=`<form style=\"margin: 0px;\" name=\"input\" action=\"search.php\" method=\"get\"><input name=\"keyword\" type=\"text\"><input name=\"type\" type=\"hidden\" value=\"videos\"><br><input value=\"Search Public Videos\" name=\"search\" type=\"submit\"></form>`;type=form;onbgcolor=;onborder=;image=;align=center");
  }

with(milonic=new menuname("ChalkTalks"))
  {
  style=submenuStyle;
  top="offset=0";
  
  aI("image=/tramline/ic_headset.gif;text=ChalkTalk a Video;status=Analyze and markup a video.;url=/pchalk_max.php");
  aI("separatorsize=1;image=/tramline/ic_headset.gif;showmenu=Diagrams;text=ChalkTalk a Diagram;status=Animate a sports diagram.");
  aI("image=/tramline/ic_neutron.gif;text=My ChalkTalks;status=Show my marked up videos.;url=/seemore.php?load=chalkboards&uid=0");
  //aI("image=/tramline/ic_chalkboardsBySport.gif;text=ChalkTalks by Sport;status=Videos sorted by sport;url=/category.php");
  //aI("image=/tramline/ic_privChalk.gif;text=Private ChalkTalks;status=Browse private ChalkTalks accessible to you.;url=/seemore.php?load=chalkboards&filter=private");
  aI("separatorsize=1;image=/tramline/ic_earth.gif;text=Public ChalkTalks;status=View public ChalkTalks.;url=/seemore.php?load=chalkboards&uid=-1");
  aI("text=`<form style=\"margin: 0px;\" name=\"input\" action=\"search.php\" method=\"get\"><input name=\"keyword\" type=\"text\"><input name=\"type\" type=\"hidden\" value=\"chalktalks\"><br><input value=\"Search Public ChalkTalks\" name=\"search\" type=\"submit\"></form>`;type=form;onbgcolor=;onborder=;image=;align=center");
  }  
  
  
with(milonic=new menuname("Diagrams"))
  {
  style=submenuStyle;
  top="offset=0";
  aI("image=/tramline/ic_baseballfield16.png;text=Baseball;url=/pchalk_max.php?vidtarget=CT:BaseballDiamond.swf;");
  aI("separatorsize=1;image=/tramline/ic_baseballfield16.png;text=Baseball (practice);url=/pchalk_max.php?vidtarget=CT:BaseballPractice.swf;");
  aI("image=/tramline/ic_basketballcourt.png;text=Basketball;url=/pchalk_max.php?vidtarget=CT:HalfCourtBasketball.swf;");
  aI("image=/tramline/ic_bowling.gif;text=Bowling;url=/pchalk_max.php?vidtarget=CT:Bowling.swf;");
  aI("separatorsize=1;image=/tramline/ic_chess.png;text=Chess;url=/pchalk_max.php?vidtarget=CT:Chess.swf;");
  aI("image=/tramline/ic_footballfield.png;text=Football;url=/pchalk_max.php?vidtarget=CT:HalfFootball.swf;");
  aI("separatorsize=1;image=/tramline/ic_footballfield.png;text=FlagFootball-7;url=/pchalk_max.php?vidtarget=CT:FlagFootball7.swf;");
  aI("image=/tramline/ic_blacktee.gif;text=Golf Hole;url=/pchalk_max.php?vidtarget=CT:GolfHole.swf;");
  aI("separatorsize=1;image=/tramline/ic_hockey.png;text=Hockey;url=/pchalk_max.php?vidtarget=CT:HalfHockey.swf;");
  aI("image=/tramline/ic_lacrosse.gif;text=Lacrosse;url=/pchalk_max.php?vidtarget=CT:LacrosseFull.swf;");
  aI("separatorsize=1;image=/tramline/ic_lacrosse.gif;text=Lacrosse;url=/pchalk_max.php?vidtarget=CT:LacrosseWomens.swf;");
  aI("image=/tramline/ic_racquetball.gif;text=Racquetball;url=/pchalk_max.php?vidtarget=CT:RacquetBall.swf;");
  aI("separatorsize=1;image=/tramline/ic_sailing.gif;text=Sailing;url=/pchalk_max.php?vidtarget=CT:Sailing.swf;");
  aI("image=/tramline/ic_soccer.gif;text=Soccer (Half);url=/pchalk_max.php?vidtarget=CT:HalfSoccer.swf;");
  aI("separatorsize=1;image=/tramline/ic_soccer.gif;text=Soccer (Full);url=/pchalk_max.php?vidtarget=CT:FullSoccer.swf;");
  aI("image=/tramline/ic_softball24.gif;text=Softball;url=/pchalk_max.php?vidtarget=CT:Softball.swf;");
  aI("image=/tramline/ic_squash.gif;text=Squash;url=/pchalk_max.php?vidtarget=CT:Squash.swf;");
  aI("image=/tramline/ic_tennis.gif;text=Tennis;url=/pchalk_max.php?vidtarget=CT:Tennis.swf;");
  aI("image=/tramline/ic_volleyball.gif;text=Volleyball;url=/pchalk_max.php?vidtarget=CT:Volleyball.swf;");
  }

with(milonic=new menuname("Photos"))
  {
  style=submenuStyle;
  top="offset=0";

  aI("image=/tramline/ic_camera.gif;text=My Photos;status=Show photos uploaded by you.;url=/photo.php?load=myphotos");
//  aI("image=/tramline/ic_favImg.gif;text=Favorite Photos;status=Videos marked by you as favorites;url=/photo.php?load=myfavs");
  aI("separatorsize=1;image=/tramline/ic_picture.gif;text=Recent Photos;status=Browse the latest uploaded photos.;url=/photo.php?load=recent");
  aI("separatorsize=1;image=/tramline/ic_uploadPhotos.gif;text=Upload Photos;status=Upload new videos to your account;url=/photo_uploader.php");
  aI("separatorsize=1;image=/tramline/ic_bbcard.gif;text=Create a Trading Card;status=Create and print a baseball card from your uploaded picture.;url=/bbcard.php");
  aI("separatorsize=1;text=`<form style=\"margin: 0px;\" name=\"input\" action=\"search.php\" method=\"get\"><input name=\"keyword\" type=\"text\"><input name=\"type\" type=\"hidden\" value=\"photos\"><br><input value=\"Search Photos\" name=\"search\" type=\"submit\"></form>`;type=form;onbgcolor=;onborder=;image=;align=center");
  }

with(milonic=new menuname("Toolbox"))
  {
  style=submenuStyle;
  top="offset=0";

  aI("image=/images/silkIcons/application.png;text=PowerChalk Explorer;status=Download the PowerChalk Explorer;url=/pcExplorer.php");
  }

with(milonic=new menuname("Business"))
{
style=submenuStyle;
top="offset=0";
aI("image=/tramline/ic_greenball.gif;text=Welcome to PowerChalk;url=/Welcome;");
aI("image=/tramline/ic_earth.gif;text=About Us;url=/page.php?page=1;");
aI("separatorsize=1;image=/tramline/ic_flag.gif;text=News;url=/page.php?page=1;");
aI("image=/tramline/ic_twitter.gif;text=Follow Us on Twitter;url=http://www.twitter.com/powerchalk;target=_blank");
aI("separatorsize=1;image=/tramline/ic_facebook.gif;text=Friend Us on Facebook;url=http://www.facebook.com/pages/PowerChalk/261522406960;target=_blank;");
//aI("image=/tramline/ic_scales.gif;text=Contest Rules;url=/page.php?page=5;");
aI("separatorsize=1;image=/tramline/ic_license.gif;text=Privacy Policy;url=/page.php?page=3;");
aI("separatorsize=1;image=/tramline/ic_mail.gif;text=Email Us;url=/page.php?page=2");
aI("separatorsize=1;image=/tramline/ic_help.gif;separatorsize=1;text=Help;url=/help_chalktalk.php");
//aI("image=/tramline/ic_search.gif;separatorsize=1;text=Search the Site;url=/search.php;");
}
