  function checkBusAd()
  {
    if(document.busadform.adidn.selectedIndex!=0)
      return true;
    alert("Please select a business ad to view!");
    return false;
  }

  function trim(str)
  {
    return str.replace(/^\s+|\s+$/g, '');
  }
  function countWords()
  {
    c = trim(document.f.comments.value).split(' ').length; // ad text
    c += trim(document.f.tagline.value).split(' ').length; // add in tagline
    if(document.f.phone2.value.length>5) c++; // +1 for phone2
    document.f.text1.value = c+1; // +1 for phone
  }

  function CountLeft(field, count, max) 
  {
    if (field.value.length > max)
      field.value = field.value.substring(0, max);
    else
      count.value = max - field.value.length;
  }

          function imagePop(img, w, h)
          {
            var winl = (screen.width - w) / 2;
            var wint = (screen.height - h) / 2;
            window.open(img,'jsc','toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,width='+w+',height='+h+',resizable=yes,top='+wint+',left='+winl).focus();
          }
	function popWindow(winlink, width, height)
	{
          portWindow = window.open(winlink, "popWin", "scrollbars=yes,width=" + width + ",height=" + height);
          portWindow.focus();
	}
	function popWindowFull(winlink)
	{
          window.open(winlink,'popWin','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,width=1000,height=700,resizable=yes').focus();
	}


          function popMax( aURL, aWinName )
          {
           var wOpen;
           var sOptions;
           var limit = .9;
           var width = screen.availWidth;
           var height = screen.availHeight;
           var left = Math.round(screen.availWidth*(1-limit)/2);
           var top = Math.round(screen.availHeight*(1-limit)/2);

           sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
           sOptions = sOptions + ',width=' + ((width - 10)*limit).toString();
           sOptions = sOptions + ',height=' + ((height - 122)*limit).toString();
           sOptions = sOptions + ',screenX='+left+',screenY='+top+',left='+left+',top='+top;

           wOpen = window.open( '', aWinName, sOptions );
           wOpen.location = aURL;
           wOpen.focus();
           wOpen.moveTo( left, top);
           wOpen.resizeTo( width*limit, height*limit );
           return wOpen;
          }

function buttonOff(buttonID){

        if ( document.images ) {
                var buttonSrcBase = buttonID.substr(1);
                document.getElementById(buttonID).src = "images/" + buttonSrcBase + "_0.jpg";
                }

}

function nav(u) { document.location.href = u; }

/* ============================================================================= */

function buttonOn(buttonID) {

        if ( document.images ) {
                var buttonSrcBase = buttonID.substr(1);
                document.getElementById(buttonID).src = "images/" + buttonSrcBase + "_1.jpg";
                }

}

/* ============================================================================= */

function showPopNote(messageboxID, thisElement) {

        var messagebox = document.getElementById(messageboxID);
        var box_left = thisElement.width;
        var box_top = thisElement.height;

        while( thisElement != null ) {
                box_top += thisElement.offsetTop;
                box_left += thisElement.offsetLeft;
                thisElement = thisElement.offsetParent;
                }
        messagebox.style.display='';
        messagebox.style.left = box_left + 'px';
        box_top = box_top - messagebox.offsetHeight;
        messagebox.style.top = box_top + 'px';


}

/* ============================================================================= */

function hidePopNote(messageboxID) {

        var messagebox = document.getElementById(messageboxID);

        messagebox.style.display='none';

}

