// ---------------- CONTACT --------------------
function viewContact(contactName) {
	window.location = contextPath + "/au/registry/rq/contact/contact_view.faces?tab=2&contactIdParam=" + encodeURIComponent(contactName);
}
function viewContactByRoidPopup(contactRoid) {
	popup(contextPath + "/au/registry/rq/contact/contact_view_popup.faces?tab=2&contactRoidParam=" + encodeURIComponent(contactRoid));
}
function viewContactPopup(contactName) {
	popup(contextPath + "/au/registry/rq/contact/contact_view_popup.faces?tab=2&contactIdParam=" + encodeURIComponent(contactName));
}
function createContact(contactName) {
	window.location = contextPath + "/au/registry/rt/contact/contact_create.faces?tab=2&contactIdParam=" + encodeURIComponent(contactName);
}
function removeContactClientUpdateProhibited(contactId) {	
	window.location =  contextPath + "/au/registry/rt/contact/contact_remove_client_update_prohibited.faces?tab=2&contactIdParam=" + encodeURIComponent(contactId);
}
// ---------------- DOMAIN ---------------------
function createDomain(domainName) {
	window.location = contextPath + "/au/registry/rt/domain/domain_create.faces?tab=2&domainNameParam=" + encodeURIComponent(domainName);
}
function viewDomain(domainName) {
	window.location = contextPath + "/au/registry/rq/domain/domain_view.faces?tab=2&domainNameParam=" + encodeURIComponent(domainName);
}
function viewDomainPopup(domainName) {	
	popup(contextPath + "/au/registry/rq/domain/domain_view_popup.faces?tab=2&domainNameParam=" + encodeURIComponent(domainName) );
}
function removeDomainClientUpdateProhibited(domainName) {	
	window.location =  contextPath + "/au/registry/rt/domain/domain_remove_client_update_prohibited.faces?tab=2&domainNameParam=" + encodeURIComponent(domainName);
}
// ----------------- HOST ----------------------
function createHost(hostName) {
	window.location = contextPath + "/au/registry/rt/host/host_create.faces?tab=2&hostNameParam=" + hostName;
}
function historyHost(hostName) {
	alert("not implemented");
}
function updateHost(hostName) {
	window.location = contextPath + "/au/registry/rt/host/host_update.faces?tab=2&hostNameParam=" + hostName;
}
function viewHost(hostName) {
	window.location = contextPath + "/au/registry/rq/host/host_view.faces?tab=2&hostNameParam=" + hostName;
}
function viewHostPopup(hostName) {
	popup(contextPath + "/au/registry/rq/host/host_view_popup.faces?tab=2&hostNameParam=" + encodeURIComponent(hostName));
}
function removeHostClientUpdateProhibited(hostName) {	
	window.location =  contextPath + "/au/registry/rt/host/host_remove_client_update_prohibited.faces?tab=2&hostNameParam=" + hostName;
}
// ---------------- ZONE --------------------
function zoneUpdateLicence(zoneName) {
    window.location = contextPath + "/au/registry/zone/zone_update_licence.faces?tab=4&zone=" + encodeURIComponent(zoneName);
}
// ---------------- ACCOUNT --------------------
function deleteAccountAny(account) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_delete.faces?tab=4&accountIdParam=" + account;
}
function updateAccountSelf() {
	window.location = contextPath + "/au/my_account/admin/my_account_update.faces?tab=4";
}
function updateAccountAny(account) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_update.faces?tab=4&accountIdParam=" + account;
}
function viewAccountPopup(account) {
	viewAccountAnyPopup(account);
}
function viewAccountSelfPopup() {
	popup(contextPath + "/au/my_account/my_account_view_popup.faces");
}
function viewAccountAnyPopup(account) {
	popup(contextPath + "/au/reg_admin/accounts_and_users/account_view_popup.faces?accountNameParam=" + encodeURIComponent(account));
}
function viewAccountAnyIdPopup(account) {
	popup(contextPath + "/au/reg_admin/accounts_and_users/account_view_popup.faces?accountIdParam=" + account);
}
function modifyAccountPermissions(account) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_modify_permissions.faces?tab=4&accountIdParam=" + account;
}
function modifyAccountZones(account) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_modify_zones.faces?tab=4&accountIdParam=" + account;
}
function suspendAccount(accountId) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_suspend.faces?tab=4&accountIdParam=" + accountId;
}
function unsuspendAccount(accountId) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_unsuspend.faces?tab=4&accountIdParam=" + accountId;
}
// ----------------- USER ----------------------
function modifyUserPermissionsAccount(username) {
	window.location = contextPath + "/au/my_account/admin/user_modify_permissions.faces?tab=4&userNameParam=" + username;
}
function modifyUserPermissionsAny(username) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/user_modify_permissions.faces?tab=4&userNameParam=" + username;
}
function resetUserPasswordAccount(username) {
	window.location = contextPath + "/au/my_account/admin/user_reset_password.faces?tab=4&userNameParam=" + username;
}
function resetUserPasswordAny(username) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/user_reset_password.faces?tab=4&userNameParam=" + username;
}
function suspendUser(username, action) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_suspend.faces?tab=4&userNameParam=" + username + "&suspendParam=" + action;
}
function changePassword() {
	window.location = contextPath + "/change_my_password.jsp?tab=4";
}
function deleteUserAccount(username) {
	window.location = contextPath + "/au/my_account/admin/user_delete.faces?tab=4&userNameParam=" + username;
}
function deleteUserAccount(userId) {
    window.location = contextPath + "/au/my_account/admin/user_delete.faces?tab=4&userIdParam=" + userId;
}
function deleteUserAny(username) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/user_delete.faces?tab=4&userNameParam=" + username;
}
function updateUserAccount(username) {
	window.location = contextPath + "/au/my_account/admin/user_update.faces?tab=4&userNameParam=" + username;
}
function updateUserAccount(userId) {
    window.location = contextPath + "/au/my_account/admin/user_update.faces?tab=4&userIdParam=" + userId;
}
function updateUserAny(username) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/user_update.faces?tab=4&userNameParam=" + username;
}
function suspendUser(userId, action) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_suspend.faces?tab=4&userIdParam=" + userId + "&suspendParam=" + action;
}
function deleteUserAny(userId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_delete.faces?tab=4&userIdParam=" + userId;
}
function updateUserAny(userId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_update.faces?tab=4&userIdParam=" + userId;
}
function modifyUserPermissionsAny(userId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_modify_permissions.faces?tab=4&userIdParam=" + userId;
}
function modifyUserPermissionsAccount(userId) {
    window.location = contextPath + "/au/my_account/admin/user_modify_permissions.faces?tab=4&userIdParam=" + userId;
}
function resetUserPasswordAny(userId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_reset_password.faces?tab=4&userIdParam=" + userId;
}
function resetUserPasswordAccount(userId) {
    window.location = contextPath + "/au/my_account/admin/user_reset_password.faces?tab=4&userIdParam=" + userId;
}
function resetEppUserPassword(userId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/user_reset_password_epp.faces?tab=4&userIdParam=" + userId;
}
function updateUserSelf() {
	window.location = contextPath + "/au/my_account/update_my_details.faces?tab=4";
}
function viewUserAccountPopup(username) {
	popup(contextPath + "/au/my_account/admin/user_view_popup.faces?userNameParam=" + username);
}
function viewUserAccountPopup(userId) {
    popup(contextPath + "/au/my_account/admin/user_view_popup.faces?userIdParam=" + userId);
}
function viewUserAnyPopup(username) {
	popup(contextPath + "/au/reg_admin/accounts_and_users/user_view_popup.faces?userNameParam=" + username);
}
function viewUserAnyPopup(userId) {
    popup(contextPath + "/au/reg_admin/accounts_and_users/user_view_popup.faces?userIdParam=" + userId);
}
function viewUserSelfPopup() {
	popup(contextPath + "/au/my_account/user_view_popup.faces");
}
function viewUser(username) {
	alert ('deprecated: please change to either viewUserSelf, viewUserAccount, or viewUserAny');
}
function viewUserPopup(username) {
	viewUserAnyPopup(username);
}
function viewHelp(url) {
	window.open(contextPath + url, "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}
function openHelpPopup(url) {
	window.open(contextPath + url + ".htm", "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}
function viewHelpMain() {
	window.open(contextPath + "/Registrar_Help/registry_portal_help.htm", "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}
function viewRegistrarHelpMain() {
	window.open(contextPath + "/Registrar_Help/registry_portal_help.htm", "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}
function viewRegistryHelpMain() {
	window.open(contextPath + "/Registry_Help/registry_portal_help.htm", "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}
function viewRegulatorHelpMain() {
	window.open(contextPath + "/Regulator_Help/registry_portal_help.htm", "Help", 'resizable=yes,scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,width=700,height=550');
}


function whoisQuery(qry) {
	window.location = contextPath + "/whois/whois_local.jsp?tab=0&qry=" + encodeURIComponent(qry);
}

function downloadFile(fileId) {
	window.location = contextPath + "/downloadFile?fileId=" + fileId;
}
function downloadFileAny(fileId) {
	window.location = contextPath + "/downloadFile?any=true&fileId=" + fileId;
}


//--------------- Account Contact -----------------------
function viewAccountContactPopup(accName, acId) {
	popup(contextPath + "/au/reg_admin/accounts_and_users/account_contact_view_popup.faces?accountNameParam=" + encodeURIComponent(accName) + "&accountContactIdParam=" + acId);
}
function viewAccountContactPopup(accId, conId) {
    popup(contextPath + "/au/reg_admin/accounts_and_users/account_contact_view_popup.faces?accountIdParam=" + accId + "&accountContactIdParam=" + conId);
}
function updateAccountContact(accName, acId) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_contact_update.faces?tab=4&accountNameParam=" + encodeURIComponent(accName) + "&accountContactIdParam=" + acId;
}
function updateAccountContact(accId, conId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/account_contact_update.faces?tab=4&accountIdParam=" + accId + "&accountContactIdParam=" + conId;
}
function deleteAccountContact(accName, acId) {
	window.location = contextPath + "/au/reg_admin/accounts_and_users/account_contact_delete_confirm.faces?tab=4&accountNameParam=" + encodeURIComponent(accName) + "&accountContactIdParam=" + acId;
}
function deleteAccountContact(accId, conId) {
    window.location = contextPath + "/au/reg_admin/accounts_and_users/account_contact_delete_confirm.faces?tab=4&accountIdParam=" + accId + "&accountContactIdParam=" + conId;
}

//--------------- Audit Log -----------------------
function viewAuditLogPopup(trnid) {
	popup(contextPath + "/au/reg_admin/support_tools/audit_log_popup.faces?trnid=" + encodeURIComponent(trnid));
}

//---------------- File Repository ---------------------
function deleteFile(fileId, accountId) {
	window.location = contextPath + "/au/reg_admin/file_repository/file_delete.faces?tab=4&fileIdParam=" + encodeURIComponent(fileId) + "&accountIdParam=" + encodeURIComponent(accountId);
}