function divAppearance(divId, divShown) {
	d = document.getElementById(divId);
	if (!d) return;
	objStyle = d.getAttribute('style');

	if (divShown) {
		if (objStyle && typeof(objStyle) == 'object') {
                        objStyle.display = 'none';
                } else {
                        d.setAttribute('style', 'display:none;');
                }
	} else {
		if (objStyle && typeof(objStyle) == 'object') objStyle.display = 'block';
        	else d.setAttribute('style', 'display:block;');
    	}

}

function trimAll(sString) 
{
        while (sString.substring(0,1) == ' ')
        {
        sString = sString.substring(1, sString.length);
        }
        while (sString.substring(sString.length-1, sString.length) == ' ')
        {
        sString = sString.substring(0,sString.length-1);
        }
        return sString;
}

function addslashes(str) {
        str=str.replace(/\'/g,'\\\'');
        str=str.replace(/\"/g,'\\"');
        str=str.replace(/\\/g,'\\\\');
        str=str.replace(/\0/g,'\\0');
        return str;
}
function stripslashes(str) {
        str=str.replace(/\\'/g,'\'');
        str=str.replace(/\\"/g,'"');
        str=str.replace(/\\\\/g,'\\');
        str=str.replace(/\\0/g,'\0');
        return str;
} 


