function tooltips() {
	// encapsulated version of this script <- has dependancies on common.js and jQuery
	
	var pageSize = $fh.getPageSize();
	var pageWidth = pageSize[2];
	var pageHeight = pageSize[3];
	var EnableOverlay = false;
	var isIE6 = $fh.isIE6();
	var fnLoad = function() {};				// blank function
	var maskActive = true;
	
	this.onLoad = function(fnExternal) {
		fnLoad = fnExternal;
	}
	
	var onLoad = function() {
		try {
			fnLoad();
		} catch(err) {
		//	alert(err);
		};
	};
	
	this.closeTip = function() {
		$fh.hide('pageMask',300,'fade');
		$fh.hide('pageOverlay',300,'fade');
		if(isIE6) {
			var arSelect = document.getElementsByTagName('select');
			for(i = 0; i < arSelect.length; i++) {
				$fh.show(arSelect[i]);
			};
		};

		setTimeout('$fh.removeElement(\'pageMask\')',600);
		setTimeout('$fh.removeElement(\'pageOverlay\')',600);
		
		return false;
	};
	
	this.disableMask = function() {
		maskActive = false;
	};
	
	this.enableMask = function() {
		maskActive = true;
	};
	
	this.loadHosting = function() {
		// sets the hyperlink locations for hosting overlays
		
		// get all the links on the page
		var arLinks = document.getElementsByTagName('a');
		
		// loop through them
		for(i = 0; i < arLinks.length; i++) {
			
			// match to rel of tooltip
			if((arLinks[i].rel.match('tooltip') || (arLinks[i].rel.match('overlay') && this.EnableOverlay)) && !arLinks[i].className.match('help')) {
				// set appropriate href
				
				if(arLinks[i].href.match('/web-hosting/buy/business-premium/')) {
					arLinks[i].href = '/web-hosting/buy/overlay/?PackageType=Premium&CustomerType=Business';
				} else if(arLinks[i].href.match('/web-hosting/buy/business-standard/')) {
					arLinks[i].href = '/web-hosting/buy/overlay/?PackageType=Standard&CustomerType=Business';
				} else if(arLinks[i].href.match('/web-hosting/buy/personal-premium/')) {
					arLinks[i].href = '/web-hosting/buy/overlay/?PackageType=Premium&CustomerType=Personal';
				} else if(arLinks[i].href.match('/web-hosting/buy/personal-standard/')) {
					arLinks[i].href = '/web-hosting/buy/overlay/?PackageType=Standard&CustomerType=Personal';
				} else if(arLinks[i].href.indexOf('/web-hosting/buy/overlay/')<0) {
					arLinks[i].href = '/web-hosting/buy/overlay/?PackageType=Premium&CustomerType=Business';
				};
			};
			
		};
	};
	
	var Methods = {
		
		showTooltip : function(el,url) {
			
			// hack fix to disable the background mask when a hosting package overlay is loaded
			try {
				if(el.href.match('/web-hosting/buy/overlay/')) {
					maskActive = false;
				} else {
					maskActive = true;
				};
			} catch(err) {};
			
			if((typeof el) != 'object') {
				el = $fh.isElement(el);
			};

			if(el == false) { return false; };				

			var sourceFile = (!url ? el.getAttribute('href') : url);

			//Is the source file an image?
			var isImage = sourceFile.split('.').pop() == 'png' ? true : (sourceFile.split('.').pop() == 'jpg' ? true : false);
			var imgSource = sourceFile;
		
			//Generate a unique ID to prevent IE caching the pages
			var rnd = Math.floor(Math.random()*10001);
			if (sourceFile.indexOf("?")!=-1) {
				sourceFile = sourceFile + "&rnd=" + rnd;
			} else {
				sourceFile = sourceFile + "?rnd=" + rnd;
			};
	
			// if ie6 then we need to hide select boxes
			if(isIE6) {
				var arSelect = document.getElementsByTagName('select');
				for(i = 0; i < arSelect.length; i++) {
					$fh.hide(arSelect[i]);
				};
			};
			
			// draw the tooltip and overlay on the page
			var oBody = document.body;
		
			// Page mask
			var oMask = document.createElement('div');
			oMask.setAttribute('id', 'pageMask');
			oBody.appendChild(oMask);
			oMask.innerHTML = '&nbsp;';
			// set the height of the mask
			oMask.style.height = pageHeight + 'px';
			
			// Tip container
			var oTip = document.createElement('div');
			oTip.setAttribute('id','pageOverlay');
			oBody.appendChild(oTip);
			
			// Close tip link
			var oClose = document.createElement('div');
			oClose.setAttribute('id','pageOverlayHeader');
			oTip.appendChild(oClose);
			oClose.innerHTML = '<a href="javascript:void(0);" id="lnkClosePageOverlay">Close</a>';
			
			// Tip content
			var oContent = document.createElement('div');
			oContent.setAttribute('id','pageOverlayBody');
			oTip.appendChild(oContent);
			oContent.innerHTML = '<img src="/pics/tooltips/tooltip-loading.gif" class="tooltiploading"/>';
			
			// show the overlay
			$fh.show(oTip,500,'fade');
			$fh.show(oMask,500,'fade');
			
			// center the tooltip
			$fh.centerElement(oTip);
			
			// set event listener to close the tooltip
			document.getElementById('lnkClosePageOverlay').onclick = function() {
				Methods.closeTip([oMask,oTip]);
				return false;
			};
			if(maskActive) {
				oMask.onclick = function() {
					Methods.closeTip([oMask,oTip]);
					return false;
				};				
			};
		
			//If source file is an image load differently.
			if (isImage) {
				jQuery(oContent).html('<img id="loadedimage" src="' + imgSource + '" alt="" title="" />');
				jQuery('#pageOverlay').css('background', 'none');
				jQuery('#pageOverlayBody').css('padding', '0 10px');
				jQuery('#pageOverlay').css('width', '662px'); //STATIC SIZE FOR VPS DIAGRAM OVERLAYS
				jQuery('#pageOverlayBody').css('background', 'none');
				$fh.centerElement(oTip);

			} else {
				jQuery.get(sourceFile, function(data){ 
					jQuery(oContent).html(data); 
					$fh.centerElement(oTip); 
					return false;
				});
			}
 
			return false;
			
		},
	
		closeTip : function(arLayers) { //Close the tooltip and overlay
			for(i = 0; i < arLayers.length; i++) {
				if($fh.isElement(arLayers[i]) != false) { 
					// first fade the element out
					$fh.hide(arLayers[i],500,'fade'); 
					// then remove it from the DOM
					setTimeout('$fh.removeElement(\'' + arLayers[i].getAttribute('id') + '\')',600);
				};
			};

			if(isIE6) {
				var arSelect = document.getElementsByTagName('select');
				for(i = 0; i < arSelect.length; i++) {
					$fh.show(arSelect[i]);
				};
			};
			return false;
		},
		
		setCloseLinks : function() {
			try {
				var el = $fh.isElement('lnkCloseTooltip');
				if(el == false) { return false; };
				el.onclick = function() {
					Methods.closeTip();
				};
			} catch(err) {
			};
		},
		
		getTips : function() {
		
			var arTips = document.getElementsByTagName('a');
			for(i = 0; i < arTips.length; i++) {
				if(arTips[i].className.match('tooltip') || arTips[i].getAttribute('rel') == 'tooltip' || (arTips[i].getAttribute('rel') == 'overlay' && this.EnableOverlay)) {
					arTips[i].onclick = function() {
						Methods.showTooltip(this);
						return false;
					};
				};
			};
			arTips = document.getElementsByTagName('span');
			for(i = 0; i < arTips.length; i++) {
				if(arTips[i].className.match('help')) {
					arTips[i].onclick = function() {
						Methods.showTooltip(this,this.getAttribute('rel'));
						return false;
					};
				};
			};
		}
	
	};
	
	//this.init = function() { Methods.getTips(); };
	Methods.getTips();

};
//var loadTT = function() { oTT = new tooltips(); };
//$fh.onLoad(loadTT);

