/*	sIFR (Scalable Inman Flash Replacement) Version 2.0 Release Candidate 3
	Copyright 2004 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
	
	Hacked by Vanja Bertalan for two-color sIFR variation

	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var hasFlash = function(){
	var nRequiredVersion = 6;	
	
	if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){
		document.write('<script language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n');  
		document.write('<'+'/script\> \n');
		/*	If executed, the VBScript above checks for Flash and sets the hasFlash variable. 
			If VBScript is not supported it's value will still be undefined, so we'll run it though another test
			This will make sure even Opera identified as IE will be tested */
		if(window.hasFlash != null){
			return window.hasFlash;
		};
	};
	
	if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
		var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
		var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		return flashVersion >= nRequiredVersion;
	};
	
	return false;
}();

String.prototype.normalize = function(){
	return this.replace(/\s+/g, " ");
};

/* IE 5.0 does not support the push method, so here goes */
if(Array.prototype.push == null){
	Array.prototype.push = function(){
		for(var i = 0; i < arguments.length; i++){
			this[this.length] = arguments[i];
		};
		return this.length;
	};
};

/*	Implement function.apply for browsers which don't support it natively
	Courtesy of Aaron Boodman - http://youngpup.net */
if (!Function.prototype.apply){
	Function.prototype.apply = function(oScope, args) {
		var sarg = [];
		var rtrn, call;

		if (!oScope) oScope = window;
		if (!args) args = [];

		for (var i = 0; i < args.length; i++) {
			sarg[i] = "args["+i+"]";
		};

		call = "oScope.__applyTemp__(" + sarg.join(",") + ");";

		oScope.__applyTemp__ = this;
		rtrn = eval(call);
		oScope.__applyTemp__ = null;
		return rtrn;
	};
};

/*	The following code parses CSS selectors.
	This script however is not the right place to explain it,
	please visit the documentation for more information. */
var parseSelector = function(){
	var reParseSelector = /^([^#\.>\`]*)(#|\.|\>|\`)(.+)$/;
	function parseSelector(sSelector, oParentNode, sMode){
		sSelector = sSelector.replace(" ", "`");
		var selector = sSelector.match(reParseSelector);
		var node, listNodes, listSubNodes, subselector;
		var listReturn = [];

		if(selector == null){ selector = [sSelector, sSelector] };
		if(selector[1] == ""){ selector[1] = "*" };
		if(sMode == null){ sMode = "`" };
		if(oParentNode == null && (selector[2] == null || selector[2] != ">")){
			oParentNode = document;
		};
		
		switch(selector[2]){
			case "#":
				subselector = selector[3].match(reParseSelector);
				if(subselector == null){ subselector = [null, selector[3]] };
				node = 	document.getElementById(subselector[1]);
				if(node == null || (selector[1] != "*" && node.nodeName.toLowerCase() != selector[1].toLowerCase())){
					return listReturn;
				};
				if(subselector.length == 2){
					listReturn.push(node);
					return listReturn;	
				};
				return parseSelector(subselector[3], node, "#");
			case ".":
				if(sMode == "`"){
					listNodes = getElementsByTagName(oParentNode, selector[1]);
				} else {
					listNodes = oParentNode.childNodes;
				};
				
				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					if(node.nodeType != 1){
						continue;	
					};

					subselector = selector[3].match(reParseSelector);
					if(subselector != null){
						if(node.className.match("\\b" + subselector[1] + "\\b") == null){
							continue;
						};
						listSubNodes = parseSelector(subselector[3], node, subselector[2]);
						listReturn = listReturn.concat(listSubNodes);	
					} else if(node.className.match("\\b" + selector[3] + "\\b") != null){
						listReturn.push(node);
					};
				};
				return listReturn;
			case ">":
				if(sMode == "`"){
					listNodes = getElementsByTagName(oParentNode, selector[1]);
				} else {
					listNodes = oParentNode.childNodes;
				};
				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					if(node.nodeType != 1){
						continue;	
					};
					if(node.nodeName.toLowerCase() != selector[1].toLowerCase()){
						continue;
					};
					listSubNodes = parseSelector(selector[3], node, ">");
					listReturn = listReturn.concat(listSubNodes);	
				};
				return listReturn;
			case "`":
				listNodes = getElementsByTagName(oParentNode, selector[1]);
				for(var i = 0; i < listNodes.length; i++){
					node = listNodes[i];
					listSubNodes = parseSelector(selector[3], node, "`");
					listReturn = listReturn.concat(listSubNodes);	
				};
				return listReturn;
			default:
				listNodes = getElementsByTagName(oParentNode, selector[0]);
				for(var i = 0; i < listNodes.length; i++){
					listReturn.push(listNodes[i]);
				};
				return listReturn;
		};
	};
	
	function getElementsByTagName(oParentNode, sTagName){
		/*	IE5.x does not support document.getElementsByTagName("*")
			therefore we're falling back to element.all */
		if(sTagName == "*" && oParentNode.all != null){
			return oParentNode.all;
		};
		return oParentNode.getElementsByTagName(sTagName);
	};
	
	return parseSelector;
}();