/***********************************************
* Drop Down/ Overlapping Content- 
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//Drop Down/ Overlapping Content: http://www.dynamicdrive.com
//Last updated: Dec 19th, 07': Added ability to dynamically populate a Drop Down content using an external file (Ajax feature)

var dropdowncontent={
 delaybeforehide: 2000, //set delay in milliseconds before content box disappears onMouseout (1000=1 sec)
	disableanchorlink: true, //when user clicks on anchor link, should it be disabled?
	ajaxloadingmsg: "Loading content. Please wait...", //HTML to show while ajax page is being feched
	ajaxbustcache: true, //Bust cache when fetching pages?

	getposOffset:function(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},

	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e)){
			var horizontaloffset=(subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0 //calculate user added horizontal offset
			var verticaloffset=(subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight //calculate user added vertical offset
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)" //hide drop down box initially via clipping
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined") //clear timer that hides drop down box?
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},

	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime //get time animation has run
		if (elapsed<obj.glidetime){ //if time run is less than specified length
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{ //if animation finished
			obj.style.clip="rect(0 auto auto 0)"
		}
	},

	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				dropdowncontent.hide1(subobj);
				clearTimeout(window["glidetimer_"+subobj.id])
			}, subobj.hidedelay)
//			}, dropdowncontent.delaybeforehide)
		}
	},
        hide1:function(subobj)
        {
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
        },

	ajaxconnect:function(pageurl, divId){
		var page_request = false
		var bustcacheparameter=""
		if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE6 or below
			try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
		document.getElementById(divId).innerHTML=this.ajaxloadingmsg //Display "fetching page message"
		page_request.onreadystatechange=function(){dropdowncontent.loadpage(page_request, divId)}
		if (this.ajaxbustcache) //if bust caching of external page
			bustcacheparameter=(pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', pageurl+bustcacheparameter, true)
		page_request.send(null)
	},

	loadpage:function(page_request, divId){
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
			document.getElementById(divId).innerHTML=page_request.responseText
		}
	},

 clickhide:function(anchorid)
 {
   var anchorobj=document.getElementById(anchorid)
   var subobj=document.getElementById(anchorobj.getAttribute("rel")) 
   dropdowncontent.hide1(subobj);
 },
 initTrue:function(anchorid, pos, glidetime, hidedelay, isonclick)
 {
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
                subobj.hidedelay = hidedelay;
		subobj.style.left=subobj.style.top=0
                if(isonclick)
                  anchorobj.onclick=function(e){dropdowncontent.show(this, subobj, e)}
                else
                {
  		  anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
  		  if (this.disableanchorlink) anchorobj.onclick=function(){return false}
  		  anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
	 	  subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
                }
	},
 init:function(anchorid, pos, glidetime, hidedelay)
 {
 		dropdowncontent.initTrue(anchorid, pos, glidetime, hidedelay, false);
 },
 initSticky:function(anchorid, pos, glidetime, hidedelay)
 {
 		dropdowncontent.initTrue(anchorid, pos, glidetime, hidedelay, true);
 }
}


/***********************************************
* Ultimate Fade-In Slideshow (v1.5): * This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
* MASSIVE modifications by Stephen Rusin @ Icon
***********************************************/

var fadebgcolor="white",
	iebrowser = document.all,
	delay = 7000,
	fadewidth = 468, 
	fadeheight = 60,
	slideshowid = "ss1", 
	degree,
	canvasbase = "canvas"+slideshowid,
	curcanvas = canvasbase+"_0",
	tempobj,
        fadepicint,
        fadebydegree = 10,
        fadespeed = 100; // higher is slower

var imgarrcount, lastad = imgarrcounter;
var imgarrcounter = 0;

