function checkStep1()
{
	if (calculate(true) == false)
	{
		return false;
	}
	else
	{
		return true;	
	}
}
/**
* str_replace
*
* This function returns a string or an array with all occurrences of
* [search] in [subject] replaced with the given [replace] value.
* If you don�t need fancy replacing rules (like regular expressions), you should always use this function.
*
* @param string search
* @param string replace
* @param string string
*/
function str_replace (search, replace, subject)
{
	var result = '';
	var oldi = 0;
	for (i = subject.indexOf(search); i > -1; i = subject.indexOf(search, i))
	{
		result += subject.substring(oldi, i);
		result += replace;
		i += search.length;
		oldi = i;
	}
	return result + subject.substring(oldi, subject.length);
}
function cfv(where,NoError)
{
	// check field value, if empty, we will return a red marker
	// if filled we will return a green arrow
	if (where.value == '')
	{
		if (NoError == true )
			markNormal(where);
		else 
			markError(where);
	}
	else
	{
		markOk(where);
	}
}

function markError(where)
{
	if (!where) 
		return false;
	where.className = 'errorField';
}

function markOk(where)
{
	where.className = 'okField';
}
function markNormal(where)
{
	where.className='';
}
function checkDoel(iid)
{
	for (i=0;i<document.stap1.doel.length;i++){
		document.stap1.doel[i].checked=false;
	}
	if (iid==0)
	{
		document.getElementById('but')[2].selected=true;
	}
	document.stap1.doel[iid].checked=true;
	return false;
}
/**
 * Only allows money
 */
function onlyMoney(where)
{
	where.value = str_replace(',','.',where.value);
	where.value = where.value.replace(/[^\d\.]/g, '');
}
/**
 * Only allows numeric
 */
function onlyNumeric(where)
{
	where.value = where.value.replace(/[^\d\.\,]/g, '');
}
/**
 * Only allows date in format mm/yyyy
 */
function onlySimpleDate(where)
{
    var RegExPattern = /^([0-9]{2})(\/)([0-9]{4})/;
    if ((where.value.match(RegExPattern)) && (where.value!=''))
	{
		// where.value='';
    }
	else
	{
		where.value='';
    }
}
/**
 * Only allows date in format dd/mm/yyyy
 */
function onlyDate(where)
{
    var RegExPattern = /^([0-9]{2})(\/)([0-9]{2})(\/)([0-9]{4})/;
	var date = where.value;

    if ((date.match(RegExPattern)) && (date != ''))
	{
		// where.value='';
    }
	else
	{
		where.value = '';
    }
}
if(document.getElementById('search-theme-form')){	var slabel = document.getElementById('slabel');	var slabel_text = slabel.firstChild.nodeValue;	var sinput = document.getElementById('s');	slabel.style.display = 'none';	sinput.setAttribute('value', slabel_text);	sinput.onfocus = function(){		sinput.setAttribute('value', '');	}	sinput.onblur = function(){		if(sinput.value == false){			sinput.setAttribute('value', slabel_text);		}	}}