/* SSF Core Javascript Functions */

	function ssfSetNodeValue(_nodeid, _nodeattribute, _nodevalue, _nodeencode) {
		try {
			if(_nodeencode === true) {
				_nodecode = 'document.getElementById(\''+_nodeid+'\').'+_nodeattribute+'=\''+escape(_nodevalue)+'\'';
			} else {
				_nodecode = 'document.getElementById(\''+_nodeid+'\').'+_nodeattribute+'=\''+_nodevalue+'\'';
			}
			eval(_nodecode);
			return true;
		}
		catch(error) {
			return false;
		}
	}

	function ssfPopupWindow(_url, _width, _height, _scrollbars) {
		var _left=(screen.availWidth/2)-(_width/2);
		var _top=(screen.availHeight/2)-(_height/2);
		window.open(_url,"popupWindow","directories=no,menubar=no,location=no,resizable=yes,scrollbars="+_scrollbars+",status=no,toolbar=no,height="+_height+",width="+_width+",left="+_left+",top="+_top);
	}

	function ssfSetNodeText(_nodeid, _text) {
		document.getElementById(_nodeid).innerHTML=_text;
	}

	function ssfSetFormReset() {
		if(confirm("Are you sure that you want to reset and lose all changes to this form?")) {
			document.forms[0].reset();
			return true;
		}
		else
		{
			return false;
		}
	}

	function ssfFormSubmit(_formname, _formaction) {
		formobject = 'document.'+_formname;
		formobject = eval(formobject);
		if(_formaction != null) {formobject.action=_formaction;}
		formobject.submit();
	}

	function ssfTestJS() {
		var block1 = new getElement('z3c2b1');
		alert(block1.id='test');
		/*swapDOM(getElement('z3c2b1'), block1);*/
		swapDOM(getElement('z3c2b2'), block1);
	}