function fadeshow()
{
  imgarrcount = imgarr.length;
  loadlast();
  document.write('<div id="master'+slideshowid+'" style="position:relative;vertical-align: bottom;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+canvasbase+'_0" style="position:absolute;vertical-align: bottom;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor+'"></div><div id="'+canvasbase+'_1" style="position:absolute;vertical-align: bottom;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor+'"></div></div>')

  rotateimage();
}

function rotateimage()
{
  resetit()
  fadepicint =  setInterval("fadepic()",fadespeed) 
  curcanvas = (curcanvas==canvasbase+"_0") ? canvasbase+"_1" : canvasbase+"_0"
}

function resetit()
{
  degree = 0
  tempobj = iebrowser ? iebrowser[curcanvas] : document.getElementById(curcanvas)

  if(tempobj.filters && tempobj.filters[0])
  {
    if(typeof tempobj.filters[0].opacity=="number") //if IE6+
      tempobj.filters(0).opacity = degree
    else //else if IE5.5-
      tempobj.style.filter = "alpha(opacity="+degree+")"
  }
  else if(tempobj.style.MozOpacity)
    tempobj.style.MozOpacity = degree / 101
  else if(tempobj.style.KhtmlOpacity)
    tempobj.style.KhtmlOpacity = degree / 100
  tempobj.style.zIndex++

  if(imgarrcounter>=imgarrcount) imgarrcounter = 0;
  tempobj.innerHTML = imgarr[imgarrcounter][0];
  imgarr[imgarrcounter][1]++;
  lastad = imgarrcounter++;
}

function fadepic()
{
  if(degree < 100)
  {
    degree += fadebydegree
    if(tempobj.filters && tempobj.filters[0])
    {
      if(typeof tempobj.filters[0].opacity == "number") //if IE6+
        tempobj.filters[0].opacity = degree
      else //else if IE5.5-
        tempobj.style.filter = "alpha(opacity="+degree+")"
    }
    else if(tempobj.style.MozOpacity)
      tempobj.style.MozOpacity = degree / 101
    else if (tempobj.style.KhtmlOpacity)
      tempobj.style.KhtmlOpacity = degree / 100
  }
  else
  {
    clearInterval(fadepicint);
    setTimeout("rotateimage()", delay);
  }
}

var fadebgcolor1="white",
	iebrowser1 = document.all,
	delay1 = 7000,
	fadewidth1 = 475, 
	fadeheight1 = 160,
	slideshowid1 = "ss2", 
	degree1,
	canvasbase1 = "canvas"+slideshowid1,
	curcanvas1 = canvasbase1+"_0",
	tempobj1,
        fadepicint1,
        fadebydegree1 = 10,
        fadespeed1 = 100; // higher is slower

var imgarrcount1, lastad1 = imgarrcounter1;
var imgarrcounter1 = 0;

function fadeshow1()
{
  imgarrcount1 = imgarr1.length;
  loadlast1();
  document.write('<div id="master'+slideshowid1+'" style="margin-top: 3px; position:relative;vertical-align: bottom;width:'+fadewidth1+'px;height:'+fadeheight1+'px;overflow:hidden;"><div id="'+canvasbase1+'_0" style="position:absolute;vertical-align: bottom;width:'+fadewidth1+'px;height:'+fadeheight1+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;-khtml-opacity:10;background-color:'+fadebgcolor1+'"></div><div id="'+canvasbase1+'_1" style="position:absolute;vertical-align: bottom;width:'+fadewidth1+'px;height:'+fadeheight1+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);-moz-opacity:10;background-color:'+fadebgcolor1+'"></div></div>')

  rotateimage1();
}

function rotateimage1()
{
  resetit1()
  fadepicint1 =  setInterval("fadepic1()",fadespeed1) 
  curcanvas1 = (curcanvas1==canvasbase1+"_0") ? canvasbase1+"_1" : canvasbase1+"_0"
}

function resetit1()
{
  degree1 = 0
  tempobj1 = iebrowser1 ? iebrowser1[curcanvas1] : document.getElementById(curcanvas1)

  if(tempobj1.filters && tempobj1.filters[0])
  {
    if(typeof tempobj1.filters[0].opacity=="number") //if IE6+
      tempobj1.filters(0).opacity = degree1
    else //else if IE5.5-
      tempobj1.style.filter = "alpha(opacity="+degree1+")"
  }
  else if(tempobj1.style.MozOpacity)
    tempobj1.style.MozOpacity = degree1 / 101
  else if(tempobj1.style.KhtmlOpacity)
    tempobj1.style.KhtmlOpacity = degree1 / 100
  tempobj1.style.zIndex++

  if(imgarrcounter1>=imgarrcount1) imgarrcounter1 = 0;
  tempobj1.innerHTML = imgarr1[imgarrcounter1][0];
  imgarr1[imgarrcounter1][1]++;
  lastad1 = imgarrcounter1++;
}

function fadepic1()
{
  if(degree1 < 100)
  {
    degree1 += fadebydegree1
    if(tempobj1.filters && tempobj1.filters[0])
    {
      if(typeof tempobj1.filters[0].opacity == "number") //if IE6+
        tempobj1.filters[0].opacity = degree1
      else //else if IE5.5-
        tempobj1.style.filter = "alpha(opacity="+degree1+")"
    }
    else if(tempobj1.style.MozOpacity)
      tempobj1.style.MozOpacity = degree1 / 101
    else if (tempobj1.style.KhtmlOpacity)
      tempobj1.style.KhtmlOpacity = degree1 / 100
  }
  else
  {
    clearInterval(fadepicint1);
    setTimeout("rotateimage1()", delay1);
  }
}


//********************************
//* AJAX functions
//* By Stephen Rusin
//********************************
function GetXmlHttpObject()
{
  var xh = null;
  try
  {
    // Firefox, Opera 8.0+, Safari
    xh = new XMLHttpRequest();
  }
  catch (e)
  {
    // Internet Explorer
    try
    {
      xh = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
      xh = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xh;
}

function getAjaxResponse(url)
{
  var xmlHttp = GetXmlHttpObject()
  if(xmlHttp==null)
  {
    alert ("Your browser does not support AJAX! You won't be able to properly view this site!");
    return;
  } 
  xmlHttp.open('GET',url+'&sid='+(new Date()).getTime(),false);
  xmlHttp.send(null);
  if(xmlHttp.status == 200)
    return xmlHttp.responseText;
}

function getNextAjaxImage()
{
  return getAjaxResponse('index.php?section=nextlevel1ad');
}

function popBusAd(aURL,aWinName,idn)
{
  popMax(aURL, aWinName);
  getAjaxResponse('adtrack.php?section=busadcontact&var='+idn);
}

function contact()
{
  savelast();
  var url = 'adtrack.php?section=adcontact&var=';
  for(i=0;i<imgarrcount;i++)
    url += imgarr[i][2] + '-' + imgarr[i][1] + '_';
  getAjaxResponse(url);
}

function get_cookie(Name) 
{
  var search = Name + "="
  var returnvalue = ""
  if (document.cookie.length > 0) 
  {
    offset = document.cookie.indexOf(search)
    if (offset != -1) 
    {
      offset += search.length
      end = document.cookie.indexOf(";", offset)
      if (end == -1)
        end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
    }
  }
  return returnvalue;
}

function savelast()
{
  document.cookie = "lastadvar="+lastad;
}

function loadlast()
{
  imgarrcounter = parseInt(get_cookie("lastadvar"))
  if(isNaN(imgarrcounter)) imgarrcounter = -1;
  imgarrcounter++;
}
function loadlast1()
{
  imgarrcounter1 = parseInt(get_cookie("lastadvar1"))
  if(isNaN(imgarrcounter1)) imgarrcounter1 = -1;
  imgarrcounter1++;
}

/***********************************************
* 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= false;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 440;
var offX= 20;	// how far from mouse to show tip
var offY= -200; 
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= "#FFFFFF"; //"#D5DFF0"; 
var tipBorderColor= "#000080";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 0;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
/*
var messages = new Array();
messages[0] = new Array('tiles/1_full.jpg','<center><b>Arpa Natura</b><br>Oro 12 x 12 AHNA-OR-F1');
messages[1] = new Array('tiles/5_full.jpg','<center><b>Cerdomus Thermae</b><br>Ercolano 12 x 12 CMTH-ER-1');
messages[2] = new Array('tiles/4_full.jpg','<center><b>Cerdomus Thermae</b><br>Ercolano 12 x 12 CMTH-ER-1');
messages[3] = new Array('tiles/3_full.jpg','<center><b>Cerdomus Thermae</b><br>Ercolano 12 x 12 CMTH-ER-1');
messages[4] = new Array('tiles/7_full.jpg','<center><b>Cerdomus Thermae</b><br>Ercolano 12 x 12 CMTH-ER-1');
messages[5] = new Array('tiles/6_full.jpg','<center><b>Cerdomus Thermae</b><br>Ercolano 12 x 12 CMTH-ER-1');
*/

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

////////////////////////////////////////////////////////////
//  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.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,message,width,height,offsetY) {

  if(offsetY!=null) offY = offsetY;

        var twidth = tipWidth;

        if(width!=null) twidth = width;
	tipcss.width = twidth+"px";


	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;

	// set colors if included in message array
	if (message[2])	var curBgColor = message[2];
	else curBgColor = tipBgColor;
	if (message[3])	var curFontColor = message[3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
                var startStr = '<table width="' + twidth + '"><tr><td align="center" width="100%"><img src="';
		var tip = startStr + message[0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + message[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>')