<!-- Begin

function switchMode(pMode)
  strXML=strXML & "<Data>" & vbcrlf
  strXML=strXML & "  <Mode>" & pMode & "</Mode>" & vbcrlf
  strXML=strXML & "</Data>" & vbcrlf
  vResponse =  SendXML(strXML, "/Login/switchMode.asp")
  if vResponse = "ok" Then
    window.top.location.href = window.top.location.href
    'window.top.fraHeader.location.href = window.top.fraHeader.location.href
    'window.top.fraNavigation.location.href = window.top.fraNavigation.location.href
    'window.top.fraMain.location.href = window.top.fraMain.location.href
  end if  
end function

function MouseOver()
  window.event.srcElement.ClassName="LinkAdminOver"
end function
 
function MouseOut()
  window.event.srcElement.ClassName="LinkAdmin"
end function

function OpenDialog(pURL,pWidth,pHeight,pArguments)
  OpenDialog=window.showModalDialog(pURL,pArguments,"dialogheight:" & pHeight & "px;dialogwidth:" & pWidth & "px;resizable:yes;center:yes;help:no;scroll:no;status:no")
end function
        
sub Login()
  rc=OpenDialog("/Login/LoginDialog.asp",300,200,"")
  if left(rc, 9)="status=ok" then 
    window.top.location.href = window.top.location.href
  end if  
end sub

sub securityMenu
  rc=window.showModalDialog("/Mini-apps/Authority/AuthorityListDialog.asp","","dialogheight:460px;dialogwidth:350px;resizable:yes;center:yes;help:no;scroll:no;status:no")
end sub

sub URLShortcut
  rc=window.showModalDialog("/URLShortcut/URLShortcutListDialog.asp","","dialogheight:460px;dialogwidth:350px;resizable:yes;center:yes;help:no;scroll:no;status:no")
end sub

sub SearchRoot
  rc=window.showModalDialog("/Admin/SearchRoot/SearchRootDialog.asp","","dialogheight:250px;dialogwidth:350px;resizable:yes;center:yes;help:no;scroll:no;status:no")
end sub

sub openDlgSwitchUser(pPathToRoot)
  rc=window.showModalDialog(pPathToRoot & "SwitchUser/SwitchUserDialog.asp","","dialogheight:400px;dialogwidth:340px;resizable:yes;center:yes;help:no;scroll:no;status:no")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub reuseContent(pContentID)
  rc=OpenDialog("/admin/ContentListDialog.asp",350,460,"")
	vContentTypeID = getResponseValue(rc, "ContentTypeID")  
	vContentID = getResponseValue(rc, "ContentID")  
  if rc <> "Cancel" AND rc <> "" then
    Content "Add",vContentTypeID,vContentID,pContentID
  end if
end sub
        
sub findPage(pContentTypeID)
  vWidth=340
  if pContentTypeID="1" then
    vHeight=150
  else
    vHeight=150
  end if
  rc=OpenDialog("/Find/FindDialog.asp?ContentTypeID=" & pContentTypeID,vWidth,vHeight,"")
  if rc<>"Cancel" then 
		if window.name = "fraHeader" then
			window.top.fraMain.location.href = "/default.asp?c=" & rc & vNewCrumb
		else  
			window.location.href = "/default.asp?c=" & rc & vNewCrumb
		end if
  end if
end sub
        
sub Content(pAction, pContentTypeID, pContentID, pContentGroupID)
  if pAction="Delete" then
    vHeight=200
    vWidth=380
  else
    vWidth=625
    if pContentTypeID="1" then
      vHeight=520
    else
      vHeight=520
    end if
  end if
  rc=OpenDialog("/admin/ContentDialog.asp?Action=" & pAction & "&ContentTypeID=" & pContentTypeID & "&ContentID=" & pContentID & "&ContentGroupID=" & pContentGroupID,vWidth,vHeight,"")
  if rc="ok" then 
		if window.name = "fraHeader" then
			window.top.fraMain.history.go(0)
		else  
      window.location.href = window.location.href
		end if
  end if
end sub

sub LoadDocument(pContentGroupID)
  vWidth=535
  vHeight=520
  rc=OpenDialog("/admin/document/DocumentDialog.asp?Action=Add&ContentGroupID=" & pContentGroupID,vWidth,vHeight,"")
  if rc="ok" then 
		if window.name = "fraHeader" then
			window.top.fraMain.history.go(0)
		else  
      window.location.href = window.location.href
		end if
  end if
end sub

sub Move(pContentTypeID, pContentGroupID, pContentID)
  vWidth=340
  if pContentTypeID="1" then
    vHeight=150
  else
    vHeight=150
  end if
  rc=OpenDialog("/Move/MoveDialog.asp?ContentTypeID=" & pContentTypeID & "&ContentGroupID=" & pContentGroupID & "&ContentID=" & pContentID,vWidth,vHeight,"")
  if rc="ok" then 
	  if window.name = "fraHeader" then
	    window.top.fraMain.history.go(0)
	  else  
      window.location.href = window.location.href
	  end if
  end if
end sub

