<!--
/*
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;


// 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= false;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 150;
var offX= 10;	// how far from mouse to show tip
var offY= 12; 


// 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] = 'Title of Channel (Needed for Roku).';
messages[1] = 'URL to website (http://...).';
messages[2] = 'Short description of what your channel is about.';
messages[3] = 'This is the date and time when the feed is actually published. Some feed readers might not display the feed unless the PubDate is made available. You don\'t have to enter the PubDate manually as it\'s selected by default.';
messages[4] = 'You can add a copyright notice for content in the feed.';
messages[5] = 'The e-mail address for the person to contact if readers have any questions or comments.';
messages[6] = 'The e-mail address for the person to contact regarding technical issues relating to feed.';
messages[7] = 'Select the language in which this feed is written.';
messages[8] = 'Enter the TTL (Time To Live) here. TTL is the number of minutes this feed is to be cached by a server or an RSS aggregator and before it is refreshed.';
messages[9] = 'You can check the hours of the day here when there will be no changes or updates to your feed. This saves your readers\' time, as they don\'t have to check for updates at the hours skipped by you. The hours are according to GMT. ';
messages[10] = 'You can check the specific days here when there will be no changes or updates to your feed. This also saves your readers\' time, as they don\'t have to check for updates at the days skipped by you.';

messages[11] = 'Each of your feed can have an image associated with it. Feed readers generally display this image with your feed\'s title.';
messages[12] = 'Image of your channel (Needed for Roku)..';
messages[13] = 'Enter your image title here. Generally this is the same as your feed\'s title and will appear in the alt text for the image.';
messages[14] = 'This is the link, which is generally your feed\'s URL. The reader is directed to this link when he clicks on the image.';
messages[15] = 'Enter the width of your image here (in pixels). The default width for an RSS image is 88 and the maximum width allowed is 144.';
messages[16] = 'Enter the height of your image here (in pixels). The default height for an RSS image is 31 and the maximum height allowed is 400.';

messages[17] = 'The Text Input area allows you to display a data entry box within your feed. This box can be used to collect specific data from your user. All feed readers do not support Text Input.';
messages[18] = 'Enter the title of your text input box here. This title will appear at the label of your submit button.';
messages[19] = 'Enter a short description here of what your user should enter in the text input box.';
messages[20] = 'Enter the variable name here assigned to the text input box.';
messages[21] = 'Enter the URL (website name) to the CGI program which will receive the data from your text input box.';

messages[22] = 'Title of individual show (Needed for Roku).';
messages[23] = 'Short description of your show content (Needed for Roku).';
messages[24] = 'URL to actual show page (http://...).';
messages[25] = 'The e-mail address of the author of the item.';
messages[26] = 'What category would you describe you news item to be under? The item could in one or more categories.';
messages[27] = 'The web address of a page for comments relating to the item.';
messages[28] = 'This is the date and time this item will be made available to readers of your feed.';

messages[29] = 'You can enclose a file, if any, with this item, so the user can access it by clicking the Enclosure icon.';
messages[30] = 'File URL: URL to Podcast/Vodcast.';
messages[31] = 'URL to Podcast/Vodcast.';
messages[32] = 'Title of playlist item.';
messages[33] = 'Add each Podcast/Vodcast in the fields below.';
messages[34] = 'Short description of what your playlist is about.';
messages[35] = 'Title of playlist.';
messages[36] = 'Preview image of your show.';
////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
/*if (document.images) {
	var theImgs = new Array();
	for (var h=0; h<messages.length; h++) {
  	theImgs[h] = new Image();
		theImgs[h].src = messages[h][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 + '">';
var midStr = '<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 = $('#tipDiv');
	tooltip.css({
				width:"150px",
				fontFamily:"Verdana, arial, helvetica, sans-serif",
				color:'#6A6967',
				backgroundColor:'#E0F0FA',
				borderColor:'#628CF0',
				borderWidth:"1px",
				padding:"5px",
				borderStyle:'solid'
				});
}

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
	curBgColor = tooltip.css('backgroundColor');
	curFontColor = tooltip.css('color');

	var tip = startStr + midStr + '<span>' + messages[num] + '</span>' + endStr;

	tooltip.css('backgroundColor',curBgColor);
	tooltip.html(tip);

	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tooltip.show()",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 = evt.clientX + $(document).scrollLeft();
		mouseY = evt.clientY + $(document).scrollTop();
	}

	// tooltip width and height
	var tpWd = tooltip.width();
	var tpHt = tooltip.height();

	// document area in view (subtract scrollbar width for ns)
	var winWd = $(window).width()+$(document).scrollLeft();
	var winHt = $(window).height()+$(document).scrollTop();
	// check mouse position against tip and window dimensions
	// and position the tooltip 

	if ((mouseX+offX+tpWd)>winWd) 
		tooltip.css('left',mouseX-(tpWd+offX)+"px");
	else tooltip.css('left',mouseX+offX+"px");
	
	if ((mouseY+offY+tpHt)>winHt) 
		tooltip.css('top',winHt-(tpHt+offY)+"px");
	else tooltip.css('top',mouseY+offY+"px");

	if (!tipFollowMouse) t1=setTimeout("tooltip.show()",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tooltip.hide()",100);
	tipOn = false;
}

//-->


