	var tempX = 0
	var tempY = 0
	var IE = document.all?true:false

	var cancel_hide = false;

	var timeout_var;

	var reset_window = -1;

	function start_timer(){
		if( reset_window==-1 ){
			reset_window = 1;
			timeout_var = window.setTimeout("check_timer();",2000);
		}
		else {
			reset_window = 0;
		}
	}

	function check_timer(){
		if( reset_window==1 ){
			hidePopup();
			reset_window = -1;
		}
		else {
			reset_window = -1;
			start_timer();
		}
	}


	function showPopup( chat_link ) {
 		document.getElementById('popup_div').style.top = (tempY-160)+'px';
		document.getElementById('popup_div').style.left = (tempX-150)+'px';
		document.getElementById('popup_div_inner').innerHTML = '<br>For more information about this load,<br>'+ decode64( chat_link ) +' to chat.<br><br><br>Alternatively, you can call <b>866-908-7608</b>';
		document.getElementById('popup_div').style.display='block';
		cancel_hide = true;
//		start_timer();
	}
	
	function hidePopup() {

		if( !cancel_hide ){
			if( reset_window!=1 ){
				reset_window = 0;
			}
			document.getElementById('popup_div').style.display='none';
		}
		cancel_hide = false;
		reset_window = -1;

	}

	// Main function to retrieve mouse x-y pos.s

	document.onmousemove = getMouseXY;

	function getMouseXY(e) {
	  if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	  } else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	  }  
	  // catch possible negative values in NS4
	  if (tempX < 0){tempX = 0}
	  if (tempY < 0){tempY = 0}  
	  // show the position values in the form named Show
	  // in the text fields named MouseX and MouseY
	  return true
	}

	var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

	function decode64(input) {
	   var output = "";
	   var chr1, chr2, chr3;
	   var enc1, enc2, enc3, enc4;
	   var i = 0;
	
	   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
	   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	
	   do {
		  enc1 = keyStr.indexOf(input.charAt(i++));
		  enc2 = keyStr.indexOf(input.charAt(i++));
		  enc3 = keyStr.indexOf(input.charAt(i++));
		  enc4 = keyStr.indexOf(input.charAt(i++));
	
		  chr1 = (enc1 << 2) | (enc2 >> 4);
		  chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		  chr3 = ((enc3 & 3) << 6) | enc4;
	
		  output = output + String.fromCharCode(chr1);
	
		  if (enc3 != 64) {
			 output = output + String.fromCharCode(chr2);
		  }
		  if (enc4 != 64) {
			 output = output + String.fromCharCode(chr3);
		  }
	   } while (i < input.length);
	
	   return output;
	}
