/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2003-5 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// adjust horizontal and vertical offsets here
// (distance from mouseover event which activates tooltip)
Tooltip.offX = 4;  
Tooltip.offY = 4;
Tooltip.followMouse = false;  // must be turned off for hover-tip

// tooltip content variables
var msgSample = '<span class="tooltipfont">This is the sample of the help text. This can <a href="#">link</a> any other page as well.</span>';
var msgMarketplace = '<span class="tooltipfont">Marketplace is a list of things our members have. Please contact these members if you want something.</span>';
var msgWishlist = '<span class="tooltipfont">Wishlist is a list of things our members need.  Please contact these members if you can assist them.</span>';
var msgPremiumOnly = '<span class="tooltipfont">Must be a premium member to download.</span>';
var msgFreeMember = '<span class="tooltipfont">Any member can download.</span>';

<!-- Forum Messages-->
var msgFreeForum = '<span class="tooltipfont">All members can access this forum.</span>';
var msgPremiumForum = '<span class="tooltipfont">Only Premium members can access this forum.</span>';

<!-- Groups Messages-->
var msgWhatIsGroup = '<span class="tooltipfont">Its where people with a shared interest meet, get to know each other, and stay informed.</span>';
var msgPublicGroup = '<span class="tooltipfont">This is a Public Group - Anyone can Join!</span>';
var msgPrivateGroup = '<span class="tooltipfont">This is a Private Group - Moderators approval is required to join.</span>';

var msgAvailableDays = '<span class="tooltipfont">This content will be unlocked when you are a member for 10 days</span>';
var msgPremiumMembers = '<span class="tooltipfont">This article is only available to Premium Members</span>';

var msgAvailablePremiumM = '<span class="tooltipfont">This is only available to Premium Members</span>';
var msgAvailableAll = '<span class="tooltipfont">This is available to All</span>';

var msgArticleAdmin = '<span class="tooltipfont">This article is posted by administrator. You will not be able to contact the guru through this</span>';

var msgTerms = 'The code is free for <a href="http://www.dyn-web.com/bus/terms.html#personal">personal use</a> but all other uses require purchase of a <a href="http://www.dyn-web.com/bus/purchase.html">license</a>.';

var msgForums = '<span class="tooltipfont">Forums or online bulletin boards where users can chat, ask questions, post information</span>';

var msgGroups = '<span class="tooltipfont">Users can form Groups online to discuss the commomn topics and chat or exchange information.</span>';

var msgArticles = '<span class="tooltipfont">Articles are used to share or express knowledge about a topic.</span>';

var msgEvents = '<span class="tooltipfont">Events are organized at various locations to have a participation from all the members.</span>';

var msgMarket = '<span class="tooltipfont">It is a place where you can post your articles for others to see and view other</span>';

var msgWishlist = '<span class="tooltipfont">Wishlist is a place where you can bookmark what you always wanted to buy or have.</span>';

var msgDownloads = '<span class="tooltipfont">Downloads allow you to download free stuff throughout the site.</span>';

var msgProducts = '<span class="tooltipfont">They are what is available for you to purchase and subscribe for.</span>';

var msgEcourse = '<span class="tooltipfont">Online courses you can get enrolled for or purchase them.</span>';

var tempblue = '<img src="images/temp_blue.jpg" alt="blue template" />';
var tempmagenta = '<img src="images/temp_magenta.jpg" alt="blue template" />';
var tempgrey = '<img src="images/temp_grey.jpg" alt="blue template" />';
var tempred = '<img src="images/temp_red.jpg" alt="blue template" />';
var temporange = '<img src="images/temp_orange.jpg" alt="blue template" />';
var tempgreen = '<img src="images/temp_green.jpg" alt="blue template" />';



var	msgGuruNetworkingWebsite	=	'<span class="tooltipfont">This is what your network is called.  We will use this field throughout your site.  It will be the FROM email name which your users will be receiving emails from.</span>';
var	msgGuruSubDomainName		=	'<span class="tooltipfont">This is the pre-generated domain name we will use as your private URL for your social network.  Your users will be able to come directly to your site by going to YOURNAMEHERE.'+PRIVATE_LABLE_URL+'.</span>';
var	msgGuruPrivateURL			=	'<span class="tooltipfont">You can have your own private URL.  Instead of using our pre-generated YOURNAMEHERE.'+PRIVATE_LABLE_URL+', you can own your own domain.  Once you have registered your domain, simply do a Forward URL to your pre-generated domain.  For example, if you registered www.mycommunity.com and your pre-generated domain is mycommunity.'+PRIVATE_LABLE_URL+' .  Simply go to your domain registrar and have the domain www.mycommunity.com URL Forward to "mycommunity.'+PRIVATE_LABLE_URL+'".</span>';



var msgSampleonmemebr = '<span class="tooltipfont">Free members can freely see contact information of your members.</span>';


var createmyowndomain = '<span class="tooltipfont">1) To get your own domain, simply go to your registrar and create a URL Forward to your private sub-domain "YOURSITE.i360net.com".<br>2) Go to Accounts & Settings >> Edit Look and Feel >> Edit Site name and Domain.<br>Make sure you enter your domain name in the field: "Enter Your Private URL" </span>';

var msgIncrementalPrice = '<span class="tooltipfont">Please enter the incremental price against each shipping method defined.  For example, if you have two shipping method, one with a base price of $8 and each additional item costs $0.50 then shipping two of these would cost the buyer (2 x 0.50) + $8 = $9.00.</span>';


function doTooltip(e, msg) {
	
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.clearTimer();
  var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
  if ( tip && tip.onmouseout == null ) {
      tip.onmouseout = Tooltip.tipOutCheck;
      tip.onmouseover = Tooltip.clearTimer;
  }
  
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.timerId = setTimeout("Tooltip.hide()", 300);
}

Tooltip.tipOutCheck = function(e) {
  e = dw_event.DOMit(e);
  // is element moused into contained by tooltip?
  var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
  if ( this != toEl && !contained(toEl, this) ) Tooltip.hide();
}

// returns true of oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}

Tooltip.timerId = 0;
Tooltip.clearTimer = function() {
  if (Tooltip.timerId) { clearTimeout(Tooltip.timerId); Tooltip.timerId = 0; }
}

Tooltip.unHookHover = function () {
    var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
    if (tip) {
        tip.onmouseover = null; 
        tip.onmouseout = null;
        tip = null;
    }
}

dw_event.add(window, "unload", Tooltip.unHookHover, true);