// Chad's Global CSS
$(document).ready(
	function(){
		chadlindstrom.tools.ShowGoodness();
	}
);

function html_entity_encode(s) {
    var out = "";
    for(i = 0; i < s.length; i++) {
        if(s[i] == '<') {
            out+= "&lt;";
        }
        else if(s[i] == '>') {
            out+= "&gt;";
        }
        else {
            out+= s[i];
        }
    }
    return out;
}

var popUpWin=0;
function ShowWindow(URLStr, width, height) {
	
	var left = 0;	//defaults
	var top = 0;	//defaults
	
	var adjustment = 40;	// slight adustment to account for menu space of things like start menu and dock
	
	left = (screen.width - width) / 2;
	top = ((screen.height - adjustment) - height) / 2;
	
	if(popUpWin) {
		if(!popUpWin.closed) { popUpWin.close(); }
	}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
} // end ShowWindow

function Redirect(URLStr) { location = URLStr; }
function SetStatusBar(msgStr) { self.status = msgStr; }

function Login(){
	ShowWindow('/_tools/login.php',400,300);
}

function CloseWindow(){
	setTimeout('window.close()',1000);
}


