function dummy(){return} function ShowNotify(){ 	document.getElementById('notifydiv').style.display=''; 	document.forms[0].fdBody.value = "Please follow this link to download. "; 	document.forms[0].fdSubject.value = document.forms[0].fdFileName.value}function Notify(){		if(document.forms[0].fdSendTo.value == '' | document.forms[0].fdSubject.value == ''){	alert(' Please fill in Subject and Receiver');	}else{		xmlHttp=getXMLHTTP();	if(xmlHttp){		var path = window.location.pathname;		var host = document.forms[0].Server_Name.value		var filePath = document.forms[0].dpWebLibraryPath.value		var Message= new String("");		var url = 'http://' + host + filePath + '/ag.i7.SendNotify?OpenAgent&&http://'+ host + filePath + '&&'  +webDocumentKey+'&&notab';		xmlHttp.open("POST", url, true);		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		xmlHttp.send(buildPOST2(document.forms[0]));		xmlHttp.onreadystatechange = function() {	    		if (xmlHttp.readyState == 4 && xmlHttp.responseText ) {				if(xmlHttp.responseText.indexOf("<title>Server")!=-1){					alert("You are not logged in. Please reload page");				}else{//					alert(xmlHttp.responseText);					if(xmlHttp.responseText.indexOf("Success")!=-1){						document.forms[0].fdSendTo.value=''					document.forms[0].fdSubject.value=''					document.forms[0].fdBody.value=''					switchMenu('notifydiv');					alert('Notify sent successfully');					}else{									//alert(xmlHttp.responseText); 					} 				}			 			}		 		} 	} 	}} function switchMenu(obj) {	var el = document.getElementById(obj);	if ( el.style.display != 'none' ) {	el.style.display = 'none';	}	else {	el.style.display = '';	}}function ProcessDeletion(thisdoc,unid,mainunid, divname,dofunc){if (confirm("Are you sure you want to delete this document?")){document.getElementById(divname).innerHTML='<img src="im.ft.web.loading.gif" border=0 title=loading>&nbsp;Deleting and re-processing documents...  '	xmlHttp2=getXMLHTTP();	if(xmlHttp2){		var path = window.location.pathname;		var host = document.forms[0].Server_Name.value		var filePath = document.forms[0].dpWebLibraryPath.value		var Message= new String("");		var isValidated = new String('No');				var url = 'http://' + host + filePath + '/ag.i7.DeleteDocument?OpenAgent&&'+ unid+'&&'+ new Date().valueOf();		xmlHttp2.open("POST", url, true);		xmlHttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		xmlHttp2.send(buildPOST2(thisdoc.forms[0]));		xmlHttp2.onreadystatechange = function() {     		if (xmlHttp2.readyState == 4 && xmlHttp2.responseText ) {				if(xmlHttp2.responseText.indexOf("<title>Server")!=-1){					alert("You are not logged in. Please reload page");				}else{				if(xmlHttp2.responseText.indexOf("SUCCESS")!=-1){				dofunc(thisdoc,unid,mainunid)				}				}						}				}	}}}function DeleteFileContainer(thisdoc,unid,mainunid){ProcessDeletion(thisdoc,unid,mainunid, 'ValidationHolder', AfterDeleteFileContainer)}function DeleteAttachment(thisdoc,unid){ProcessDeletion(thisdoc,unid,'', 'Attachments', AfterDeleteAttachment)}function AfterDeleteAttachment(thisdoc, unid, mainunid){LoadAttachments(document.forms[0], 'Yes')}function AfterDeleteFileContainer(thisdoc,unid,mainunid){	var gridPanel = window.parent.ExtndApp.ui.tabPanel.findById('xnd-grid-panel');	var grid = gridPanel.items.items[0];	var bbar = grid.getBottomToolbar();	bbar.store.load(); 		window.parent.ExtndApp.ui.tabPanel.remove('pnl-' + unid)}function addClassName(el, sClassName) {		 var s = el.className;		 var p = s.split(" ");		 var l = p.length;		 for (var i = 0; i < l; i++) {		 		 if (p[i] == sClassName)		 		 		 return;		 }		 p[p.length] = sClassName;		 el.className = p.join(" ").replace( /(^\s+)|(\s+$)/g, "" );}function removeClassName(el, sClassName) {		 var s = el.className;		 var p = s.split(" ");		 var np = [];		 var l = p.length;		 var j = 0;		 for (var i = 0; i < l; i++) {		 		 if (p[i] != sClassName)		 		 		 np[j++] = p[i];		 }		 el.className = np.join(" ").replace( /(^\s+)|(\s+$)/g, "" );}/****************** ATTACHMENTS ***************************************/function newattachmentjava (UNID){	showPopWin(webLibraryPath+'/fm.i7.WEB.Uploadapplet?openform&ParentUNID='+UNID, 450, 400, null);}function DeleteAttachment2(UNID){	if(UNID == '') return;	var host = document.forms[0].Server_Name.value	var filePath = document.forms[0].dpWebLibraryPath.value	var queryString = 'http://' + host + filePath + '/(vw.xArc.Index.DocumentsByKey)/'+UNID+'?DeleteDocument';	doRemoteQuery(queryString);		alert(XMLHTTPStore);	}function LoadAttachments(thisform, editmode){	if(!editmode){editmode='empty'}	//document.getElementById("Attachments").innerHTML="Fetching Attachments documents...please wait"	document.getElementById("Attachments").innerHTML='<img src="../im.FT.Web.loading.gif" border=0 title=loading>'					//var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  	xmlHttpA=getXMLHTTP();	//'alert("Validtion begins");	if(xmlHttpA){		var path = window.location.pathname;		var host = document.forms[0].Server_Name.value		var filePath = document.forms[0].dpWebLibraryPath.value		var Message= new String("");		var isValidated = new String('No');				var url = 'http://' + host + filePath + '/ag.BE.FilePile.Attachments?OpenAgent&&'+ filePath+"&&" +webDocumentKey+ '&&'+editmode+'&&' + new Date().valueOf();		xmlHttpA.open("POST", url, true);		xmlHttpA.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		xmlHttpA.send(buildPOST2(thisform));		xmlHttpA.onreadystatechange = function() {	     		if (xmlHttpA.readyState == 4 && xmlHttpA.responseText ) {				if(xmlHttpA.responseText.indexOf("<title>Server")!=-1){					alert("You are not logged in. Please reload page");				}else{			//alert(xmlHttp.responseText);				    	document.getElementById("Attachments").innerHTML=xmlHttpA.responseText;				    	var st = new SortableTable(document.getElementById("AttachmentTable"), ['none', 'String', 'String', 'String', 'Number']);					st.onsort = function () {		 			var rows = st.tBody.rows;		 			var l = rows.length;		 			for (var i = 0; i < l; i++) {		 		 		removeClassName(rows[i], i % 2 ? "odd" : "even");		 		 		addClassName(rows[i], i % 2 ? "even" : "odd");		 			}					};					st.sort(1);								}						}				}	}} function ShowDocumentInPanel(href, unid, title){var entry = parent.ExtndApp.ui.tabPanel.getItem('pnl-'+unid);var panelId = 'pnl-' + unid;                if(!entry){       var iframe = parent.Ext.DomHelper.append(document.body, {          tag: 'iframe',           frameBorder: 0,           src:  href,          id: unid,          style: {width: '100%', height: '100%'}      });       parent.ExtndApp.ui.tabPanel.add({        id: panelId,        contentEl: iframe.id,        title: parent.Ext.util.Format.ellipsis(title,16),         layout: 'fit',        closable: true      }).show();      var panel = parent.Ext.getCmp(panelId);            var dom = parent.Ext.get(unid).dom;      var event = parent.Ext.isIE ? 'onreadystatechange' : 'onload';      dom[event] = (function() {       // var cd = parent.ExtndApp.ui.contentWindow || window.frames[parent.ExtndApp.ui.name];       // var title = cd.document.title;        if (title != "") {          panel.setTitle(parent.Ext.util.Format.ellipsis(title,16));        } else {          panel.setTitle("Untitled");        }      }).createDelegate(dom);    } else { // we've already opened this document      entry.show();    }}function RefreshDocumentInPanel(oldunid,href, unid, title){ExtndApp.ui.tabPanel.remove('pnl-' + oldunid)ShowDocumentInPanel(href, unid, title)}function AjaxValidate(thisform, dofunc) {	xmlHttp=getXMLHTTP();	if(xmlHttp){		var path = window.location.pathname;		var host = document.forms[0].Server_Name.value		var filePath = document.forms[0].dpWebLibraryPath.value		var Message= new String("");		var isValidated = new String('No');					var url = 'http://' + host + filePath + '/ag.i7.AjaxValidate?OpenAgent&' + thisform.fdDocumentClass.value;		xmlHttp.open("POST", url, true);		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		xmlHttp.send(buildPOST2(thisform));		xmlHttp.onreadystatechange = function() {	     		if (xmlHttp.readyState == 4 && xmlHttp.responseText ) {				if(xmlHttp.responseText.indexOf("<title>Server")!=-1){				alert("You are not logged in. Please reload page");				}else{					eval(xmlHttp.responseText);					if (isValidated == 'Yes'){dofunc()};				}						}				}	}}function buildPOST2(theForm) {	var qs = ''	for (e=0;e<theForm.elements.length;e++) {		if(theForm.elements[e].name){	if (theForm.elements[e].type.toLowerCase() == 'text'||theForm.elements[e].type.toLowerCase() == 'textarea'||theForm.elements[e].type.toLowerCase() == 'hidden'||theForm.elements[e].type.toLowerCase() == 'radio') {					//if (theForm.elements[e].type.toLowerCase() == 'text'||theForm.elements[e].type.toLowerCase() == 'hidden'||theForm.elements[e].type.toLowerCase() == 'radio') {								if (theForm.elements[e].name.indexOf("fd")==0||theForm.elements[e].name.indexOf("BE")==0){					//alert('nam='+theForm.elements[e].name);										resetBorders(theForm.elements[e]);					var name = theForm.elements[e].name;					qs+=(qs=='')?'':'&&';					qs+= name+'='+escape(theForm.elements[e].value);									}			}		}	}		 var selects = theForm.getElementsByTagName('select'); 	 for( i = 0; i < selects.length; i++ ) 	{         var eSelect = selects[i];         if (eSelect.name.indexOf("fd")==0||eSelect.name.indexOf("BE")==0){  					var selectname = eSelect.name;					resetBorders(eSelect);					qs+=(qs=='')?'':'&&';					qs+= selectname+'='+escape(eSelect.options[eSelect.selectedIndex].value);	           }    	} 	return qs}function resetBorders(f){     if(f.type!='hidden'){          //     f.style.border ="1px #C7C7C7";          	//alert(f.style.backgroundColor);	               if (f.style.backgroundColor=="rgb(255, 204, 204)"||f.style.backgroundColor=="#ffcccc"){                              f.style.backgroundColor=""};    			 }}function getXMLHTTP(){  var A = null;	try{	    A = new ActiveXObject("Msxml2.XMLHTTP");	  	}catch(e){	try{	      A = new ActiveXObject("Microsoft.XMLHTTP");    		} catch(oc){      A = null;    }  }  if(!A && typeof XMLHttpRequest != "undefined") {    A = new XMLHttpRequest();  }  return A;}function SubmitDocument(){			hideElement(getElement('PageContent'));			//centerElement(getElement('PageSubmit'),0,0);			showElement(getElement('PageSubmit'));document.forms[0].submit();}function hideElement(element) {  if (element==null)    return;  if (browser.ns4)    element.visibility='hide';  if (browser.hasDOM || browser.isIE)    element.style.visibility='hidden';}function showElement(element) {  if (element==null)    return;  if (browser.ns4)    element.visibility='show';  if (browser.hasDOM || browser.isIE)    element.style.visibility='visible';}function getElement(id) {  if (id=='')    return null;  if (browser.ns4)    return findElement(id,document);  else  if (browser.hasDOM)    return document.getElementById(id);  else  if (browser.isIE)    return eval('document.all.'+id);  return null;}function findElement(id,doc) {  var i;  var element;  for (i=0; i<doc.layers.length; i++) {    element=doc.layers[i];    if (element.name==id)      return element;    if (element.document.layers.length>0)      if ((element=findElement(id,element.document))!=null)        return element;  }  return null;}function getBrowser() {	this.navigator=navigator;	this.isIE = (navigator.appName == 'Microsoft Internet Explorer');	this.isNS = (navigator.appName == 'Netscape');	this.isOpera = (this.navigator.userAgent.indexOf("Opera") != -1);	this.isKonqueror = (this.navigator.userAgent.indexOf("Konqueror") != -1);	this.isMac = (navigator.appVersion.indexOf("Mac") != -1);	this.hasDOM = (document.getElementById) ? true : false;	this.version = parseInt(navigator.appVersion);	if (this.isIE) {		this.ie4 = (this.navigator.userAgent.indexOf('MSIE 4') > 0);		this.ie5 = (this.navigator.userAgent.indexOf('MSIE 5') > 0);		this.ie6 = (this.navigator.userAgent.indexOf('MSIE 6') > 0);		this.ie7 = (this.navigator.userAgent.indexOf('MSIE 7') > 0);				if (this.ie5)			this.version = 5;		if (this.ie6)			this.version = 6;		if (this.ie7)			this.version = 7;	}	if (this.isNS) {    		this.ns4 = (this.version == 4);		this.ns6 = (this.version == 5);	}}browser = new getBrowser();function SaveDocument(){//Locking('SAVE',document.forms[0]);document.forms[0].submit()}
