var undefined;

function errorBox(msg, title) {
	var outmsg = '<div class="warning_box">';
	if (title) {
		outmsg += '<span style="font-weight:bold;">There was a problem:</span><br />';
	}
	outmsg += msg + '</div><br clear="all">';
	return outmsg;
}

function successBox(msg) {
	var outmsg = '<div class="success_box">' + msg + '</div><br clear="all">';
	return outmsg;
}

function delaySec(msg) {
	var len = msg.length;
	var show_sec = parseInt(len/5);
	return show_sec;
}

function popURL(url, name, width, height, scrollbar) {
       	var options = "scrollbars="+scrollbar+",resizable=0, location=no,toolbar=0,width=" + width + ", height=" + height;
	options += ",left="+((screen.width/2)-(width/2))+",top="+((screen.height/2)-(height/2));
        options += ",screenX="+((screen.width/2)-(width/2))+",screenY="+((screen.height/2)-(height/2));

        newwindow = window.open(url, name, options);
        if (window.focus) {
        	newwindow.focus();
        }       
        return newwindow;
}

function ridComma(numString) {
    var re = /,/g;
    return numString.replace(re,"");
}

function containsComma(string) {
	var index = string.indexOf(",");
	if (index != -1) {
		return true;
	}
	return false;
}

function addEvent(obj, evType, fn){
 if (obj.addEventListener){
    obj.addEventListener(evType, fn, true);
    return true;
 } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
 } else {
    return false;
 }
} 

