azfGeenVoorkeurString = "Maak een keuze";

function azfButtonHTML()	{
	addInitFunction( azfButtonInit );
	addStepFunction( azfButtonStep );
	var s = "";
	s += layerStartHTML( window.azfButtonLayerId = UI(), "width:100%;text-align:right;" );
	s += '<nobr>';
	s += moImageHTML( eImageArray( "/azf/images/but_wis_out.gif", "/azf/images/but_wis_over.gif" ), "javascript: void( azfButtonWis() );", "Wissen" );
	s += '<img src="/azf/images/spacer.gif" width="3" height="1" border="0" alt="">';
	s += moImageHTML( eImageArray( "/azf/images/but_ok_out.gif", "/azf/images/but_ok_over.gif" ), "javascript: void( azfButtonOk() );", "Ok" );
	s += '</nobr>';
	s += endHTML();
	return s;
	}
function azfButtonInit()	{
	window.azfButtonLayer = window.document.getElementById( window.azfButtonLayerId );
	window.azfForm = window.document.getElementById( "azf" );
	}
function azfButtonStep()	{
	window.azfButtonLayer.style.display = window.azfIsOpen ? "none" : "block";
	}
function azfButtonOk()	{
	window.azfForm.submit();
	}
function azfButtonWis()	{
	for( var c = 0; c < window.azfCollection.length; c++ )	{
		window.azfCollection[ c ].wis();
		}
	for( var c = 0; c < window.azfCollection.length; c++ )	{
		window.azfCollection[ c ].updateValue();
		}
	}

function azfPopButtonHTML()	{
	var s = "";
	s += moImageHTML( eImageArray( "/azf/images/but_wis_out.gif", "/azf/images/but_wis_over.gif" ), "javascript: void( azfPopButtonWis() );", "Wissen" );
	s += '<img src="/azf/images/spacer.gif" width="3" height="1" border="0" alt="" />';
	s += moImageHTML( eImageArray( "/azf/images/but_ok_out.gif", "/azf/images/but_ok_over.gif" ), "javascript: void( azfPopButtonOk() );", "Ok" );
	return s;
	}
function azfPopButtonOk()	{
	if( window.azfIsOpen )	{
		window.azfIsOpen.ok();
		}
	}
function azfPopButtonWis()	{
	if( window.azfIsOpen )	{
		window.azfIsOpen.wis();
		}
	}


window.azfPopCollection = new Array();
function AzfPop()	{
	this.toString = new Function( "return 'window. azfPopCollection[ " + window.azfPopCollection.length + " ]';" )
	window.azfPopCollection[ window.azfPopCollection.length ] = this;

	this.formId = arguments[ 0 ];
	this.searchRowId = "azf" + this.formId + "SearchRow";
	this.selectRowId = "azf" + this.formId + "SelectRow";

	this.popSpeed = 0.5;
	this.popZIndex = 100;
	this.popBgColor = "#ffffff";

	this.isOpen = false;
	}
AzfPop.prototype.startHTML = function()	{
	var s = '';
	with( this.pop = new LayerTransition() )	{
		speed = this.popSpeed;
		s += layerStartHTML( layerId, "display:hidden;/*z-index:" + this. popZIndex + ";*/background-color:" + this. popBgColor + ";" );
		}
	return s;
	}
AzfPop.prototype.init = function()	{
	this.form = window.document.getElementById( this.formId );
	this.pop.init();
 	}
AzfPop.prototype.step = function()	{
	var searchRow = window.document.getElementById( this.searchRowId );
	var selectRow = window.document.getElementById( this.selectRowId );
	if( this.isOpen && !this.pop.visible )	{
		searchRow.style.display = '';
		selectRow.style.display = 'none';
		this.pop.transition = "wipeInFromTop";
		}
	else if( !this.isOpen && this.pop.visible )	{
		searchRow.style.display = 'none';
		selectRow.style.display = '';
		this.pop.transition = "snapOut";
		}
	this.pop.step();
	}
AzfPop.prototype.getDisplayValue = function()	{
	if( this.getValue() )	{
		return this.getValue();
		}
	else	{
		return azfGeenVoorkeurString;
		}
	}
AzfPop.prototype.getValue = function()	{
	}
AzfPop.prototype.setPosition = function()	{
	this.pop.layer.style.left = arguments[ 0 ];
	this.pop.layer.style.top = arguments[ 1 ];
	}




