
/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm
***********************************************/

var offsetxpoint=-60; //Customize x offset of tooltip
var offsetypoint=20; //Customize y offset of tooltip
var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
var tipobj=document.getElementById("dhtmltooltip");
if (ns6||ie){
//if (thewidth!="") tipobj.style.width=thewidth+"px"
//if (thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML="<fieldset class='dhtmltooltip'>"+thetext+"</fieldset>"
enabletip=true
return false
}
}

function positiontip(e){
var tipobj=document.getElementById("dhtmltooltip");
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
var tipobj=document.getElementById("dhtmltooltip");
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

//document.onmousemove=positiontip
// addEvent(document, 'mousemove', positiontip);



function modify_links()
{
	for(var i=0; i < document.links.length; i++)
	{
		//document.links[i].href='javascript:upgrade_account();'
	}
}

function upgrade_account()
{
	update_msgbox("You must first upgrade your account to view this page.  &nbsp; <a href=''>Read More</a>");
}

function current_access(id)
{
	//update_msgbox("You already have access to this content.");
	ddrivetip('You already have access to this content.','yellow', 300);
}

function update_msgbox(msg)
{
	/*
	//swapClass('mm_frame','mm_frame_empty');
	var obj = document.getElementById('mm_frame');
	obj.style.backgroundImage = 'url(/images/spacer.gif)';
	var obj = document.getElementById('msgbox');
	obj.innerHTML = msg;
	*/
	
	update_html('msgbox','msg',msg);
}

function collapse_menu(id, toggle)
{
	var obj = document.getElementById(id);
	if(toggle == undefined) obj.style.display = obj.style.display == 'inline' ? 'none' : 'inline';
	else obj.style.display = toggle == 1 ? 'inline' : 'none';
}

function init_buttons()
{
	// initialize the button image src
	for(var i=0; i < 100; i++)
	{
		var img = document.images['button'+i];
		if(img)
		{
			img.src = ButtonOff.src;
		}
		else break;
	}
}
function addLoadEvent(func) {
	
	/* Use this funciton to add multiple onload events in one of two ways:
		addLoadEvent(init_msgbox);
		addLoadEvent(function() {
	  // more code to run on page load
	});
	*/

  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

ButtonOn = new Image();
//ButtonOn.src = "/images/button_on.jpg";
ButtonOff = new Image();
//ButtonOff.src = "/images/button_off.jpg";

/*
var preload = new Array('/images/border_bottom_right.gif', '/images/border_top_right.gif','/images/border_top_left.gif', '/images/border_tile_top.gif', '/images/border_tile_bottom.gif', '/images/border_tile_right.gif', '/images/border_tile_left.gif', '/images/main_divider_tile.jpg', '/images/top_divider_tile.jpg', '/images/border_bottom_left.gif', '/images/header_divider_tile.jpg', '/images/button_tile.jpg', '/images/button_rt.jpg', '/images/button_off.jpg', '/images/tile_left.gif', '/images/tile_right.gif', '/images/home_50x50.jpg', '/images/test/images/contact_50x50.jpg', '/images/test/images/search_50x50.jpg', '/images/test/images/store_50x50.jpg', '/images/account_83x50.gif');
var tmp = new Array();
for(var i=0; i < preload.length; i++)
{
	tmp[i] = new Image();
	tmp[i].src = preload[i];
}
*/
function swapImage(name, flag)
{
	document.getElementById(name).setAttribute('className', flag ? 'mmb_on' : 'mmb_off');
}

function swapClass(id, newclass)
{
	var obj = document.getElementById(id);
	//obj.setAttribute('className',newclass);
	if(obj.className != newclass) obj.className = newclass;
}
////////////addLoadEvent(init_buttons);
