// JS - framebuster
//if(top!=self)
//top.location='http://www.funda.nl/'

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('Klik op OK om deze pagina automatisch te printen.');
		if (agree) window.print();
	}
}
function CheckComment()
{
	sClassName = (document.getElementById('display').className == 'display-on' ? 'display-off' : 'display-on')
	document.getElementById('display').className = sClassName
}

function checkAll(field)
{
if(field.length)
for (i = 0; i < field.length; i++)
	{
	field[i].checked = true ;
	}
	field.checked = true ;
}

function uncheckAll(field)
{
if(field.length)
for (i = 0; i < field.length; i++)
	{
	field[i].checked = false ;
	}
	field.checked = false ;
}
function savenotitie(sEmpty)
	{
	if ( sEmpty ) document.checkboxform['note'+sEmpty].value = ''
	document.checkboxform.action.value = 'bewaardaanbod_savenote';
	document.checkboxform.submit();
	}
	
// Funda Tag
var toggle=0;

function FundaTagToggle(){
	toggle==0?FundaTagOpen():FundaTagClose();
}

function FundaTagOpen(){
	document.getElementById("FunTagArrow").src= "/img/koop/icn-arrow-down.gif";
	document.getElementById("FundaTagBar").style.border = "1px solid #999"
	document.getElementById("FundaTagForm").style.display = "block";
	document.getElementById("FundaOptionalTagTextArea").focus();
	toggle=1;
}

function FundaTagClose(){
	document.getElementById("FunTagArrow").src= "/img/koop/icn-arrow-right.gif";
	document.getElementById("FundaTagBar").style.border = "1px solid #fff"
	document.getElementById("FundaTagBar").style.borderTop =  "1px solid #999"
	document.getElementById("FundaTagForm").style.display = "none";
	toggle=0;
}

function FundaTagSubmit(){
	document.getElementById("FundaTagBar").style.display = "none";
	document.getElementById("FundaTagGratitude").style.display = "block";
	return false;
}