<!--
// *Popup Window Function

function ShowPopup(url, width, height) {
	var MyURL = url;
	var MyWindowName = 'NewWindow';
	var MyWidth = width;
	var MyHeight = height;
	var MyScrollBars = 'yes';
	var MyResizable = 'Yes';
	var MyMenuBar = 'No';
	var MyToolBar = 'No';
	var MyStatusBar = 'No';
	
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;

    var xOffset = (xMax - MyWidth)/2, yOffset = (yMax - MyHeight)/2;

    window.open(MyURL,MyWindowName,'width='+MyWidth+',height='+MyHeight+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars='+MyScrollBars+',resizable='+MyResizable+',menubar='+MyMenuBar+',toolbar='+MyToolBar+',status='+MyStatusBar+'');
}
// This functions handles the delete button and confirms the user action before redirecting to the delete page
function ConfirmDelete(URL){
	if (confirm("Are you sure you want to permanantly delete this item?")){
	window.location.href=URL;
	}
}


// *Handle Errors Politely	

function errorHandler(message, url, line) {
   alert("Please inform the administrator that the following error occurred on this page:\n\n" + message);
   return true;
}
window.onerror = errorHandler


// Status Text Message

var data = "123456789ABCDEF";
var done = 1;
function statusIn(text) {
decrypt(text, 2, 50);
}

function statusOut() {
self.status = '';
done = 1;
}

function decrypt(text, max, delay) {
if (done) {
done = 0;
decrypt_helper(text, max, delay,  0, max);
   }
}
function decrypt_helper(text, runs_left, delay, charvar, max) {
if (!done) {
runs_left = runs_left - 1;
var status = text.substring(0, charvar);
for (var current_char = charvar; current_char < text.length; current_char++) {
status += data.charAt(Math.round(Math.random()*data.length));
}
window.status = status;
var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
var new_char = charvar + 1;
var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"
if(runs_left > 0) {
setTimeout(rerun, delay);
}
else {
if (charvar < text.length) {
setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));
}
else {
done = 1;
         }
      }
   }
}
// Call with this: onload="statusIn('Contact <cfoutput>#a_clientName# @ #a_clientPhone#</cfoutput>')"

// Set Default Status Text
window.defaultStatus='';

// Bookmark Script
function bookmark(url, description){
//***---This text will be shown to the visitor if it has Netscape.
netscape="First push OK and then hit CTRL+D to add a bookmark to this site."

	if (navigator.appName=='Microsoft Internet Explorer'){
	window.external.AddFavorite(url, description);
	}
	else if (navigator.appName=='Netscape')
	{
	alert(netscape);
	}
}

//-->