// JS
if(top!=self)
top.location='http://www.sa-investment.com/'

nHoogte = 100
nAantalStappen = 15
var OpenGeklapt = new Array()

function KlapOpen(sDiv)
{
	if ( OpenGeklapt[sDiv] == true )
	{
		OpenGeklapt[sDiv] = false
		document.checkboxform.noteKey.value = document.checkboxform.noteKey.value.replace(',' + sDiv + ',', ',')
		setTimeout('Beweeg("' + sDiv + '", ' + (nAantalStappen-1) + ', -1)', 15)
	}
	else
	{
		document.getElementById('toevoegenlink' + sDiv).style.display = 'none'
		if ( document.checkboxform.noteKey.value == '' ) document.checkboxform.noteKey.value = ','
		document.checkboxform.noteKey.value += sDiv + ','
		OpenGeklapt[sDiv] = true
		document.getElementById(sDiv).style.display = 'block'
		setTimeout('Beweeg("' + sDiv + '", 1, 1)', 15)
		document.checkboxform['note' + sDiv].focus();
	}
}

function Beweeg(sDiv, nStap, nRichting)
{
	if ( nStap == 0 )
	{
		document.getElementById(sDiv).style.display = 'none'
		document.getElementById('toevoegenlink' + sDiv).style.display = 'block'
	}
	else
	{
		document.getElementById(sDiv).style.height = Math.floor(nHoogte * Factor(nStap / nAantalStappen)) + 'px'
	}
	if ( nStap != 0 && nStap != nAantalStappen ) setTimeout('Beweeg("' + sDiv + '", ' + (nStap + nRichting) + ', ' + nRichting + ')', 15)
}

function Factor(n)
{
	return (1-Math.cos(n*Math.PI))/2
}

function textCounter(field, maxlimit)
{
	var countfield = field.value.length
	if (field.value.length > maxlimit)
		field.value = field.value.substring(0, maxlimit);
	else
		countfield.value = maxlimit - field.value.length;
}

function printPage()
{
	if (window.print)
	{
		agree = confirm('Click OK to print this page automatically.');
		if (agree) window.print();
	}
}
function CheckComment()
{
	sClassName = (document.getElementById('display').className == 'display-on' ? 'display-off' : 'display-on')
	document.getElementById('display').className = sClassName
}

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}


function savenotitie(sEmpty)
	{
	if ( sEmpty ) document.checkboxform['note'+sEmpty].value = ''
	document.checkboxform.action.value = 'bewaardaanbod_savenote';
	document.checkboxform.submit();
	}