
function Riquadro() {
    this.width = 500;                     
    this.bgColor = '#003300';             
    this.textColor = '#FFFFFF';           
    this.borderColor = '#33FF33';        
    this.opacity = 80;                    
    this.cursorDistance = 5;             
  
    this.text = '';
    this.obj = 0;
    this.sobj = 0;
    this.active = false;

    this.create = function() {
      if(!this.sobj) this.init();

      var t = '<table border=0 style=" z-index:5; " cellspacing=0 cellpadding=4 width=' + this.width + ' bgcolor=' + this.bgColor + '><tr>' +
              '<td align=center><br><font style=" font-family:Verdana; font-size:12px; " color=' + this.textColor + '>' + this.text + '<br></font></td></tr></table>';

      if(document.layers) {
        t = '<table border=0 cellspacing=0 cellpadding=1 style=" z-index:5; "><tr><td bgcolor=' + this.borderColor + '><br>' + t + '<br></td></tr></table>';
        this.sobj.document.write(t);
        this.sobj.document.close();
      }
      else {
        this.sobj.border = '1px solid ' + this.borderColor;
        this.setOpacity();
        if(document.getElementById) document.getElementById('ToolTip').innerHTML = t;
        else document.all.ToolTip.innerHTML = t;
      }
      this.show();
    }

    this.init = function() {
      if(document.getElementById) {
        this.obj = document.getElementById('ToolTip');
        this.sobj = this.obj.style;
      }
      else if(document.all) {
        this.obj = document.all.ToolTip;
        this.sobj = this.obj.style;
      }
      else if(document.layers) {
        this.obj = document.ToolTip;
        this.sobj = this.obj;
      }
    }

     this.show = function() {
      var ext = (document.layers ? '' : 'px');
      var left = mouseX;

      if(left + this.width + this.cursorDistance > winX) left -= this.width + this.cursorDistance;
      else left += this.cursorDistance;

      this.sobj.left = left + ext;
      this.sobj.top = mouseY + this.cursorDistance + ext;

      if(!this.active) {
        this.sobj.visibility = 'visible';
        this.active = true;
      }
    }

    this.hide = function() {
      if(this.sobj) this.sobj.visibility = 'hidden';
      this.active = false;
    }

    this.setOpacity = function() {
      this.sobj.filter = 'alpha(opacity=' + this.opacity + ')';
      this.sobj.mozOpacity = '.1';
      if(this.obj.filters) this.obj.filters.alpha.opacity = this.opacity;
      if(!document.all && this.sobj.setProperty) this.sobj.setProperty('-moz-opacity', this.opacity / 100, '');
    }
  }

  var tooltip = mouseX = mouseY = winX = 0;


  if(document.layers) {
    document.write('<layer id="ToolTip" style="position:absolute; z-index:5; top:0; left:0;"></layer>');
    document.captureEvents(Event.MOUSEMOVE);
  }
  else document.write('<div id="ToolTip" style="position:absolute; z-index:5; top: 0; left: 0;"></div>');
  document.onmousemove = getMouseXY;

  function getMouseXY(e) {
    if(document.all) {
      mouseX = event.clientX + document.body.scrollLeft;
      mouseY = event.clientY + document.body.scrollTop;
    }
    else {
      mouseX = e.pageX;
      mouseY = e.pageY;
    }
    if(mouseX < 0) mouseX = 0;
    if(mouseY < 0) mouseY = 0;

    if(document.body && document.body.offsetWidth) winX = document.body.offsetWidth - 25;
    else if(window.innerWidth) winX = window.innerWidth - 25;
    else winX = screen.width - 25;

    if(tooltip && tooltip.active) tooltip.show();
  }

  function Tip(type, level, width, opacity) {
    if(type + 1) {
      tooltip = new Riquadro();
      switch (type)
	  {
		   case 0: tooltip.text = '<b style=" color:#FFFF00;">INTENSITY</b><br>'; 
		  		  tooltip.text += '<br>is how much hard the player intends to work in the match. A high value corresponds to a best performance and to a great energetic waste<br>'; break;
		  case 1: tooltip.text = '<b style=" color:#FFFF00;">RISK</b><br>'; 
		  		  tooltip.text += '<br>Higher is the value will be the more the tennis player will try to play above his own ability taking huge risks<br>'; break;
		  case 2: tooltip.text = '<b style=" color:#FFFF00;">MOVE</b><br>'; 
		  		  tooltip.text += '<br>The player\'s tendency to move to the side of the hit when it\'s played back to him. If the value is high the tennis player it will move straight to the side of a direct return or of the reverse according to its characteristics, but exhaustion will increase more quickly<br>'; break;
	      case 3: tooltip.text = '<b style=" color:#FFFF00;">RISK FIRST BALL SERVICE</b><br>'; 
		  		  tooltip.text += '<br>If the value is low the tennis player it will have the tendency to serve within the safety lines to limit errors. If the value is high. the tennis player it will have the tendency to look for the most effective service committing some errors however more but he will try to score ace\'s<br>'; break;
		  case 4: tooltip.text = '<b style=" color:#FFFF00;">RISK SECOND BALL SERVICE</b> <br>'; 
		  		  tooltip.text += '<br>If the value is low the tennis player will have the tendency to serve safely to limit the errors. If the value is high the tennis player will have the tendency to look for the most effective service, committing some double faults more often<br>'; break;
		  case 5: tooltip.text = '<b style=" color:#FFFF00;">RISK ON SERVICE RETURN</b> <br>'; 
		  		  tooltip.text += '<br>If the value is low the tennis player it will attempt to return the service safely within the lines to limit the errors. If the value is high the tennis player will attempt to look for the win and aim for the lines themselves increasing the chance for an error.<br>'; break;
		  case 6: tooltip.text = '<b style=" color:#FFFF00;">SERVE AND VOLLEY</b> <br>'; 
		  		  tooltip.text += '<br>The player after the service can decide whether to follow up on the net service<br>'; break;
	      case 7: tooltip.text = '<b style=" color:#FFFF00;">TACTIC GAME</b><br>'; 
		  		  tooltip.text += '<br>The tactic in which the tennis player will exert his maximum output<br>'; break;
		  case 8: tooltip.text = '<b style=" color:#FFFF00;">LOST FIRST</b><br>'; 
		  		  tooltip.text += '<br>Formulation of the tactics of the game after having lost the first set in the match<br>'; break;
		  case 9: tooltip.text = '<b style=" color:#FFFF00;">WON FIRST</b><br>'; 
		  		  tooltip.text += '<br>Formulation of the tactics of the game after having won the first set in the match <br>'; break;
		  case 10: tooltip.text = '<b style=" color:#FFFF00;">THIRD</b><br>'; 
		  		  tooltip.text += '<br>Formulation of the tactics of game in the third set of the match <br>'; break;
		  case 11: tooltip.text = '<b style=" color:#FFFF00;">FOURTH</b><br>'; 
		  		  tooltip.text += '<br>Formulation of the tactics of game in the fourth set of the match<br>'; break;
		  case 12: tooltip.text = '<b style=" color:#FFFF00;">FIFTH</b><br>'; 
		  		  tooltip.text += '<br>Formulation of the tactics of game in the fifth set of the match<br>'; break;
				  
		
		  case 20: tooltip.text = '<b style=" color:#FFFF00;">DIRECT</b><br>'; 
		  		  tooltip.text += '<br>Ability to hit by a forehand in tennis<br>'; break;
		  case 21: tooltip.text = '<b style=" color:#FFFF00;">REVERSE</b><br>'; 
		  		  tooltip.text += '<br>Ability to use the backhand stroke in tennis<br>'; break;
		  case 22: tooltip.text = '<b style=" color:#FFFF00;">VOLLEY</b><br>'; 
		  		  tooltip.text += '<br>Ability to hit a high game ball: volley and smash<br>'; break;
		  case 23: tooltip.text = '<b style=" color:#FFFF00;">SERVICE</b><br>'; 
		  		  tooltip.text += '<br>Ability to hit a point at the begginning to get first point<br>'; break;
		  case 24: tooltip.text = '<b style=" color:#FFFF00;">ATTACK</b><br>'; 
		  		  tooltip.text += '<br>Increased chance to attack at the forefront of the court<br>'; break;
		  case 25: tooltip.text = '<b style=" color:#FFFF00;">DEFENSE</b><br>'; 
		  		  tooltip.text += '<br>Ability to recover and play at the back half of the court<br>'; break;
		  case 26: tooltip.text = '<b style=" color:#FFFF00;">SPEED</b><br>'; 
		  		  tooltip.text += '<br>Leg speed<br>'; break;
		  case 27: tooltip.text = '<b style=" color:#FFFF00;">TOUCH</b><br>'; 
		  		  tooltip.text += '<br>Ability to drop the ball just over the net <br>'; break;
		  case 28: tooltip.text = '<b style=" color:#FFFF00;">ANSWER</b><br>'; 
		  		  tooltip.text += '<br>Hit a return off of the opponents service<br>'; break;
		  case 29: tooltip.text = '<b style=" color:#FFFF00;">REFLEXES</b><br>'; 
		  		  tooltip.text += '<br>Speed and promptness of returning the ball<br>'; break;
		  case 30: tooltip.text = '<b style=" color:#FFFF00;">RESISTANCE</b><br>'; 
		  		  tooltip.text += '<br>Ability to recover tiredness between matches<br>'; break;
		  case 31: tooltip.text = '<b style=" color:#FFFF00;">CONDITION</b><br>'; 
		  		  tooltip.text += '<br>Physical ability and endurance of the tennis player<br>'; break;
		  case 32: tooltip.text = '<b style=" color:#FFFF00;">EXPERIENCE</b><br>'; 
		  		  tooltip.text += '<br>Ability points developed by the tennis player beause of  victories<br>'; break;
		  case 33: tooltip.text = '<b style=" color:#FFFF00;">MORAL</b><br>'; 
		  		  tooltip.text += '<br>Increases the output of the tennis player. Increases with victories<br>'; break;
				  
		  case 40: tooltip.text = '<b style=" color:#FFFF00;">SKILLS</b><br>'; 
		  		  tooltip.text += '<br>The technical characteristics of the tennis player<br>'; break;
		  case 41: tooltip.text = '<b style=" color:#FFFF00;">VALUE OF TRAINING</b><br>'; 
		  		  tooltip.text += '<br>Every section will increase certain abilities and will limit the effect of the other abilities. The training is reset as soon as he changes sections<br>'; break;
		  case 42: tooltip.text = '<b style=" color:#FFFF00;">OUTFIT</b><br>'; 
		  		  tooltip.text += '<br>Points out what, at that time the tennis pro is wearing <br>'; break;
		  case 43: tooltip.text = '<b style=" color:#FFFF00;">PLAYER PROFILE</b><br>'; 
		  		  tooltip.text += '<br>The data of the player: weight, height and nationality. As well as the classification in the general ranking and that inside of his own nation. There are two links under the photo of the tennis player that you can add the tennis player to his own list of preferred opponents and to contact sending him a message<br>'; break;
		  case 44: tooltip.text = '<b style=" color:#FFFF00;">MODIFY PHOTO</b><br>'; 
		  		  tooltip.text += '<br>Load or modify the avatar of your own player<br>'; break;
		  case 45: tooltip.text = '<b style=" color:#FFFF00;">REGISTRATION TO THE TOURNAMENTS</b><br>'; 
		  		  tooltip.text += '<br>In this section it is possible to enroll your own tennis player into the various tournaments<br>'; break;
		  case 46: tooltip.text = '<b style=" color:#FFFF00;">TOURNY MANAGEMENT</b><br>'; 
		  		  tooltip.text += '<br>Through this section it will be possible to cancel from tournaments to where he is enrolled but that arent started yet<br>'; break;
		  case 47: tooltip.text = '<b style=" color:#FFFF00;">PLAYER MESSAGES</b><br>'; 
		  		  tooltip.text += '<br>Here you can read messages that the other players send you. Also the messages give you important news for the optimal management of your tennis player. When the icon flashes it means that you have received a message<br>'; break;
		  case 48: tooltip.text = '<b style=" color:#FFFF00;">EQUIPMENT MANAGEMENT</b><br>'; 
		  		  tooltip.text += '<br>In this section you can manage equipment that is purchased by your tennis player<br>'; break;
		  case 49: tooltip.text = '<b style=" color:#FFFF00;">EQUIPMENT CREATION</b><br>'; 
		  		  tooltip.text += '<br>Here you can create equipment,attire, accessories, shoes and rackets<br>'; break;
		  case 50: tooltip.text = '<b style=" color:#FFFF00;">PURCHASE BONUS</b><br>'; 
		  		  tooltip.text += '<br>In this section it is possible to purchase bonuses to increase the skills of the tennis player<br>'; break;
		  case 51: tooltip.text = '<b style=" color:#FFFF00;">ASSIGN BONUS</b><br>'; 
		  		  tooltip.text += '<br>Once purchased the bonuses can be distributed among the skills of the tennis player. You can distribut these, but there is no obligation. They can be purchased and kept for use later as you need them.<br>'; break;
		  case 52: tooltip.text = '<b style=" color:#FFFF00;">PRESS RELEASE</b><br>'; 
		  		  tooltip.text += '<br>Every tennis player can make a press release; however, it must immediately be published in the section news<br>'; break;
		  case 53: tooltip.text = '<b style=" color:#FFFF00;">PREFERRED TACTIC</b><br>'; 
		  		  tooltip.text += '<br>The tactic in which the tennis player mostly feels to be the best way to play<br>'; break;
		  case 54: tooltip.text = '<b style=" color:#FFFF00;">SELL PLAYER</b><br>'; 
		  		  tooltip.text += '<br>The tennis player\'s sale bid<br>'; break;
		  case 55: tooltip.text = '<b style=" color:#FFFF00;">player logs</b><br>'; 
		  		  tooltip.text += '<br>player logs History<br>'; break;
		  case 56: tooltip.text = '<b style=" color:#FFFF00;">MANAGER MESSAGES</b><br>'; 
		  		  tooltip.text += '<br>here you can read the messages that consumers send to your manager. When the writing flashes it means that you have received a message <br>'; break;
		  case 57: tooltip.text = '<b style=" color:#FFFF00;">TENNIS PLAYERS BID</b><br>'; 
		  		  tooltip.text += '<br>bid system for sell and buy tennis players<br>'; break;
		  case 58: tooltip.text = '<b style=" color:#FFFF00;">TOURNY CREATION</b><br>'; 
		  		  tooltip.text += '<br>Allows you to create tournaments and to earn credits for their management<br>'; break;
		  case 59: tooltip.text = '<b style=" color:#FFFF00;">CREATE PLAYER</b><br>'; 
		  		  tooltip.text += '<br>Allows you to create a new tennis player<br>'; break;
		  case 60: tooltip.text = '<b style=" color:#FFFF00;">STRATEGY for FRIENDLY match</b><br>'; 
		  		  tooltip.text += '<br>Allows you to setting the strategy used in the friendly matches<br>'; break;
		  case 61: tooltip.text = '<b style=" color:#FFFF00;">PEMIUM ACCOUNT</b><br>'; 
		  		  tooltip.text += '<br>Allows the activation of interesting abilities<br>'; break;
		  case 62: tooltip.text = '<b style=" color:#FFFF00;">CREDITS</b><br>'; 
		  		  tooltip.text += '<br>Allows the distribution of credits from the manager to the tennis player<br>'; break;
		  case 63: tooltip.text = '<b style=" color:#FFFF00;">PURCHASE CREDITS</b><br>'; 
		  		  tooltip.text += '<br>Allows you to purchase credits for the manager and the tennis players <br>'; break;
		  case 64: tooltip.text = '<b style=" color:#FFFF00;">MANAGER LOG</b><br>'; 
		  		  tooltip.text += '<br>history related to the manager <br>'; break;
		  case 65: tooltip.text = '<b style=" color:#FFFF00;">TURN INFO</b><br>'; 
		  		  tooltip.text += '<br>Shows the duration and the planning of the turns of game<br>'; break;
		  case 66: tooltip.text = '<b style=" color:#FFFF00;">FORUM</b><br>'; 
		  		  tooltip.text += '<br>Go to the forum of Tennis Manager to enter the Player community<br>'; break;
		  case 67: tooltip.text = '<b style=" color:#FFFF00;">TENNIS PLAYER SELECTION</b><br>'; 
		  		  tooltip.text += '<br>Select a tennis player to manage. <br>'; break;
				  
		  case 68: tooltip.text = '<b style=" color:#FFFF00;">DELETE TENNIS PLAYER</b><br>'; 
		  		  tooltip.text += '<br>Allows the cancelation of a tennis player. <br>'; break;
				  
		  default: break;
	  }

      if(width) tooltip.width = width;
      if(opacity) tooltip.opacity = opacity;
      tooltip.create();
    }
    else if(tooltip) tooltip.hide();
  }