window. azfCollection = new Array();
function Azf()	{
	this.toString = new Function( "return 'window.azfCollection[ " + window.azfCollection.length + " ]';" )
	window.azfCollection[ window.azfCollection.length ] = this;

	this.imageSrc = "/azf/images/zoeknavigatie/lblauw_groot_rechts.gif";
	this.imageSrcOpen = "/azf/images/zoeknavigatie/lblauw_groot_beneden.gif";
	this.valueStyleClass = "zoekenTekst";
	this.titleStyleClass = "zoekenKop";
	this.valueElementId = arguments[ 0 ];

	this.pop = new Array();

	addInitFunction( new Function( this + ".init();" ) );
	addStepFunction( new Function( this + ".step();" ) );
	}
Azf.prototype.imageHTML = function()	{
	var s = '';
	s += '<a';
	s += ' href="javascript: void( ' + this + '.click() );"';
	s += ' onclick = "' + this + '.click(); return false;" ';
	s += ' onfocus = "this.blur();" ';
	s += '>';
	s += ( this.multiImage = new MultiImage( eImageArray( this.imageSrc, this.imageSrcOpen ) ) ).HTML();
	s += '</a>';
	return s;
	}
Azf.prototype.valueHTML = function()	{
	var s = '';
	s += layerStartHTML( this.valueLayerId = UI(), "position:relative; width:100%; height:100%" );
	s += '';
	s += endHTML();
	return s;
	}
Azf.prototype.valueContentHTML = function()	{
	var s = '';
	s += '<a';
	s += ' href="javascript: void( ' + this + '. click() );"';
//	s += ' onclick = "' + this + '.click(); return false;" ';
	s += ' onfocus = "this. blur();" ';
	s += ' class="' + this. valueStyleClass + '"';
	s += '>';
	s += this. activePop. getDisplayValue();
	s += '</a>';
	return s;
	}
Azf.prototype.titleHTML = function()	{
	var s = '';
	s += '<a';
	s += ' href="javascript: void( ' + this + '. click() );"';
//	s += ' onclick = "' + this + '.click(); return false;" ';
	s += ' onfocus = "this.blur();" ';
	s += ' class="' + this.titleStyleClass + '"';
	s += '>';
	s += arguments[ 0 ];
	s += '</a>';
	return s;
	}
Azf.prototype.init = function()	{
	for( var c = 0; c < this.pop.length; c++ )	{
		this.pop[ c ].init();
		}
	this.valueLayer = window.document.getElementById( this.valueLayerId );
	this.valueElement = window.document.getElementById( this.valueElementId );
	this.multiImage.init();
	this.updateValue();

//--- elmer 20020304 debug begin
	this.complete	=	true;
//--- elmer 20020304 debug einde
 	}
Azf.prototype.step = function()	{
	for( var c = 0; c < this.pop.length; c++ )	{
		this.pop[ c ].step();
		}
	this.multiImage.set( this.activePop.isOpen ? 1 : 0 );
	}
Azf.prototype.updateValue = function()	{
	this.valueElement.value = this.activePop.getValue();
	this.valueLayer.innerHTML = this.valueContentHTML();
	}
Azf.prototype.click = function()	{
//--- elmer 20020304 debug begin
	if(	this.complete	)	{
		if( window.azfIsOpen == this )	{
			this.close();
			}
		else	{
			this.open();
			}
		}
//--- elmer 20020304 debug einde
	}
Azf.prototype.open = function()	{
	if( window.azfIsOpen )	{
		window.azfIsOpen.close();
	}
	window.azfIsOpen = this;
	this.activePop.setPosition( getPageX( this.multiImage.image ), getPageY( this.multiImage.image ) + this.multiImage.image.height );
	this.activePop.isOpen = true;
	}
Azf.prototype.onClose = function()	{
	}
Azf.prototype.close = function()	{
	window.azfIsOpen = null;
	for( var c = 0; c < this.pop.length; c++ )	{
		this.pop[ c ].isOpen = false;
		}
	this.updateValue();
	this.onClose();
	}
Azf.prototype.appendPop = function()	{
	this.pop[ this.pop.length ] = arguments[ 0 ];
	if( !this.activePop )	{
		this.activePop = this.pop[ 0 ];
		}
	}
Azf.prototype.setActivePop = function()	{
	this.activePop = this.pop[ arguments[ 0 ] ];
	this.close();
	}
Azf. prototype.ok = function()	{
	this.close();
	}
Azf.prototype.wis = function()	{
	for( var c = 0; c < this.pop.length; c++ )	{
		this.pop[ c ].form.reset();
		}
	}

jsLoaded = true;