var actDocID = '' ; var actDocNum = '' ; var actDocForm = '' ; var actObject = null ; var tmpValueArray = new Array () ; var thisForm = null ; var actBrowser = 'w3c' ; var r = 1 ; var previewWindow = null ; if ( document.layers ) actBrowser = 'nn' ; if ( document.getElementById ) actBrowser = 'w3c' ; if ( document.all ) actBrowser = 'ms' ; function load_form () { thisForm = document.forms[docForm] ; if ( view.indexOf ('vwNewKG') == 0 ) return ; window.status = ' '; if ( document.getElementsByTagName ('h2')[0] ) { obj = document.getElementsByTagName ('h2')[0] ; // obj.style.setAttribute ( 'display' , 'None' ) ; var noDocs = document.createTextNode(''); obj.replaceChild(noDocs, obj.firstChild); obj.style.display='None' ; } if ( !top.TopNavi ) return ; if ( isEmbView == 1 ) return ; actHref = document.location.href ; actView = ( actHref.indexOf('?') > -1 ) ? actHref.substring ( actHref.toLowerCase().indexOf('.nsf/') + 5 , actHref.indexOf ('?') ) : view ; if ( actView.toLowerCase() != view.toLowerCase() && actView.length == 32 ) document.location.replace(top.TopNavi.contentLocation); if ( top.TopNavi ) top.TopNavi.contentLocation = actHref ; if ( viewE == 'ExpandView' ) { for ( i = 0 ; i < document.images.length ; i++ ) { img = document.images[i] ; if ( img.name.indexOf('img_') == 0 ) { if ( img ) img.src = expand_img_src ; } } } if ( viewE.indexOf ( 'Expand=' ) > -1 ) { img_id = parent.TopNavi.restrictCat + actExpDoc ; if ( document.images['img_'+ img_id] ) { document.images['img_'+ img_id].src = expand_img_src } } var expandArray = new Array () ; expandArray = (parent.TopNavi.restrictCat + actExpDoc).split ('.') ; tmp_img = '' ; for ( i = 0 ; i < expandArray.length - 1 ; i ++ ) { tmp_img += expandArray[i] ; if ( document.images['img_' + tmp_img] ) document.images['img_' + tmp_img].src = expand_img_src ; if ( i < expandArray.length - 2 ) tmp_img += '.' } load_actionbar (); if ( top.TopNavi.selectedDocID != '' && actBrowser == 'ms' ) { id = top.TopNavi.selectedDocID ; actObject = document.getElementById ( id ) ; if ( actObject ) { actObject.click () ; window.scrollTo( 0 , actObject.offsetTop ); } } } function load_actionbar () { if ( top.TopNavi ) top.TopNavi.load_actionBar ( buttonArray ) ; } function reopen_view ( viewOption ) { document.location.href = dbPath + '/' + view + '?OpenView&' + viewOption ; } function expand_collapse_all ( m ) { url = dbPath + '/' + view + '?OpenView' + viewSingleCategory; ExpColl = '&CollapseView' ; if ( m == 'e' ) ExpColl = '&ExpandView' url += ExpColl ; document.location.href = url ; } function expand_collapse (id) { thisSrc = document.images['img_' + id].src ; if ( thisSrc.toLowerCase().indexOf('expand') > -1 ) ExpColl = 'Expand' ; else ExpColl = 'Collapse' ; if ( viewSingleCategory != '' ) { if ( parent.TopNavi ) parent.TopNavi.restrictCat = id.substring ( 0 , id.indexOf('.') + 1 ) id = id.substring ( id.indexOf('.') + 1 , id.length ) ; } else { if ( parent.TopNavi ) parent.TopNavi.restrictCat = '' ; } if ( ExpColl == 'Expand' && viewCount != '' ) { check_lastCat (id) ; } url = dbPath + '/' + view + '?OpenView' + viewCount + viewStart + viewSingleCategory + '&'+ExpColl+'=' + id //+ '#' + id document.location.href = url } function remove_doc ( addType ) { if ( !addType ) addType = '' ; docSelection = check_docSelection () ; if ( docSelection < 1 ) return alert ( 'Please select at least one document for deletion! ' ) ; if ( !confirm ( 'Do you want to delete ' +docSelection + ' selected document'+((docSelection==1)?'':'s')+'? ' ) ) return ; thisForm.AgentName.value = 'WebEditDocSelection' ; thisForm.ActionType.value = 'delete' + addType ; thisForm.submit () ; } function check_mouseEvent () { empty_var (); eval ( 'try { top.TopNavi.empty_div ()} catch(e) {}' ) // if ( top.TopNavi ) top.TopNavi.selectedDoc = null ; } function open_doc (id) { if ( id == '' || !id ) id = actDocID ; if ( id == '' ) return ( alert ( 'Please select one document! ' ) ) ; url = dbPath + '/' + view + '/' + id + '?OpenDocument' ; document.location.href = url ; } function new_doc ( formName , makeResponse ) { if ( makeResponse ) { if ( actDocID == '' ) return alert ( 'Please select one document to create a response document! ' ) } url = dbPath + '/' + formName + '?OpenForm&id=' + actDocID + '&view=' + view ; document.location.href = url ; } function check_docSelection () { selectedDoc = 0 ; tmpField = thisForm.DocSelection ; if ( tmpField ) { if ( !tmpField.length ) { if ( tmpField.checked && tmpField.value != actDocID ) selectedDoc ++ ; } else { for ( i = 0 ; i < tmpField.length ; i++ ) { if ( tmpField[i].checked && tmpField[i].value != actDocID ) selectedDoc ++; } } } if ( actDocID != '' ) selectedDoc ++; thisForm.DocSelection_Edit.value = actDocID ; return selectedDoc ; } function set_docid ( docID , docNum , docForm ) { actDocID = docID ; if ( docNum ) actDocNum = docNum ; if ( docForm ) actDocForm = docForm ; mark_selected() ; } function empty_var () { objID = 'tr_' + actDocID ; if ( actDocNum != '' ) objID += '_' + actDocNum ; linkObj = ( actBrowser == 'ms' ) ? document.all[objID] : document.getElementById(objID); if ( linkObj ) linkObj.className = linkObj.className.replace ( 'Click' , '' ) ; actDocID = '' ; actDocNum = '' ; actDocForm = '' ; actDocEditor = '' ; } function mark_selected() { objID = 'tr_' + actDocID ; if ( actDocNum != '' ) objID += '_' + actDocNum ; linkObj = document.getElementById(objID); if ( linkObj ) linkObj.className += 'Click' ; actObject = linkObj ; top.TopNavi.selectedDoc = linkObj ; top.TopNavi.selectedDocID = linkObj.id ; } function mark_nextDoc ( n ) { if ( !actObject || actBrowser != 'ms' ) return ; nextObject = ( n == 40 ) ? actObject.nextSibling : actObject.previousSibling ; if ( nextObject ) { while ( nextObject.id == '' ) { actObject = nextObject ; mark_nextDoc ( n ) ; if ( !nextObject ) break ; } empty_var (); if ( nextObject ) nextObject.click(); } return false; } function do_navigate (direction) { i = ( direction == 'prev' ) ? 0 : 1 ; newFunction = document.links[i].onclick.toString () ; ind1 = newFunction.indexOf ( 'return ' )+ 7 ; ind2 = newFunction.lastIndexOf (')') + 1; newFunction = newFunction.substring ( ind1 , ind2 ) ; eval ( newFunction ) ; } function check_lastCat (id) { imgL = document.images.length; lastImg = document.images[imgL-1] ; if ( lastImg ) { if ( lastImg.name.indexOf('img_') == 0 ) { imgCount = 0 ; for ( i = 0 ; i < imgL ; i++ ) { tmpImg = document.images[i] ; if ( tmpImg.name.indexOf('img_') == 0 ) imgCount ++ ; } lastID = lastImg.name.split('_')[1] ; if ( lastID == id && lookupCount == imgCount ) viewStart = '&Start=' + lastImg.name.split('_')[1] ; } } } function get_selection ( arg , wi , hi , nextFunction , selectionType ) { url = dbPath + '/dlgSelectList?OpenForm' ; if ( selectionType == 'names' ) url = dbPath + '/dlgAddressForm?OpenForm' ; if ( selectionType == 'picklist' ) url = dbPath + '/dlgPickListView?OpenForm' ; if ( arg ) url += arg ; height = ( hi ) ? hi : 310 ; width = ( wi ) ? wi : 300 ; modalWindow = null ; if (window.showModalDialog) { tmpValueArray = window.showModalDialog(url,'','status=no;dialogWidth='+width+'px;dialogHeight='+height+'px;') ; if ( tmpValueArray ) eval ( nextFunction ) } else { height = height - 30 ; width = width - 10 ; posTop = ( screen.height - height ) / 2 ; posLeft = ( screen.width - width ) / 2 ; modalWindow = window.open ( url + '&nextfunction=window.opener.'+nextFunction ,'', 'dependent=yes,width='+width+'px,height='+height+'px,top='+posTop+',left='+posLeft) ; modalWindow.focus() ; } } function do_edit () { if ( actDocID != '' ) document.location.href = dbPath + '/' + view + '/' + actDocID + '?EditDocument' ; } function refresh_embView ( ) { for ( i = 0 ; i < refresh_embView.arguments.length ; i++ ) { viewName = refresh_embView.arguments[i] ; get_viewObject ( viewName ) ; if ( viewObject ) viewObject.document.location.href = viewObject.document.location.href ; } } function get_viewObject ( objName ) { if ( actBrowser == 'ms' ) { viewObject = eval ( 'document.' + objName ) ; } if ( actBrowser == 'w3c' ) { viewObject = document.getElementById (objName).contentWindow ; viewObject.focus(); } return viewObject ; } function show_img ( img ) { posX = event.x ; posY = event.y ; previewDiv = document.getElementById ( 'tmpDIV' ) ; if ( !previewDiv ) return ; previewDiv.innerHTML = '<' + img + ' border=1>' ; previewDiv.style.top = posY + 15 + document.body.scrollTop ; previewDiv.style.left = posX + 20; } function hide_img () { previewDiv = document.getElementById ( 'tmpDIV' ) ; if ( previewDiv ) previewDiv.innerHTML = '' ; } function start_agent ( agentName , params , confirmMsg ) { if ( confirmMsg ) { if ( !confirm ( confirmMsg ) ) return ; } url=dbPath+'/'+agentName+'?OpenAgent' + params ; top.DummyFrame.location.href = url ; } function select_all ( flag ) { tmpField = thisForm.DocSelection ; if ( tmpField ) { if ( !tmpField.length ) tmpField.checked = flag ; else { for ( i = 0 ; i < tmpField.length ; i++ ) { tmpField[i].checked = flag ; } } } }