//////////////////////////////////////////////////////////////////////////////////////////
// dbnetspell.js
// copyright DbNetLink Ltd 2006
//////////////////////////////////////////////////////////////////////////////////////////
window.DbNetSpellArray = new Object()


DbNetSpell.prototype = new Component();

DbNetSpell.prototype.allowAddition = true;
DbNetSpell.prototype.automaticMessages = true;
DbNetSpell.prototype.childComponents = null;
DbNetSpell.prototype.container = null;
DbNetSpell.prototype.dynamicSuggestionList = true;
DbNetSpell.prototype.dialogWindow = null;
DbNetSpell.prototype.language = "englishus";
DbNetSpell.prototype.maximumSuggestions = 20;
DbNetSpell.prototype.mode = null;
DbNetSpell.prototype.server = "dbnetspell.aspx";
DbNetSpell.prototype.singleElement = false;
DbNetSpell.prototype.statistics = null;
DbNetSpell.prototype.text = null;
DbNetSpell.prototype.version = '3.0';
DbNetSpell.prototype.virtualDir = "/dbnetlink_components/dbnetspell/";


HttpRequest.prototype.xmlHttpProgIds='MSXML2.XMLHTTP,Microsoft.XMLHTTP';HttpRequest.prototype.xmlRequest=null;HttpRequest.prototype.get=HttpRequest_get;function HttpRequest()
{if(window.XMLHttpRequest)
this.xmlRequest=new XMLHttpRequest();else
if(window.ActiveXObject)
{var arr=this.xmlHttpProgIds.split(",");for(var i=0;i<arr.length;i++)
{try
{this.xmlRequest=new ActiveXObject(arr[i]);}
catch(e)
{continue;}
break;}}}
function HttpRequest_get(url)
{this.xmlRequest.open("GET",url,false);this.xmlRequest.setRequestHeader("Content-Type","text/XML");this.xmlRequest.send("");}
DbNetLink.prototype.isIE='';DbNetLink.prototype.IEVersion=-1;DbNetLink.prototype.FFVersion=-1;DbNetLink.prototype.xmlDocProgIds='MSXML2.XMLDOM,Microsoft.XMLDOM';DbNetLink.prototype.assignHandler=DbNetLink_assignHandler;DbNetLink.prototype.sizeDialog=DbNetLink_sizeDialog;DbNetLink.prototype.windowOpen=DbNetLink_windowOpen;DbNetLink.prototype.addClassName=DbNetLink_addClassName;DbNetLink.prototype.removeClassName=DbNetLink_removeClassName;DbNetLink.prototype.textFromNode=DbNetLink_textFromNode;DbNetLink.prototype.getElementById=DbNetLink_getElementById;DbNetLink.prototype.getNode=DbNetLink_getNode;DbNetLink.prototype.getNodeValue=DbNetLink_getNodeValue;DbNetLink.prototype.createXmlDocument=DbNetLink_createXmlDocument;DbNetLink.prototype.createXmlNode=DbNetLink_createXmlNode;DbNetLink.prototype.showMessage=DbNetLink_showMessage;DbNetLink.prototype.clearMessage=DbNetLink_clearMessage;DbNetLink.prototype.elementAttribute=DbNetLink_elementAttribute;DbNetLink.prototype.addStyleSheet=DbNetLink_addStyleSheet;DbNetLink.prototype.standardDateFormat=DbNetLink_standardDateFormat;DbNetLink.prototype.addToObjectPool=DbNetLink_addToObjectPool;DbNetLink.prototype.testArray=DbNetLink_testArray;DbNetLink.prototype.openHTMLEditor=DbNetLink_openHTMLEditor;DbNetLink.prototype.openModalDialog=DbNetLink_openModalDialog;DbNetLink.prototype.openDialog=DbNetLink_openDialog;DbNetLink.prototype.openNonModalDialog=DbNetLink_openNonModalDialog;function DbNetLink()
{this.isIE=false;if(document.all)
this.isIE=true;if(this.isIE)
{navigator.userAgent.toLowerCase().match(/msie (\d{1,}\.\d{1,})/)
if(RegExp.$1!="")
this.IEVersion=parseFloat(RegExp.$1);}
else
{navigator.userAgent.toLowerCase().match(/firefox\/(\d{1,}\.\d{1,})/)
if(RegExp.$1!="")
this.FFVersion=parseFloat(RegExp.$1);}}
function DbNetLink_assignHandler(methodName,noSrcElement,returnValue,o)
{if(!o)
o=window;if(typeof(methodName)=="function")
{var fn=arguments[0].toString().split("(")[0].replace("function ","");if(fn=="function")
return methodName;else
methodName=fn;}
if(methodName=="")
return function(){};var call="o."+methodName+"("+((noSrcElement)?"":"getCoords(event)")+")";if(returnValue)
return function(event){return(eval(call))};else
return function(event){eval(call)};}
function DbNetLink_sizeDialog(centre)
{if(typeof(centre)=='undefined')
centre=true;if(!document.all)
{window.sizeToContent();}
else
{var layout=document.getElementById('layout');if(!layout)
layout=document.body.childNodes[0];var xpad=0;var ypad=0;if(this.IEVersion<7)
{xpad=this.elementAttribute(layout,"xpad",10);ypad=this.elementAttribute(layout,"ypad",30);}
var h=(parseInt(layout.offsetHeight)+parseInt(ypad));var w=(parseInt(layout.offsetWidth)+parseInt(xpad));window.dialogHeight=h+"px";window.dialogWidth=w+"px";}
if(centre)
centreDialog();}
function DbNetLink_windowOpen(w)
{if(w)
if(!w.closed)
return true;return false;}
function DbNetLink_addClassName(e,className)
{if(e.className.indexOf(className)==-1)
e.className+=" "+className;}
function DbNetLink_removeClassName(e,className)
{var a=e.className.split(" ");var b=new Array();for(var i=0;i<a.length;i++)
if(a[i]!=className)
b[b.length]=a[i];e.className=b.join(" ").replace("  ","");}
function DbNetLink_textFromNode(n)
{if(n==null)
return'';if(n.text)
return n.text;if(n.childNodes.length>0)
{var returnText='';for(var i=0;i<n.childNodes.length;i++)
returnText+=n.childNodes[i].nodeValue;return(returnText);}
return'';}
function DbNetLink_addToObjectPool(obj)
{if(!document.__ObjectPool)
{document.__ObjectPool=new Object;document.__ObjectPool.Objects=new Array();document.__ObjectPool.length=0;}
obj.objectId=document.__ObjectPool.length++;document.__ObjectPool.Objects[obj.objectId]=obj;obj.toString=new Function("return 'document.__ObjectPool.Objects["+obj.objectId+"]'");}
function DbNetLink_getElementById(rootNode,id)
{if(rootNode==null)alert("root node is null "+id)
if(rootNode.all)
return rootNode.all[id];else
{if(rootNode.getElementsByTagName)
{var all=rootNode.getElementsByTagName('*');for(i=0;i<all.length;i++)
{if(all[i].getAttribute)
if(all[i].getAttribute('id'))
if(all[i].getAttribute('id').toLowerCase()==id.toLowerCase())
return all[i];}}}
return null;}
function DbNetLink_createXmlDocument()
{if(document.implementation&&document.implementation.createDocument)
return document.implementation.createDocument("","",null);var o=null;if(window.ActiveXObject)
{var arr=this.xmlDocProgIds.split(",");for(var i in arr)
{try
{o=new ActiveXObject(arr[i]);}
catch(e)
{continue;}
break;}}
return o;}
function DbNetLink_createXmlNode(nodeName,nodeValue,attributes)
{if(nodeValue==null)
nodeValue="";if(typeof(nodeName)!="string"||nodeName=="")
return"";var xml="<"+nodeName;if(attributes)
for(a in attributes)
{var attributeValue=attributes[a];switch(typeof(attributeValue))
{case"string":attributeValue=attributeValue.replace(/\&/g,'&amp;').replace(/\"/g,'&quot;').replace(/\>/g,'&gt;').replace(/\</g,'&lt;');break;}
xml+=" "+a+"=\""+attributeValue+"\"";}
xml+=">";switch(typeof(nodeValue))
{case"object":if(testArray(nodeValue))
{for(var i=0;i<nodeValue.length;i++)
xml+=this.createXmlNode("item",nodeValue[i]);}
else
{for(var p in nodeValue)
xml+=this.createXmlNode(p,nodeValue[p]);}
break;case"string":xml+=(nodeValue.indexOf("<![CDATA[")>-1)?nodeValue:"<![CDATA["+nodeValue+"]]>";break;default:xml+=nodeValue;break;}
xml+="</"+nodeName+">";return xml;}
function DbNetLink_showMessage(str)
{if(!$('messageLine'))
{alert(str);return;}
$('messageLine').innerHTML=str;addClassName($('messageLine'),'activeMessage');window.setTimeout('clearMessage()',3000);}
function DbNetLink_clearMessage()
{$('messageLine').innerHTML='&nbsp;';removeClassName($('messageLine'),'activeMessage');}
function DbNetLink_elementAttribute(e,id,v)
{if(e[id])
return e[id];else if(e.getAttribute(id))
return e.getAttribute(id);else
return(v)?v:null;}
function DbNetLink_addStyleSheet(url,doc)
{var addStyleSheet=true;for(var i=0;i<doc.styleSheets.length;i++)
{var tmp=doc.styleSheets[i].href;if(tmp)
if(tmp.toLowerCase().indexOf(url.toLowerCase())>-1)
addStyleSheet=false;}
if(addStyleSheet)
{if(this.isIE)
doc.createStyleSheet(url,0);else
{var sheet=doc.createElement('link');sheet.rel='stylesheet';sheet.href=url;var head=doc.getElementsByTagName("head")[0];head.insertBefore(sheet,head.firstChild);}}}
function DbNetLink_standardDateFormat(formatString)
{if(typeof(formatString)!='string')
return true;if(formatString=='')
return true;if(formatString.length!=1)
return false;var re=/^[dGgTt]$/;return re.test(formatString);}
function DbNetLink_testArray(obj)
{if(obj)
if(obj.constructor)
return obj.constructor.toString().indexOf("Array")>=0?true:false;return false;}
function DbNetLink_openHTMLEditor(params)
{var comp;if(params.component.component)
comp=params.component.component;else
comp=params.component;var editor=comp.HTMLEditor;if(editor.toLowerCase().indexOf("tinymce")>-1)
{params.tinyMCEConfig=comp.tinyMCEConfig;editor="tinymce/tinymce.htm";params.standardWindow=true;window._htmlEditorParams=params;}
openModalDialog(params.component.virtualDir+'/common/editor/'+editor,'htmleditor',params,"resizable=yes");}
function DbNetLink_getNodeValue(doc,pattern)
{return dbNetLink.textFromNode(dbNetLink.getNode(doc,pattern));}
function DbNetLink_getNode(doc,pattern)
{if(pattern.indexOf("/")!=0)
pattern="//"+pattern;return doc.selectSingleNode(pattern);}
var dbNetLink=new DbNetLink();Component.prototype.clearTextTokens=null;Component.prototype.configLang='';Component.prototype.culture=null;Component.prototype.currentProfileId="";Component.prototype.isIE=null;Component.prototype.encryptedTokens=null;Component.prototype.filterText="";Component.prototype.filterTextObjectArray=null;Component.prototype.httpRequest=null;Component.prototype.messageLine=null;Component.prototype.profileCombo=null;Component.prototype.profileKey="";Component.prototype.profileSelect=false;Component.prototype.profileSelectText="";Component.prototype.profileUser="";Component.prototype.profileWindow=null;Component.prototype.requiredProperties=null;Component.prototype.text=null;Component.prototype.trace=false;Component.prototype.traceArray=null;Component.prototype.traceArea=null;Component.prototype.xmlDocument=null;Component.prototype.xmlRequest=null;Component.prototype.xmlResponse=null;Component.prototype.instances=null;Component.prototype.instanceIndex=null;Component.prototype.callbackFunction=null;Component.prototype.toolButtonStyle='image';Component.prototype.openWindows=null;Component.prototype.tinyMCEConfig=null;Component.prototype.addUserProfileProperties=Component_addUserProfileProperties;Component.prototype.assignHandler=Component_assignHandler;Component.prototype.assignButtonHint=Component_assignButtonHint;Component.prototype.addCSSRule=Component_addCSSRule;Component.prototype.buttonContent=Component_buttonContent;Component.prototype.callService=Component_callService;Component.prototype.checkDOM=Component_checkDOM;Component.prototype.clearMessage=Component_clearMessage;Component.prototype.clearText=Component_clearText;Component.prototype.createXmlNode=Component_createXmlNode;Component.prototype.createXmlDocument=Component_createXmlDocument;Component.prototype.deleteUserProfile=Component_deleteUserProfile;Component.prototype.encrypt=Component_encrypt;Component.prototype.evaluate=Component_evaluate;Component.prototype.fireCustomEvent=Component_fireCustomEvent;Component.prototype.formatNumber=Component_formatNumber;Component.prototype.getChildNodes=Component_getChildNodes;Component.prototype.getDataType=Component_getDataType;Component.prototype.getNode=Component_getNode;Component.prototype.getNodeValue=Component_getNodeValue;Component.prototype.getText=Component_getText;Component.prototype.initialiseStyleSheet=Component_initialiseStyleSheet;Component.prototype.inspectCSSRule=Component_inspectCSSRule;Component.prototype.loadDocument=Component_loadDocument;Component.prototype.loadText=Component_loadText;Component.prototype.loadProfileCombo=Component_loadProfileCombo;Component.prototype.loadUserProfiles=Component_loadUserProfiles;Component.prototype.logTrace=Component_logTrace;Component.prototype.makeImageButton=Component_makeImageButton;Component.prototype.message=Component_message;Component.prototype.MSDB=Component_MSDB;Component.prototype.openDialog=Component_openDialog;Component.prototype.openNonModalDialog=Component_openNonModalDialog;Component.prototype.openModalDialog=Component_openModalDialog;Component.prototype.readOnlyDataType=Component_readOnlyDataType;Component.prototype.recordExists=Component_recordExists;Component.prototype.saveUserProfile=Component_saveUserProfile;Component.prototype.selectData=Component_selectData;Component.prototype.selectDate=Component_selectDate;Component.prototype.selectProfile=Component_selectProfile;Component.prototype.selectUserProfile=Component_selectUserProfile;Component.prototype.makeRequest=Component_makeRequest;Component.prototype.serialise=Component_serialize;Component.prototype.serialize=Component_serialize;Component.prototype.serialiseRequiredProperties=Component_serialiseRequiredProperties;Component.prototype.showError=Component_showError;Component.prototype.checkRequestState=Component_checkRequestState;Component.prototype.processResponse=Component_processResponse;Component.prototype.convertDateTimeFormat=Component_convertDateTimeFormat;Component.prototype.userProfileDialog=Component_userProfileDialog;Component.prototype.setAccessKey=Component_setAccessKey;Component.prototype.isEncrypted=Component_isEncrypted;Component.prototype.isMethodAssigned=Component_isMethodAssigned;Component.prototype.escape=Component_escape;Component.prototype.configureSimpleSearchFilter=Component_configureSimpleSearchFilter;Component.prototype.onBeforeProfileSaved=null;Component.prototype.onProfileSelected=null;Component.prototype.onProfileSaved=null;Component.prototype.onProfileDeleted=null;function Component()
{this.isIE=false;if(document.all)
this.isIE=true;this.requiredProperties=new Array();this.instances=new Array();this.openWindows=new Object();this.encryptedTokens=new Object();this.clearTextTokens=new Object();this.tinyMCEConfig=new Object();}
function initialiseComponent(o)
{if(window[o.componentName+"VirtualFolder"])
o.virtualDir=window[o.componentName+"VirtualFolder"];o.httpRequest=new HttpRequest();o.xmlRequest=o.httpRequest.xmlRequest;o.instanceIndex=o.instances.length;o.instances[o.instances.length]=o;dbNetLink.addToObjectPool(o);}
function Component_callService(xml,method,doc)
{xml+=this.serialiseRequiredProperties();var url=this.virtualDir+"/"+this.server+"?mode="+method;this.xmlDocument=doc;if(!this.makeRequest(url,xml))
return false;return true;}
function Component_checkDOM(id)
{if(document.readyState)
if(document.readyState!="complete")
{alert("Element with ID ["+id+"] not available. Use the window.onload event to create "+this.componentName);return;}
alert("The element with ID ["+id+"] not available. Check element has been defined or you are creating or use the window.onload event to create "+this.componentName);}
function Component_serialiseRequiredProperties()
{var xml="";for(var i=0;i<this.requiredProperties.length;i++)
xml+=this.serialize(this.requiredProperties[i]);return xml;}
function Component_makeRequest(url,xml)
{if(xml.indexOf('<root>')!=0)
xml='<root>'+xml+'</root>';url=url.replace(/\/\//g,'\/');try
{this.xmlRequest.open("POST",url,(this.callbackFunction)?true:false);}
catch(e)
{this.xmlRequest=new HttpRequest().xmlRequest;this.xmlRequest.open("POST",url,(this.callbackFunction)?true:false);}
this.xmlRequest.setRequestHeader("Content-Type","text/XML");if(this.callbackFunction)
this.xmlRequest.onreadystatechange=this.checkRequestState(this);else
this.xmlRequest.onreadystatechange=function(){};this.logTrace('out',url,xml);this.xmlRequest.send(xml);if(this.callbackFunction)
return true;if(this.xmlRequest.status!=200||this.xmlRequest.responseXML==null)
{this.showError(this.xmlRequest.responseText);return false;}
if(url)
this.logTrace('in',url,this.xmlRequest.responseXML.xml);return this.processResponse(url);}
function Component_processResponse(url)
{if(this.xmlRequest.status!=200||((this.xmlRequest.responseXML==null)||(this.xmlRequest.responseXML.xml=="")))
{this.showError(this.xmlRequest.responseText);return false;}
if(url)
this.logTrace('in',url,this.xmlRequest.responseXML.xml);if(typeof(this.xmlDocument)=='undefined')
this.xmlResponse=this.xmlRequest.responseXML;else
this.loadDocument(this.xmlDocument);return true;}
function Component_checkRequestState(component)
{return function()
{if(component.xmlRequest.readyState!=4)
return;if(component.processResponse())
if(component.callbackFunction)
component.callbackFunction();}}
function Component_logTrace(direction,url,xml)
{if(!this.trace)
return;if(!this.traceArray)
this.traceArray=new Array();if(this.traceArray.length==100)
this.traceArray=new Array();if(this.traceArea)
this.traceArea.value+=direction+":"+url+":"+xml;this.traceArray[this.traceArray.length]=direction+":"+url+":"+xml;}
function Component_loadDocument(doc,xml)
{if(document.implementation&&document.implementation.createDocument)
{if(typeof(xml)=='undefined')
{var objXMLSerializer=new XMLSerializer();xml=objXMLSerializer.serializeToString(this.xmlRequest.responseXML);}
if(xml=="")
xml="<root></root>";var objDOMParser=new DOMParser();var objDoc=objDOMParser.parseFromString(xml,"text/xml");while(doc.hasChildNodes())
doc.removeChild(doc.lastChild);for(var i=0;i<objDoc.childNodes.length;i++)
{var objImportedNode=doc.importNode(objDoc.childNodes[i],true);doc.appendChild(objImportedNode);}}
else
{if(typeof(xml)=='undefined')
xml=this.xmlRequest.responseXML.xml;doc.loadXML(xml);}}
function Component_createXmlDocument()
{return dbNetLink.createXmlDocument();}
function Component_getNode(pattern,doc)
{if(doc==null)
return dbNetLink.getNode(this.xmlResponse,pattern);return dbNetLink.getNode(doc,pattern);}
function Component_getNodeValue(pattern,doc)
{if(doc==null)
return dbNetLink.getNodeValue(this.xmlResponse,pattern);return dbNetLink.getNodeValue(doc,pattern);}
function Component_getChildNodes(pattern,doc)
{var n=this.getNode(pattern,doc);if(!n)
return null;return n.childNodes;}
function Component_showError(text)
{var leftPos=(screen.availWidth-500)/2;var topPos=(screen.availHeight-500)/2;var posStr=('left='+leftPos+',top='+topPos+',width=500,height=500,toolbars=no,scrollbars=yes,resizable=yes');var win=window.open("about:blank",null,posStr);if(!win)
alert("A popup-blocker has prevented the error window from opening\nPlease adjust the settings to allow popups from this site");else
{try
{win.document.open();}
catch(e)
{win.close();win=window.open("about:blank",null,posStr);win.document.open();}
win.document.write(text);win.document.close();}}
function Component_serialize(propertyName,nodeName)
{if(!nodeName)
nodeName=propertyName;var xml="";switch(typeof(this[propertyName]))
{case"undefined":break;case"object":xml=this.createXmlNode(nodeName,this[propertyName]);break;case"boolean":xml=this.createXmlNode(nodeName,this[propertyName].toString().toLowerCase());break;default:xml=this.createXmlNode(nodeName,this[propertyName]);break;}
return xml;}
function Component_createXmlNode(nodeName,nodeValue,attributes)
{return dbNetLink.createXmlNode(nodeName,nodeValue,attributes);}
function Component_loadText()
{if(!this.text)
this.text=new Object();else
if(typeof(this.text['true'])=='string')
return;var doc=this.createXmlDocument();var xml=this.serialise('configLang');if(!this.callService(xml,"loadtext",doc))
return;var nodeList=doc.documentElement.childNodes;for(var i=0;i<nodeList.length;i++)
this.text[nodeList[i].nodeName]=dbNetLink.textFromNode(nodeList[i]);}
function Component_getText(id)
{if(this.text[id])
return this.text[id];else
return id;}
function Component_message(messageText)
{if((this.messageLine)&&(messageText.length<100))
{this.messageLine.innerHTML=messageText;var color='gold';if(this.messageLine.backgroundColor)
color=this.messageLine.backgroundColor;this.messageLine.style.backgroundColor=color;if(this.isIE)
window.setTimeout('Component_clearMessage('+this.instanceIndex+',"'+this.componentName+'")',3000);else
window.setTimeout(this.clearMessage,3000,this);}
else
alert(messageText);}
function Component_clearMessage(objectReference)
{var o;if(!isNaN(objectReference))
{var index=arguments[0];var componentName=arguments[1];o=eval(componentName+'.prototype.instances['+index+']');}
else
o=arguments[0];o.messageLine.innerHTML='&nbsp;';o.messageLine.style.backgroundColor='';}
function Component_clearText(token)
{if(this.clearTextTokens[token])
return this.clearTextTokens[token];var xmlResponseSave=this.xmlResponse;var xml=this.createXmlNode("token",token);if(!this.callService(xml,"cleartext"))
return token;eToken=this.getNodeValue("token");this.clearTextTokens[token]=eToken;this.xmlResponse=xmlResponseSave;return eToken;}
function Component_assignHandler(methodName,noSrcElement,returnValue)
{return dbNetLink.assignHandler(methodName,noSrcElement,returnValue,this);}
function Component_formatNumber(expr,decplaces)
{if(isNaN(expr)||expr=='')
return expr;if(!decplaces)
decplaces=2;var str=""+Math.round(eval(expr)*Math.pow(10,decplaces));while(str.length<=decplaces)
{str="0"+str;}
var decpoint=str.length-decplaces;var decimalSeparator=this.decimalSymbol;if(this.culture)
if(this.culture.numberDecimalSeparator)
decimalSeparator=this.culture.numberDecimalSeparator;return str.substring(0,decpoint)+decimalSeparator+str.substring(decpoint,str.length);}
function Component_fireCustomEvent()
{switch(typeof(arguments[0]))
{case'string':functionName=arguments[0];break;case'function':var arr=arguments[0].toString().split("(");functionName=arr[0].replace("function ","");if(functionName=="function")
{arguments[0].apply();return;}
break;default:functionName='';break;}
if(functionName!='')
{if(typeof(eval("window."+functionName))!='undefined')
{var args=new Array();for(var i=1;i<arguments.length;i++)
args[args.length]=arguments[i];return(eval(functionName+".apply(this, args)"));}
else
alert("Handler '"+functionName+"' is undefined");}
return null;}
function Component_evaluate(value,defaultValue)
{if(typeof(value)=="boolean")
return value;else if(typeof(defaultValue)=="boolean")
return defaultValue;return true;}
function Component_selectDate(field,x,y,callback)
{if(field.disabled||field.readOnly)
return;var params=new Object();params.field=field;params.monthNames='';params.dayNames='';params.x=x;params.y=y;params.callback=callback;params.component=this;for(var i=1;i<=12;i++)
{if(i>1)
params.monthNames+=',';params.monthNames+=this.getText('month'+i);}
for(var i=1;i<=7;i++)
{if(i>1)
params.dayNames+=',';params.dayNames+=this.getText('day'+i);}
this.openModalDialog(this.virtualDir+'common/calendar.htm','calendar',params);}
function Component_MSDB()
{var MS=false;switch(this.DBMSName)
{case'MySQL':case'DB2/NT':case'Oracle':case'InterSystems Cache':case'Sybase SQL Server':case'Adaptive Server Anywhere':case'Microsoft Visual FoxPro':case'SAS':case'Informix':case'Advantage':case'Pervasive.SQL':case'OpenRDA DAM':case'Firebird':MS=false;break;default:MS=true;break;}
return MS;}
function Component_selectData(sql,parameters,allRows,format)
{var xmlResponseSave=this.xmlResponse;var data=new Array();var xml=this.createXmlNode("sql",sql);xml+=this.createXmlNode("parameters",parameters);xml+=this.createXmlNode("format",format);if(!this.callService(xml,"selectdata"))
return null;var rows=this.xmlResponse.documentElement.childNodes;for(var r=0;r<rows.length;r++)
{data[r]=new Object();var fields=rows[r].childNodes;for(var i=0;i<fields.length;i++)
data[r][fields[i].nodeName]=dbNetLink.textFromNode(fields[i]);}
this.xmlResponse=xmlResponseSave;if(allRows)
return data;else
return data[0];}
function Component_recordExists(sql,parameters)
{var xmlResponseSave=this.xmlResponse;var xml=this.createXmlNode("sql",sql);xml+=this.createXmlNode("parameters",parameters);if(!this.callService(xml,"recordexists"))
return false;var exists=(eval(this.getNodeValue("eof").toLowerCase())==false);this.xmlResponse=xmlResponseSave;return exists;}
function Component_encrypt(token)
{if(this.encryptedTokens[token])
return this.encryptedTokens[token];var xmlResponseSave=this.xmlResponse;var xml=this.createXmlNode("token",token);if(!this.callService(xml,"encrypttoken"))
return token;eToken=this.getNodeValue("token");this.encryptedTokens[token]=eToken;this.xmlResponse=xmlResponseSave;return eToken;}
function Component_makeImageButton(image,label,common,hint,e)
{var template='<table title="{title}" cellpadding=0 cellspacing=0><tr><td><img src="{file}"></td><td>&nbsp;{text}</td></tr></table>'
if(typeof(hint)!='string')
hint='';var filepath=this.virtualDir+'/'+(common?'common':'')+'/images/'+image+'.gif';filepath=filepath.replace(/\/\//g,'\/');str=template.replace('{title}',hint).replace('{file}',filepath).replace('{text}',label);if(e)
{e.innerHTML=str;e.childNodes[0].rows[0].cells[0].childNodes[0].src=filepath;}
else
{return str;}}
function Component_initialiseStyleSheet()
{var styleSheetUrl=this.virtualDir+"css/"+this.componentName+".css";dbNetLink.addStyleSheet(styleSheetUrl,window.document);}
function Component_buttonContent(id,img,text,style)
{if(!img)
img=this.virtualDir+"images/"+id.replace(/Row/,'')+".gif";if(!text)
text="";if(!style)
style=this.toolButtonStyle;var imgCell="<td id=buttonImg style=\"text-align:center;display:"+((style=="text")?"none":"")+"\"><img id="+id+"Img src=\""+img+"\"></img><td>";var textCell="<td id=buttonText style=\"text-align:center;display:"+((style=="image")?"none":"")+"\">"+text+"</td>";var html="<table cellpadding=0 cellspacing=0><tr>";html+=imgCell;switch(style)
{case"vertical":html+="</tr><tr>";break;case"horizontal":html+="<td>&nbsp;</td>";break;}
html+=textCell;html+="</tr></table>";return html;}
function Component_addCSSRule(ruleName,rule)
{var qualifiedName=ruleName;if(ruleName.indexOf('#')!=0)
qualifiedName='.'+ruleName;var found=false;for(var s=0;s<document.styleSheets.length;s++)
{var rules=(this.isIE)?document.styleSheets[s].rules:document.styleSheets[s].cssRules;for(var r=0;r<rules.length;r++)
{alert(rules[r].selectorText+"\n"+qualifiedName)
if(("#"+this.container.id+" "+qualifiedName==rules[r].selectorText)||(qualifiedName==rules[r].selectorText));{found=true;break;}}}
if(!found)
{var tmp="#"+this.container.id+" "+qualifiedName;if(this.isIE)
document.styleSheets[0].addRule(tmp,rule);else
document.styleSheets[0].insertRule(tmp+"{"+rule+"}",0);}}
function Component_inspectCSSRule(ruleName,property)
{var found=false;for(var s=0;s<document.styleSheets.length;s++)
{var rules=(this.isIE)?document.styleSheets[s].rules:document.styleSheets[s].cssRules;for(var r=0;r<rules.length;r++)
{if(("#"+this.container.id+" ."+ruleName==rules[r].selectorText)||("."+ruleName==rules[r].selectorText));{return(rules[r].style[property]);}}}
return(null);}
function Component_isMethodAssigned(p)
{switch(typeof(p))
{case"function":case"string":return true;}
return false;}
function Component_convertDateTimeFormat(f)
{if(f.match(/^[ymd].[ymd].[ymd] h:mi:s$/))
return"G";if(f.match(/^[ymd].[ymd].[ymd] h:mi$/))
return"g";if(f.match(/^[ymd].[ymd].[ymd]$/))
return"d";if(f.match(/^h:mi:s$/))
return"T";if(f.match(/^h:mi$/))
return"t";return f;}
function Component_readOnlyDataType(dataType)
{switch(dataType.toLowerCase())
{case"varbinary":case"binary":case"dbtype_binary":case"dbtype_longvarchar":case"dbtype_longvarbinary":case"dbtype_varbinary":case"image":case"blob":case"bytea":case"sql_variant":case"longbinary":return true;}
return false;}
function Component_getDataType(dbDataType)
{if(typeof(dbDataType)!="string")
return null;var dataType;switch(dbDataType.toLowerCase())
{case"dbtype_bool":case"bit":case"11":case"boolean":case"bool":dataType="boolean";break;case"dbtype_dbtime":case"time":case"134":dataType="time";break;case"dbtype_date":case"dbtype_dbdate":case"dbtype_dbtimestamp":case"date":case"datetime":case"smalldatetime":case"timestamp":case"133":case"135":case"7":dataType="date";break;case"dbtype_dbtimestamp":case"dbtype_wvarchar":case"dbtype_wlongvarchar":case"dbtype_varchar":case"dbtype_char":case"dbtype_longvarchar":case"dbtype_wchar":case"char":case"wchar":case"nchar":case"longchar":case"unichar":case"varchar":case"nvarchar":case"wvarchar":case"univarchar":case"long varchar":case"varchar2":case"nvarchar2":case"wvarchar2":case"text":case"ntext":case"memo":case"sysname":case"129":case"200":case"130":case"201":case"202":case"203":case"clob":case"bpchar":case"longtext":dataType="string";break;case"72":case"uniqueidentifier":dataType="guid";break;case"128":case"varbinary":case"blob":case"bytea":dataType="blob";break;default:if(dbDataType.toLowerCase().indexOf("time ")==0)
dataType="time";else if(dbDataType.toLowerCase().indexOf("timestamp ")==0)
dataType="date";else
dataType="numeric";}
return dataType;}
function Component_openModalDialog(url,winName,args,features)
{return this.openDialog(url,winName,args,true,features);}
function Component_openNonModalDialog(url,winName,args,features)
{return(this.openDialog(url,winName,args,false,features));}
function Component_openDialog(url,winName,args,modal,optFeatures)
{if(window.showModalDialog)
{return openDialog(url,winName,args,modal,optFeatures);}
else
{var w=this.openWindows[winName];if(dbNetLink.windowOpen(w))
{window.dialogArguments[winName]=args;w.focus();}
else
{w=dbNetLink.openDialog(url,winName,args,modal,optFeatures);this.openWindows[winName]=w;}
return w;}}
function Component_assignButtonHint(btn,t)
{if(this.isIE)
btn.childNodes[0].title=this.getText(t);else
btn.title=this.getText(t);}
function Component_userProfileDialog()
{if(windowOpen(this.profileWindow))
{this.profileWindow.focus();return;}
var o=new Object();o.grid=this;this.profileWindow=this.openNonModalDialog(this.virtualDir+'common/profile.aspx','profile_window',o);}
function Component_saveUserProfile(title,id)
{this.fireCustomEvent(this.onBeforeProfileSaved,this);var a=new Array();for(var i=0;i<this.userProfileProperties.length;i++)
{var p=this.userProfileProperties[i];if(typeof(this[p])=="undefined")
{var e;if(this.componentName=="DbNetGrid")
e=this.toolbarElement(p);if(typeof(e)=="undefined"||e==null)
e=document.getElementById(p);if(e)
if(e.tagName=="INPUT"&&e.type=="checkbox")
a[a.length]=this.createXmlNode(p,e.checked.toString().toLowerCase());else
a[a.length]=this.createXmlNode(p,e.value);else if(typeof(window[p])!="undefined")
a[a.length]=this.createXmlNode(p,window[p]);}
else
a[a.length]=this.serialize(p);}
var xml=this.createXmlNode("profileTitle",title);xml+=this.createXmlNode("profileId",id);xml+=this.serialize("profileKey");xml+=this.serialize("profileUser");xml+="<profile>"+a.join("")+"</profile>";if(!this.callService(xml,'saveuserprofile'))
return
this.currentProfileId=this.getNodeValue('id');this.loadProfileCombo();this.fireCustomEvent(this.onProfileSaved,this);return this.getNodeValue('html');}
function Component_deleteUserProfile(id)
{var xml=this.createXmlNode("profileId",id);xml+=this.serialize("profileKey");xml+=this.serialize("profileUser");if(!this.callService(xml,'deleteuserprofile'))
return"";this.currentProfileId="";this.loadProfileCombo();this.fireCustomEvent(this.onProfileDeleted,this);return this.getNodeValue('html');}
function Component_loadProfileCombo()
{if(this.profileCombo!=null)
{this.loadUserProfiles(this.profileCombo,this.profileSelectText);this.profileCombo.value=this.currentProfileId;}}
function Component_selectUserProfile(id)
{var xml=this.createXmlNode("profileId",id);if(!this.callService(xml,'selectuserprofile'))
return;for(var i=0;i<this.userProfileProperties.length;i++)
{var p=this.userProfileProperties[i];if(!this.getNode(p))
continue;if(typeof(this[p])!="undefined")
{switch(p)
{case"searchDialogContent":case"simpleSearchDialogContent":this[p]=xmlFromNode(this.getNode(p));break;case"filterPart":this[p]=this.getNodeValue("/root/profile/"+p);break;default:if(dbNetLink.testArray(this[p]))
{var nl=this.getNode(p).childNodes;var a=new Array();for(var n=0;n<nl.length;n++)
a[a.length]=dbNetLink.textFromNode(nl[n]);this[p]=a;}
else
this[p]=this.getNodeValue(p);break;}}
else
{var e;if(this.componentName=="DbNetGrid")
e=this.toolbarElement(p);if(typeof(e)=="undefined"||e==null)
e=document.getElementById(p);if(e)
if(e.tagName=="INPUT"&&e.type=="checkbox")
e.checked=eval(this.getNodeValue(p));else
e.value=this.getNodeValue(p)
else if(typeof(window[p])!="undefined")
window[p]=this.getNodeValue(p);}}
this.currentProfileId=id;this.fireCustomEvent(this.onProfileSelected,this);if(this.componentName=="DbNetGrid")
this.loadData();else
this.initialiseNavigator();if(this.profileCombo!=null)
this.profileCombo.value=this.currentProfileId;}
function Component_loadUserProfiles(e,emptyOption)
{var xml=this.serialize("profileKey");xml+=this.serialize("profileUser");if(!this.callService(xml,'loaduserprofiles'))
return"";if(e!=null)
{e.innerHTML="";var onchange=e.onchange;var p=e.parentNode;var tags=e.parentNode.innerHTML.split('><');p.innerHTML=tags[0]+">"+((typeof(emptyOption)=="string")?"<option value=\"\">"+emptyOption:"")+this.getNodeValue('html')+"</select>";p.childNodes[0].onchange=onchange;this.profileCombo=p.childNodes[0];}
return this.getNodeValue('html');}
function Component_addUserProfileProperties(p)
{if(!dbNetLink.testArray(p))
p=p.split(",");this.userProfileProperties=this.userProfileProperties.concat(p);}
function Component_setAccessKey(el)
{var txt=el.innerHTML;var accessKey=txt.toLowerCase().match(/<u>(.*)<\/u>/);if(accessKey)
el.accessKey=accessKey[1];}
function Component_isEncrypted(s)
{if(typeof(s)=="string")
return(s.indexOf("___")==0);else
return false;}
function Component_escape(s)
{return escape(s).replace(/\+/g,"%2B");}
function Component_selectProfile()
{if(this.profileCombo.value!="")
this.selectUserProfile(this.profileCombo.value);}
function Component_configureSimpleSearchFilter()
{var f=this.simpleSearchFilter;if(typeof(f)=="string")
f=new Array(new Array("",f));if(typeof(f[0])=="string")
f=new Array(new Array(f[0],f[1]));this.simpleSearchFilter=f;}
cultureInfo.prototype.dpRE=null;cultureInfo.prototype.dateTimeSeparator=' ';cultureInfo.prototype.numberDecimalSeparator='.';cultureInfo.prototype.formattedDate=cultureInfo_formattedDate;cultureInfo.prototype.formatHint=cultureInfo_formatHint;cultureInfo.prototype.isDate=cultureInfo_isDate;cultureInfo.prototype.isDateTime=cultureInfo_isDateTime;cultureInfo.prototype.isNumeric=cultureInfo_isNumeric;cultureInfo.prototype.isTime=cultureInfo_isTime;cultureInfo.prototype.sizeDateTimeField=cultureInfo_sizeDateTimeField;cultureInfo.prototype.stringToJavascriptDateObject=cultureInfo_stringToJavascriptDateObject;cultureInfo.prototype.stringToDate=cultureInfo_stringToJavascriptDateObject;cultureInfo.prototype.javascriptDateObjectToString=cultureInfo_javascriptDateObjectToString;cultureInfo.prototype.dateToString=cultureInfo_javascriptDateObjectToString;function cultureInfo(comp,doc)
{var cultureInfoNode=comp.getNode('CultureInfo',doc);if(cultureInfoNode)
{for(var i=0;i<cultureInfoNode.childNodes.length;i++)
{var node=cultureInfoNode.childNodes[i];this[node.nodeName]=dbNetLink.textFromNode(node);}}
this.dpRE=new RegExp('\\'+((this.numberDecimalSeparator=='')?'.':this.numberDecimalSeparator));}
function cultureInfo_formatHint(format)
{var hint='';switch(format)
{case'd':hint=this.shortDatePattern;break;case'g':hint=this.shortDatePattern+' '+this.shortTimePattern;break;case'G':hint=this.shortDatePattern+' '+this.longTimePattern;break;case't':hint=this.shortTimePattern;break;case'T':hint=this.longTimePattern;break;default:hint=this.shortDatePattern;break;}
return hint.toLowerCase();}
function cultureInfo_stringToJavascriptDateObject(str,format)
{if(!format)
format="d";var d=null;var o=this.isDateTime(str,format,true);if(o)
{switch(format.toLowerCase())
{case'g':var d=new Date(o.year,o.month-1,o.day,o.hour,o.mins,0);break;case'd':var d=new Date(o.year,o.month-1,o.day);break;}}
return d;}
function cultureInfo_javascriptDateObjectToString(o,format)
{if(!format)
format="d";return this.formattedDate(format,o.getFullYear(),o.getMonth()+1,o.getDate(),o.getHours(),o.getMinutes());}
function cultureInfo_isNumeric(str)
{if(this.numberDecimalSeparator!='.')
if(str.indexOf('.')>=0)
return false;return!isNaN(str.replace(this.dpRE,'.'));}
function cultureInfo_isDateTime(dateTimeValue,format,returnObject)
{if(typeof(returnObject)=='undefined')
returnObject=false;if(dateTimeValue=='')
return(returnObject)?null:false;if(typeof(format)=='undefined')
format='d';else
{var validFormats="dgGtT";if(format==''||validFormats.indexOf(format)<0)
format='d';}
var dateTimeParts=dateTimeValue.split(this.dateTimeSeparator);var rv;switch(format.toLowerCase())
{case'g':if(dateTimeParts.length==2)
{if(returnObject)
{rv=this.isDate(dateTimeParts[0],format,true);if(rv!=null)
{var o=this.isTime(dateTimeParts[1],format,true);if(o!=null)
for(var i in o)
rv[i]=o[i];}}
else
{rv=false;if(this.isDate(dateTimeParts[0],format,false))
if(this.isTime(dateTimeParts[1],format,false))
rv=true;}}
break;case'd':rv=this.isDate(dateTimeParts[0],format,returnObject);break;case't':rv=this.isTime(dateTimeParts[0],format,returnObject);break;}
return rv;}
function cultureInfo_isDate(dateValue,format,returnObject)
{if(typeof(returnObject)=='undefined')
returnObject=false;var formatParts=this.shortDatePattern.split(this.dateSeparator);var dateParts=dateValue.split(this.dateSeparator);for(var i=0;i<dateParts.length;i++)
{if(isNaN(dateParts[i]))
return(returnObject)?null:false;dateParts[i]=parseInt(dateParts[i],10);}
var obj=new Object();if(dateParts.length!=formatParts.length)
return(returnObject)?null:false;var d1=new Date();obj.month=d1.getMonth()+1;obj.year=d1.getFullYear();obj.day=d1.getDate();for(var i=0;i<formatParts.length;i++)
{switch(formatParts[i].toLowerCase())
{case'd':case'dd':obj.day=dateParts[i];break;case'y':case'yy':case'yyyy':obj.year=dateParts[i];break;case'm':case'mm':obj.month=dateParts[i];break;}}
var d2=new Date(obj.year,obj.month-1,obj.day);if(d2.getFullYear()!=obj.year||d2.getMonth()!=(obj.month-1)||d2.getDate()!=obj.day)
return(returnObject)?null:false;return(returnObject)?obj:true;}
function cultureInfo_isTime(timeValue,format,returnObject)
{if(typeof(returnObject)=='undefined')
returnObject=false;var obj=new Object();var formatParts;if(format=='g'||format=='t')
formatParts=this.shortTimePattern.split(this.timeSeparator);else
formatParts=this.longTimePattern.split(this.timeSeparator);var timeParts=timeValue.split(this.timeSeparator);for(var i=0;i<timeParts.length;i++)
{if(isNaN(timeParts[i]))
return(returnObject)?null:false;timeParts[i]=parseInt(timeParts[i],10);}
if(timeParts.length!=formatParts.length)
return(returnObject)?null:false;obj.hour=0;obj.mins=0;obj.secs=0;for(var i=0;i<formatParts.length;i++)
{switch(formatParts[i].toLowerCase())
{case'h':case'hh':obj.hour=timeParts[i];break;case'm':case'mm':obj.mins=timeParts[i];break;case's':case'ss':obj.secs=timeParts[i];break;}}
if(obj.hour>23||obj.hour<0||obj.mins>59||obj.mins<0||obj.secs>59||obj.secs<0)
return(returnObject)?null:false;return(returnObject)?obj:true;}
function cultureInfo_formattedDate(format,year,month,day,hour,min)
{var datePart='';var timePart='';if(format=='d'||format=='g'||format=='G')
{var formatParts=this.shortDatePattern.split(this.dateSeparator);var arr=new Array();for(var i=0;i<formatParts.length;i++)
{switch(formatParts[i].toLowerCase())
{case'd':case'dd':arr[arr.length]=day;break;case'm':case'mm':arr[arr.length]=month;break;case'y':case'yy':case'yyyy':arr[arr.length]=year;break;}}
datePart=arr.join(this.dateSeparator);}
if(format.toLowerCase()=='g'||format.toLowerCase()=='t')
{arr=new Array();if(format=='g'||format=='t')
formatParts=this.shortTimePattern.split(this.timeSeparator);else
formatParts=this.longTimePattern.split(this.timeSeparator);for(var i=0;i<formatParts.length;i++)
{switch(formatParts[i].toLowerCase())
{case'h':case'hh':arr[arr.length]=lz(hour);break;case'm':case'mm':arr[arr.length]=lz(min);break;case's':case'ss':arr[arr.length]='00';break;}}
timePart=arr.join(this.timeSeparator);}
if(datePart!='')
return datePart+' '+timePart;return timePart;}
function cultureInfo_sizeDateTimeField(field)
{var format='d';if(typeof(field.format!='undefined'))
if(field.format!='')
format=field.format;switch(format)
{case'd':l=10;break;case'g':l=16;break;case'G':l=19;break;case't':l=5;break;case'T':l=8;break;default:l=20;break;}
field.size=l;field.maxLength=20;}
function getElementById(rootNode,id)
{return dbNetLink.getElementById(rootNode,id);}
function disableElementById(rootNode,id,disabled)
{var el=dbNetLink.getElementById(rootNode,id);if(el)
el.disabled=disabled;}
function hideElementById(rootNode,id,visible)
{var el=dbNetLink.getElementById(rootNode,id);if(el)
el.style.display=(visible)?'block':'none';}
function setElementStyleById(rootNode,id,styleName,styleValue)
{var el=dbNetLink.getElementById(rootNode,id);if(el)
el.style[styleName]=styleValue;}
function getElementsByClassName(node,className,tagName)
{if(tagName==undefined||tagName==null)
tagName="*";var arr=node.getElementsByTagName(tagName);var ret=new Array();for(var i=0;i<arr.length;i++)
if(arr[i].className.toLowerCase()==className.toLowerCase())
ret[ret.length]=arr[i];return ret;}
function textFromNode(n)
{return dbNetLink.textFromNode(n);}
function xmlFromNode(n)
{if(n==null)
return'';if(typeof(n.xml)=='string')
return n.xml;var s=new XMLSerializer();return(s.serializeToString(n));}
function getNodeValue(doc,pattern)
{return dbNetLink.getNodeValue(doc,pattern);}
function getNode(doc,pattern)
{return dbNetLink.getNode(doc,pattern);}
function addOption(select,text,value)
{var opt=document.createElement("OPTION");opt.value=value;if(document.all)
opt.text=text;else
opt.innerHTML=text;select.options.add(opt);}
function setAccessKey(el)
{var txt=el.innerHTML;var accessKey=txt.toLowerCase().match(/<u>(.*)<\/u>/);if(accessKey)
el.accessKey=accessKey[1];}
function lz(num)
{if(num<10)
return'0'+num.toString();else
return num.toString();}
function testArray(obj)
{return dbNetLink.testArray(obj);}
function sizeDialog(centre)
{dbNetLink.sizeDialog(centre);}
function windowOpen(w)
{return dbNetLink.windowOpen(w);}
function DbNetLink_openModalDialog(url,winName,args,features)
{return dbNetLink.openDialog(url,winName,args,true,features);}
function DbNetLink_openNonModalDialog(url,winName,args,features)
{return(dbNetLink.openDialog(url,winName,args,false,features));}
function openModalDialog(url,winName,args,features)
{return dbNetLink.openDialog(url,winName,args,true,features);}
function openNonModalDialog(url,winName,args,features)
{return(dbNetLink.openDialog(url,winName,args,false,features));}
function openDialog(url,winName,args,modal,optFeatures)
{return dbNetLink.openDialog(url,winName,args,modal,optFeatures);}
function DbNetLink_openDialog(url,winName,args,modal,optFeatures)
{var top=(parseInt(window.screen.availHeight)-100)/2;var left=(parseInt(window.screen.availWidth)-100)/2;winName=winName+dbNetLink.isIE?"":"_"+new Date().valueOf();var features;if(typeof(optFeatures)=='undefined')
optFeatures='';var standardWindow=false;if(args)
standardWindow=eval(args.standardWindow)
if(window.showModalDialog&&dbNetLink.isIE&&!standardWindow)
{features="dialogHeight=200px;dialogWidth=200px;status=yes;help=no;resizable=yes";if(optFeatures!='')
features+=';'+optFeatures.replace(/\,/g,';');if(modal)
return window.showModalDialog(url,args,features);else
return window.showModelessDialog(url,args,features);}
else
{features="top="+top+",left="+left+",toolbar=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,dependent=yes,modal=yes,dialog=yes";if(optFeatures!='')
features+=','+optFeatures.replace(/\;/g,',').replace('dialogHeight','height').replace('dialogWidth','width');if(features.indexOf('height='<0))
features+=',height=100px';if(features.indexOf('width='<0))
features+=',width=100px';if(!window.dialogArguments)
window.dialogArguments=new Object();window.dialogArguments[winName]=args;return window.open(url,winName,features);}}
function centreDialog()
{var h=parseInt(window.screen.availHeight);var w=parseInt(window.screen.availWidth);if(window.dialogTop)
{var left=(w-parseInt(window.dialogWidth))/2;var top=(h-parseInt(window.dialogHeight))/2;window.dialogTop=top+"px";window.dialogLeft=left+"px";}
else
{var left=(w-window.outerWidth)/2;var top=(h-window.outerHeight)/2;window.moveTo(left,top);}}
function repositionDialog(args)
{if(args==null)
return;if(window.dialogTop)
{window.dialogTop=args.y;window.dialogLeft=args.x;}
else
window.moveTo(args.x,args.y);}
function viewSource()
{var o=new Component();initialiseComponent(o);o.xmlRequest.open("GET",document.location.href,false);o.xmlRequest.setRequestHeader("Content-Type","text/XML");o.xmlRequest.send(null);var params=new Object();params.source=o.xmlRequest.responseText;openModalDialog('../common/viewsource.htm','viewsource',params);}
function getCoords(event)
{var o=new Object();if(!event)
{o.srcElement=window.event.srcElement;o.x=window.event.screenX;o.y=window.event.screenY;o.event=window.event;}
else
{o.srcElement=event.target;o.x=event.screenX;o.y=event.screenY;o.event=event;}
return o;}
function getWindowArguments()
{if(opener)
if(opener.dialogArguments)
return opener.dialogArguments[window.name];if(window.dialogArguments)
return window.dialogArguments;return null;}
function addClassName(e,className)
{dbNetLink.addClassName(e,className);}
function removeClassName(e,className)
{dbNetLink.removeClassName(e,className);}
function $(id)
{return document.getElementById(id);}
function sleep(millisecs)
{if(window.showModalDialog)
{}
else
java.lang.Thread.sleep(millisecs);}
function arrayToOptions(str)
{var arr=eval(str);var html=new Array();for(var i=0;i<arr.length;i++)
{if(arr[i].length<2)
continue;var option="<option value='"+arr[i][0]+"'>"+arr[i][1];html[html.length]=option;}
return html.join("");}
function showMessage(str)
{dbNetLink.showMessage(str);}
function clearMessage()
{dbNetLink.clearMessage();}
function createChildNodeObject(node)
{var nodeObj=new Object();for(var j=0;j<node.childNodes.length;j++)
nodeObj[node.childNodes[j].nodeName]=dbNetLink.textFromNode(node.childNodes[j]);return(nodeObj);}
function getParentElement(e,tagName)
{while(e.tagName!=tagName.toUpperCase())
{if(e.parentNode)
e=e.parentNode;else
break;}
return e;}
if(typeof(DOMParser)!="undefined")
_loadMozillaCompatLayer();function _loadMozillaCompatLayer()
{if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.insertAdjacentElement)
{HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode)
{switch(where)
{case'beforeBegin':this.parentNode.insertBefore(parsedNode,this);break;case'afterBegin':this.insertBefore(parsedNode,this.firstChild);break;case'beforeEnd':this.appendChild(parsedNode);break;case'afterEnd':if(this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);else
this.parentNode.appendChild(parsedNode);break;}}
HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr)
{var r=this.ownerDocument.createRange();r.setStartBefore(this);var parsedHTML=r.createContextualFragment(htmlStr);this.insertAdjacentElement(where,parsedHTML);}
HTMLElement.prototype.insertAdjacentText=function(where,txtStr)
{var parsedText=document.createTextNode(txtStr);this.insertAdjacentElement(where,parsedText);}}
if(document.implementation&&document.implementation.createDocument)
{XMLDocument.prototype.selectNodes=function(sExpr,contextNode)
{var oResult=this.evaluate(sExpr,(contextNode?contextNode:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var nodeList=new Array(oResult.snapshotLength);nodeList.expr=sExpr;for(i=0;i<nodeList.length;i++)
nodeList[i]=oResult.snapshotItem(i);return nodeList;};Element.prototype.selectNodes=function(sExpr)
{var doc=this.ownerDocument;if(doc.selectNodes)
return doc.selectNodes(sExpr,this);else
throw"Method selectNodes is only supported by XML Nodes";};XMLDocument.prototype.selectSingleNode=function(sExpr,contextNode)
{var ctx=contextNode?contextNode:null;sExpr+="[1]";var nodeList=this.selectNodes(sExpr,ctx);if(nodeList.length>0)
return nodeList[0];else
return null;};Element.prototype.selectSingleNode=function(sExpr)
{var doc=this.ownerDocument;if(doc.selectSingleNode)
return doc.selectSingleNode(sExpr,this);else
throw"Method selectSingleNode is only supported by XML Nodes";};HTMLElement.prototype.__defineGetter__("parentElement",function()
{return(this.parentNode==this.ownerDocument)?null:this.parentNode;});var _emptyTags={"IMG":true,"BR":true,"INPUT":true,"META":true,"LINK":true,"PARAM":true,"HR":true};HTMLElement.prototype.__defineGetter__("outerHTML",function(){var attrs=this.attributes;var str="<"+this.tagName;for(var i=0;i<attrs.length;i++)
str+=" "+attrs[i].name+"=\""+attrs[i].value+"\"";if(_emptyTags[this.tagName])
return str+">";return str+">"+this.innerHTML+"</"+this.tagName+">";});HTMLElement.prototype.__defineSetter__("outerHTML",function(sHTML){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(sHTML);this.parentNode.replaceChild(df,this);});HTMLElement.prototype.__defineGetter__("innerText",function(){var tmp=this.innerHTML.replace(/<br>/gi,"\n");return tmp.replace(/<[^>]+>/g,"");});HTMLElement.prototype.__defineSetter__("innerText",function(txtStr){var parsedText=document.createTextNode(txtStr);this.innerHTML="";this.appendChild(parsedText);});HTMLElement.prototype.click=function(){var evt=this.ownerDocument.createEvent('MouseEvents');evt.initMouseEvent('click',true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(evt);}}}
DbNetSpell.prototype.componentName='DbNetSpell';DbNetSpell.prototype.configLang='default';DbNetSpell.prototype.checkCustomRange=DbNetSpell_checkCustomRange;DbNetSpell.prototype.checkElement=DbNetSpell_checkElement;DbNetSpell.prototype.checkNext=DbNetSpell_checkNext;DbNetSpell.prototype.checkRange=DbNetSpell_checkRange;DbNetSpell.prototype.checkSelection=DbNetSpell_checkSelection;DbNetSpell.prototype.fireComplete=DbNetSpell_fireComplete;DbNetSpell.prototype.languageChanged=DbNetSpell_languageChanged;DbNetSpell.prototype.loadConfig=DbNetSpell_loadConfig;DbNetSpell.prototype.registerElement=DbNetSpell_registerElement;DbNetSpell.prototype.setLanguage=DbNetSpell_languageChanged;DbNetSpell.prototype.dbNetSpellComplete=null;DbNetSpell.prototype.onComplete=null;DbNetSpellStatistics.prototype.add=DbNetSpellStatistics_add;DbNetSpellElement.prototype=new Component();DbNetSpellElement.prototype.checkTags=true;DbNetSpellElement.prototype.clipboard=true;DbNetSpellElement.prototype.colorSelection=true;DbNetSpellElement.prototype.connectionString=null;DbNetSpellElement.prototype.correctedSample="";DbNetSpellElement.prototype.dbNetSpell=null;DbNetSpellElement.prototype.dictionary=null;DbNetSpellElement.prototype.endOffset=null;DbNetSpellElement.prototype.fontNames="Arial,Courier,Garamond,Tahoma,Times New Roman,Verdana";DbNetSpellElement.prototype.fontSelection=true;DbNetSpellElement.prototype.fontStyle=true;DbNetSpellElement.prototype.format=true;DbNetSpellElement.prototype.justify=true;DbNetSpellElement.prototype.maximumSuggestions=null;DbNetSpellElement.prototype.originalSample="";DbNetSpellElement.prototype.requiredProperties=['connectionString','dictionary','virtualDir','maximumSuggestions','tokenBoundary','soundexGroups'];DbNetSpellElement.prototype.server="dbnetspell.aspx";DbNetSpellElement.prototype.soundexGroups=null;DbNetSpellElement.prototype.spell=true;DbNetSpellElement.prototype.startOffset=null;DbNetSpellElement.prototype.statistics=null;DbNetSpellElement.prototype.tokenBoundary=null;DbNetSpellElement.prototype.toolbar=null;DbNetSpellElement.prototype.toolbarComplete=null;DbNetSpellElement.prototype.toolbarConfiguration=null;DbNetSpellElement.prototype.toolbarLayout=null;DbNetSpellElement.prototype.virtualDir=null;DbNetSpellElement.prototype.workspace=null;DbNetSpellElement.prototype.addToDictionary=DbNetSpellElement_addToDictionary;DbNetSpellElement.prototype.check=DbNetSpellElement_check;DbNetSpellElement.prototype.checkButton=DbNetSpellElement_checkButton;DbNetSpellElement.prototype.checkElement=DbNetSpellElement_checkElement;DbNetSpellElement.prototype.checkElementIE=DbNetSpellElement_checkElementIE;DbNetSpellElement.prototype.checkMoz=DbNetSpellElement_checkMoz;DbNetSpellElement.prototype.checkRange=DbNetSpellElement_checkRange;DbNetSpellElement.prototype.checkSelection=DbNetSpellElement_checkSelection;DbNetSpellElement.prototype.checkText=DbNetSpellElement_checkText;DbNetSpellElement.prototype.createColors=DbNetSpellElement_createColors;DbNetSpellElement.prototype.doVertical=DbNetSpellElement_doVertical;DbNetSpellElement.prototype.fireComplete=DbNetSpellElement_fireComplete;DbNetSpellElement.prototype.focusDialogWindow=DbNetSpellElement_focusDialogWindow;DbNetSpellElement.prototype.fontNameChange=DbNetSpellElement_fontNameChange;DbNetSpellElement.prototype.fontSizeChange=DbNetSpellElement_fontSizeChange;DbNetSpellElement.prototype.inList=DbNetSpellElement_inList;DbNetSpellElement.prototype.languageChanged=DbNetSpellElement_languageChanged;DbNetSpellElement.prototype.makeFontSelector=DbNetSpellElement_makeFontSelector;DbNetSpellElement.prototype.makeToolbar=DbNetSpellElement_makeToolbar;DbNetSpellElement.prototype.makeToolbarButton=DbNetSpellElement_makeToolbarButton;DbNetSpellElement.prototype.mozHilite=DbNetSpellElement_mozHilite;DbNetSpellElement.prototype.selectColor=DbNetSpellElement_selectColor;DbNetSpellElement.prototype.setDocumentProperties=DbNetSpellElement_setDocumentProperties;DbNetSpellElement.prototype.showColorPopup=DbNetSpellElement_showColorPopup;function DbNetSpell(container,lang)
{initialiseComponent(this);this.childComponents=new Array();if(lang)
this.language=lang;this.loadConfig();if(container!=null)
this.registerElement(container,lang)
this.statistics=new DbNetSpellStatistics();}
function DbNetSpell_loadConfig()
{var xml=this.serialise('language');if(!this.callService(xml,"loadconfig"))
return
var nodeList=this.getNode(this.language).childNodes;this.text=new Array();for(var i=0;i<nodeList.length;i++)
this.text[nodeList[i].nodeName]=textFromNode(nodeList[i]);this.culture=new cultureInfo(this);}
function DbNetSpell_registerElement(container,lang)
{if(typeof(container)=='string')
field=$(container);if(!container)
{alert("registerElement : container does not exist")
return}
var o=new DbNetSpellElement(this,container,lang);this.childComponents[this.childComponents.length]=o;}
function DbNetSpell_checkRange(startMarker,endMarker)
{if(this.childComponents.length==0)
{alert("no elements have been registered")
return}
var ctrl=this.childComponents[0]
var start=0
var end=ctrl.container.value.length-1;if(startMarker!='')
start=ctrl.container.value.indexOf(startMarker)+startMarker.length;if(endMarker!='')
end=ctrl.container.value.indexOf(endMarker,start)+endMarker.length;if(start>=startMarker.length&&end>start)
{if(this.isIE)
{var range=ctrl.container.createTextRange()
range.move('character',start)
range.moveEnd('character',end-start)}
else
{var range=document.createRange();range.setStart(ctrl.childNodes[0],start);range.setEnd(ctrl.childNodes[0],end);}
this.checkCustomRange(range);}}
function DbNetSpell_checkCustomRange(range,html)
{if(this.childComponents.length==0)
{alert("no elements have been registered")
return}
this.singleElement=true;this.childComponents[0].checkRange(range,html)}
function DbNetSpell_checkNext(oSpellElement)
{if(oSpellElement.statistics.cancelled)
{this.statistics.cancelled=true;this.fireComplete();}
else
{this.statistics.add(oSpellElement.statistics)
if(oSpellElement.index==(this.childComponents.length-1)||this.singleElement)
{this.statistics.cancelled=false;this.fireComplete();}
else
{var nextSpell=this.childComponents[oSpellElement.index+1]
nextSpell.checkElement();}}}
function DbNetSpell_checkElement(singleElement)
{if(this.childComponents.length==0)
{alert("no elements have been registered")
return}
this.statistics=new DbNetSpellStatistics()
if(typeof(singleElement)=='string')
{var matchedElement=null;for(var i=0;i<this.childComponents.length;i++)
{if(this.childComponents[i].container.id==singleElement)
{matchedElement=this.childComponents[i]
break;}}
if(matchedElement!=null)
{this.singleElement=true
matchedElement.checkElement();return;}}
this.singleElement=false
this.childComponents[0].checkElement();}
function DbNetSpell_checkSelection(degrade)
{if(this.childComponents.length==0)
{alert("no elements have been registered")
return}
this.singleElement=true
this.childComponents[0].checkSelection(degrade);}
function DbNetSpell_fireComplete()
{var result=this.fireCustomEvent(this.dbNetSpellComplete,this);var result=this.fireCustomEvent(this.onComplete,this);if(eval(this.automaticMessages)&&this.dbNetSpellComplete==null&&this.onComplete==null)
{var msgType;if(this.statistics.cancelled)
msgType='cancelledMessage';else
msgType=(this.errors==0?'noErrorsMessage':'completedMessage')
if(typeof(this.text[msgType])=='string')
{var msg=this.text[msgType]
for(var prop in this.statistics)
msg=msg.replace("{"+prop+"}",this.statistics[prop])
alert(msg)}}}
function DbNetSpell_languageChanged(lang)
{this.language=lang;this.loadConfig();for(var i=0;i<this.childComponents.length;i++)
{var o=this.childComponents[i];o.connectionString=this.text['connectionAlias'];o.dictionary=this.text['dictionary'];o.tokenBoundary=this.text['tokenBoundary'];o.soundexGroups=this.text['soundexGroups'];var selector=$(o.container.id+'.Language')
if(selector)
selector.value=this.language;}}
function DbNetSpellElement(dbNetSpell,container,lang)
{switch(typeof(container))
{case"string":container=$(container);break;}
initialiseComponent(this);this.initialiseStyleSheet();this.virtualDir=dbNetSpell.virtualDir
this.dbNetSpell=dbNetSpell;this.index=dbNetSpell.childComponents.length;this.maximumSuggestions=dbNetSpell.maximumSuggestions;this.container=container;this.workspace=document.createElement("TEXTAREA")
this.statistics=new DbNetSpellStatistics()
if(this.container.getAttribute("fontStyle")!=null)
this.fontStyle=this.container.getAttribute("fontStyle");if(this.container.getAttribute("justify")!=null)
this.justify=this.container.getAttribute("justify");if(this.container.getAttribute("clipboard")!=null)
this.clipboard=this.container.getAttribute("clipboard");if(this.container.getAttribute("format")!=null)
this.format=this.container.getAttribute("format");if(this.container.getAttribute("spell")!=null)
this.spell=this.container.getAttribute("spell");if(this.container.getAttribute("colorSelection")!=null)
this.colorSelection=this.container.getAttribute("colorSelection");if(this.container.getAttribute("fontSelection")!=null)
this.fontSelection=this.container.getAttribute("fontSelection");this.connectionString=this.dbNetSpell.text['connectionAlias'];this.dictionary=this.dbNetSpell.text['dictionary'];this.tokenBoundary=this.dbNetSpell.text['tokenBoundary'];this.soundexGroups=this.dbNetSpell.text['soundexGroups'];this.toolbarLayout=new Array()
if(this.container.tagName=="IFRAME")
{if(!this.isIE)
this.container.contentDocument.designMode="on";var toolbarContainer=$(this.container.id+'.Toolbar');if(toolbarContainer)
this.makeToolbar(toolbarContainer)}
var languageContainer=$(this.container.id+'.Language');if(languageContainer)
{if(languageContainer.tagName.toLowerCase()=="select")
{if(this.callService("","languages"))
{var languages=this.getNode("root").childNodes;for(var i=0;i<languages.length;i++)
addOption(languageContainer,textFromNode(languages[i].selectSingleNode("description")),textFromNode(languages[i].selectSingleNode("id")));}
languageContainer.value=this.dbNetSpell.language
languageContainer.onchange=this.assignHandler("languageChanged");}}}
function DbNetSpellElement_languageChanged()
{this.dbNetSpell.languageChanged($(this.container.id+'.Language').value);}
function DbNetSpellElement_makeToolbar(container)
{var defaultLayout=['Cut','Copy','Paste','|','Bold','Italic','Underline','StrikeThrough','SubScript','SuperScript','|','JustifyLeft','JustifyCenter','JustifyRight','|','InsertUnorderedList','InsertOrderedList','Outdent','Indent','InsertHorizontalRule','|','Spell','BR','ForeColor','BackColor','|','FontSelector']
if(!this.isIE)
this.colorSelection=false;var result=this.fireCustomEvent(this.toolbarConfiguration,this);var buttons=new Array()
if(this.toolbarLayout.length!=0)
{for(var i=0;i<this.toolbarLayout.length;i++)
{var b=this.checkButton(this.toolbarLayout[i],defaultLayout)
if(b!='')
buttons[buttons.length]=b}}
else
buttons=defaultLayout
var html="<table id=toolbarTable cellpadding=0 cellspacing=0><tr>"
var seperator=true
for(var i in buttons)
{if(seperator&&buttons[i]=='|')
continue
if(!eval(this.clipboard)&&this.inList(buttons[i],['Cut','Copy','Paste']))
continue
if(!eval(this.fontStyle)&&this.inList(buttons[i],['Bold','Italic','Underline','StrikeThrough','SubScript','SuperScript']))
continue
if(!eval(this.justify)&&this.inList(buttons[i],['JustifyLeft','JustifyCenter','JustifyRight']))
continue
if(!eval(this.format)&&this.inList(buttons[i],['InsertUnorderedList','InsertOrderedList','Outdent','Indent','InsertHorizontalRule']))
continue
if(!eval(this.spell)&&this.inList(buttons[i],['Spell']))
continue
if(!eval(this.colorSelection)&&this.inList(buttons[i],['ForeColor','BackColor']))
continue
if(!eval(this.fontSelection)&&this.inList(buttons[i],['fontSelector']))
continue
html+=this.makeToolbarButton(buttons[i])
if(buttons[i]=='|')
seperator=true
else
seperator=false}
html+="</tr></table>"
container.innerHTML=html
for(var i in buttons)
if(buttons[i]!='|'&&buttons[i].toLowerCase()!='br'&&buttons[i]!='FontSelector')
{var btn=getElementById(container,buttons[i]+'Btn');if(btn)
btn.onclick=this.assignHandler('setDocumentProperties');}
var btn=getElementById(container,"ForeColorBtn");if(btn)
btn.onclick=this.assignHandler("showColorPopup");var btn=getElementById(container,"BackColorBtn");if(btn)
btn.onclick=this.assignHandler("showColorPopup");var btn=getElementById(container,"fontBox");if(btn)
btn.onchange=this.assignHandler("fontNameChange");var btn=getElementById(container,"sizeBox");if(btn)
btn.onchange=this.assignHandler("fontSizeChange");var tables=container.getElementsByTagName("table")
for(var i=0;i<tables.length;i++)
{var cells=tables[i].rows[0].cells
if(cells.length>0)
if(cells[0].id=="seperator")
cells[0].style.display="none"
var ct=0
for(var c=0;c<cells.length;c++)
if(cells[c].style.display!="none")
ct++
if(ct==0)
tables[i].style.display="none"}
var result=this.fireCustomEvent(this.toolbarComplete,this);}
function DbNetSpellElement_inList(button,buttonArr)
{for(var i=0;i<buttonArr.length;i++)
if(buttonArr[i].toLowerCase()==button.toLowerCase())
return true
return false}
function DbNetSpellElement_checkButton(id,defaultLayout)
{if(id.toLowerCase()=='br'||id=='|')
return id
var match=''
for(var i=0;i<defaultLayout.length;i++)
{if(id.toLowerCase()==defaultLayout[i].toLowerCase())
{match=defaultLayout[i]
break}}
return match}
function DbNetSpellElement_setDocumentProperties(evt)
{var action=evt.srcElement.id.replace("Btn","")
switch(action)
{case"Bold":case"Italic":case"Underline":case"StrikeThrough":case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"InsertUnorderedList":case"InsertOrderedList":case"Outdent":case"Indent":case"Cut":case"Copy":case"SubScript":case"SuperScript":case"InsertHorizontalRule":if(document.focus)
document.focus()
rVal=this.container.contentWindow.document.execCommand(action,false,'');break;case"Paste":if(document.focus)
document.focus()
if(this.isIE)
rVal=this.container.contentWindow.document.execCommand('Paste')
else
rVal=this.container.contentWindow.document.execCommand('Paste',false,'')
break;case"DoVertical":this.doVertical()
break;case"Spell":this.checkElement()
break;}
this.container.focus()}
function DbNetSpellElement_makeToolbarButton(id)
{var html=""
switch(id.toLowerCase())
{case'|':html="<td id=seperator><span style='fontSize = 0;height = \"25px\";margin-left:3;margin-right:3;border = \"1.5 inset #efefef\"'></SPAN></td>"
break;case'br':html="</tr></table><table style='margin-top:5' cellpadding=0 cellspacing=0><tr>"
break;case'fontselector':html=this.makeFontSelector()
break;default:html="<td id="+id+"Cell><button class='toolbarButton' title ='"+this.dbNetSpell.text[id]+"' id="+id+"Btn><img src="+this.virtualDir+"images/"+id.toLowerCase()+".gif></button></td>"
break}
return html}
function DbNetSpellElement_makeFontSelector()
{var fontFamilies=this.fontNames.split(",")
var html="<td id=fontSelectorCell><select id=fontBox size=1>"
for(var i in fontFamilies)
html+="<option value='"+fontFamilies[i]+"'>"+fontFamilies[i]
html+="</select>&nbsp;<select id=sizeBox>"
for(var i=1;i<7;i++)
if(i==3)
html+="<option selected value="+i+">"+i
else
html+="<option value="+i+">"+i
html+="</select></td>"
return html}
function DbNetSpellElement_doVertical()
{if(this.container.style.writingMode=='tb-rl')
this.container.style.writingMode='lr-tb';else
this.container.style.writingMode='tb-rl';}
function DbNetSpellElement_fontNameChange(evt)
{this.container.contentWindow.document.execCommand("FontName",false,evt.srcElement.value);}
function DbNetSpellElement_fontSizeChange(evt)
{this.container.contentWindow.document.execCommand("FontSize",false,evt.srcElement.value);}
function DbNetSpellElement_showColorPopup(evt)
{var parentButton=evt.srcElement.id.replace("Btn","")
var k=0;popUp=window.createPopup();var popupBody=popUp.document.body;popupBody.style.border="2px solid black"
var colors=this.createColors()
var html="<div style='overflow:auto;' id='layout'><table id='colorsTable' style='border-collapse:collapse; border: 1px solid dimgray' parentButton='"+parentButton+"'>";for(var i=0;i<14;i++)
{html+="<tr>"
for(var j=0;j<10;j++)
html+="<td onclick='parent.DbNetSpellElement_selectColor(this)' style='font-family:tahoma,arial; font-size:11px; width:10px; height:8px; border: 1px solid white'>&nbsp;</td>"
html+="</tr>"}
html+="</table></div>"
popupBody.innerHTML=html;var table=popupBody.children[0].children[0];for(var i=0;i<table.rows.length;i++)
{var row=table.rows[i]
for(var j=0;j<row.cells.length;j++)
{var cell=row.cells[j]
cell.title=colors[k]
cell.spell=this;cell.style.backgroundColor=colors[k];k++}}
popUp.show(window.event.x,window.event.y,135,229,document.body);}
function DbNetSpellElement_selectColor(cell)
{var table=cell.parentElement
var doc=cell.spell.container.contentWindow.document;while(table.tagName.toLowerCase()!="table")
table=table.parentElement
var selectedColor=cell.style.backgroundColor
doc.execCommand(table.parentButton,false,selectedColor);popUp.hide();}
function DbNetSpellElement_createColors()
{var bgColor=new Object();bgColor[0]="LightPink"
bgColor[1]="Pink"
bgColor[2]="Crimson"
bgColor[3]="LavenderBlush"
bgColor[4]="PaleVioletRed"
bgColor[5]="HotPink"
bgColor[6]="DeepPink"
bgColor[7]="MediumVioletRed"
bgColor[8]="Orchid"
bgColor[9]="Thistle"
bgColor[10]="Plum"
bgColor[11]="Violet"
bgColor[12]="Magenta"
bgColor[13]="Fuchsia"
bgColor[14]="DarkMagenta"
bgColor[15]="Purple"
bgColor[16]="MediumOrchid"
bgColor[17]="DarkViolet"
bgColor[18]="DarkOrchid"
bgColor[19]="Indigo"
bgColor[20]="BlueViolet"
bgColor[21]="MediumPurple"
bgColor[22]="MediumSlateBlue"
bgColor[23]="SlateBlue"
bgColor[24]="DarkSlateBlue"
bgColor[25]="Lavender"
bgColor[26]="GhostWhite"
bgColor[27]="Blue"
bgColor[28]="MediumBlue"
bgColor[29]="MidnightBlue"
bgColor[30]="DarkBlue"
bgColor[31]="Navy"
bgColor[32]="RoyalBlue"
bgColor[33]="CornflowerBlue"
bgColor[34]="LightSteelBlue"
bgColor[35]="LightSlateGray"
bgColor[36]="SlateGray"
bgColor[37]="DodgerBlue"
bgColor[38]="AliceBlue"
bgColor[39]="SteelBlue"
bgColor[40]="LightSkyBlue"
bgColor[41]="SkyBlue"
bgColor[42]="DeepSkyBlue"
bgColor[43]="LightBlue"
bgColor[44]="PowderBlue"
bgColor[45]="CadetBlue"
bgColor[46]="Azure"
bgColor[47]="LightCyan"
bgColor[48]="PaleTurquoise"
bgColor[49]="Cyan"
bgColor[50]="Aqua"
bgColor[51]="DarkTurquoise"
bgColor[52]="DarkSlateGray"
bgColor[53]="DarkCyan"
bgColor[54]="Teal"
bgColor[55]="MediumTurquoise"
bgColor[56]="LightSeaGreen"
bgColor[57]="Turquoise"
bgColor[58]="Aquamarine"
bgColor[59]="MediumAquamarine"
bgColor[60]="MediumSpringGreen"
bgColor[61]="MintCream"
bgColor[62]="SpringGreen"
bgColor[63]="MediumSeaGreen"
bgColor[64]="SeaGreen"
bgColor[65]="Honeydew"
bgColor[66]="LightGreen"
bgColor[67]="PaleGreen"
bgColor[68]="DarkSeaGreen"
bgColor[69]="LimeGreen"
bgColor[70]="Lime"
bgColor[71]="ForestGreen"
bgColor[72]="Green"
bgColor[73]="DarkGreen"
bgColor[74]="Chartreuse"
bgColor[75]="LawnGreen"
bgColor[76]="GreenYellow"
bgColor[77]="DarkOliveGreen"
bgColor[78]="YellowGreen"
bgColor[79]="OliveDrab"
bgColor[80]="Beige"
bgColor[81]="LightGoldenrodYellow"
bgColor[82]="Ivory"
bgColor[83]="LightYellow"
bgColor[84]="Yellow"
bgColor[85]="Olive"
bgColor[86]="DarkKhaki"
bgColor[87]="LemonChiffon"
bgColor[88]="PaleGoldenrod"
bgColor[89]="Khaki"
bgColor[90]="Gold"
bgColor[91]="Cornsilk"
bgColor[92]="Goldenrod"
bgColor[93]="DarkGoldenrod"
bgColor[94]="FloralWhite"
bgColor[95]="OldLace"
bgColor[96]="Wheat"
bgColor[97]="Moccasin"
bgColor[98]="Orange"
bgColor[99]="PapayaWhip"
bgColor[100]="BlanchedAlmond"
bgColor[101]="NavajoWhite"
bgColor[102]="AntiqueWhite"
bgColor[103]="Tan"
bgColor[104]="BurlyWood"
bgColor[105]="Bisque"
bgColor[106]="DarkOrange"
bgColor[107]="Linen"
bgColor[108]="Peru"
bgColor[109]="PeachPuff"
bgColor[110]="SandyBrown"
bgColor[111]="Chocolate"
bgColor[112]="SaddleBrown"
bgColor[113]="Seashell"
bgColor[114]="Sienna"
bgColor[115]="LightSalmon"
bgColor[116]="Coral"
bgColor[117]="OrangeRed"
bgColor[118]="DarkSalmon"
bgColor[119]="Tomato"
bgColor[120]="MistyRose"
bgColor[121]="Salmon"
bgColor[122]="Snow"
bgColor[123]="LightCoral"
bgColor[124]="RosyBrown"
bgColor[125]="IndianRed"
bgColor[126]="Red"
bgColor[127]="Brown"
bgColor[128]="FireBrick"
bgColor[129]="DarkRed"
bgColor[130]="Maroon"
bgColor[131]="White"
bgColor[132]="WhiteSmoke"
bgColor[133]="Gainsboro"
bgColor[134]="LightGrey"
bgColor[135]="Silver"
bgColor[136]="DarkGray"
bgColor[137]="Gray"
bgColor[138]="DimGray"
bgColor[139]="Black"
return(bgColor)}
function DbNetSpellElement_checkText(txt)
{this.workspace.value=txt
var range=this.workspace.createTextRange()
return(this.check(range,false,true))}
function DbNetSpellElement_checkSelection(degrade)
{if(this.isIE)
{var range=document.selection.createRange()
if(range.text=='')
{if(degrade)
this.checkElement()
else
alert(this.dbNetSpell.text['noselectionMessage'])
return}
else
if(this.checkRange(range))
document.selection.text=this.correctedSample}
else
{if(this.container.selectionStart==this.container.selectionEnd)
{if(degrade)
this.checkElement()
else
alert(this.dbNetSpell.text['noselectionMessage']);}
else
{this.startOffset=this.container.selectionStart;this.endOffset=this.container.selectionEnd;this.checkMoz();}}}
function DbNetSpellElement_checkRange(range,html)
{if(html==null)
html=false
if(this.isIE)
return(this.check(range,html,false))
this.startOffset=range.startOffset;this.endOffset=range.endOffset;return(this.checkMoz())}
function DbNetSpellElement_checkElement()
{if(this.isIE)
return(this.checkElementIE())
else
{this.startOffset=0;this.endOffset=0;return(this.checkMoz());}}
function DbNetSpellElement_checkElementIE()
{if(this.container.isTextEdit)
{var range=this.container.createTextRange()
return(this.check(range,false,false))}
if(typeof(this.container.innerHTML)=="string")
{if(this.container.tagName.toLowerCase()=="iframe")
{var el=document.frames[this.container.id].document.body
var range=el.createTextRange()
range.moveToElementText(el)}
else
{var el=this.container.parentElement
while(!el.isTextEdit)
el=el.parentElement
if(!el.isTextEdit)
return false
var range=el.createTextRange()
range.moveToElementText(this.container)}
return(this.check(range,true,false))}}
function DbNetSpellElement_check(range,html,sourceInDlg)
{if(html)
var sample=range.htmlText
else
var sample=range.text
with(this.statistics)
{errors=0
skipped=0
changed=0
added=0
cancelled=true}
var tmp=sample.replace("<![CD"+"ATA[","").replace("]"+"]>","")
if(!eval(this.checkTags)||html)
tmp=tmp.split("\n").join("").replace(/<(.+?)>/gm,"")
var xml=dbNetLink.createXmlNode('text',tmp)
if(!this.callService(xml,"check"))
{this.fireComplete()
return false}
var items=this.xmlResponse.selectNodes("//item")
if(items.length==0)
{this.statistics.cancelled=false
this.fireComplete()
return true}
this.statistics.errors=items.length
var o=new Object()
o.dbNetSpellElement=this
o.range=range
o.sampleText=tmp
o.html=html
o.sourceInDlg=sourceInDlg
this.correctedSample=tmp
this.originalSample=sample
var status=window.showModalDialog(this.virtualDir+"dbnetspell.htm",o,'status=yes;help=no')
try
{window.focus()}
catch(e)
{}
this.fireComplete()
return status}
function DbNetSpellElement_checkMoz()
{var sample;this.statistics=new Object();this.statistics.errors=0;this.statistics.skipped=0;this.statistics.changed=0;this.statistics.added=0;this.statistics.cancelled=true;if(this.container.tagName=="IFRAME")
sample=this.container.contentWindow.document.body.innerHTML.replace(/<(.+?)>/gm,"");else
if(!this.container.value)
{sample=this.container.innerHTML.replace("<![CD"+"ATA[","").replace("]"+"]>","");sample=sample.split("\n").join(" ").replace(/<(.+?)>/gm,"")}
else
{sample=this.container.value.toString();if(this.startOffset!=0&&this.endOffset!=0&&this.startOffset!=this.endOffset)
sample=sample.substring(this.startOffset,this.endOffset);sample=sample.replace("<![CD"+"ATA[","").replace("]"+"]>","");}
var xml=dbNetLink.createXmlNode('text',sample)
if(!this.callService(xml,"check"))
{this.fireComplete()
return false}
var items=this.xmlResponse.selectNodes("//item")
if(items.length==0)
{this.statistics.cancelled=false
this.fireComplete()
return true}
this.statistics.errors=items.length;if(!dbNetLink.windowOpen(this.dialogWindow))
this.dialogWindow=openNonModalDialog(this.virtualDir+"dbnetspell_moz.htm",'dbnetspell',this);else
this.dialogWindow.focus();return true;}
function DbNetSpellElement_addToDictionary(additions)
{if(!eval(this.dbNetSpell.allowAddition))
return
var xml=""
additions.sort()
for(var i=1;i<additions.length;i++)
if(additions[i]!=additions[i-1])
xml+=dbNetLink.createXmlNode("word",additions[i-1])
xml+=dbNetLink.createXmlNode("word",additions[i-1])
if(!this.callService(xml,"add"))
return false
this.statistics.added=additions.length;return this.getNodeValue("msg");}
function DbNetSpellElement_fireComplete()
{this.dbNetSpell.checkNext(this);}
function DbNetSpellElement_focusDialogWindow()
{if(!this.isIE)
if(dbNetLink.FFVersion>=2)
if(dbNetLink.windowOpen(this.dialogWindow))
this.dialogWindow.focus();}
function DbNetSpellElement_mozHilite(start,end,node)
{if(this.container.setSelectionRange)
{window.focus()
this.container.selectionStart=start;this.container.selectionEnd=end;this.container.focus();}
else
{var range=document.createRange();range.setStart(node,start);range.setEnd(node,end);if(this.container.tagName=="IFRAME")
{this.container.contentWindow.getSelection().removeAllRanges();this.container.contentWindow.getSelection().addRange(range);}
else
{window.getSelection().removeAllRanges();window.getSelection().addRange(range);}}}
function DbNetSpellStatistics()
{this.errors=0
this.skipped=0
this.changed=0
this.added=0
this.cancelled=false}
function DbNetSpellStatistics_add(stats)
{this.errors+=stats.errors
this.skipped+=stats.skipped
this.changed+=stats.changed
this.added+=stats.added}