/*	Adds named arguments support to JavaScript. */
function named(oArgs){ 
	return new named.Arguments(oArgs);
};

named.Arguments = function named_Arguments(oArgs){
	this.oArgs = oArgs;
};

named.Arguments.prototype.constructor = named.Arguments;

named.extract = function named_extract(listPassedArgs, oMapping){
	var oNamedArgs, passedArg;
	
	for(var i = 0; i < listPassedArgs.length; i++){
		passedArg = listPassedArgs[i];
		if(passedArg != null && passedArg.constructor != null && passedArg.constructor == named.Arguments){
			oNamedArgs = listPassedArgs[i].oArgs; /* oNamedArgs isn't the named.Arguments class! */
			break;
		};
	};

	if(oNamedArgs == null){ return };
	
	for(sName in oNamedArgs){
		if(oMapping[sName] != null){
			oMapping[sName](oNamedArgs[sName]);
		};
	};
	
	return;
};

/*	Executes an anonymous function which returns the function sIFR (defined inside the function).
	You can replace elements using sIFR.replaceElement()
	All other variables and methods you see are private. If you want to understand how this works you should
	learn more about the variable-scope in JavaScript. */
var sIFR = function(){
	/*	Disable sIFR for non-Flash or old browsers */
	if(window.hasFlash == false || !document.createElement || !document.getElementById){ return false; };

	/* Opera and Mozilla require a namespace when creating elements in an XML page */
	var sNameSpaceURI = "http://www.w3.org/1999/xhtml";
	var bIsInitialized = false;
	var bIsSetUp = false;
	var stackReplaceElementArguments = [];
	var UA = function(){ 
		var sUA = navigator.userAgent.toLowerCase();
		var oReturn =  {
			bIsWebKit : sUA.indexOf("applewebkit") > -1,
			bIsKHTML: sUA.indexOf("applewebkit") > -1 || sUA.indexOf("konqueror") > -1,
			bIsOpera : sUA.indexOf("opera") > -1,
			bIsXML : document.contentType != null && document.contentType.indexOf("xml") > -1,
			bHasTransparentSupport : true
		};
		
		oReturn.bIsIE = sUA.indexOf("msie") > -1 && !oReturn.bIsOpera && !oReturn.bIsKHTML && !oReturn.bIsGecko;
		oReturn.bIsGecko = !oReturn.bIsKHTML && navigator.product != null && navigator.product.toLowerCase() == "gecko";
		if(oReturn.bIsOpera){ oReturn.nOperaVersion = new Number(sUA.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]) };
		if(oReturn.bIsGecko){ oReturn.nGeckoBuildDate = new Number(sUA.match(/.*gecko\/(\d{8}).*/)[1]) };
		if(oReturn.bIsWebKit){ oReturn.nWebKitVersion = new Number(sUA.match(/.*applewebkit\/(\d+).*/)[1]) };
		if(sUA.match(/.*(windows|mac).*/) == null || (oReturn.bIsOpera == true && oReturn.nOperaVersion < 7.6) || (oReturn.bIsWebKit == true && oReturn.nWebKitVersion < 124) || (oReturn.bIsGecko == true && oReturn.nGeckoBuildDate < 20020523)){
			oReturn.bHasTransparentSupport = false;
		};
		
		return oReturn;
	}();

	function sIFR(e){
		if((!self.bAutoInit && (window.event || e) != null) || !mayReplace(e)){
			return;	
		};
		bIsInitialized = true;

		for(var i = 0; i < stackReplaceElementArguments.length; i++){
			replaceElement.apply(null, stackReplaceElementArguments[i]);
		};
		stackReplaceElementArguments = [];
	};
	
	var self = sIFR;

	function mayReplace(e){
		if(bIsSetUp == false || ((UA.bIsXML && UA.bIsGecko || UA.bIsKHTML) && e == null && bIsInitialized == false) || document.getElementsByTagName("body").length == 0){
			return false;
		};
		return true;
	};

	function fetchContent(oNode, oNewNode, sCase, nLinkCount, sLinkVars){
		var sContent = "";
		var oSearch = oNode.firstChild;
		var oRemove, oRemovedNode, oResult;

		if(nLinkCount == null){ nLinkCount = 0 };
		if(sLinkVars == null){ sLinkVars = "" };

		while(oSearch){
			if(oSearch.nodeType == 3){
				switch(sCase){
					case "lower":
						sContent += oSearch.nodeValue.toLowerCase();
						break;
					case "upper":
						sContent += oSearch.nodeValue.toUpperCase();
						break;
					default:
						sContent += oSearch.nodeValue;
				};
			} else if(oSearch.nodeType == 1){
				if(oSearch.nodeName.toLowerCase() == "a" && !oSearch.getAttribute("href") == false){
					if(oSearch.getAttribute("target")){
						sLinkVars += "&sifr_url_" + nLinkCount + "_target=" + oSearch.getAttribute("target");
					};
					sLinkVars += "&sifr_url_" + nLinkCount + "=" + oSearch.getAttribute("href").replace(/&/g, "%26");
					sContent += '<a href="asfunction:_root.launchURL,' + nLinkCount + '">';
					nLinkCount++;
				} else if(oSearch.nodeName.toLowerCase() == "em"){
					sContent += "­";
				} else if(oSearch.nodeName.toLowerCase() == "br"){
					sContent += "­";
				};
				if(oSearch.hasChildNodes){
					/*	The childNodes are already copied with this node, so oNewNode = null */
					oResult = fetchContent(oSearch, null, sCase, nLinkCount, sLinkVars);
					sContent += oResult.sContent;
					nLinkCount = oResult.nLinkCount;
					sLinkVars = oResult.sLinkVars;
				};
				if(oSearch.nodeName.toLowerCase() == "a"){
					sContent += "</a>";
				} else if(oSearch.nodeName.toLowerCase() == "em"){
					sContent += "­";
				};
			};
			oRemove = oSearch;
			oSearch = oSearch.nextSibling;
			if(oNewNode != null){
				oRemovedNode = oRemove.parentNode.removeChild(oRemove);
				oNewNode.appendChild(oRemovedNode);	
			};
		};
		
		return {"sContent" : sContent, "nLinkCount" : nLinkCount, "sLinkVars" : sLinkVars};
	};
	
	function createElement(sTagName){
		if(document.createElementNS && !UA.bIsOpera){
			return document.createElementNS(sNameSpaceURI, sTagName);	
		} else {
			return document.createElement(sTagName);
		};
	};

	function createObjectParameter(nodeObject, sName, sValue){
		var node = createElement("param");
		node.setAttribute("name", sName);	
		node.setAttribute("value", sValue);
		nodeObject.appendChild(node);
	};
	
	function replaceElement(sSelector, sFlashSrc, sColor, sLinkColor, sHoverColor, sAltColor, sBgColor, nPaddingTop, nPaddingRight, nPaddingBottom, nPaddingLeft, sFlashVars, sCase, sWmode){
		if(!mayReplace()){
			return stackReplaceElementArguments.push(arguments);	
		};
		
		/*	Extract any named arguments.	*/
		named.extract(arguments, {
			sSelector : function(value){ sSelector = value },
			sFlashSrc : function(value){ sFlashSrc = value },
			sColor : function(value){ sColor = value },
			sLinkColor : function(value){ sLinkColor = value },
			sHoverColor : function(value){ sHoverColor = value },
			sAltColor : function(value){ sAltColor = value },
			sBgColor : function(value){ sBgColor = value },
			nPaddingTop : function(value){ nPaddingTop = value },
			nPaddingRight : function(value){ nPaddingRight = value },
			nPaddingBottom : function(value){ nPaddingBottom = value },
			nPaddingLeft : function(value){ nPaddingLeft = value },
			sFlashVars : function(value){ sFlashVars = value },
			sCase : function(value){ sCase = value },
			sWmode : function(value){ sWmode = value }
		});
		
		/*	Set default values. */
		if(sFlashVars != null){
			sFlashVars = "&" + sFlashVars.normalize();
		} else {
			sFlashVars = "";	
		};
		
		if(nPaddingTop == null){ nPaddingTop = 0 };
		if(nPaddingRight == null){ nPaddingRight = 0 };
		if(nPaddingBottom == null){ nPaddingBottom = 0 };
		if(nPaddingLeft == null){ nPaddingLeft = 0 };

		if(sWmode == "transparent"){
			if(!UA.bHasTransparentSupport){
				sWmode = "opaque";
			} else {
				sBgColor = "transparent";
			};
		};
		
		if(sWmode == null){ sWmode = "" };
	
		/*	Do the actual replacement. */
		var node, sWidth, sHeight, sMargin, sPadding, sText, sVars, nodeAlternate, nodeFlash, oContent;
		var listNodes = parseSelector(sSelector);
		if(listNodes.length == 0){ return false };

		for(var i = 0; i < listNodes.length; i++){
			node = listNodes[i];
			
			/* Prevents elements from being replaced multiple times. */
			if(node.className.match(/\bsIFR\-replaced\b/) != null){ continue; };

			sWidth = node.offsetWidth - nPaddingLeft - nPaddingRight;
			sHeight = node.offsetHeight - nPaddingTop - nPaddingBottom;

			nodeAlternate = createElement("span");
			nodeAlternate.className = "sIFR-alternate";

			oContent = fetchContent(node, nodeAlternate, sCase);
			sText = oContent.sContent;
			if(UA.bIsIE){ /* The RegExp for IE breaks old Gecko's, the RegExp for non-IE breaks IE 5.01 */
				sText = sText.replace(new RegExp("%\d{0}", "g"), "%25");
			} else {
				sText = sText.replace(new RegExp("%(?!\d)", "g"), "%25");
			};
			sText = sText.replace(/\+/g, "%2B");
			sText = sText.replace(/&/g, "%26");
			sText = sText.replace(/\"/g, "%22");
			sText = sText.normalize();

			sVars = "txt=" + sText + sFlashVars + "&w=" + sWidth + "&h=" + sHeight + oContent.sLinkVars;
			if (sColor != null){sVars += "&textcolor=" + sColor};
			if (sLinkColor != null){sVars += "&linkcolor=" + sLinkColor}; 
			if (sHoverColor != null){sVars += "&hovercolor=" + sHoverColor};
			if (sAltColor != null){sVars += "&altcolor=" + sAltColor};
			
			node.className = node.className.normalize() + (node.className == ""  ? "" : " ") + "sIFR-replaced";

			/*	Opera only supports the object element, other browsers are given the embed element,
				for backwards compatibility reasons between different browser versions.
				Opera versions below 7.60 use innerHTML, from 7.60 and up we use the DOM */
			if(UA.bIsOpera){
				if(UA.nOperaVersion < 7.60){
					node.innerHTML = ['<object class="sIFR-flash" type="application/x-shockwave-flash" data="', sFlashSrc, '" quality="best" wmode="', sWmode, '" bgcolor="', sBgColor, '" flashvars="', sVars, '" width="', sWidth, '" height="', sHeight, '"></object>'].join("");
				} else {
					nodeFlash = createElement("object");
					nodeFlash.setAttribute("type", "application/x-shockwave-flash");
					nodeFlash.setAttribute("data", sFlashSrc);
					createObjectParameter(nodeFlash, "quality", "best");
					createObjectParameter(nodeFlash, "wmode", sWmode);
					createObjectParameter(nodeFlash, "bgcolor", sBgColor);
					createObjectParameter(nodeFlash, "flashvars", sVars);
				};
			} else {
				nodeFlash = createElement("embed");
				nodeFlash.setAttribute("src", sFlashSrc);
				nodeFlash.setAttribute("quality", "best");
				nodeFlash.setAttribute("flashvars", sVars);
				nodeFlash.setAttribute("type", "application/x-shockwave-flash");
				nodeFlash.setAttribute("wmode", sWmode);
				nodeFlash.setAttribute("bgcolor", sBgColor);
			};
			/*	This code is shared between the DOM-created objects */
			if(!UA.bIsOpera || UA.nOperaVersion >= 7.60){
				nodeFlash.className = "sIFR-flash";
				nodeFlash.setAttribute("width", sWidth);
				nodeFlash.setAttribute("height", sHeight);
				nodeFlash.style.width = sWidth + "px";
				nodeFlash.style.height = sHeight + "px";
				node.appendChild(nodeFlash);
			};
							
			node.appendChild(nodeAlternate);
			
			/*	Workaround to force KHTML-browsers to repaint the document. 
				Additionally, IE for both Mac and PC need this.
				See: http://neo.dzygn.com/archive/2004/09/forcing-safari-to-repaint */

			if(UA.bIsKHTML || UA.bIsIE){
				node.innerHTML += "";
			};
		};
	};
	
	function setup(){
		bIsSetUp = true;
		/*	Providing a hook for you to hide certain elements if Flash has been detected. */
		if(document.documentElement){
			document.documentElement.className = document.documentElement.className.normalize() + (document.documentElement.className == "" ? "" : " ") + "sIFR-hasFlash";
		};
		
		if(window.attachEvent){
			window.attachEvent("onload", sIFR);
		} else if(document.addEventListener || window.addEventListener){
			if(document.addEventListener){
				document.addEventListener("load", sIFR, false);	
			};
			if(window.addEventListener){
				window.addEventListener("load", sIFR, false);	
			};
		} else {
			if(typeof window.onload == "function"){
				var fOld = window.onload;
				window.onload = function(){ fOld(); sIFR(); };
			} else {
				window.onload = sIFR;
			};
		};
	};
	
	/* Public Methods */
	self.UA = UA;
	self.bAutoInit = true;
	self.replaceElement = replaceElement;
	self.setup = setup;
	
	return self;
}();

