/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 300;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array("../images/ClassBad/maBoxAdd1.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[1] = new Array("../images/ClassBad/maBoxAdd2.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[2] = new Array("../images/ClassBad/maBoxAdd3.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[3] = new Array("../images/ClassBad/maBoxAdd4.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[4] = new Array("../images/ClassBad/maBoxAdd5.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[5] = new Array("../images/ClassBad/maBoxAdd6.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[6] = new Array("../images/ClassBad/maBoxAdd7.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[7] = new Array("../images/ClassBad/maBoxAdd8.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[8] = new Array("../images/ClassBad/maBoxAdd9.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[9] = new Array("../images/ClassBad/maBoxAdd10.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[10] = new Array("../images/ClassBad/maBoxAdd11.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[11] = new Array("../images/ClassBad/maBoxAdd12.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[12] = new Array('../images/pub.gif','<B>ROTARY</B> CLUB OF MYRTLEFORD Wood Raffle drawn  on 24/7/10,  Winner: M. Ellero. Ticket: Yellow E19 ');
messages[13] = new Array('../images/pub.gif','<B>UNITING</B> Church Mow Roster 2nd - 6th of August 2010. Mon 2<B> -</B> L & R McCarthy, Tues 3 - C. Newlands & E. Frankowski, Wed 4 - V & T Cousins, Thu 5 - M. Torpey & J.Leita. Fri 6<B> </B>- R & C Walker.');
messages[14] = new Array("../images/ClassBad/maBoxAdd13.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[15] = new Array("../images/ClassBad/maBoxAdd14.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[16] = new Array("../images/ClassBad/maBoxAdd15.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[17] = new Array("../images/ClassBad/maBoxAdd16.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[18] = new Array('../images/tol.gif','<B>4</B> Bedroom Brick House, 7 kms from Myrtleford, 2 bathrooms, 2 toilets, freshly painted throughout, lock-up garage, optional second garage.  Phone (03)57 511 386.');
messages[19] = new Array('../images/tol.gif','<B>THREE</B> bedroom house, freshly painted, located in Delaney Avenue, Bright.  $210 per week.  Phone 0417 568 328.');
messages[20] = new Array('../images/wwa.gif','<B>CAPE</B> weed sprayed. Contact Chris on 0427 523 293.');
messages[21] = new Array("../images/ClassBad/maBoxAdd17.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[22] = new Array("../images/ClassBad/maBoxAdd18.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[23] = new Array("../images/ClassBad/maBoxAdd19.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[24] = new Array('../images/emw.gif','<B>PART-TIME</B> Autumn Glory Cottages. A part time Cleaner/Caretaker is required for our holiday cottage in Bright.  High standards and pride in your work are essential.  Work may be required 1 -3 times per week including weekends.  Would siut semi retired or school hours. Ph (02) 6056 0350 evenings.');
messages[25] = new Array('../images/pet.gif','<B>BULLMASTIFF</B> pups, 8wks old, assorted colours, 4 females, 6 males, $200each.  Phone 0430 524 379.');
messages[26] = new Array('../images/pet.gif','<B>WHIPPET</B> pups, males and females, vet checked, wormed and vaccinated, $240 each. Ph 0412 290 381.');
messages[27] = new Array('../images/liv.gif','<B>sheep</B> for sale 4 Dorset Ewes with fleeces $80 each Myrtleford ph 57511510 or Email colti@bigpond.com');
messages[28] = new Array("../images/ClassBad/maBoxAdd20.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[29] = new Array('../images/mot.gif','<B>HYUNDAI</B> Lantra 96, manual, 5 door, cd player, air con, 10 months Vic Rego (XRF 399), 255,000kms, $2500 ono. Ph 0400 928 111.');
messages[30] = new Array('../images/moc.gif','<B>MOTORCYCLE</B> <B>LICENCE</B> / Learner courses. Vic Roads accredited training and assessment. 1 day courses, Sat, Sun and Mon. Scooter, Trail and Road Bikes supplied. Ride-Tek Wangaratta 0458 373 040. ');
messages[31] = new Array("../images/ClassBad/maBoxAdd21.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[32] = new Array("../images/ClassBad/maBoxAdd22.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[33] = new Array("../images/ClassBad/maBoxAdd23.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[34] = new Array("../images/ClassBad/maBoxAdd24.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[35] = new Array("../images/ClassBad/maBoxAdd25.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[36] = new Array("../images/ClassBad/maBoxAdd26.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[37] = new Array("../images/ClassBad/maBoxAdd27.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[38] = new Array("../images/ClassBad/maBoxAdd28.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[39] = new Array('../images/fos.gif','<B>CHAINSAW</B> for sale, JONS-ED, excellent condition, 2065 turbo $700. Ph 0428 391 476.');
messages[40] = new Array('../images/fos.gif','<B>FIREWOOD</B> top quality redgum, split and delivered. Phone Rob 5722 2949.');
messages[41] = new Array('../images/fos.gif','<B>GOODWOOD</B> split and delivered to Myrtleford, $65 for 1m.  Phone Joe on 0401 867 009.');
messages[42] = new Array('../images/fos.gif','<B>NATIVE PLANTS. </B>From 75 cents, home or farm. Huge variety, drought tolerant, direct from grower to you. Prompt mail order service. Sales by appointment.  www.sandycreektrees. com.au. Ph (02) 6027 1497.');
messages[43] = new Array('../images/fos.gif','<B>PALMS</B> for sale, four large Cotton Palms - suit large landscape project, all offers welcome, phone 57 551 867 or 0419 485 152.');
messages[44] = new Array('../images/fos.gif','<B>POPLAR VARIETIES</B>. 2 meters $8 each or $550 straight 100. Ph 5753 4572. www. coststreeland.com.au.');
messages[45] = new Array("../images/ClassBad/maBoxAdd29.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[46] = new Array("../images/ClassBad/maBoxAdd30.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[47] = new Array('../images/dea.gif','<B>GAMBOLD,</B> Olive (Dolly). Late of Edwards Street, Wangaratta. Formerly of Whorouly. Beloved mother of Marie, Brian, Doug, Kevan and Fay, Helen, Ian.  Nana of 15 and great Nan of 25. We knew that you were suffering,  We tried to ease the pain. We will always love and treasure you,  One day well meet again.');
messages[48] = new Array('../images/dea.gif','<B>PANOZZO</B> Arcisa Passed away peacefully at her Oxley Flats home on Sunday July 25, 2010 - aged 88 years.  Beloved wife of Gioacchino (Jock).  Dearly love mother and mother in law of Teresiano (Terry), Yollie and Sam.  Loving nonna of Carmine and Vanessa and biznonna of Daimler. Riposi in Pace TATE FUNERAL SERVICES ROBERT TATE WANGARATTA 57 222 525');
messages[49] = new Array('../images/dea.gif','<B>PEARCE</B> Ernest Richard (Dick) late of Delany Avenue, Bright. Passed away peacefully at Barwidgee Lodge, Myrtleford on July 19, 2010. Dearly loved husband of Tasma for 59 years. Father of Michael. Precious Memories" A funeral service was held in Bright on Monday, July 26 2010. TATE FUNERAL SERVICES ROBERT TATE Wangaratta 5722 2525.');
messages[50] = new Array("../images/ClassBad/maBoxAdd31.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[51] = new Array('../images/fun.gif','<B>PANOZZO</B> Requiem mass for the repose of the soul of Mrs Arcisa Panozzo will be offered in St Patricks Catholic Church, Ford St, Wangaratta on Saturday, July 31, 2010, commencing at 12.30pm. The funeral will leave at the conclusion of mass for interment in the Vault section of the Wangaratta General Cemetery. Rosary will be recited in the Chapel of Tate Funeral Services, 59 - 63 Greta Rd, Wangaratta on Friday July 30, 2010 commencing at 7.00pm.  Flowers are welcome, or if preferred a donation made to the Wangaratta Pallative Care would be appreciated.  Donation envelopes will be available at the Church entrance. TATE FUNERAL SERVICES ROBERT TATE WANGARATTA 57 222 525');
messages[52] = new Array("../images/ClassBad/maBoxAdd32.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[53] = new Array("../images/ClassBad/maBoxAdd33.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[54] = new Array("../images/ClassBad/maBoxAdd34.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[55] = new Array("../images/ClassBad/maBoxAdd35.jpg","<CENTER>If you cannot read this add then<BR>just click the LEFT MOUSE BUTTON.</CENTER>");
messages[56] = new Array('../images/mem.gif','<B>IVONE,</B> Peter Anthony. 23/9/1959 - 28/7/2006 In loving memory of our youngest Son, Peter. God has him in his keeping,  We have him in our hearts. Love Mum and Dad.');
messages[57] = new Array('../images/mem.gif','<B>IVONE,</B> Peter Anthony. 23/9/1959 - 28/7/2006 Four years have passed.  Remembered every day with love.  Loved brother, brother-in-law and uncle of Sue, Kevin, Taryn & Rob and Shane, John, Tina, Melissa, Joanne & Brett and Darren, Steve, Karen, Kristie, Brooke and Jeremy, Veronica, Gary, Bradley, Amanda and Matthew.  Great Uncle of Lily and Violet.');
messages[58] = new Array('../images/mem.gif','<B>IVONE</B> - Peter. Pete 4 years have passed, but not a day goes by without you in our thoughts and in our hearts. Darren and Mary.');
messages[59] = new Array('../images/mem.gif','<B>IVONE</B> - Peter 28/7/2006 Loving memories of Peter.  Always in our thoughts, so sadly missed. Gary, Carolyn, James & Georgia. Uncle Peter, A flower may fall, the sun may set, an Uncle like you Ill never forget.  I miss you, and the times we shared I treasure more than gold.  Love forever - Georgia.');
messages[60] = new Array('../images/mem.gif','<B>IVONE -</B> Peter Anthony. Passed away 28/7/06 A long lonely time without your love and wisdom.  In our thoughts you always stay.  The years we shared together are the memories we keep forever.  Ever loving husband of Leanne, loved father of Anthony, Jason and Kaelee.');
messages[61] = new Array('../images/mem.gif','<B>IVONE</B> - Peter 28/7/2006 We dont need a special day to bring you to mind.  A day without a thought of you is very hard to find. Loved son-in-law of Beryl and John.');
messages[62] = new Array('../images/PED.gif','<B>TRESIZE,</B> Tina 13 year old domestic short hair tabby cat, of 76 Clancy Lane, Myrtleford. 1997 - 7/5/2010. Long time companion to Len Tresize.  Faithful to the end, no more suffering, in Gods care. Donations to the RSPCA, Phone Donation Line on 1300 300 662.');
messages[63] = new Array('../images/PED.gif','<B>TRESIZE,</B> Fluffy Suddenly on July 9, 2010. 4 year old grey english short hair domestic cat.  Mate and companion to Len Tresize of 76 Clancy Lane, Myrtleford.  One in a million, can never be replaced, taken far too soon.  Sadly missed.  Rest in peace dear friend.  Now in gods care, always remembered. Donations to RSPCA, Phone Donation Line 1300 300 662.');
////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}