sub btnHistory_onclick
  rc=OpenDialog("/action/actionListDialog.asp?Criteria=" & hidHistory.value,600,500,"")
end sub

sub Template(pTemplateID, pContentID, pTypeID)
  if pTypeID = 1 then
    rc=OpenDialog("/Admin/Template/TemplateDialog.asp?TemplateID=" & pTemplateID & "&ContentID=" & pContentID & "&TypeID=" & pTypeID,450,560,"")
    if rc="ok" then 
      window.location.href = window.location.href
    end if  
  else
    rc=OpenDialog("/Admin/Template/TemplateDialog.asp?TemplateID=" & pTemplateID & "&ContentID=" & pContentID & "&TypeID=" & pTypeID,350,560,"")
    if rc <> "Cancel" then 
      ContentTemplateID.value = getResponseValue(rc, "TemplateID")
      ContentTemplate.src = "/images/template/" & getResponseValue(rc, "Image")
    end if  
  end if
end sub

sub contentOrder(pContentID)
  rc=OpenDialog("/Admin/Content/ContentOrderDialog.asp?ContentID=" & pContentID,600,410,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Navigation()
  rc=OpenDialog("/Admin/Navigation/NavigationListDialog.asp",320,410,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Toolbar()
  rc=OpenDialog("/Admin/toolbar/toolbarListDialog.asp",310,260,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Report()
  rc=OpenDialog("/Admin/entity/EntityListDialog.asp?Type=Report",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub MiniApp()
  rc=OpenDialog("/Admin/entity/EntityListDialog.asp?Type=MiniApp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Email()
  rc=OpenDialog("/Admin/email/EmailListDialog.asp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub DocumentCategoryGroup()
  rc=OpenDialog("/Admin/DocumentCategoryGroup/DocumentCategoryGroupListDialog.asp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub DocumentCategory()
  rc=OpenDialog("/Admin/DocumentCategory/CategoryListDialog.asp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub TagCategory()
  rc=OpenDialog("/Admin/TagCategory/CategoryListDialog.asp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub ServiceCategory()
  rc=OpenDialog("/Admin/ServiceCategory/CategoryListDialog.asp",320,300,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Options()
  rc=OpenDialog("/options/OptionsDialog.asp",250,320,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Favourites()
on error resume next
  vPageTitle = window.document.title
  if instr(vPageTitle, ":") then
    vPageTitle = trim(mid(vPageTitle, instr(vPageTitle, ":") + 1))
  end if  
  if len(trim(vPageTitle)) = 0 then
    vPageTitle = "(untitled)"
  end if  
  vPageTitle = escape(vPageTitle)
  vPageURL = escape(window.location.href)
  rc=OpenDialog("/admin/favourite/FavouriteDialog.asp?title=" & vPageTitle & "&url=" & vPageURL,320,240,"")
  if rc="ok" then 
    window.location.href = window.location.href
    'history.go(0)
  end if  
end sub

sub AddExistingResource(pAction, pResourceTypeID, pContentID)
  if pAction="Add" then
    vHeight=370
    vWidth=500
    rc=OpenDialog("/admin/ResourceDialog.asp?Action=" & pAction & "&ResourceTypeID=" & pResourceTypeID & "&ContentID=" & pContentID,vWidth,vHeight,"")
  end if
  if rc <> "Cancel" AND rc <> "" then
    'msgbox "rc:" & rc & ", pContentID:" & pContentID & ", ContentID:" & mid(rc,instr(rc,"System:")+7)
    select case pResourceTypeID
      case 2
        Content "Add","1",mid(rc,instr(rc,"System:")+7),pContentID
      case 21
        Content "Add","2",mid(rc,instr(rc,"System:")+7),pContentID
    end select
  end if
end sub

sub Authority(pAction, pAuthorityType, pAuthorityID)
  if pAction="Delete" then
    vHeight=200
  else
    if pAuthorityType="Group" then
      vHeight=385
    else
      vHeight=385
    end if
  end if
  rc=OpenDialog("/mini-apps/authority/AuthorityDialog.asp?Action=" & pAction & "&AuthorityType=" & pAuthorityType & "&AuthorityID=" & pAuthorityID,375,vHeight,"")
  if rc="ok" then
    window.location.href = window.location.href
  end if  
end sub

sub Staff(pAction, pStaffID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=630
    vHeight=600
  end if
  rc=OpenDialog("/mini-apps/staff/custom/StaffDialog.asp?Action=" & pAction & "&StaffID=" & pStaffID, vWidth, vHeight,"")
  if rc="ok" then history.go(0)
end sub

sub Service(pAction, pServiceID)
  if pAction="Delete" then
    vHeight=200
    vWidth=400
  else
    vHeight=670
    vWidth=710
  end if
  rc=OpenDialog("/mini-apps/service/ServiceDialog.asp?Action=" & pAction & "&id=" & pServiceID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub GP(pAction, pID)
  if pAction="Delete" then
    vHeight=200
    vWidth=400
  else
    vWidth=500
    vHeight=450
  end if
  rc=OpenDialog("/mini-apps/GPs/GPDialog.asp?Action=" & pAction & "&id=" & pID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Practice(pAction, pID)
  if pAction="Delete" then
    vHeight=200
    vWidth=400
  else
    vWidth=500
    vHeight=720
  end if
  rc=OpenDialog("/mini-apps/GPs/PracticeDialog.asp?Action=" & pAction & "&id=" & pID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub CCG(pAction, pID)
  if pAction="Delete" then
    vHeight=200
    vWidth=400
  else
    vWidth=500
    vHeight=430
  end if
  rc=OpenDialog("/mini-apps/GPs/CCGDialog.asp?Action=" & pAction & "&id=" & pID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if  
end sub

sub Job(pAction, pJobID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=510
    vHeight=610
  end if
  rc=OpenDialog("/mini-apps/job/JobDialog.asp?Action=" & pAction & "&JobID=" & pJobID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if
end sub

sub MI(pAction, pMIID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=485
    vHeight=570
  end if
  rc=OpenDialog("/mini-apps/MedicalInformation/MIDialog.asp?Action=" & pAction & "&id=" & pMIID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if
end sub

sub Clinic(pAction, pClinicID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=510
    vHeight=420
  end if
  rc=OpenDialog("/mini-apps/Clinic/ClinicDialog.asp?Action=" & pAction & "&ClinicID=" & pClinicID, vWidth, vHeight,"")
  if rc="ok" then 
    window.location.href = window.location.href
  end if
end sub

sub Forum(pAction, pForumID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=490
    vHeight=470
  end if
  rc=OpenDialog("/mini-apps/forum/forumDialog.asp?Action=" & pAction & "&ForumID=" & pForumID, vWidth, vHeight,"")
  if rc="ok" then history.go(0)
end sub

sub ForumPost(pAction, pForumID, pForumParentPostID, pForumPostID)
  select case pAction
    case "Offline" , "Online"
      vHeight=160
      vWidth=340
    case "Delete" 
      vHeight=160
      vWidth=340
    case "Edit", "Add"
      vWidth=490
      vHeight=470
    case "Report"
      vWidth=490
      vHeight=470
    case "Subject"
      vWidth=480
      vHeight=200
  end select
  'window.alert "Action=" & pAction & "&ForumID=" & pForumID & "&ForumPostID=" & pForumPostID & "&ForumParentPostID=" & pForumParentPostID
  rc=OpenDialog("/mini-apps/forum/forumPostDialog.asp?Action=" & pAction & "&ForumID=" & pForumID & "&ForumPostID=" & pForumPostID & "&ForumParentPostID=" & pForumParentPostID, vWidth, vHeight,"")
  if rc="ok" then history.go(0)
end sub

sub Video(pAction, pVideoID)
  if pAction="Delete" then
    vHeight=150
    vWidth=300
  else
    vWidth=510
    vHeight=500
  end if
  rc=OpenDialog("/mini-apps/video/videoDialog.asp?Action=" & pAction & "&VideoID=" & pVideoID, vWidth, vHeight,"")
  if rc="ok" then history.go(0)
end sub

function getResponseValue(pResponseText, pValue)
  vStart = InStr(pResponseText, pValue & "=")
  pResponseText = replace(pResponseText, "&amp;", "~amp;")
  If vStart > 0 Then
    vEnd = InStr(vStart, pResponseText, "&")
    If vEnd = 0 Then
      vResponseValue = Mid(pResponseText, vStart)
    Else
      vResponseValue = Mid(pResponseText, vStart, vEnd - vStart)
    End If
    vResponseValue = Mid(vResponseValue, Len(pValue) + 2)
  End If
  getResponseValue = replace(vResponseValue, "~amp;", "&")
end function

sub designPage(pContentID)
  if window.name = "fraHeader" then
    window.top.fraMain.location = "/admin/PageDesign.asp?c=" & pContentID
		oPopup.hide
  else  
    window.location = "/admin/PageDesign.asp?c=" & pContentID
  end if
end sub

sub previewPage(pPageURL)
  if window.name = "fraHeader" then
    window.top.fraMain.location = pPageURL
		oPopup.hide
  else  
    window.location = pPageURL
  end if
end sub

sub actions()
  window.location = "/action/actionList.asp"
end sub

sub columnSort(pObj)
  set columnObj = pObj
  columnName = mid(columnObj.id, 4)
  set imageObject = document.getElementById("sort" & columnName)
  if instr(imageObject.src, "one.gif") or instr(imageObject.src, "DESC") then
    vSortDirection = "ASC"
  end if
  if instr(imageObject.src, "ASC") then
    vSortDirection = "DESC"
  end if
  Sort.value = columnName
  SortDirection.value = vSortDirection
  submitForm 1 
end sub

function prevPage()
  submitForm PageNumber.value - 1 
end function

function nextPage()
  submitForm PageNumber.value + 1 
end function

function go()
  submitForm 1 
end function

sub setSearch()
  txtCriteria.select()
end sub

sub documentProperties(pId)
  rc=OpenDialog("/mini-apps/documents/documentStoreDialog.asp?id=" & pId,700,580,"")
  if rc <> "Cancel" AND rc <> "" then
    window.location.href = window.location.href  
  end if
end sub


//  End -->