function openDoc(title,whereto,height,width) {

	var newheight = height+40;
	var newwidth = width+20;

	//alert(height + ' = ' + newheight);
	//alert(width + ' = ' + newwidth);

	if (newheight > 600) {
		//alert('set height 600');
		newheight = 600;
	}

	var features = 'top=50,left=50,height=' + newheight + ',width=' + newwidth + ',toolbar=no,resizable=yes,scrollbars=no';
	newwindow = window.open('', 'info', features);

	var contents;

	contents = '<html><head><title>' + title + '</title></head>';
	contents += '<FRAMESET border="0" rows="*,30" frameborder="0" frameSpacing="0">';
	contents += '<FRAME border="0" frameborder="0" frameSpacing="0" marginHeight="0" marginWidth="0" name="menu" scrolling="yes" src="' + whereto + '">';
	contents += '<FRAME border="0" frameborder="0" frameSpacing="0" marginHeight="0" marginWidth="0" name="main" scrolling="no" src="close.htm">';
	contents += '</FRAMESET>';
	contents += '</html>';


	newwindow.document.write(contents);
	isopen = "yes";
	newwindow.focus();
}

function removeClassName (elem, className) {
  elem.className = elem.className.replace(className, "").trim(); 
}

function addClassName (elem, className) {
	removeClassName (elem, className);
	elem.className = (elem.className + " " + className).trim();
}

function setClassName (elem, className) {
  elem.className = className;
}

function strltrim() {return this.replace(/^\s+/,'');}
function strrtrim() {return this.replace(/\s+$/,'');}
function strtrim() {return this.replace(/^\s+/,'').replace(/\s+$/,'');}

String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim = strtrim;

