	
	var bgcolor;
	var txtcolor;
	function selectrow(obj, rowbgcolor, rowtxtcolor)
	{
		document.getElementById(obj);
		bgcolor = obj.style.backgroundColor;
		txtcolor = obj.style.color;
		if (rowbgcolor == undefined)
		{
			rowbgcolor = '#ffff00';
		}
		obj.style.backgroundColor=rowbgcolor;
		
		if (rowtxtcolor != '')
		{
			obj.style.color = rowtxtcolor;
		}
	}
	function deselectrow(obj)
	{
		document.getElementById(obj);
		obj.style.backgroundColor= bgcolor;
		obj.style.color = txtcolor;
	}
	
	var adminmenutimers = new Array();
	var visiblemenus = new Array();
	function clearmenutimer(menuid)
	{
		for (x in adminmenutimers)
		{
			if (x == menuid)
			{
				clearTimeout(adminmenutimers[x]);
			}
		}	
	}
	function goto(inURL)
	{
		document.location.href=inURL;
	}
	
	function gotoOpen(inURL)
	{
		window.open(inURL);
	}
	function addmenutimer(menuid)
	{
		action = "_hidemenu('" + menuid + "');";
		adminmenutimers[menuid] = setTimeout(action, 350);
	}
	
	function showitem(inid, srcobjid, xoffset, yoffset)
	{
		initem = document.getElementById(inid);
		pos = findPos(document.getElementById(srcobjid));
		initem.style.top = (pos[1] + parseInt(yoffset)) + 'px';
		initem.style.left = (pos[0] + parseInt(xoffset)) + 'px';
	}
	
	function hideitem(inid)
	{
		document.getElementById(inid).style.top = '-10000px';
		document.getElementById(inid).style.left = '-10000px';
	
	}
	function showadminmenu(menuid, srcobjid, xoffset, yoffset)
	{
		clearmenutimer(menuid);
		hideallmenus();
		menu = document.getElementById(menuid);
		pos = findPos(document.getElementById(srcobjid));
		menu.style.top = (pos[1] + parseInt(yoffset)) + 'px';
		menu.style.left = (pos[0] + parseInt(xoffset)) + 'px';
		visiblemenus[menuid] = 'true';
	}
	function hideallmenus()
	{
		for(x in visiblemenus)
		{
			_hidemenu(x);
		}
	}
	function hidemenu(menuid)
	{
		addmenutimer(menuid);
	}
	
	function _hidemenu(menuid)
	{
		document.getElementById(menuid).style.top = '-10000px';
		document.getElementById(menuid).style.left = '-10000px';
		visiblemenus[menuid] = 'false';
	}
	/* preload these images! */
	var preloadedimages = new Array();
	function preloadimage(imgsrc)
	{
		preloadedimages[imgsrc] = new Image();
		preloadedimages[imgsrc].src = imgsrc;
	}
	preloadimage("/admin/images/v2/save_button.png");
	preloadimage("/admin/images/nav/icons/adminlogout_on.png");
	preloadimage("/admin/images/nav/icons/adminlogout.png");
	preloadimage("/admin/images/nav/icons/adminlogout_sel.png");
	preloadimage("/admin/images/nav/icons/profile.png");
	preloadimage("/admin/images/nav/icons/home.png");
	preloadimage("/admin/images/nav/icons/auto.png");
	preloadimage("/admin/images/nav/icons/leads.png");
	preloadimage("/admin/images/nav/icons/reports.png");
	preloadimage("/admin/images/nav/icons/tools.png");
	preloadimage("/admin/images/nav/icons/support.png");
	preloadimage("/admin/images/nav/icons/website.png");
	
	function swapimg(imgsrc, obj)
	{
		if (preloadedimages[imgsrc])
		{
			obj.src = preloadedimages[imgsrc].src;
		}
		else
		{
			obj.src = imgsrc;
		}
	}
	
	
	
	
	
	/* this will capture the mouse location on every page*/
	var IE = document.all?true:false
	if (!IE)
	{
		document.captureEvents(Event.mousemove);
	}

	document.onmousemove = getMouseXY;
	var MouseX = 0
	var MouseY = 0
	function getMouseXY(e) 
	{
	  if (IE) 
	  { 
	  	
	    MouseX = event.clientX + document.body.scrollLeft
	    MouseY = event.clientY + document.body.scrollTop
	  } 
	  else 
	  {  
	    MouseX = e.pageX
	    MouseY = e.pageY
	  }  
	//document.getElementById('status').innerHTML = MouseX + ', ' + MouseY + '<br>' +  document.getElementById('status').innerHTML;
	  if (MouseX < 0){MouseX = 0}
	  if (MouseY < 0){MouseY = 0}  
	  return true
	}
	
	
	function showHelpItem(inItemID)
	{
		document.getElementById(inItemID).style.left = (MouseX - 250) + 'px';
		document.getElementById(inItemID).style.top = (MouseY +15) + 'px';
	}
	
	function hideHelpItem(inItemID)
	{
		document.getElementById(inItemID).style.left = '-10000px';
		document.getElementById(inItemID).style.top = '-10000px';
	}
	
	
	function hideItem(inID)
	{
		document.getElementById(inID).style.left = '-10000px';
		document.getElementById(inID).style.top = '-10000px';
	}
	function moveItem(inID, xpos, ypos)
	{
		document.getElementById(inID).style.left = xpos + 'px';
		document.getElementById(inID).style.top = ypos + 'px';
	}