/************************************************************************************************************
Ajax tooltip
Copyright (C) 2006  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
	
************************************************************************************************************/
/* Minified using JSMin */
var ttArray=new Array('tooltip_bg','tooltip_top','tooltip_bot');imgPreload(ttArray,'/img/','.gif');function newGames()
{location.href='/new-games/'+$("#year").val()+'/'+$("#month").val()+'/';return false;}
var tooltipCache=new Array();var tooltipObj=false;var tooltipObj_iframe=false;var tooltipMSIE=false;if(navigator.userAgent.indexOf('MSIE')>=0)
tooltipMSIE=true;function showT(gameID,inputObj)
{if(!tooltipObj)
{tooltipObj=document.createElement('DIV');tooltipObj.style.position='absolute';tooltipObj.id='tooltipObj';document.body.appendChild(tooltipObj);var contentDiv=document.createElement('DIV');contentDiv.className='gameTooltip';tooltipObj.appendChild(contentDiv);contentDiv.id='gameTooltip';if(tooltipMSIE)
{tooltipObj_iframe=document.createElement('<iframe frameborder="0">');tooltipObj_iframe.style.position='absolute';tooltipObj_iframe.border='0';tooltipObj_iframe.frameborder=0;tooltipObj_iframe.style.backgroundColor='#FFF';tooltipObj_iframe.src='about:blank';contentDiv.appendChild(tooltipObj_iframe);tooltipObj_iframe.style.left='0px';tooltipObj_iframe.style.top='0px';}}
tooltipObj.style.display='block';if(tooltipMSIE)
{tooltipObj_iframe.style.width=tooltipObj.clientWidth+'px';tooltipObj_iframe.style.height=tooltipObj.clientHeight+'px';}
positionTooltip(inputObj);if(tooltipCache[gameID])
{$("#gameTooltip").html(tooltipHTML(tooltipCache[gameID]));return;}
$("#gameTooltip").html(tooltipHTML('Loading...'));$.get('/tooltip.php',{id:gameID},function(html)
{$("#gameTooltip").html(tooltipHTML(html));tooltipCache[gameID]=html;});return false;}
function positionTooltip(inputObj)
{var leftPos=(tooltipLeftPos(inputObj)+inputObj.offsetWidth);var topPos=tooltipTopPos(inputObj);var screenWidth=tooltipMSIE?document.body.clientWidth:window.innerWidth;var tooltipWidth=document.getElementById('gameTooltip').offsetWidth;if((leftPos+tooltipWidth)>screenWidth)
leftPos=leftPos-tooltipWidth-79;tooltipObj.style.left=leftPos+'px';tooltipObj.style.top=topPos+'px';}
function hideT()
{tooltipObj.style.display='none';}
function tooltipHTML(html)
{return'<img src="/img/tooltip_top.gif" alt="" /><br /><div id="tooltip">'+html+'</div><img src="/img/tooltip_bot.gif" alt="" />';}
function tooltipTopPos(inputObj)
{var returnValue=inputObj.offsetTop;while((inputObj=inputObj.offsetParent)!=null)
{if(inputObj.tagName!='HTML')
returnValue+=inputObj.offsetTop;}
return returnValue;}
function tooltipLeftPos(inputObj)
{var returnValue=inputObj.offsetLeft;while((inputObj=inputObj.offsetParent)!=null)
{if(inputObj.tagName!='HTML')
returnValue+=inputObj.offsetLeft;}
return returnValue;}