<?xml version="1.0"?>
<component>
<?component error="true" debug="true"?>
<registration
	description="custfunctions"
	progid="custfunction.wsc"
	version="1.00"
	classid="{4F51571C-1DFC-4769-B8DD-37B356378F12}"
>
</registration>

<public>

<!-- properties -->
	<property name="Oracle">
		<put/>
	</property>
	<property name="__Log">
		<put/>
	</property>
	<property name="__DoLog">
		<put/>
	</property>
	<property name="safe">
		<put/>
	</property>

<!-- methods -->
	<method name="API_PHONEBOOK">
		<PARAMETER name="prs_key"/>
		<PARAMETER name="data"/>
	</method>
</public>

<script language="javascript">
<![CDATA[

/*	properties	*/
function put_Oracle(newValue)	{Oracle		= newValue};
function put___Log(newValue)	{__Log		= newValue};
function put___DoLog(newValue)	{__DoLog	= newValue};
function put_safe(newValue)	    {safe		= newValue};

/*
   $Revision$
   $Id$
*/


API_PHONEBOOK =
function (prs_key, data)
{
   var result = {};
   //
       // Hoofdlocatie
   //
   if (data.werkplekken.length)
   {
       var txt = "";
       var wp;
       var wplabel = "Hoofdlocatie:";
       var loc_key = -1;
       for (wp in data.werkplekken)
       {
           if (!data.werkplekken[wp].prs_werkplek_aanduiding.isVirtueel && wp < 1)  // pak er maar eentje, TODO hoofdwerkplek
           {
              //  trs += "<tr><td>"+wplabel+"</td><td>" + data.werkplekken[wp].prs_werkplek_aanduiding + "</td></tr>";
               txt +=  data.werkplekken[wp].prs_werkplek_aanduiding;
               loc_key = data.werkplekken[wp].alg_locatie_key;

           }
       }
       result.demo_locatie = safe.html(txt);
   }
   //
   // Klikbaar e-mailadres
   //
   if (data.prs_perslid_email)
   {
        result.demo_mailto = "<a href='mailto:" + data.prs_perslid_email + "'>" + data.prs_perslid_email + "</a>";
   }

   return result;
};

]]>
</script>
</component>