$(document).ready(function(){
  $(".navWithDropdown").hoverIntent({
    over: makeTall,
    timeout: 150,
    out: makeShort
  });
  function makeTall(){
    $('#TFnav_top li').removeClass('hover');
    $('#TFnav_top li').stop().find(".sub").slideDown('fast').show();
    $('#TFnav_top li').addClass('hover');
    $('#navTrackMyOrder').css('background-position', '0 -60px');
    
  }
  function makeShort(){
    $('#TFnav_top li').removeClass('hover');
    $('#TFnav_top li').stop().find(".sub").fadeOut('fast');
    $('#navTrackMyOrder').css('background-position', '0 0');
  }
});

function openPopupWindow(url,toolbar,width,height,scrollbars,resizeable)
{
  winprops = "toolbar="+toolbar+",width="+width+",height="+height+",directories=0,status=0,scrollbars="+scrollbars+",resizeable="+resizeable+",menubar=0,location=0,copyhistory=0,fullscreen=0'"
  win = window.open(url,'',winprops);
}

/**
  * Prints current page
  */
function printPage()
{
  window.print();
}

/**
  * Opens a separate browser window in the left upper corner
  * with the specified URL
  *
  * @param url - the URL to open in the window
  * @param width - width of the window (default of 580 is used if not specified)
  * @param height - height of the window (default of 400 is used if not specified)
  */
function openWin(url,width,height)
{
  var winWidth;
  var winHeight;

  if(width)
  {
    winWidth=width;
  }
  else
  {
  	winWidth='780';
  }

  if(height)
  {
  	winHeight=height;
  }
  else
  {
  	winHeight='400';
  }

  var W = window.open(url,"","toolbar=no,width="+winWidth+",height="+winHeight+",directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,copyhistory=no")
}