/*	sIFR setup. You can add browser detection here. 
	sIFR's browser detection is exposed through sIFR.UA. */
if(sIFR != false){
	sIFR.setup();
};

// sIFR.replaceElement(sSelector, sFlashSrc, sColor, sLinkColor, sHoverColor, sAltColor, sBgColor, nPaddingTop, nPaddingRight, nPaddingBottom, nPaddingLeft, sFlashVars, sCase, sWmode)
if(typeof sIFR == "function"){

sIFR.replaceElement(named({
sSelector:"#bodyContent>h1", 
sFlashSrc:"swf/h1.swf", 
sColor:"#8ac4a5", 
sAltColor:"#ffae00", 
sLinkColor:"",  
sHoverColor:"",
sWmode:"transparent",
//sCase:"upper",
sFlashVars:"offsetLeft=0&offsetTop=0",
nPaddingTop:0,
nPaddingBottom:10,
nPaddingLeft:13,
nPaddingRight:0
}));

sIFR.replaceElement(named({
sSelector:"#logo>h1", 
sFlashSrc:"swf/logo.swf", 
sColor:"#8ac4a5", 
sAltColor:"#ffae00", 
sLinkColor:"",  
sHoverColor:"",
sWmode:"transparent",
//sCase:"upper",
sFlashVars:"offsetLeft=0&offsetTop=0",
nPaddingTop:0,
nPaddingBottom:0,
nPaddingLeft:0,
nPaddingRight:0
}));

sIFR.replaceElement(named({
sSelector:"#header>h1", 
sFlashSrc:"swf/header_h1.swf", 
sColor:"#04483e", 
sAltColor:"", 
sLinkColor:"",  
sHoverColor:"",
sWmode:"transparent",
//sCase:"upper",
sFlashVars:"offsetLeft=0&offsetTop=0&textalign=right",
nPaddingTop:6,
nPaddingBottom:0,
nPaddingLeft:0,
nPaddingRight:6
}));

sIFR.replaceElement(named({
sSelector:"#flashPromo>h1", 
sFlashSrc:"swf/flash_promo.swf", 
sColor:"#117a6f", 
sAltColor:"", 
sLinkColor:"",  
sHoverColor:"",
sWmode:"transparent",
//sCase:"upper",
sFlashVars:"offsetLeft=0&offsetTop=0",
nPaddingTop:0,
nPaddingBottom:0,
nPaddingLeft:0,
nPaddingRight:0
}));

sIFR.replaceElement(named({
sSelector:"#headers>h1", 
sFlashSrc:"swf/web_headers.swf", 
sColor:"#117a6f", 
sAltColor:"", 
sLinkColor:"",  
sHoverColor:"",
sWmode:"transparent",
//sCase:"upper",
sFlashVars:"offsetLeft=0&offsetTop=0",
nPaddingTop:0,
nPaddingBottom:0,
nPaddingLeft:0,
nPaddingRight:0
}));



};

/***********************************************
* Cool DHTML tooltip script II- © 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
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="images/arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
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 winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-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=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
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+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip;
