function ArticlePAFSetup(formId,translation,files) {
	var form = document.getElementById(formId);
	var dirs = getChildrenWithId(form,"serverDirs")[0];
	form.imageSelector = getChildrenWithId( form , "imageSelector" )[0];
	dirs.options.length = translation.length - 1;
	for( var i = 1 ; i < translation.length ; i++ ) {
		dirs.options[i-1].text = translation[i];
	}
	dirs.files = files;
	dirs.onchange = function( dir ) {
		var panel = getChildrenWithId( this.form , "serverBrowser" )[0];
		while( panel.childNodes.length > 0 ) panel.removeChild( panel.firstChild );
		for( var i = 0 ; i < this.files.length ; i++ ) if( this.files[i][1] == this.selectedIndex + 1 ) {
			//alert( this.files[i][0] );
			var image = document.createElement( "img" );
			panel.appendChild( image );
			image.fileName = this.files[i][0];
			image.path = this.options[ this.selectedIndex ].text + "/" + this.files[i][0];
			image.src = image.path;
			image.title = this.files[i][0];
			image.onclick = function() {
				form.serverFile.value = this.path;
				form.imageSelector.roll();
			}
			image.onerror = function() {
				this.src = 'documents/dir.gif';
				this.onclick = function() {
					for( var i = dirs.selectedIndex+1 ; i < dirs.options.length; i++ ) {
						if( dirs.options[i].text == dirs.options[dirs.selectedIndex].text + "/" + this.fileName ) {
							dirs.selectedIndex = i;
							dirs.onchange();
							return;
						}
					}
				}
			}
		}
	}
	dirs.onchange();
	form.locationType.onchange = function() {
		dirs.style.display = "none";
		form.URL.style.display = "none";
		form.localFile.style.display = "none";
		if( this.selectedIndex == 0 ) {
			dirs.style.display = "";
			dirs.onchange();
		} else {
			var panel = getChildrenWithId( this.form , "serverBrowser" )[0];
			while( panel.childNodes.length > 0 ) panel.removeChild( panel.firstChild );
			var image = document.createElement( "img" );
			panel.appendChild( image );

			if( this.selectedIndex == 1 ) form.URL.style.display = "";
			else if( this.selectedIndex == 2 ) form.localFile.style.display = "";
		}
	}
	form.URL.onkeyup = function() {
		var panel = getChildrenWithId( this.form , "serverBrowser" )[0];
		panel.firstChild.src = this.value;
	}
	form.imageSelector.roll = function() {
		this.style.visibility = ( this.style.visibility == "hidden" ) ? "" : "hidden";
		this.style.left = parseInt(document.body.clientWidth)/2-parseInt(this.offsetWidth)/2 + "px";
		this.style.top = Math.max( 100 , parseInt(document.body.clientHeight)/2-parseInt(this.clientHeight)/2 ) + "px" ;
	}
	
}
