<!--

function menu_select(menuId, pageId, sessionId) {
	if (menuId == 'main') {
  		window.location="index.php?p=" + pageId;
  	}
  	else if (menuId == 'admin') {
  		window.location="admin.php?" + sessionId + "&p=" + pageId;
  	}
}

function changeClass(element, className) {
  	element.className=className;
}

function resizeImage(image, maxWidth, maxHeight) {

	  setwidth=400;

	  x=document.getElementById('image').offsetWidth;
	  y=document.getElementById('image').offsetHeight;
	if(x>setwidth) {
	  xn=setwidth;

	  y=y*xn/x;

	     document.getElementById('image').style.width=xn+"px";
	     document.getElementById('image').style.height=y+"px";

	  }
}

function limitTextarea(textareaElement, countElement, maxCharCount) {
	text= textareaElement.value;
	
	text= text.replace(/\'/g, '');
	text= text.replace(/\"/g, '');
	text= text.replace(/>/g, '');
	text= text.replace(/</g, '');
	text= text.replace(/&gt;/g, '');
	text= text.replace(/&lt;/g, '');
	textareaElement.value=text;

	if (textareaElement.value.length > maxCharCount) {
		textareaElement.value = textareaElement.value.substring(0, maxCharCount);
	}
	else { 
		countElement.value = maxCharCount - textareaElement.value.length;
	}
}

-->
