/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// 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= 330;
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= "#8dd8f8"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 0;
var tipBorderStyle= "ridge";
var tipPadding= 4;

var baseURL = '/skin/frontend/noodoll/default/images/media/';

// 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(' ',' ',"#FFFFFF");
messages[1] = new Array(baseURL + 'noolittle-noolarge.gif','<h3>NOOLITTLE &amp; NOOLARGE</h3><p>One believes size doesn\'t matter the other that size is everything-in fact the only thing that they seem to agree on is that they couldn\'t live without each other!</p>');
messages[2] = new Array(baseURL + 'noofiddle.gif','<h3>NOOFIDDLE</h3><p>Noofiddle can often be heard jamming on rooftops until the early hours. He mostly plays folk music but loves to mix it up with the odd bit of jungle or gangster rap thrown in for good measure-nice!</p>');
messages[3] = new Array(baseURL + 'nooducks-noocloud-noolightning.gif','<h3>NOODUCKS, NOOCLOUD &amp; NOOLIGHTNING</h3><p>Noocloud and Noolightning are always looking to rain on people who are up to no good. That\'s why Ricehead always carries a brolly!<br />The only few who love the weather that they bring are the Nooducks!</p>');
messages[4] = new Array(baseURL + 'noobot.gif','<h3>NOOBOT</h3><p>This funky robot is a well-oiled groove machine. He loves to boogie and only the rusty Ricebot can pull the plug on his disco delight!</p>');
messages[5] = new Array(baseURL + 'nooperman.gif','<h3>NOOPERMAN</h3><p>Is it a bird? Is it a plane? No it\'s Nooperman keeping a watchful eye over Noodle Town. He is super strong, a top stunt man and an even better tour guide!<br />');
messages[6] = new Array(baseURL + 'noobear.gif','<h3>NOOBEAR</h3><p>Noobear is as lazy as the day is long! The only thing that he likes fast is his food!</p>');
messages[7] = new Array(baseURL + 'noobuddy-noomiao.gif','<h3>NOOBUDDY &amp; NOOMIAO</h3><p>Noobuddy is Noodoll\'s loyal dog. He often tries to woo Noomiao with little success!</p>');
messages[8] = new Array(baseURL + 'noobery-noobirr.gif','<h3>NOOBERY & NOOBIRR</h3><p>This troublesome pair can often be seen relieving themselves of the heads of Noodle Towner\'s!</p>');
messages[9] = new Array(baseURL + 'noobery-noobirr.gif','<h3>NOOBERY & NOOBIRR</h3><p>This troublesome pair can often be seen relieving themselves of the heads of Noodle Towner\'s!</p>');
messages[10] = new Array(baseURL + 'Noopid.gif','<h3>NOOPID</h3><p>Noopid spends his days spreading love around Noodle Town. Sometimes love can blossom in the most unusual of places!</p>');
messages[11] = new Array(baseURL + 'Noohairys.gif','<h3>NOOHAIRY FAMILY</h3><p>You couldn\'t wish to meet a nicer family. What they spend on haircuts they save on heating bills!</p>');
messages[12] = new Array(baseURL + 'nootamer-nooking.gif','<h3>NOOTAMER &amp; NOOKING</h3><p>Audiences are wowed by their \'death-defying\' performance unaware that these two are actually best friends who love nothing more than watching countdown with a nice hot mug of Cocoa!!</p>');
messages[13] = new Array(' ',' ');
messages[14] = new Array(baseURL + 'profile_noopaparazzi.gif','<h3>NOOPAPARAZZI</h3><p>The Noopaparazzi are always on the prowl for the next big scoop and will stop at nothing to get that cover shot!</p>');
messages[15] = new Array(baseURL + 'nooying-nootine-noobei.gif','<h3>NOOYING &amp; NOOTINE &amp; NOOBEI</h3><p>These girls are Noodle Town\'s hottest young socialites! They are the life and soul of any party.</p>');
messages[16] = new Array(baseURL + 'mr-mrs-nooga-noobella.gif','<h3>MR &amp; MRS NOOGA &amp; NOOBELLA</h3><p>Mr Nooga is Noodoll\'s greedy agent. He exploits Noodoll and takes most of his money. Un fortunately for him Mrs Nooga takes most of that! Mrs Nooga can often be heard bellowing her famous catchphrase, \'Money is everything!\' whilst enjoying her daily soak with her spoilt pup, Noobella!</p>');
messages[17] = new Array(baseURL + 'nootisse.gif','<h3>NOOTISSE</h3><p>Nootisse is a poor artist who is certain that his work will one day be recognised as genius. For now though people think he\'s just plain bonkers!</p>');
messages[18] = new Array(baseURL + 'noomeerkats.gif','<h3>NOOMEERKATS</h3><p>These watchful fellas are as nosey as they come! They are often tipping off the Noopaparazzi as to the next big story</p>');
messages[19] = new Array(baseURL + 'noocy.gif','<h3>NOOCY</h3><p>Noocy is a fantastic painter and loves to paint beautiful ladies. Sometimes female models are hard to come by so it\'s a good job that Noocy is good at improvising!</p>');
messages[20] = new Array(baseURL + 'noolephant-noomicky.gif','<h3>NOOLEPHANT &amp; NOOMOUSE</h3><p>These two unlikely friends have a \'love hate\' relationship. Noolephant loves Noomouse and Noomouse hates Noolephant!</p>');
messages[21] = new Array(baseURL + 'noomeo-noomayor.gif','<h3>NOOMEO &amp; NOOMAYOR</h3><p>Noomayor is in charge of all the big decisions in Noodle Town. As for Noomeo, well the biggest decision that he ever has to make is what after-shave to put on!</p>');
messages[22] = new Array(baseURL + 'nooptain.gif','<h3>NOOPTAIN</h3><p>Head of all security in Noodle Town, Nooptain is dedicated to keeping Noodle Town safe!</p>');
messages[23] = new Array(baseURL + 'nooneshot-noodare.gif','<h3>NOOONESHOT &amp; NOODARE</h3><p>These two are one of the Circus\' hottest acts. Noooneshot never misses his target but first aid is always to hand, just in case!</p>');
messages[24] = new Array(baseURL + 'nooguagua-noolala.gif','<h3>NOOGUAGUA &amp; NOOLALA </h3><p>Noolala loves to unicycle. He wants to be the first unicyclist to win the tour de France! Nooguagua is not into anything quite so active but as long as he has his banjo he\'s happy!</p>');
messages[25] = new Array(baseURL + 'noodia.gif','<h3>NOODIA</h3><p>Noodia loves her beautiful garden and spends most of her time planting, snipping, clipping and shearing!</p>');
messages[26] = new Array(baseURL + 'noofro.gif','<h3>NOOFRO</h3><p>One of Noodle Town\'s biggest mover and shaker. She loves to Disco-dance until the early hours. When the music\'s thumpin\' you can guarantee that Noofro will be jumpin\'!</p>');
messages[27] = new Array(baseURL + 'ricered-ricewolf.gif',' ');
messages[28] = new Array(baseURL + 'noostrong.gif','<h3>NOOSTRONG</h3><p>Noostrong claims he could lift the moon if he was taller and he probably could! He spends most of his day in the gym but when he has a free minute he indulges himself in his other passion..Flower Arranging!</p>');
messages[29] = new Array(baseURL + 'noosa.gif','<h3>NOOSA</h3><p>Noosa is confident and never gives a fig about what others think of her. She follows her dreams and is certain that one day she\'ll be a huge star!</p>');
messages[30] = new Array(baseURL + 'noobalance.gif','<h3>NOOBALANCE</h3><p>Noobalance is a determined and focused athlete. He is always hotly tipped for gold at the Noolympics.!</p>');
messages[31] = new Array(baseURL + 'noobbit.gif','<h3>NOOBBIT</h3><p>Noobbit loves nothing better than to play hide and seek with lots of Noocarrots.</p>'); 
messages[32] = new Array(baseURL + 'noobbit.gif','<h3>NOOBBIT</h3><p>Noobbit loves nothing better than to play hide and seek with lots of Noocarrots.</p>'); 
messages[33] = new Array(baseURL + 'nootwins.gif','<h3>NOOTWINS</h3><p>These spooky twins often appear, as if by magic, in dark and dingy hallways. They look harmless enough but are guaranteed to send chills down your spine!</p>'); 
messages[34] = new Array(baseURL + 'noobuddy-noomiao.gif','<h3>NOOBUDDY &amp; NOOMIAO</h3><p>Noobuddy is Noodoll\'s loyal dog. He often tries to woo Noomiao with little success!</p>');
messages[35] = new Array(baseURL + 'noodoll.gif','<h3>NOODOLL</h3><p>Meet Noodoll, a modest fellow who also happens to be the biggest star in the whole NOONIVERSE! His Zen mastery is regularly put to the test but even in the most difficult of situations he remains calm and keeps on smiling!</p>'); 
messages[36] = new Array(baseURL + 'noosagent.gif','<h3>NOOSAGENT</h3><p>Noosagent always knows the latest news and gossip in Noodle Town. He is always watching you so make sure you behave!</p>'); 
messages[37] = new Array(baseURL + 'nooballer.gif','<h3>NOOBALLER</h3><p>Nooballer is a famous for two things-football and underwear modelling! He is the number 2 pin-up behind Noodoll.</p>'); 
messages[38] = new Array(baseURL + 'noopa-nooma.gif','<h3>NOOPA &amp; NOOMA</h3><p>Noodoll\'s parents are madly in love. They can often be seen taking romantic walks in Noodia\'s beautiful garden.<br />'); 
messages[39] = new Array(baseURL + 'nooducks-noocloud-noolightning.gif','<h3>NOODUCKS, NOOCLOUD &amp; NOOLIGHTNING</h3><p>Noocloud and Noolightning are always looking to rain on people who are up to no good. That\'s why Ricehead always carries a brolly!<br />The only few who love the weather that they bring are the Nooducks!</p>');
messages[40] = new Array(baseURL + 'noomi-nooz.gif','<h3>NOOGENERATION: NOOMI &amp; NOOZ</h3><p>These urban kids are the Noogeneration who live for Hip-Hop! Whether it\'s free styling, beat boxing, skating, or breakin\', these two always keep it Oldskool and have loads of fun!</p>'); 




////////////////////  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 = '<div class="profilepop"><table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top" style="padding: 0 7px;">';
var endStr = '</td></tr></table></div>';

//var startStr = '<div class="profilepop"><img src="';
//var midStr = '" border="0">';
//var endStr = '</div>';


////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = 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) {
		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 (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) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.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) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')