//this calls the setUpHelp function when the page first loads
setUpHelp();
//calls the Is function at the begginning to check the browser

/// array to store the stings of text
var toolTipCaptions = new Array();
toolTipCaptions[0] = "Pool cues and billiards supplies with FREE SHIPPING. Get bargain prices on your pool table accessories!";
toolTipCaptions[1] = "Billiard Warehouse has a large selection of pool cues, pool cue cases, billiard lighting, pool accessories and more with great prices and fantastic service.";
toolTipCaptions[2] = "CueStore.com carries quality brand name pool cues, cue cases and billiard accessories at discount prices.";
toolTipCaptions[3] = "Descriptions and prices on over 150 current McDermott cues and a link to the exclusive McDermott Private Reserve Collection cues.";
toolTipCaptions[4] = "Star is the exciting lower price brand of cues from McDermott, with full Lifetime Warranty.";
toolTipCaptions[5] = "The on-line complement of the most comprehensive magazine in billiards.";
toolTipCaptions[6] = "Inside Pool Magazine - Pool and billiard games, videos, pictures, photos, images, billiards image galleries, pool tours, tournament brackets, and more.";
toolTipCaptions[7] = "Pool & Billiard Magazine: the sport's oldest monthly magazine and boasts the largest readership of billiard businesses, players and fans.";
toolTipCaptions[8] = "Home of the Viking 9-ball tour.";
toolTipCaptions[9] = "The International Pool Tour is the largest pool tour in the history of billiards, and the best pool or pocket billiards and snooker players in the world are represented from 27 different countries.";
toolTipCaptions[10] = "If you are interested in getting into the sport of Billiards, look no further. The BCA will give you all you need to find what you seek.";
toolTipCaptions[11] = "Large billiard site with player forums, online brackets, tournament info, player rankings, and more.";
toolTipCaptions[12] = "A flash based utility that will allow you to post a diagram of a table to describe a shot.";
toolTipCaptions[13] = "The purdue recreation center in the basement of the Memorial Union is where the billiard tables and bowling lanes are located.";
toolTipCaptions[14] = "A large international site with lots of videos but the links are not in English.";
toolTipCaptions[15] = "Large site full of all kinds of pool videos free to watch.";
toolTipCaptions[16] = "Video of Niels Feijen running 259 balls in straight pool.";
toolTipCaptions[17] = "3 cushion billiards videos";
toolTipCaptions[18] = "3 cushion billiards videos";
toolTipCaptions[19] = "Videos of some trick shots.";
toolTipCaptions[20] = "An old Tom &amp; Jerry Cartoon of them playing pool.";

var is = new Is();
//checks the version of the browser, if it is told old then it will not work
function Is ()
{   // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()

    // *** BROWSER VERSION ***
    this.major = parseInt(navigator.appVersion)

    this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
    this.nav4 = (this.nav && (this.major == 4))
    this.nav4up = this.nav && (this.major >= 4)

    this.ie   = (agt.indexOf("msie") != -1)
    this.ie4  = (this.ie && (this.major == 4))
    this.ie4up  = this.ie  && (this.major >= 4)
}
// makes the ballon that will hold the text
// TheDiv is the name that will be referenced both on the actual page and in other functions below
function setUpHelp()
{
	// call the maketheBalloon function to actually physically make the balloon
   maketheBalloon("helpballoon",100,"");
}
//make the balloon set the properties of the ballon in the div tag
function maketheBalloon(width, message)
{
	//set the div that will hold the content
	/*settings for Div
		border-width:thin
		border-style:inset
		border-color:blue
		position:absolute
		background-color:#CCCCCC
		padding:2
		layer-background-color: #CCCCCC
		visibility:hidden	
	*/
   var theString = '<STYLE TYPE="text/css">#helpballoon{width:'+width+';}</STYLE>';
   theString+='<DIV style="position:absolute; width:200px; visibility:hidden; z-index:100;" id="helpballoon">'+message+'</DIV>';
   // write the div tag to the page
   document.write(theString);
}
// makes the div visible and places it beside the mouse pointer
function showhelp(TheText,event)
{
	event = (event) ? event : ((window.event) ? window.event : "");
	

	//this is for netscape
	if (is.nav4up) {
			document.getElementById('helpballoon').style.left = event.pageX + 10 + 'px';
			document.getElementById('helpballoon').style.top = event.pageY + 10 + 'px';
			document.getElementById('helpballoon').style.background = "#FFFFFF";
			document.getElementById('helpballoon').style.border = "1px solid black";
			document.getElementById('helpballoon').style.padding = "2px";
			document.getElementById('helpballoon').innerHTML = TheText;
			document.getElementById('helpballoon').style.visibility = "visible";			
	}
	//this is for IE
	else {
			document.all['helpballoon'].style.pixelLeft = (document.body.scrollLeft +event.clientX) + 10;
			document.all['helpballoon'].style.pixelTop = (document.body.scrollTop + event.clientY) + 10;
			document.all['helpballoon'].style.background = "#FFFFFF";
			document.all['helpballoon'].style.border = "1px solid black";
			document.all['helpballoon'].style.padding = "2px";
			document.all['helpballoon'].innerHTML = TheText;
			document.all['helpballoon'].style.visibility="visible";
	}
                
}
// hide the div tag
function hidehelp()
{
        is.nav4up ? document.getElementById('helpballoon').style.visibility = "hidden" : document.all['helpballoon'].style.visibility="hidden";
}
