<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 0 Transitional//EN">
<html>
<head>
	<style type="text/css">
		a {font-weight:bold;}
		td {width:270px;}
		input{width:200px;}
		table {border:0;}
		select {width:200px;} 
	</style>
	
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link rel="stylesheet" type="text/css" media="screen, projection" href="dataDelivery.css"/>
    <script type="text/javascript" src='/registryEbxml/dwr/engine.js'></script>
    <script type="text/javascript" src='/registryEbxml/dwr/util.js'></script>
    <script type='text/javascript' src='/registryEbxml/dwr/interface/RegistryWeb.js'></script>
    <script type='text/javascript' src='/registryEbxml/dataDeliveryUtil.js'></script>
    <script type='text/javascript' src='/registryEbxml/validateForm.js'></script>
    <title>Data Delivery Registry Admin: Add New Organization</title>
</head>

<body onLoad="populateFormData('Organization')">  

<span id="titleSpan" style="font-weight:bold; font-size:20pt"></span>
<p>
<a href="javascript:javascript:history.go(-1)">Back</a>
<br>
<a href="RegistryOrganizationMenu.html">Organization Search</a>
<a href="RegistryUserMenu.html">User Search</a>
<hr width="500" align="left"/>
<button id="deleteOrgButton" onclick="deleteParty()">Delete Organization</button> 
<button id="modifyOrgButton" onclick="goToModifyOrg()">Modify Organization</button>
<h4>Organization Name</h4>
<table>
	<tr>
		<td>Organization ID</td>
		<td><input id="idText" type="text"/></td>
	</tr>
 	<tr>
 		<td>Organization Name</td>
 		<td><input id="organizationNameText" type="text"/></td>
 	</tr>
 	<tr>
 		<td>Local Registry Admin</td>
 		<td><span id="primaryContactSpan">Not Specified</td>
 	</tr>
</table>
<hr width="100" align="left"/>
<h4>Primary Address</h4>
<table>
	<tr>
		<td>Address Type</td>
		<td><select id="addressTypeSelect"></select></td>
	</tr>
	<tr>
		<td>Address 1</td>
		<td><input id="streetAddress1Text" type="text"/></td>
	</tr>
	<tr>
		<td>Address 2</td>
		<td><input id="streetAddress2Text" type="text"/></td>
	</tr>
	<tr>
		<td>City</td>
		<td><input id="cityText" type="text"/></td>
	</tr>
	<tr>
		<td>State/Province</td>
		<td><select id="stateSelect"\></td>
	</tr>
	<tr>
		<td>Country</td>
		<td><select onclick="populateStates('stateSelect')" id="countrySelect"\></td>
	</tr>
	<tr>
		<td>Postal Code</td>
		<td><input id="postalCodeText" type="text"/></td>
	</tr>
</table>

<hr width="100" align="left"/>

<h4>Primary Telephone</h4>
<table>
	<tr>
		<td>Telephone Type</td>
		<td><select id="telephoneTypeSelect"></select></td>
	</tr>
	
	<tr>
		<td>Telephone Number</td>
		<td>(<input id="areaCodeText" type="text" maxlength=3 style='width: 28px;'/>)
		<input id="phone1Text" type="text" maxlength=3 style='width: 28px;'/>-
		<input id="phone2Text" type="text" maxlength=4 style='width: 36px;'/>
		Ext:<input id="extensionText" type="text" maxlength=8 style='width: 70px;'/>
		</td>
	</tr>
</table>

<hr width="100" align="left" />
<h4>Primary Email</h4>

<table>
	<tr>
		<td>Email Type</td>
		<td><select id="emailTypeSelect"></select></td>
	</tr>
	<tr>
		<td>Email Address</td>
		<td><input id="emailText" type="text" style='width: 260px;'/>
	</tr>
</table>

<hr width="100" align="left"/> 
<p>
<button id="userActionButton" type="button" onclick="partyAction()"/>
</body>

<script language="JavaScript"> 
	/*
	 * The user currently be looked at by this page.  Null if none
	 */
	self.userId = getUserId();
	
	/* 
	 * The current mode of the page.  Valid modes are 'add', 'modify', and 'view'
	 * The add mode is used when adding a new user to the registry
	 * The modify mode is used when modifying a user in the registry
	 * The view mode is used when viewing a user in the registry
	 */
	self.mode=getMode()
	
	RegistryWeb.getUserIdsAndNames(function(users){
		//clearComboBox("primaryContactSelect");
		//addOptionToList("primaryContactSelect","","");
		//for(var i = 0; i < users.length; i+=3){
			//addOptionToList("primaryContactSelect",users[i+2]+", "+users[i+1]+" ("+users[i]+")", users[i]);
		//}
	});
	
	/*
	 *  This function redirects the browser to the registry user interface in the modify mode
	 */
	function goToModifyOrg(){
		window.location="RegistryOrganizationInterface.html?id="+self.userId+"&mode=modify"
	}


</script>
</html>