	<!--	

	// -----------------------------------------------------------	
	// check or uncheck a radiobutton or checkbox if it's value matches pVal
	// -----------------------------------------------------------	
	
	function setRadioOrCheck(pName, pVal)
	{
		var form = document.form;
		for (var i=0; i<form.elements.length; i++)
		{
			var el = form.elements[i];
			if (el.name == pName) el.checked = (el.value == pVal);
		}		
	}

	// -----------------------------------------------------------	
	// alt to title adds a title tag to each image, if none exists
	// -----------------------------------------------------------
	
	function altToTitle(pRoot)
	{
		if (!pRoot) pRoot = document;
		var els = pRoot.getElementsByTagName("IMG");
		for (var i=0; i<els.length; i++)
		{
			var el = els[i];
			if (el.title && !el.alt) 
			{
				el.alt = el.title;
			}
			else if (el.alt && !el.title)
			{
				el.title = el.alt;	
			}			
		}
	}
	
	addOnLoad('altToTitle');
	
	// -----------------------------------------------------------	
	// validate mail form
	// -----------------------------------------------------------	
	
	function checkMailForm(pForm)
	{
		var elForm = gel(pForm);
		if (!elForm)
		{
		    return;
		}
		// alert(elForm);
		var isValid = true;
		// alert(elForm.elements.length);
		for (var i=0; i<elForm.elements.length; i++)
		{
			var el = elForm.elements[i];			
			el.className = el.className.replace(" error", "");
			if (el && el.getAttribute("req") == 1 && el.value.trim() == '')
			{
				isValid = false;	
				el.className += " error";
			}			
		}
		if (isValid) 
        {
            return true;
        }
        else
        {
            alert('Niet alle verplichte velden zijn ingevuld!');      
            return false;
        }		
	}
	
	// -----------------------------------------------------------	
	// element functions
	// -----------------------------------------------------------	
	
	// get element by id
	function gel(pId)
	{
		if (document.getElementById && pId) return document.getElementById(pId);
		return null;
	}
	
	// click element by id
	function clel(pId)
	{
		var el = gel(pId);
		if (el) el.click();
	}
	
	// set element visibilty by id and state
	function sel(pId, pState)
	{
		var el = gel(pId);
		if (el) el.style.display = pState ? '' : 'none';
	}
	
	// -----------------------------------------------------------	
	// include functions
	// -----------------------------------------------------------	
	
	function include_js(src)
	{
		if (document.createElement && src)
		{
			var js_el = document.createElement('SCRIPT');
			js_el.type = 'text/javascript';
			js_el.src = src;
			addElToHead(js_el);
		}
	}
	
	function include_css(src)
	{
		if (document.createElement && src)
		{
			var css_el = document.createElement('LINK');
			css_el.type = 'text/css';
			css_el.rel = 'stylesheet';
			css_el.href = src;
			addElToHead(css_el);
		}
	}
	
	function addElToHead(el)
	{
		if (el)
		{
			if (document.getElementsByTagName && document.getElementsByTagName("HEAD").length > 0) 
			{
				document.getElementsByTagName("HEAD")[0].appendChild(el) 
			}
			else if (document.body.appendChild)
			{
				document.body.appendChild(el);			
			}
		}
	}
	
	// -----------------------------------------------------------	
	// handle onload functions
	// -----------------------------------------------------------	
	
	var arrOnLoad = Array();
	
	function addOnLoad(ref)
	{
		// alert('addOnLoad(' + ref + ');');
		if (arrOnLoad && arrOnLoad.push && ref)
		{
			arrOnLoad.push(ref);		
		}
	}
	
	function onLoadHandler()
	{
		if (arrOnLoad)
		{
			for (var i=0; i<arrOnLoad.length; i++)
			{
				alert('addOnLoad(' + ref + ');');
				if (this[arrOnLoad[i]]) this[arrOnLoad[i]]();
			}
		}
	}	
	
	window.onload = onLoadHandler;
	
	// -----------------------------------------------------------	
	// handle onunload functions
	// -----------------------------------------------------------	
	
	var arrOnUnload = Array();
	
	function addOnUnload(ref)
	{
		if (arrOnUnload && arrOnUnload.push && ref)
		{
			arrOnUnload.push(ref);		
		}
	}
	
	function onUnloadHandler()
	{
		if (arrOnUnload)
		{
			for (var i=0; i<arrOnUnload.length; i++)
			{
				if (this[arrOnUnload[i]]) this[arrOnUnload[i]]();
			}
		}
	}	
	
	window.onunload = onUnloadHandler;	
	
	// -----------------------------------------------------------	
	// Admin link scripts
	// -----------------------------------------------------------
	
	var strLink1 = "<a href=\"";
	var strLink2 = "\" target=\"";
	var strLink3 = "\">";
	var strLink4 = "</a>";
	
	var strLinkJs = "javascript:var w=window.open('";
	
	// makeLink with name n and type t

	function makeLink(n, t) 
	{		
		if (n && document.form)
		{		
			var f = document.form;
			
			var elId	= f['input' + n + 'Id'];
			var elProt	= f['input' + n + 'Prot'];
			var elLink	= f['input' + n + 'Link'];
			var elTarg	= f['input' + n + 'Target'];
			var elText	= f['input' + n + 'Text'];
			
			// js elements
			var elWidth		= f['input' + n + 'Width'];
			var elHeight	= f['input' + n + 'Height'];
			var elToolbar	= f['input' + n + 'Toolbar'];
			var elLocation	= f['input' + n + 'Location'];
			var elStatus	= f['input' + n + 'Status'];
			var elMenu		= f['input' + n + 'Menubar'];
			var elScroll	= f['input' + n + 'Scrollbars'];
			var elStatus	= f['input' + n + 'Status'];
			var elResize	= f['input' + n + 'Resizable'];
			var elWindow	= f['input' + n + 'Window'];
			var elTable		= gel(n + 'NewWindow');
	
			if (t) 
			{
				var elType 	= gel('input' + n + 'Type' + t);
				if (elType) elType.checked = true;		
			}
					
			if (getLinkType(n) == 'Int')
			{
				if (elTable) elTable.style.display = 'none';
				if (elId && elText) f[n].value = strLink1 + contentUrl + '?id=' + elId.value + strLink2 + '_self' + strLink3 + elText.value + strLink4;
			}
			else
			{
				if (elTarg && elTarg.value == 'popup')
				{
					if (elTable) elTable.style.display = '';
					if (elToolbar && elLocation && elStatus && elMenu && elScroll && elResize && elWidth && elHeight && elText)
					{
						f[n].value = strLink1 + strLinkJs + elProt.value + elLink.value + "','" + elWindow.value + "','" +
										"toolbar=" 		+ (elToolbar.checked ? 1 : 0) + "," + 
										"location=" 	+ (elLocation.checked ? 1 : 0) + "," + 
										"status=" 		+ (elStatus.checked ? 1 : 0) + "," + 
										"menubar=" 		+ (elMenu.checked ? 1 : 0) + "," + 
										"scrollbars=" 	+ (elScroll.checked ? 1 : 0) + "," + 
										"resizable=" 	+ (elResize.checked ? 1 : 0) + "," + 
										"width=" 		+ elWidth.value + "," +
										"height=" 		+ elHeight.value + "');" +									
										strLink3 + elText.value + strLink4;		
					}
				}
				else
				{
					if (elTable) elTable.style.display = 'none';
					if (elProt && elLink && elTarg && elText)
					{
						f[n].value = strLink1 + elProt.value + elLink.value + strLink2 + elTarg.value + strLink3 + elText.value + strLink4;
					}
				}
			}	
		}
	}
	
	function getLinkType(n)
	{
		if (n && document.form)
		{
			var elType	= document.form['input' + n + 'Type'];
			var elExt	= gel('input' + n + 'TypeExt');			
			return (elType && elExt && elExt.checked) ? 'Ext' : 'Int';
		}
	}
	
	function getLink(n) 
	{		
		// get form element
		var f = document.form;
		
		// get elements
		var elRes 		= f[n];			
		var elId		= f['input' + n + 'Id'];
		var elProt		= f['input' + n + 'Prot'];
		var elLink		= f['input' + n + 'Link'];
		var elTarg		= f['input' + n + 'Target'];
		var elText		= f['input' + n + 'Text'];
		
		// js elements
		var elWidth		= f['input' + n + 'Width'];
		var elHeight	= f['input' + n + 'Height'];
		var elToolbar	= f['input' + n + 'Toolbar'];
		var elLocation	= f['input' + n + 'Location'];
		var elStatus	= f['input' + n + 'Status'];
		var elMenu		= f['input' + n + 'Menubar'];
		var elScroll	= f['input' + n + 'Scrollbars'];
		var elStatus	= f['input' + n + 'Status'];
		var elResize	= f['input' + n + 'Resizable'];
		var elWindow	= f['input' + n + 'Window'];
		var elTable		= document.getElementById(n + 'NewWindow');
		
		// vars
		var strRes 	= elRes.value;
		var strJs 	= '';
		var strText = '';
		var strLink = '';
		var strTarg = '';
		var strText = '';
		var strProt = '';
		var strId 	= '';
		var strType	= (strRes.indexOf(contentUrl) >= 0) ? "Int" : "Ext"; // getLinkType(n);	
		
		// javascript?		
		if (strRes.indexOf(strLinkJs) >= 0)
		{
			strJs 	= strRes.substring(strRes.indexOf(strLink1) + strLink1.length, strRes.indexOf(strLink3));
			strText	= strRes.substring(strRes.indexOf(strLink3) + strLink3.length, strRes.indexOf(strLink4));
			
			strJs 	= strJs.replace(strLinkJs, '');
			strJs 	= strJs.replace(');', '');
			strJs	= strJs.replace(/'/gi, '');
			
			var arrJs = strJs.split(',');			
			
			strLink 			= arrJs[0];
			elWindow.value 		= arrJs[1];
			elToolbar.checked 	= (arrJs[2].indexOf('1') >= 0);
			elLocation.checked 	= (arrJs[3].indexOf('1') >= 0);
			elStatus.checked 	= (arrJs[4].indexOf('1') >= 0);
			elMenu.checked 		= (arrJs[5].indexOf('1') >= 0);
			elScroll.checked 	= (arrJs[6].indexOf('1') >= 0);
			elResize.checked 	= (arrJs[7].indexOf('1') >= 0);
			elWidth.value 		= parseInt('0' + arrJs[8].replace('width=', ''), 10);			
			elHeight.value 		= parseInt('0' + arrJs[9].replace('height=', ''), 10);		
			
			strTarg = 'popup';
			strType = 'Ext';
			
			elTable.style.display = '';
		}
		else
		{		
			if (elTable) elTable.style.display = 'none';
		
			// get values		
			strLink	= strRes.substring(strRes.indexOf(strLink1) + strLink1.length, strRes.indexOf(strLink2));
			strTarg	= strRes.substring(strRes.indexOf(strLink2) + strLink2.length, strRes.indexOf(strLink3));
			strText	= strRes.substring(strRes.indexOf(strLink3) + strLink3.length, strRes.indexOf(strLink4));	
								
			// check if internal link
			if (elId && (strType == 'Int' || strLink.indexOf(contentUrl) == 0))
			{	
				// get id
				var idPos = strLink.indexOf('?id=') + 4
				var ampPos = strLink.indexOf('&', idPos);
				if (ampPos <= 0) ampPos = strLink.length;				
				setSelVal(elId, strLink.substring(idPos, ampPos));
			}			
		}
		
		// get protocol and strip it from the link string
		if (elProt && strType == 'Ext')
		{					
			for (var i=0; i<elProt.length; i++) 
			{
				var opVal = elProt.options[i].value;
				if (strLink.indexOf(opVal) == 0) 
				{
					strLink = strLink.substring(opVal.length, strLink.length);
					elProt.selectedIndex = i;
					break;
				}
			}
			
			// set link text value
			elLink.value = strLink;
		}
		
		// set select values
		if (elTarg) setSelVal(elTarg, strTarg);	
		
		// set text values	
		if (elText) elText.value = strText;	
		
		// set type radio button
		var elType = document.getElementById('input' + n + 'Type' + strType);
		if (elType) elType.checked = true;
	}
	
	// -----------------------------------------------------------	
	// FCKeditor autosave hook: saves when field loses focus
	// -----------------------------------------------------------	
	
	function fck_save(w)
	{			
		// exit the function if no window reference was passed
		if (!w) return
		
		// get the window location parameters
		var s = String(w.location.search).substr(1);	// search part of location string
		var a = s.split('&');							// arr of parameters
		var f = '';										// field name
		
		// find the InstanceName		
		for (var i=0; i<a.length; i++)
		{
			if (a[i].indexOf('InstanceName=') == 0)
			{
				f = a[i].split('=')[1];
				break;
			}
		}			
		
		// exit the function if no field name, field reference or source field reference was found		
		if (f == '' || !document.getElementById(f)) return;
		
		// Get the editor instance that we want to interact with.
		var oEditor = FCKeditorAPI.GetInstance(f) ;
	
		// pass the xhtml contents to the destination field
		document.getElementById(f).value = oEditor.GetXHTML( true );
	}
	
	
	// -----------------------------------------------------------	
	// Admin mail scripts
	// -----------------------------------------------------------

	function makeMail(fld) 
	{	
		var elMail = document.getElementById("input" + fld + "Mail");
		if (elMail)
		{
			var m = elMail.value;
			document.getElementById(fld).value = "<a href=\"mailto:" + m + "\">" + m + "</a>";
		}
	}
	
	function getMail(fld) 
	{
		var elMail		= document.getElementById(fld);
		if (elMail)
		{
			var strMail		= elMail.value;		
			var strBegin	= '<a href="mailto:';
			var strEnd 		= '">';		
			var posBegin	= strMail.indexOf(strBegin);
			var posEnd		= strMail.indexOf(strEnd);		
			var strMail		= strMail.substring(posBegin + strBegin.length, posEnd);	
			var elMail 	= document.getElementById("input" + fld + "Mail");
			if (elMail) elMail.value = strMail;	
		}
	}
	
	// -----------------------------------------------------------	
	// Macromedia functions
	// -----------------------------------------------------------
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
			
	// -----------------------------------------------------------	
	// String functions
	// -----------------------------------------------------------
			
	function maxChars(checkFld, chars, rtnField) 
	{
		if (checkFld.value.length > chars) checkFld.value = checkFld.value.substring(0,chars);
		if (rtnField) rtnField.value = chars - checkFld.value.length;
	}
	
	function shortString(m, i)
	{
		m = parseInt(0 + m, 10);
		var el = document.getElementById("shortTxt" + i);
		var t = stripHTML(el.innerHTML);
		el.innerHTML = (m > 0 && t.length > m) ? ( t.substr(0, m) + " ..." ) : t;
	}
	
	function stripHTML(str) 
	{
		return str.replace(/(<([^>]+)>)/ig,'');
	}
	
	// -----------------------------------------------------------	
	// Cookies functions
	// -----------------------------------------------------------
	
	function Get_Cookie(name) {
		var start = document.cookie.indexOf(name+"=");
		var len = start+name.length+1;
		if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
		if (start == -1) return null;
		var end = document.cookie.indexOf(";",len);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(len,end));
	}
	
	function Set_Cookie(name,value,expires) {
		document.cookie = name + "=" +escape(value) +
			( (expires) ? ";expires=" + expires.toGMTString() : "");
	}
	
	function Delete_Cookie(name) {
		if (Get_Cookie(name)) document.cookie = name + "=" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
	}
	
	// -----------------------------------------------------------
	// Date functions
	// -----------------------------------------------------------
	
	function date2utc(year, month, day, hours, minutes, seconds) {
		d = new Date(year, month-1, day, hours, minutes, seconds);
		return d.getTime()/1000;	
	}
	
	function dateStringToDate(str) {
		// dateStringToDate("19760320") = "20 maart 1976";
		var d = dateStringToArr(str);
		if (d[0] < intYearMin) d[0] = intYearMin;
		if (d[0] > intYearMax) d[0] = intYearMax;
		if (d[1] > arrMonth.length) d[1] = arrMonth.length;
		if (d[1] <= 0) d[1] = 1;
		if (d[2] > 31) d[2] = 31;
		return d[2] + " " + arrMonth[d[1]-1].toLowerCase() + " " + d[0];
	}	
		
	function dateToDateString(d) {
		// dateToDateString("20 maart 1976") = "19760320";
		var a = d.split(" ");
		var tempDate = new Date();
		if (!a[0]) a[0] = tempDate.getFullYear();
		if (!a[1]) a[1] = arrMonth[tempDate.getMonth()+1];
		if (!a[2]) a[2] = tempDate.getDate();
		var ii = arrMonth.length;
		for(var i=0; i<ii; i++) {
			if (arrMonth[i].toLowerCase() == a[1].toLowerCase()) {				
				a[1] = i+1;
				i = ii;
			}
		}		
		a[1] = a[1] < 10 ? "0" + a[1] : a[1];
		a[2] = a[2] < 10 ? "0" + a[2] : a[2];		
		return a[2] + a[1] + a[0] + "0000";
	}	
	
	function dateStringToArr(date) 
	{
		// dateStringToArr("19760320") = new Array("1976", "03", "20", "00", "00", "00");
		var a = new Array()
		a[0] = date.substr(0,4); // yyyy
		a[1] = date.substr(4,2); // mm
		a[2] = date.substr(6,2); // dd
		a[3] = date.substr(8,2); // hh
		a[4] = date.substr(10,2); // nn
		a[5] = date.substr(12,2); // ss
		// check all values
		for(var i=0; i<a.length; i++) {
			if (!a[i] || a[i] < 0) a[i] = 0;
			a[i] = Math.round(a[i]);
		}		
		// return array
		return a;
	}	
	
	// -----------------------------------------------------------
	// Table and layer functions
	// -----------------------------------------------------------
	
	function expandTable(pEl, pStatus) 
	{
		if (typeof(pEl) == "string") pEl = gel(pEl);
		if (pEl) pEl.style.display  = pStatus ? '' : 'none';	
	}	
	
	function rememberTableState(pName, pState) 
	{		
		// hide or show tables
		setTableState(pName, pState);	
					
		var ckVal = Get_Cookie(ckLstHidTbl);		// get cookie value
		if (ckVal) 
		{
			var re = new RegExp(pName, "gi")
			ckVal = ckVal.replace(re, "");			// replace table name			
		}
		if (!pState ) ckVal = ckVal + "," + pName;	// add table name, only if table is hidden
		ckVal = ckVal.replace(/,,/gi, ",");			// replace any double comma's
		var d = new Date();
		d.setFullYear(d.getFullYear()+1);		
		Set_Cookie(ckLstHidTbl, ckVal, d);			// save cookie with new value and remember for one year
	}
	
	function getTableState(pName)
	{
		// get cookie value
		var ckVal = Get_Cookie(ckLstHidTbl);
		// if table name exists in cookie, minimize table
		var state = false;
		if (ckVal)
		{
			var a = ckVal.split(",");
			for (var i=0; i<a.length; i++)
			{
				if (a[i] == pName)
				{
					state = true;
					break;
				}
			}
		}
		setTableState(pName, !state);	
	}
		
	function setTableState(pName, pState)
	{
		sel('tblMin' + pName, !pState);
		sel('tblMax' + pName, pState);		
	}
	
	// tableMin and tableMax are called on the push of a button, don't use them internally
	
	function onMinimizeTable(pName) 
	{
		rememberTableState(pName, false);
	}
	
	function onMaximizeTable(pName) 
	{
		rememberTableState(pName, true);
	}
	
	function swapVisible(el)
	{
		if (typeof(el) == "string") el = gel(el);
		el.style.display=(el.style.display=='none')?'':'none'
	}
	
	// -----------------------------------------------------------
	// Form functions
	// -----------------------------------------------------------
	
	function checkAction(pVal) 
	{
		// show or hide the table that contains the menu list 
		// depending on the specified value being true or not
		sel('moveListTable', (pVal == "move"));
	}	
	
	function doAction(include, action, id, parent) 
	{	
		submitForm(include, action, '', '', id, parent);
	}	
	
	function checkDel(include, id)
	{
		var msg = "";
		if (include == "Block")
		{
			msg = "Weet u zeker dat u deze paragraaf en al haar objecten wil verwijderen?"
		}
		else if (include == "Page")
		{
			msg = "Weet u zeker dat u deze pagina en al haar paragrafen wil verwijderen?";
		}
		if (msg && confirm(msg)) submitForm(include, 'delete', '', '', id, '');	
	}
	
	function submitForm(include, action, tmp, name, id, parent)
	{
		var form = document.form
		if (include && form.form_include) 	form.form_include.value = include;	// set include
		if (action 	&& form.form_action) 	form.form_action.value 	= action;	// set action
		if (tmp 	&& form.form_tmp) 		form.form_tmp.value 	= tmp;		// set template
		if (name 	&& form.form_name) 		form.form_name.value 	= name;		// set name
		if (id 		&& form.form_id) 		form.form_id.value 		= id;		// set id	
		if (parent 	&& form.form_parent) 	form.form_parent.value 	= parent;	// set parent id (element id from which action is called)
		form.submit();															// submit form	
	}	
	
	function setSelVal(sel, val) 
	{
		for(var i=0; i<sel.length; i++) 
		{
			if (sel.options[i].value == val) 
			{
				sel.selectedIndex = i;
				break;
			}
		}
	}
	
	function checkDate(n1,n2) 
	{
		var form = document.form;
		form[n1].value = dateStringToDate(form[n2].value);
		setTimeout("checkDate('" + n1 +"','" + n2 + "')", 300);
	}
	
	function getCheckbox(box, trueVal, falseVal) 
	{
		return (box.checked ? trueVal : falseVal);	
	}
	
	function setCheckBox(box, val) 
	{		
		box.checked = (val.toLowerCase()  == "true" || parseInt(val) == 1) ? true : false;
	}
		
	// -----------------------------------------------------------------
	// File upload scripts
	// -----------------------------------------------------------------
	
	var strFilePre 		= '<a href="';
	var strFileMid 		= '" target="_blank">';
	var strFilePost 	= '</a>';	

	function makeFile(name, genName) 
	{
		var form 		= document.form;
					
		var fldResult 	= form[name];
		var fldFile		= form['input' + name + 'File'];
		var fldText		= form['input' + name + 'Text'];
		var fldPath		= form['input' + name + 'Path'];
		
		var strResult 	= fldResult.value;
		var strFile		= fldFile.value
		var strPath		= fldPath.value;	
		
		if (strFile) 
		{
			var strName		= strFile.substring(strFile.lastIndexOf('\\')+1, strFile.length);
			var strPath		= strUplPath + strName;
			if (genName) fldText.value = strName;
			fldPath.value	= strPath;
			fldResult.value = strFilePre + strPath + strFileMid + fldText.value + strFilePost;
		} 
		else 
		{
			if (genName) fldText.value = strPath.substring(strPath.lastIndexOf('\\')+1, strPath.length);
			fldResult.value = strFilePre + strPath + strFileMid + fldText.value + strFilePost;
		}		
	}
	
	function getFile(name) 
	{
		var form 		= document.form;	
		var fldResult 	= form[name];
		var fldFile		= form['input' + name + 'File'];
		var fldText		= form['input' + name + 'Text'];
		var fldPath		= form['input' + name + 'Path'];	
		var strResult 	= fldResult.value;
		var strPath		= strResult.substring(strResult.indexOf(strFilePre) + strFilePre.length, strResult.indexOf(strFileMid));
		fldPath.value	= strPath;
		fldText.value 	= strResult.substring(strResult.indexOf(strFileMid) + strFileMid.length, strResult.indexOf(strFilePost));
	}
	
	// -----------------------------------------------------------------
	// Image upload scripts
	// -----------------------------------------------------------------
	
	var strImgPre 		= '<img src="';
	var strImgPost 		= '" border="0">';
	
	function delImg(name)
	{
		document.form[name].value = '';
		MM_swapImage('img' + name,'','',1);
		gel('img' + name).style.display = 'none';
	}

	function makeImg(name) 
	{
		var fldResult	= gel(name);		
		var fldImg		= gel('img' + name + 'File');
		var strFile		= fldImg.value;			
		var strImg		= 'img' + name;		
		if (strFile)
		{
			MM_swapImage(strImg, '', strFile, 1);
			gel('img' + name).style.display = '';
			var strPath 	= strUplPath + strFile.substring(strFile.lastIndexOf('\\')+1, strFile.length);
			fldResult.value = strImgPre + strPath + strImgPost;
		}
		else
		{
			delImg(name);
		}		
	}
	
	function getImg(name) 
	{
		var fldResult 	= gel(name);
		if (!fldResult) return;
		var strImg		= 'img' + name;	
		var strResult 	= fldResult.value;
		if (strResult == undefined) return;
		var strPath		= strResult.substring(strResult.indexOf(strImgPre) + strImgPre.length, strResult.indexOf(strImgPost));
		if (strResult) 
		{
			gel('img' + name).style.display = '';
			MM_swapImage(strImg, '', strPath, 1);
		}
		else
		{
			delImg(name);
		}
	}
	
	// display first child image in element in a popup window
	
	function showChildImage(rootEl)
	{
		for (var i=0; i<rootEl.childNodes.length; i++)
		{
			var el = rootEl.childNodes[i];
			if (el.nodeName == 'IMG')
			{
				window.open('../imgpopup.asp?img=' + el.src, 'imageviewer', 'width=10, height=10, menubar=0, resizable=1, personalbar=0, scrollbars=0, status=0, titlebar=0, toolbar=0');	
			}
		}
	}
	
	// -----------------------------------------------------------------
	// Editor scripts
	// -----------------------------------------------------------------	
	
	function openEditor(strForm, strField) 
	{ 
		window.open(strSiteUrl + 'inc/editor.asp?form=' + strForm + '&field=' + strField, 'vsenvEditor', 'width=' + editWidth + ', height=' + editHeight); 
	}	
	
	// -->
