// Copyright (C) Acquiro Systems Inc. 2012 - All Rights Reserved

var BROWSER_IE=false;var BROWSER_FIREFOX=false;var BROWSER_OPERA=false;var BROWSER_SAFARI=false;var BROWSER_CHROME=false;var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++)
{var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString)
{if(dataString.indexOf(data[i].subString)!=-1)
{return data[i].identity;}}
else if(dataProp)
{return data[i].identity;}}
return null;},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return-1;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();BROWSER_IE=BrowserDetect.browser=="Explorer";BROWSER_FIREFOX=BrowserDetect.browser=="Firefox";BROWSER_OPERA=BrowserDetect.browser=="Opera";BROWSER_SAFARI=BrowserDetect.browser=="Safari";BROWSER_CHROME=BrowserDetect.browser=="Chrome";function getBrowserVersion()
{return BrowserDetect.version;}
function isInternetExplorer()
{return BROWSER_IE;}
function isFirefox()
{return BROWSER_FIREFOX;}
function isOpera()
{return BROWSER_OPERA;}
function isSafari()
{return BROWSER_SAFARI;}
function isChrome()
{return BROWSER_CHROME;}
function copyPrototype(descendant,parent)
{var sConstructor=parent.toString();var aMatch=sConstructor.match(/\s*function (.*)\(/);if(aMatch!=null)
{var fname=aMatch[1];var index=fname.indexOf("(");if(index>-1)
{fname=fname.substring(0,index);}
descendant.prototype[fname]=parent;}
for(var m in parent.prototype)
{descendant.prototype[m]=parent.prototype[m];}}
function getType(object)
{var strConst=object.constructor.toString();strConst=strConst.substring(9,strConst.length);var index=strConst.indexOf("(");strConst=strConst.substring(0,index);strConst=trim(strConst);return strConst;}
function isTypeOf(object,type)
{return getType(object)==type;}
function deleteObject(obj)
{if(obj==null)
{return;}
var objPrototype;eval("objPrototype = "+getType(obj)+".prototype;")
if(objPrototype==undefined)
{return;}
for(var m in obj)
{if(objPrototype[m.toString()]!=null)
{continue;}
eval("obj. "+m.toString()+" = null;")}}
var LAST_EVENT=null;function EventDispatcher_addEventListener(htmlObj,eventType,listener)
{if(htmlObj.EVENT_DISPATCHER==null)
{htmlObj.EVENT_DISPATCHER=new EventDispatcher(htmlObj);}
htmlObj.EVENT_DISPATCHER.addEventHandler(eventType,listener);}
function EventDispatcher_removeEventListener(htmlObj,eventType,listener)
{if(htmlObj.EVENT_DISPATCHER==null)
{return;}
if(htmlObj.EVENT_DISPATCHER.removeEventHandler(eventType,listener))
{deleteObject(htmlObj.EVENT_DISPATCHER);htmlObj.EVENT_DISPATCHER=null;}}
function EventDispatcher(htmlObj)
{this.m_eventListeners=new HashMap();this.m_htmlObj=htmlObj;this.m_delayClickTimer=null;this.m_delayedClickEvent=null;}
EventDispatcher.prototype.removeEventHandler=function(eventType,listener)
{var listeners=this.m_eventListeners.get(eventType);var arrayIndex=getArrayIndex(listeners,listener);listeners=removeFromArray(listeners,arrayIndex);if(listeners.length==0)
{this.m_eventListeners.put(eventType,null);eval("this.m_htmlObj.on"+eventType+" = null;");return true;}
return false;}
EventDispatcher.prototype.addEventHandler=function(eventType,listener)
{var listeners=this.m_eventListeners.get(eventType);if(listeners==null)
{listeners=new Array();this.m_eventListeners.put(eventType,listeners);eval("this.m_htmlObj.on"+eventType+" = this.ondispatchevent.bind( this );");}
listeners.push(listener);}
EventDispatcher.prototype.ondispatchevent=function(event)
{if(!event&&window.event)
{event=window.event;}
LAST_EVENT=event;var retValFinal=true;if(this.m_eventListeners==null)
{return retValFinal;}
var listeners=this.m_eventListeners.get(event.type);var retVal;if(event.type=="click")
{var dblListeners=this.m_eventListeners.get("dblclick");if(dblListeners==null)
{for(var i=0;i<listeners.length;i++)
{eval("retVal = listeners[ i ].on"+event.type+"( event, this.m_htmlObj );");if(!retVal)
{retValFinal=retVal;}}}
else
{this.m_delayedClickEvent=new Object();this.m_delayedClickEvent.type="click";this.m_delayedClickEvent.ctrlKey=event.ctrlKey;this.m_delayedClickEvent.target=event.target;this.m_delayedClickEvent.srcElement=event.srcElement;this.m_delayClickTimer=setTimeout(this.ondispatchdelayedclick.bind(this),250);}}
else if(event.type=="dblclick")
{var cancelSingleClick=false;for(var i=0;i<listeners.length;i++)
{eval("cancelSingleClick = listeners[ i ].on"+event.type+"( event, this.m_htmlObj );");if(cancelSingleClick!=undefined&&cancelSingleClick==true)
{clearTimeout(this.m_delayClickTimer);this.m_delayClickTimer=null;}}}
else
{for(var i=0;i<listeners.length;i++)
{eval("retVal = listeners[ i ].on"+event.type+"( event, this.m_htmlObj );");if(!retVal)
{retValFinal=retVal;}}}
return retValFinal;}
EventDispatcher.prototype.ondispatchdelayedclick=function()
{if(this.m_delayClickTimer==null)
{return;}
LAST_EVENT=this.m_delayedClickEvent;var listeners=this.m_eventListeners.get("click");for(var i=0;i<listeners.length;i++)
{listeners[i].onclick(this.m_delayedClickEvent,this.m_htmlObj);}}
var HTML_TEXT_FIELD=null;function createHiddenField(id,value,div)
{var htmlObj=document.createElement("input");htmlObj.type="hidden";htmlObj.name=id;htmlObj.value=value;if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createTextField(value,div)
{if(HTML_TEXT_FIELD==null)
{HTML_TEXT_FIELD=document.createElement("input");}
var htmlObj=HTML_TEXT_FIELD.cloneNode(true);htmlObj.type="text";htmlObj.value=value;htmlObj.style.borderColor=SKIN_FIELD_BORDER_COLOR;htmlObj.style.borderWidth="1px";htmlObj.style.borderStyle="solid";htmlObj.style.margin="0px";htmlObj.style.fontSize=SKIN_FONT_SIZE;htmlObj.style.fontFamily=SKIN_FONT_FAMILY;if(isInternetExplorer()&&getBrowserVersion()<8)
{htmlObj.style.marginTop="-1px";htmlObj.style.height="18px";htmlObj.style.paddingTop="2px";}
else
{htmlObj.style.height="18px";htmlObj.style.paddingTop="2px";}
EnabledSelection(htmlObj);if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createPassword(value,div)
{var htmlObj=document.createElement("input");htmlObj.type="password";htmlObj.value=value;htmlObj.style.borderColor=SKIN_FIELD_BORDER_COLOR;htmlObj.style.borderWidth="1px";htmlObj.style.borderStyle="solid";htmlObj.style.margin="0px";htmlObj.style.fontSize=SKIN_FONT_SIZE;htmlObj.style.fontFamily=SKIN_FONT_FAMILY;if(isInternetExplorer()&&getBrowserVersion()<8)
{htmlObj.style.marginTop="-1px";htmlObj.style.height="18px";htmlObj.style.paddingTop="2px";}
else
{htmlObj.style.height="18px";htmlObj.style.paddingTop="2px";}
EnabledSelection(htmlObj);if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createCheckbox(value,div)
{var htmlObj=document.createElement("input");htmlObj.type="checkbox";var test=parseInt(value);if(!isNaN(test)&&test==1)
{htmlObj.checked=true;htmlObj.defaultChecked=true;}
else
{htmlObj.checked=false;htmlObj.defaultChecked=false;}
if(!isInternetExplorer())
{htmlObj.style.borderColor=SKIN_FIELD_BORDER_COLOR;htmlObj.style.borderWidth="1px";htmlObj.style.borderStyle="solid";}
if(div!=null)
{div.appendChild(htmlObj);}
if(!isNaN(test)&&test==1)
{htmlObj.checked=true;htmlObj.defaultChecked=true;}
else
{htmlObj.checked=false;htmlObj.defaultChecked=false;}
return htmlObj;}
function createRadioButton(name,isChecked,value,div)
{var htmlObj;if(isInternetExplorer()&&getBrowserVersion()<9)
{var inputHtml="<input type='radio' name='"+name+"'";if(isChecked)
{inputHtml+=" CHECKED";}
inputHtml+=">";htmlObj=document.createElement(inputHtml);}
else
{htmlObj=document.createElement("input");htmlObj.type="radio";htmlObj.name=name;}
htmlObj.value=value;if(div!=null)
{div.appendChild(htmlObj);}
htmlObj.checked=isChecked;return htmlObj;}
function createTextArea(value,div)
{var htmlObj=document.createElement("textarea");htmlObj.value=value;htmlObj.style.borderColor=SKIN_FIELD_BORDER_COLOR;htmlObj.style.borderWidth="1px";htmlObj.style.borderStyle="solid";htmlObj.style.margin="0px";htmlObj.style.fontSize=SKIN_FONT_SIZE;htmlObj.style.fontFamily=SKIN_FONT_FAMILY;EnabledSelection(htmlObj);if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createSpan(value,className,div)
{var htmlObj=document.createElement("span");htmlObj.innerHTML=value;htmlObj.className=className;if(div!=null)
{div.appendChild(htmlObj);}
htmlObj.style.MozUserSelect="none";return htmlObj;}
function createLineBreak(div)
{var htmlObj=document.createElement("br");if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj}
function createDiv(divClass,div)
{var htmlObj=document.createElement("div");if(divClass!=null)
{htmlObj.className=divClass;}
if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createButton(objLabel,div)
{var newBtn=document.createElement("input");newBtn.type="button";newBtn.value=objLabel;newBtn.style.display="inline";newBtn.style.fontSize=SKIN_FONT_SIZE;newBtn.style.fontFamily=SKIN_FONT_FAMILY;if(div!=null)
{div.appendChild(newBtn);}
return newBtn;}
function createHR(div)
{var htmlObj=document.createElement("hr");if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj}
function createSelect(div,multiple)
{var bMultiple=false;if(multiple==1||multiple==true)
{bMultiple=true;}
if(bMultiple)
{if(isInternetExplorer())
{var tempDiv=document.createElement("div");tempDiv.innerHTML="<SELECT MULTIPLE></SELECT>";htmlObj=tempDiv.firstChild.cloneNode(true);}
else
{htmlObj=document.createElement("select");htmlObj.multiple=true;}}
else
{var htmlObj=document.createElement("select");htmlObj.multiple=false;}
htmlObj.style.borderColor=SKIN_FIELD_BORDER_COLOR;htmlObj.style.borderWidth="1px";htmlObj.style.borderStyle="solid";htmlObj.style.margin="0px";htmlObj.style.fontSize=SKIN_FONT_SIZE;htmlObj.style.fontFamily=SKIN_FONT_FAMILY;if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createSelectOption(htmlSelect,text,value,selected)
{var htmlObj=new Option(text,value,false,selected);htmlSelect.options.add(htmlObj);return htmlObj;}
var HTML_UTILS_TABLE=null;function createTable(className,div)
{var htmlObj=null;if(HTML_UTILS_TABLE==null)
{htmlObj=document.createElement("table");htmlObj.className=className;htmlObj.border=0;htmlObj.cellPadding="0";htmlObj.cellSpacing="0";htmlObj.style.padding="0";htmlObj.style.margin="0";htmlObj.style.borderWidth="0";htmlObj.style.borderStyle="none";htmlObj.style.borderColor="";var htmlTBody=document.createElement("tbody");htmlObj.appendChild(htmlTBody);HTML_UTILS_TABLE=htmlObj;}
htmlObj=HTML_UTILS_TABLE.cloneNode(true);if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createTableRow(className,table)
{var htmlObj=document.createElement("tr");htmlObj.className=className;if(table!=null)
{table.firstChild.appendChild(htmlObj);}
return htmlObj;}
function createTableCell(className,tableRow)
{var htmlObj=document.createElement("td");htmlObj.className=className;if(tableRow!=null)
{tableRow.appendChild(htmlObj);}
return htmlObj;}
function createLink(caption,url,div)
{var htmlObj=document.createElement("a");htmlObj.href=url;htmlObj.innerHTML=caption;if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function createTooltip(className,caption,tooltip,div)
{var htmlObj=document.createElement("span");htmlObj.innerHTML=caption;attachTooltip(htmlObj,tooltip);if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function getDropdownSelection(htmlSelect)
{var sel=new Array();for(var i=0;i<htmlSelect.childNodes.length;i++)
{if(htmlSelect.childNodes[i].selected)
{sel[sel.length]=htmlSelect.childNodes[i].value;}}
return sel;}
function removeHTMLObject(htmlObj)
{htmlObj.parentNode.removeChild(htmlObj);}
function compareDropdownOption(option1,option2)
{var name1=option1.innerHTML.toLowerCase();var name2=option2.innerHTML.toLowerCase();return((name1<name2)?-1:((name1>name2)?1:0));}
function sortDropdown(htmlSelect)
{var dropdownOptions=new Array();for(var i=htmlSelect.childNodes.length-1;i>=0;i--)
{if(htmlSelect.childNodes[i].value!="-1")
{dropdownOptions.push(htmlSelect.childNodes[i]);htmlSelect.removeChild(htmlSelect.childNodes[i]);}}
dropdownOptions.sort(compareDropdownOption);for(var i=0;i<dropdownOptions.length;i++)
{htmlSelect.appendChild(dropdownOptions[i]);}}
function createImage(src,div,width,height)
{var extension=src.substring(src.length-3,src.length)
if(extension=="png"&&isInternetExplorer())
{var htmlObj=document.createElement("div");htmlObj.style.overflow="hidden";htmlObj.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale' )";htmlObj.src=src;}
else
{var htmlObj=document.createElement("img");if(src.length>0)
{htmlObj.src=src;}}
if(width!=null)
{htmlObj.style.width=width+"px";}
if(height!=null)
{htmlObj.style.height=height+"px";}
if(div!=null)
{div.appendChild(htmlObj);}
return htmlObj;}
function changeImage(objImg,src)
{if(src.length==0)
{src=null;}
var extension=src.substring(src.length-3,src.length)
if(extension=="png"&&isInternetExplorer())
{objImg.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale' )";}
else
{objImg.src=src;}}
var HTML_INPUT_CONTROLS=["input","textarea","select","a"];function onSelectStartEnabled()
{event.cancelBubble=true;return true;}
function onSelectStartDisabled()
{return false;}
function disableSelection(target)
{if(target.onselectstart!=undefined)
{target.onselectstart=function(){return false;};}
else if(target.style.MozUserSelect!=undefined)
{target.style.MozUserSelect="none"}
else
{target.onmousedown=function(){return false;}}
target.style.cursor="default";}
function DisableSelectionR(htmlObj)
{if(htmlObj.nodeType==1)
{disableSelection(htmlObj);}
var i;for(i=0;i<htmlObj.childNodes.length;i++)
{DisableSelectionR(htmlObj.childNodes[i]);}}
function EnabledSelection(htmlObj)
{htmlObj.onselectstart=onSelectStartEnabled;}
function disableInputControls(htmlObj,val)
{var index=getArrayIndex(HTML_INPUT_CONTROLS,htmlObj.nodeName.toLowerCase());if(index>-1)
{htmlObj.disabled=val;}
var i;for(i=0;i<htmlObj.childNodes.length;i++)
{disableInputControls(htmlObj.childNodes[i],val);}}
function setReadOnlyInputControls(htmlObj,val)
{var nodeName=htmlObj.nodeName.toLowerCase();var index=getArrayIndex(HTML_INPUT_CONTROLS,nodeName);if(val&&index>-1)
{if(nodeName=="select"||(nodeName=="input"&&htmlObj.type=="checkbox"))
{htmlObj.disabled=true;}
else
{htmlObj.readOnly="readOnly";}}
else if(index>-1)
{if(nodeName=="select"||(nodeName=="input"&&htmlObj.type=="checkbox"))
{htmlObj.disabled=false;}
else
{htmlObj.readOnly="";}}
var i;for(i=0;i<htmlObj.childNodes.length;i++)
{setReadOnlyInputControls(htmlObj.childNodes[i],val);}}
function getFirstElement(tagNames,obj)
{if(!obj)
{obj=document;}
var resultArray=new Array();for(var i=0;i<tagNames.length;i++)
{var nodes=obj.getElementsByTagName(tagNames[i]);if(nodes[0]!=undefined)
{resultArray.push(nodes[0]);}}
var testNode=resultArray[0];if(!testNode)return[];if(testNode.sourceIndex)
{resultArray.sort(function(a,b){return a.sourceIndex-b.sourceIndex;});}
else if(testNode.compareDocumentPosition)
{resultArray.sort(function(a,b){return 3-(a.compareDocumentPosition(b)&6);});}
return resultArray;}
function focusFirstInputControl(htmlObj)
{if(htmlObj==undefined||htmlObj==null)
{return false;}
var index=getArrayIndex(HTML_INPUT_CONTROLS,htmlObj.nodeName.toLowerCase());if(index>-1)
{try
{htmlObj.focus();return true;}
catch(e)
{}}
var childNodes=htmlObj.childNodes;for(var i=0;i<childNodes.length;i++)
{if(focusFirstInputControl(childNodes[i]))
{return true;}}
return false;}
function DisableAllSelection()
{for(i=0;i<document.all.length;i++)
{document.all(i).unselectable="on";}}
function setOpacity(obj,opacity)
{opacity=(opacity==100)?99.999:opacity;if(isInternetExplorer())
{obj.runtimeStyle.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+")";return;}
if(isFirefox())
{obj.style.MozOpacity=opacity/100;return;}
obj.style.KHTMLOpacity=opacity/100;obj.style.opacity=opacity/100;}
function findPosY(htmlObj)
{var obj=htmlObj;var pos=0;while(obj!=document&&obj!=undefined)
{pos+=obj.offsetTop;obj=obj.offsetParent;}
obj=htmlObj;while(obj!=document&&obj!=undefined)
{pos-=obj.scrollTop;obj=obj.parentNode;}
return pos;}
function findPosX(htmlObj)
{var obj=htmlObj;var pos=0;while(obj!=document&&obj!=undefined)
{pos+=obj.offsetLeft;obj=obj.offsetParent;}
obj=htmlObj;while(obj!=document&&obj!=undefined)
{pos-=obj.scrollLeft;obj=obj.parentNode;}
return pos;}
function containsElement(container,element)
{while(element)
{if(element==container)
{return true;}
element=element.parentNode;}
return false;}
function getScrollXY()
{var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
function swapNodes(node1,node2)
{var parentNode1=node1.parentNode;var parentNode2=node2.parentNode;var nextSibling1=node1.nextSibling;var nextSibling2=node2.nextSibling;if(nextSibling1==node2)
{nextSibling1=node1;}
if(nextSibling2==node1)
{nextSibling2=node1.nextSibling;}
parentNode1.removeChild(node1);parentNode2.removeChild(node2);parentNode2.insertBefore(node1,nextSibling2);parentNode1.insertBefore(node2,nextSibling1);}
function loadJavaScript(srcUrl,callback)
{var oHead=document.getElementsByTagName("head")[0];var oScript=document.createElement("script");oScript.type="text/javascript";oScript.charset="utf-8";oScript.src=srcUrl;if(callback!=undefined&&callback!=null)
{oScript.callback=callback;if(isInternetExplorer())
{oScript.onreadystatechange=function()
{if(this.readyState=="loaded"||this.readyState=="complete")
{this.callback(this);this.callback=null;}}}
else
{oScript.onload=loadJavaScript_FF;}}
oHead.appendChild(oScript);return oScript;}
function loadJavaScript_FF(event)
{if(!event&&window.event)
{event=window.event;}
var objScript=getEventSource(event);objScript.callback(objScript);objScript.callback=null;}
function loadCSS(srcUrl)
{var fileref=document.createElement("link")
fileref.setAttribute("rel","stylesheet")
fileref.setAttribute("type","text/css")
fileref.setAttribute("href",srcUrl)
var oHead=document.getElementsByTagName("head")[0];oHead.appendChild(fileref);return fileref;}
function removeJavaScript(objScript)
{objScript.parentNode.removeChild(objScript);}
function getTotalWidth(objHTML)
{var objWidth=0;var w=parseInt(objHTML.style.width);if(!isNaN(w))
{objWidth+=w;}
w=parseInt(objHTML.style.paddingLeft);if(!isNaN(w))
{objWidth+=w;}
w=parseInt(objHTML.style.paddingLeft);if(!isNaN(w))
{objWidth+=w;}
w=parseInt(objHTML.style.paddingRight);if(!isNaN(w))
{objWidth+=w;}
w=parseInt(objHTML.style.marginLeft);if(!isNaN(w))
{objWidth+=w;}
w=parseInt(objHTML.style.marginRight);if(!isNaN(w))
{objWidth+=w;}
return objWidth;}
function setInputControlsBackgroundColor(htmlObj,color)
{if(color==null)
{color="";}
var nodeName=htmlObj.nodeName.toLowerCase();var index=getArrayIndex(HTML_INPUT_CONTROLS,nodeName);if(index>-1&&!(index==0&&htmlObj.type=="button"))
{htmlObj.style.backgroundColor=color;}
for(var i=0;i<htmlObj.childNodes.length;i++)
{setInputControlsBackgroundColor(htmlObj.childNodes[i],color);}}
function insertAfter(newElement,targetElement)
{var parent=targetElement.parentNode;if(parent.lastchild==targetElement)
{parent.appendChild(newElement);}
else
{parent.insertBefore(newElement,targetElement.nextSibling);}}
function isOverflowing(el)
{var curOverflow=el.style.overflow;if(!curOverflow||curOverflow==="visible")
{el.style.overflow="hidden";}
var isOverflowing=el.clientWidth<el.scrollWidth||el.clientHeight<el.scrollHeight;el.style.overflow=curOverflow;return isOverflowing;}
function removeHiddenElements(objHTML)
{var cCount=objHTML.childNodes.length;var child=null;for(var c=cCount-1;c>=0;c--)
{child=objHTML.childNodes[c];if(child.nodeType=="1"&&child.style.display=="none")
{objHTML.removeChild(child);}
else
{removeHiddenElements(child);}}}
var HTTP_Utils={read_querystring:function()
{var a_out=new Object();var s_loc=String(location.href);if(s_loc.indexOf('?')>0)
{var p;var s_query=s_loc.substr(s_loc.indexOf('?')+1);var a_query=s_query?s_query.split('&'):new Array();for(var i=0;i<a_query.length;i++)
{p=a_query[i].split('=');a_out[p[0]]=decodeURIComponent(p[1]);}}
return a_out;},getCookie:function(name)
{var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1)
{begin=dc.indexOf(prefix);if(begin!=0)
{return null;}}
else
{begin+=2;}
var end=dc.indexOf(";",begin);if(end==-1)
{end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));},setCookie:function(name,value,expires,path,domain,secure)
{if(domain=="localhost")
{domain=null;}
document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");},cookiesEnabled:function()
{HTTP_Utils.setCookie("INTERCEPT_TEMP","true");var value=HTTP_Utils.getCookie("INTERCEPT_TEMP");if(value!=null&&value=="true")
{HTTP_Utils.setCookie("INTERCEPT_TEMP",null);return true;}
return false;},getTopDomain:function(domain)
{var topDomain=domain;if(topDomain.indexOf(":")>-1)
{topDomain=topDomain.substring(0,topDomain.indexOf(":"));}
while(topDomain.indexOf(".")!=topDomain.lastIndexOf("."))
{topDomain=topDomain.substring(topDomain.indexOf(".")+1,topDomain.length);}
return topDomain;},getDomain:function()
{var fqdn=window.location.toString().toLowerCase();if(fqdn.indexOf("https://")==-1)
{fqdn=fqdn.substring(7,fqdn.length);}
else
{fqdn=fqdn.substring(8,fqdn.length);}
var pos=fqdn.indexOf("/");if(pos>-1)
{fqdn=fqdn.substring(0,pos);}
return fqdn;},getPage:function()
{var page=window.location.toString();if(page.indexOf("https://")==-1)
{page=page.substring(7,page.length);}
else
{page=page.substring(8,page.length);}
var pos=page.indexOf("/");if(pos>-1)
{page=page.substring(pos,page.length);}
else
{page="";}
return page;}};function trim(str)
{return str.replace(/^\s\s*/,'').replace(/\s\s*$/,'');}
function encodeISOQuotes(val)
{val=val.replace("'","&#39;");val=val.replace("\"","&quot;");return val;}
Function.prototype.bind=function(obj)
{var method=this;var temp=function(){return method.apply(obj,arguments);};return temp;}
function get_all_props(obj,obj_name,separator)
{var i;var result="";for(i in obj)
result+=obj_name+"."+i+" = "+obj[i]+separator;return result;}
function fixLineFeeds(value)
{value=value.replace(/\r/g,"\n");value=value.replace(/\n\n/g,"\n");return value;}
function removeLineFeeds(value)
{value=value.replace(/\n/g,"");return value;}
function htmlEncode(value)
{value=value.replace(/&/g,"&amp;");value=value.replace(/</g,"&lt;");value=value.replace(/>/g,"&gt;");return value;}
function getRandomInt(min,max)
{return Math.floor(Math.random()*(max-min+1))+min;}
function div(op1,op2)
{return Math.floor(op1/op2);}
function removeHTML(val)
{var matchTag=/<(?:.|\s)*?>/g;return val.replace(matchTag,"");}
function newDate(dateVal)
{var date=new Date();var dateVals=dateVal.split("-");if(dateVals[1].indexOf("0")==0)
{dateVals[1]=dateVals[1].substring(1,dateVals[1].length);}
if(dateVals[2].indexOf("0")==0)
{dateVals[2]=dateVals[2].substring(1,dateVals[2].length);}
date.setFullYear(dateVals[0],parseInt(dateVals[1])-1,parseInt(dateVals[2]));date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);return date;}
function newDateTime(dateTimeVal)
{var dateTimeVals=dateTimeVal.split(" ");var date=newDate(dateTimeVals[0]);setTime(date,dateTimeVals[1]);return date;}
function newTime(timeVal)
{var date=new Date();date.setFullYear(2000,0,1);setTime(date,timeVal);return date;}
function setTime(objDate,strTime)
{var timeVals=strTime.split(":");objDate.setHours(timeVals[0]);if(timeVals[1][0]=="0")
{timeVals[1]=timeVals[1].substring(1,timeVals[1].length);}
objDate.setMinutes(parseInt(timeVals[1]));if(timeVals.length>2)
{if(timeVals[2][0]=="0")
{timeVals[2]=timeVals[2].substring(1,timeVals[2].length);}
objDate.setSeconds(timeVals[2]);}
else
{objDate.setSeconds(0);}
objDate.setMilliseconds(0);}
function newNumber(number)
{var num=number;if(number!=null&&number.length>0)
{num=parseFloat(number);}
return num;}
function isEmailValid(email)
{var str=email;var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(!str.match(re))
{return false;}
return true;}
function isPercent(val)
{var pos=val.indexOf("%");if(pos==-1)
{return false;}
if(pos!=val.length-1)
{return false;}
val=val.substring(0,pos);return!isNaN(val);}
function isFloat(s)
{if(s==null||s.length==0)
{return false;}
var reg=new RegExp("^[-]?[0-9]+([\.]?[0-9]+$)?$");return reg.test(s);}
function isInteger(s)
{if(s==null||s.length==0)
{return false;}
var reg=new RegExp("^[-]?[0-9]+$");return reg.test(s);}
function formatNumber2Decimals(val)
{val=val.toString();var pIndex=val.indexOf(".");var len=val.length;if(pIndex>-1)
{if(len>pIndex+3)
{return val.substring(0,pIndex+3);}
if(len<pIndex+3)
{return val+"0";}}
else
{val+=".00";}
return val;}
function round2Decimals(val)
{val=val.toString();var pIndex=val.indexOf(".");var len=val.length;if(pIndex>-1)
{if(len>pIndex+3)
{val=val.substring(0,pIndex+3);}
while(val[val.length-1]=='0'||val[val.length-1]=='.')
{val=val.substring(0,val.length-1);}}
return val;}
function formatCurrency(nStr)
{nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;}
function getLongestWord(str)
{var vals=str.split(" ");var maxLen=0;var maxIndex=-1;for(var i=0;i<vals.length;i++)
{if(vals[i].length>maxLen)
{maxLen=vals[i].length;maxIndex=i;}}
return vals[maxIndex];}
function HashMap()
{this.m_map=new Object();}
HashMap.prototype.contains=function(key)
{return this.m_map[key]!=undefined;}
HashMap.prototype.put=function(key,value)
{this.m_map[key]=value;}
HashMap.prototype.get=function(key)
{var val=this.m_map[key];if(val==undefined)
{return null;}
return val;}
HashMap.prototype.size=function()
{return this.getKeys().length;}
HashMap.prototype.getKeys=function()
{var keys=new Array();for(var key in this.m_map)
{if(key==null||key.length==0||key==undefined)
{continue;}
if(!(key in Object.prototype))
{keys.push(key);}}
return keys;}
HashMap.prototype.isEmpty=function()
{for(var key in this.m_map)
{if(key==null||key.length==0||key==undefined)
{continue;}
return false}
return true;}
HashMap.prototype.remove=function(keyToRemove)
{var temp=this.m_map;this.m_map=new Object();for(var key in temp)
{if(key==null||key.length==0||key==undefined||key==keyToRemove)
{continue;}
if(!(key in Object.prototype))
{this.m_map[key]=temp[key];}}}
function MultiMap()
{this.m_map=new HashMap();}
MultiMap.prototype.put=function(key,value)
{var values=this.m_map.get(key);if(values==null)
{values=new Array();this.m_map.put(key,values);}
values.push(value);}
MultiMap.prototype.get=function(key)
{return this.m_map.get(key);}
MultiMap.prototype.remove=function(key)
{return this.m_map.remove(key);}
MultiMap.prototype.replaceAll=function(key,values)
{this.m_map.put(key,values);}
MultiMap.prototype.contains=function(key)
{return this.m_map.contains(key);}
MultiMap.prototype.getKeys=function()
{return this.m_map.getKeys();}
function StringBuffer(){this.buffer=[];}
StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join("");};var COOKIE_MAP_SEPARATOR="||";function CookieMap(cookieName)
{this.m_cookie=cookieName;this.m_map=new HashMap();this.parseCookie();}
CookieMap.prototype.put=function(key,val)
{this.m_map.put(key,val);this.saveCookie();}
CookieMap.prototype.get=function(key)
{return this.m_map.get(key);}
CookieMap.prototype.parseCookie=function()
{var vals=HTTP_Utils.getCookie(this.m_cookie);if(vals==null)
{return;}
vals=vals.split(COOKIE_MAP_SEPARATOR);for(var i=0;i<vals.length;i+=2)
{this.m_map.put(vals[i],vals[i+1]);}}
CookieMap.prototype.saveCookie=function()
{var cookieValue="";var keys=this.m_map.getKeys();for(var i=0;i<keys.length;i++)
{if(i>0)
{cookieValue+=COOKIE_MAP_SEPARATOR;}
cookieValue+=keys[i];cookieValue+=COOKIE_MAP_SEPARATOR;cookieValue+=this.m_map.get(keys[i]);}
var date=new Date();date.setFullYear(date.getFullYear()+1);HTTP_Utils.setCookie(this.m_cookie,cookieValue,date,"/");}
var PANEL_LAST_FOCUS=null;var PANEL_IUNIQUE_ID=1;var UI_SETTINGS=null;function Panel()
{this.m_created=false;this.m_uniqueId=null;this.m_width=0;this.m_height=0;this.m_minWidth=0;this.m_minHeight=0;this.m_controlWidth=true;this.m_controlHeight=true;this.m_paddingLeft=0;this.m_paddingRight=0;this.m_paddingTop=0;this.m_paddingBottom=0;this.m_borderLeft=0;this.m_borderRight=0;this.m_borderTop=0;this.m_borderBottom=0;this.m_borderStyle="";this.m_borderColor="";this.m_marginLeft=0;this.m_marginRight=0;this.m_marginTop=0;this.m_marginBottom=0;this.m_overflowMode="hidden";this.m_htmlDiv=null;this.m_listeners=new Array();this.m_parent=null;this.m_children=new Array();this.m_notifyChanges=true;this.m_hasChanged=false;this.m_hasFocus=false;this.m_canHaveFocus=false;this.m_visible=true;this.m_backgroundColor=null;this.m_controlBorderStyle=true;this.m_backgroundImg=null;this.m_readOnly=false;this.m_fontFamily=null;this.m_fontSize=null;this.m_color=null;this.m_triggerResize=true;this.m_handleFocus=true;this.m_toolbar=null;this.m_pageBreakBefore=false;this.m_cursor=null;}
Panel.prototype.create=function(htmlParent,objParent)
{this.m_parent=objParent;if(this.m_parent!=null&&!this.m_readOnly)
{if(this.m_parent.getReadOnly())
{this.m_readOnly=true;}}
this.m_htmlDiv=createDiv("",htmlParent);if(this.m_pageBreakBefore)
{this.m_htmlDiv.style.pageBreakBefore="always";}
this.m_htmlDiv.style.marginLeft=this.m_marginLeft+"px";this.m_htmlDiv.style.marginRight=this.m_marginRight+"px";this.m_htmlDiv.style.marginTop=this.m_marginTop+"px";this.m_htmlDiv.style.marginBottom=this.m_marginBottom+"px";this.m_htmlDiv.style.borderLeftWidth=this.m_borderLeft+"px";this.m_htmlDiv.style.borderRightWidth=this.m_borderRight+"px";this.m_htmlDiv.style.borderTopWidth=this.m_borderTop+"px";this.m_htmlDiv.style.borderBottomWidth=this.m_borderBottom+"px";if(this.m_controlBorderStyle)
{this.m_htmlDiv.style.borderStyle=this.m_borderStyle;this.m_htmlDiv.style.borderColor=this.m_borderColor;}
this.m_htmlDiv.style.paddingLeft=this.m_paddingLeft+"px";this.m_htmlDiv.style.paddingRight=this.m_paddingRight+"px";this.m_htmlDiv.style.paddingTop=this.m_paddingTop+"px";this.m_htmlDiv.style.paddingBottom=this.m_paddingBottom+"px";this.onCreate();this.postCreate();if(this.m_parent!=null)
{objParent.addChild(this);}}
Panel.prototype.onCreate=function()
{if(this.m_canHaveFocus)
{this.m_focusHandler=this.onFocusP.bind(this);EventUtils_attachEvent(this.m_htmlDiv,"click",this.m_focusHandler);}
this.m_created=true;if(this.m_backgroundColor!=null)
{this.setBackgroundColor(this.m_backgroundColor);}
if(this.m_color!=null)
{this.setColor(this.m_color);}
else if(this.m_parent!=null)
{this.setColor(this.m_parent.getColor());}
if(this.m_fontFamily!=null)
{this.setFontFamily(this.m_fontFamily);}
else if(this.m_parent!=null)
{this.setFontFamily(this.m_parent.getFontFamily());}
if(this.m_fontSize!=null)
{this.setFontSize(this.m_fontSize);}
else if(this.m_parent!=null)
{this.setFontSize(this.m_parent.getFontSize());}
this.setOverflowMode(this.m_overflowMode);if(this.m_backgroundImg!=null)
{this.m_htmlDiv.style.backgroundImage="url("+this.m_backgroundImg+")";}
if(this.m_cursor!=null)
{this.m_htmlDiv.style.cursor=this.m_cursor;}}
Panel.prototype.postCreate=function()
{if(this.m_controlWidth||this.m_controlHeight)
{if(this.m_controlWidth&&this.m_controlHeight)
{var tempWidth=this.getWidth();var tempHeight=this.getHeight();this.m_width=-1;this.m_height=-1;this.setSize(tempWidth,tempHeight);}
else
{if(this.m_controlWidth)
{var tempWidth=this.getWidth();this.m_width=-1;this.setWidth(tempWidth);}
if(this.m_controlHeight)
{var tempHeight=this.getHeight();this.m_height=-1;this.setHeight(tempHeight);}}}
if(this.m_readOnly)
{this.setReadOnly(this.m_readOnly);}
if(!this.m_visible)
{Panel.prototype.hide.apply(this,arguments);}}
Panel.prototype.destroy=function()
{if(!this.isCreated())
{return;}
if(this.m_parent!=null)
{this.m_parent.removeChild(this);this.m_parent=null;}
for(var i=this.m_children.length-1;i>=0;i--)
{this.m_children[i].destroy();}
this.m_children=new Array();if(this.m_canHaveFocus)
{EventUtils_detachEvent(this.m_htmlDiv,"click",this.m_focusHandler);}
this.m_htmlDiv.parentNode.removeChild(this.m_htmlDiv);this.m_htmlDiv.innerHTML="";this.m_htmlDiv=null;this.m_created=false;this.m_requiresUpdate=true;}
Panel.prototype.addChild=function(objChild)
{this.m_children.push(objChild);}
Panel.prototype.removeChild=function(objChild)
{var cIndex=getArrayIndex(this.m_children,objChild);this.m_children=removeFromArray(this.m_children,cIndex);}
Panel.prototype.setSize=function(newWidth,newHeight)
{if(newWidth==this.m_width&&newHeight==this.m_height)
{return;}
this.m_triggerResize=false;this.setWidth(newWidth);this.setHeight(newHeight);this.m_triggerResize=true;if(this.isCreated())
{this.resize();}}
Panel.prototype.setAvailableSize=function(newWidth,newHeight)
{this.m_triggerResize=false;this.setAvailableWidth(newWidth);this.setAvailableHeight(newHeight);this.m_triggerResize=true;if(this.isCreated())
{this.resize();}}
Panel.prototype.setWidth=function(newWidth)
{newWidth=parseInt(newWidth);var minWidth=this.getMinWidth();if(newWidth<minWidth)
{newWidth=minWidth;}
if(newWidth==this.m_width)
{return;}
this.m_width=newWidth;if(this.isCreated())
{if(this.m_controlWidth)
{var cssWidth=this.getAvailableWidth();this.m_htmlDiv.style.width=cssWidth+"px";if(this.m_triggerResize)
{this.onresize();}}}}
Panel.prototype.getWidth=function()
{return this.m_width;}
Panel.prototype.getMinWidth=function()
{return this.m_minWidth;}
Panel.prototype.setAvailableWidth=function(newWidth)
{newWidth=parseInt(newWidth);newWidth+=this.m_borderLeft;newWidth+=this.m_borderRight
newWidth+=this.m_paddingLeft;newWidth+=this.m_paddingRight
newWidth+=this.m_marginLeft;newWidth+=this.m_marginRight;this.setWidth(newWidth);}
Panel.prototype.getAvailableWidth=function()
{var cssWidth=this.m_width-this.m_paddingLeft-this.m_paddingRight-this.m_borderLeft-this.m_borderRight-this.m_marginLeft-this.m_marginRight;if(cssWidth<0)
{return 0;}
return cssWidth;}
Panel.prototype.setHeight=function(newHeight)
{newHeight=parseInt(newHeight);if(newHeight==this.m_height)
{return;}
this.m_height=newHeight;if(this.isCreated())
{if(this.m_controlHeight)
{var cssHeight=this.getAvailableHeight();this.m_htmlDiv.style.height=cssHeight+"px";if(this.m_triggerResize)
{this.onresize();}}}}
Panel.prototype.getHeight=function()
{return this.m_height;}
Panel.prototype.getMinHeight=function()
{return this.m_minHeght;}
Panel.prototype.setAvailableHeight=function(newHeight)
{newHeight=parseInt(newHeight);newHeight+=this.m_borderTop;newHeight+=this.m_borderBottom
newHeight+=this.m_paddingTop;newHeight+=this.m_paddingBottom
newHeight+=this.m_marginTop;newHeight+=this.m_marginBottom;this.setHeight(newHeight);}
Panel.prototype.getAvailableHeight=function()
{var cssHeight=this.m_height-this.m_paddingTop-this.m_paddingBottom-this.m_borderTop-this.m_borderBottom-this.m_marginTop-this.m_marginBottom;if(cssHeight<0)
{return 0;}
return cssHeight;}
Panel.prototype.setPadding=function(paddingLeft,paddingRight,paddingTop,paddingBottom)
{this.m_paddingLeft=paddingLeft;this.m_paddingRight=paddingRight;this.m_paddingTop=paddingTop;this.m_paddingBottom=paddingBottom;if(this.isCreated())
{this.m_htmlDiv.style.paddingLeft=this.m_paddingLeft+"px";this.m_htmlDiv.style.paddingRight=this.m_paddingRight+"px";this.m_htmlDiv.style.paddingTop=this.m_paddingTop+"px";this.m_htmlDiv.style.paddingBottom=this.m_paddingBottom+"px";if(this.m_controlWidth)
{var cssWidth=this.getAvailableWidth();this.m_htmlDiv.style.width=cssWidth+"px";}
if(this.m_controlHeight)
{var cssHeight=this.getAvailableHeight();this.m_htmlDiv.style.height=cssHeight+"px";}
this.onresize();}}
Panel.prototype.setBorder=function(borderLeft,borderRight,borderTop,borderBottom,style,color)
{this.m_borderLeft=borderLeft;this.m_borderRight=borderRight;this.m_borderTop=borderTop;this.m_borderBottom=borderBottom;this.m_borderStyle=style;this.m_borderColor=color;if(this.isCreated())
{this.m_htmlDiv.style.borderLeftWidth=this.m_borderLeft+"px";this.m_htmlDiv.style.borderRightWidth=this.m_borderRight+"px";this.m_htmlDiv.style.borderTopWidth=this.m_borderTop+"px";this.m_htmlDiv.style.borderBottomWidth=this.m_borderBottom+"px";if(this.m_controlBorderStyle)
{this.m_htmlDiv.style.borderStyle=this.m_borderStyle;this.m_htmlDiv.style.borderColor=this.m_borderColor;}
if(this.m_controlWidth)
{var cssWidth=this.getAvailableWidth();this.m_htmlDiv.style.width=cssWidth+"px";}
if(this.m_controlHeight)
{var cssHeight=this.getAvailableHeight();this.m_htmlDiv.style.height=cssHeight+"px";}
this.onresize();}}
Panel.prototype.setMargin=function(marginLeft,marginRight,marginTop,marginBottom)
{this.m_height+=marginTop-this.m_marginTop;this.m_height+=marginBottom-this.m_marginBottom;this.m_width+=marginLeft-this.m_marginLeft;this.m_width+=marginRight-this.m_marginRight;this.m_marginLeft=marginLeft;this.m_marginRight=marginRight;this.m_marginTop=marginTop;this.m_marginBottom=marginBottom;if(this.isCreated())
{this.m_htmlDiv.style.marginLeft=this.m_marginLeft+"px";this.m_htmlDiv.style.marginRight=this.m_marginRight+"px";this.m_htmlDiv.style.marginTop=this.m_marginTop+"px";this.m_htmlDiv.style.marginBottom=this.m_marginBottom+"px";if(this.m_controlWidth)
{var cssWidth=this.getAvailableWidth();this.m_htmlDiv.style.width=cssWidth+"px";}
if(this.m_controlHeight)
{var cssHeight=this.getAvailableHeight();this.m_htmlDiv.style.height=cssHeight+"px";}
this.onresize();}}
Panel.prototype.isCreated=function()
{return this.m_created;}
Panel.prototype.resize=function()
{if(this.m_triggerResize)
{this.onresize();}}
Panel.prototype.onresize=function()
{}
Panel.prototype.setOverflowMode=function(mode)
{this.m_overflowMode=mode;if(this.isCreated())
{this.m_htmlDiv.style.overflow=this.m_overflowMode;}}
Panel.prototype.getHTMLContainer=function()
{return this.m_htmlDiv;}
Panel.prototype.addListener=function(listener)
{var arrayIndex=getArrayIndex(this.m_listeners,listener);if(arrayIndex>-1)
{return;}
this.m_listeners[this.m_listeners.length]=listener;}
Panel.prototype.removeListener=function(listener)
{var index=getArrayIndex(this.m_listeners,listener);this.m_listeners=removeFromArray(this.m_listeners,index);}
Panel.prototype.notifyListeners=function(method,param)
{var args=new Array();for(var a=1;a<arguments.length;a++)
{args.push(arguments[a]);}
var i;var retVal;var globalRetVal=true;for(i=0;i<this.m_listeners.length;i++)
{var evalCall="if ( this.m_listeners[ i ]."+method+" ) retVal = this.m_listeners[ i ]."+method+"(";for(var a=0;a<args.length;a++)
{if(a>0)
{evalCall+=",";}
evalCall+=" args[ "+a+" ]";}
evalCall+=" );";eval(evalCall);if(retVal!=undefined&&retVal==false)
{globalRetVal=false;}}
return globalRetVal;}
Panel.prototype.isOverflow=function()
{if(!this.isCreated())
{return false;}
if(this.m_htmlDiv.scrollWidth>this.m_htmlDiv.clientWidth||this.m_htmlDiv.scrollHeight>this.m_htmlDiv.heightWidth)
{return true;}
return false;}
Panel.prototype.getFocus=function()
{focusFirstInputControl(this.getHTMLContainer());}
Panel.prototype.onFocusP=function(event)
{if(this==PANEL_LAST_FOCUS)
{return;}
if(!this.m_handleFocus)
{this.m_handleFocus=true;return;}
var parentPanel=this.getParent();while(parentPanel!=null)
{parentPanel.m_handleFocus=false;parentPanel=parentPanel.getParent();}
var focusPanels=new Array();focusPanels.push(this);var parentWithFocus=this.getParent();while(parentWithFocus!=null&&!parentWithFocus.hasFocus())
{focusPanels.push(parentWithFocus);parentWithFocus=parentWithFocus.getParent();}
var lostFocusPanels=new Array();var panelToLoseFocus=PANEL_LAST_FOCUS;while(panelToLoseFocus!=null)
{if(panelToLoseFocus==parentWithFocus)
{break;}
lostFocusPanels.push(panelToLoseFocus);panelToLoseFocus=panelToLoseFocus.getParent();}
for(var i=0;i<lostFocusPanels.length;i++)
{lostFocusPanels[i].onLostFocus(this);}
for(var i=0;i<focusPanels.length;i++)
{focusPanels[i].onFocus(this,event);}
PANEL_LAST_FOCUS=this;}
Panel.prototype.onFocus=function(objPanel)
{this.m_hasFocus=true;this.notifyListeners("onGotFocus",this);}
Panel.prototype.onLostFocus=function(newFocusPanel)
{this.m_hasFocus=false;}
Panel.prototype.hasFocus=function()
{return this.m_hasFocus;}
Panel.prototype.setCanHaveFocus=function(canHaveFocus)
{this.m_canHaveFocus=canHaveFocus;}
Panel.prototype.setToolbar=function(toolbar)
{this.m_toolbar=toolbar;}
Panel.prototype.getToolbar=function()
{if(this.m_toolbar!=null)
{return this.m_toolbar;}
if(this.m_parent!=null)
{return this.m_parent.getToolbar();}
return null;}
Panel.prototype.hide=function()
{this.m_visible=false;if(this.isCreated())
{this.m_htmlDiv.style.display="none";}}
Panel.prototype.show=function()
{this.m_visible=true;if(this.isCreated())
{this.m_htmlDiv.style.display="block";}}
Panel.prototype.isVisible=function()
{return this.m_visible;}
Panel.prototype.hasChanged=function()
{return this.m_hasChanged;}
Panel.prototype.clearHasChanged=function()
{this.m_hasChanged=false;var curChild;for(var i=0;i<this.m_children.length;i++)
{curChild=this.m_children[i];curChild.clearHasChanged();}}
Panel.prototype.onPanelChange=function(objChangedPanel)
{this.m_hasChanged=true;if(this.m_parent!=null&&this.m_notifyChanges)
{this.m_parent.onPanelChange(objChangedPanel);}}
Panel.prototype.setNotifyChanges=function(notify)
{this.m_notifyChanges=notify;}
Panel.prototype.getNotifyChanges=function()
{return this.m_notifyChanges;}
Panel.prototype.parentOf=function(objPanel)
{var curPanel=objPanel;while(curPanel!=null)
{if(this==curPanel)
{return true;}
curPanel=curPanel.m_parent;}
return false;}
Panel.prototype.getParent=function(objPanel)
{return this.m_parent;}
Panel.prototype.setBackgroundColor=function(val)
{this.m_backgroundColor=val;if(this.isCreated())
{if(this.m_backgroundColor==null)
{this.m_htmlDiv.style.backgroundColor="";}
else
{this.m_htmlDiv.style.backgroundColor=this.m_backgroundColor;}}}
Panel.prototype.getBackgroundColor=function()
{return this.m_backgroundColor;}
Panel.prototype.setColor=function(val)
{this.m_color=val;if(this.isCreated()&&this.m_color!=null)
{this.m_htmlDiv.style.color=this.m_color;}}
Panel.prototype.getColor=function()
{return this.m_color;}
Panel.prototype.setBackgroundImage=function(img)
{this.m_backgroundImg=img;}
Panel.prototype.scrollIntoView=function(scrollToTop)
{if(this.isCreated())
{this.m_htmlDiv.scrollIntoView(scrollToTop);}}
Panel.prototype.setUniqueId=function(id)
{this.m_uniqueId=id.replace(/ /g,"_");}
Panel.prototype.getUniqueId=function()
{return this.m_uniqueId;}
Panel.prototype.getUISetting=function(key)
{if(UI_SETTINGS==null||this.m_uniqueId==null)
{return null;}
key="["+this.m_uniqueId+"]"+key;return UI_SETTINGS.get(key);}
Panel.prototype.setUISetting=function(key,val)
{if(UI_SETTINGS==null||this.m_uniqueId==null)
{return;}
key="["+this.m_uniqueId+"]"+key;UI_SETTINGS.put(key,val);}
Panel.prototype.setFontFamily=function(val)
{this.m_fontFamily=val;if(this.isCreated()&&this.m_fontFamily!=null)
{this.m_htmlDiv.style.fontFamily=this.m_fontFamily;}}
Panel.prototype.getFontFamily=function()
{return this.m_fontFamily;}
Panel.prototype.setFontSize=function(val)
{this.m_fontSize=val;if(this.isCreated()&&this.m_fontSize!=null)
{this.m_htmlDiv.style.fontSize=this.m_fontSize;}}
Panel.prototype.getFontSize=function()
{return this.m_fontSize;}
Panel.prototype.getReadOnly=function()
{return this.m_readOnly;}
Panel.prototype.setReadOnly=function(val)
{this.m_readOnly=val;for(var i=0;i<this.m_children.length;i++)
{this.m_children[i].setReadOnly(this.m_readOnly);}}
Panel.prototype.getClass=function()
{return getType(this);}
Panel.prototype.deletePanel=function()
{if(this.isCreated())
{this.destroy();}
for(var i=this.m_children.length-1;i>=0;i--)
{deleteObject(this.m_children[i]);}
deleteObject(this);this.m_listeners=null;}
Panel.prototype.setPageBreakBefore=function(blnVal)
{this.m_pageBreakBefore=blnVal;}
Panel.prototype.setCursor=function(val)
{this.m_cursor=val;}
Panel.prototype.isOverflowing=function()
{return isOverflowing(this.getHTMLContainer());}
function createPositionedPanel(objParent)
{var pPanel=new PositionedPanel();pPanel.create(document.body,objParent);return pPanel;}
function PositionedPanel()
{this.Panel();this.m_left=-1
this.m_top=-1;this.m_zIndex=null;this.m_dragPanel=null;this.m_useIFrame=isInternetExplorer();this.m_mousemoveBody=null;this.m_canMove=true;}
copyPrototype(PositionedPanel,Panel);PositionedPanel.prototype.onCreate=function()
{Panel.prototype.onCreate.apply(this,arguments);this.m_htmlDiv.style.position="absolute";this.m_htmlDiv.style.top=this.m_top+"px";this.m_htmlDiv.style.left=this.m_left+"px";if(this.m_zIndex!=null)
{this.m_htmlDiv.style.zIndex=this.m_zIndex;}
if(this.m_useIFrame)
{this.m_iframe=document.createElement("iframe");this.m_iframe.style.position="absolute";this.m_iframe.style.zIndex=this.m_zIndex-1;this.m_iframe.style.backgroundColor="";this.m_iframe.style.borderWidth="0";this.m_iframe.style.borderStyle="none";this.m_iframe.style.overflow="hidden";this.m_iframe.src=APP_URL+"/core/empty.jsp";this.m_iframe.style.borderStyle="none";this.m_iframe.style.top=this.m_top+"px";this.m_iframe.style.left=this.m_left+"px";document.body.appendChild(this.m_iframe);}}
PositionedPanel.prototype.destroy=function()
{if(this.m_dragPanel!=null)
{var htmlDragContainer=this.m_dragPanel.getHTMLContainer();EventUtils_detachEvent(htmlDragContainer,"mousedown",this.m_mousedownTitle);EventUtils_detachEvent(document,"mouseup",this.m_mouseupBody);this.m_mousedownTitle=null;this.m_mouseupBody=null;if(this.m_mousemoveBody!=null)
{EventUtils_detachEvent(document,"mousemove",this.m_mousemoveBody);this.m_mousemoveBody=null;}
this.m_dragPanel=null;}
if(this.m_useIFrame)
{if(this.m_iframe.parentNode!=null)
{document.body.removeChild(this.m_iframe);}
this.m_iframe=null;}
Panel.prototype.destroy.apply(this,arguments);}
PositionedPanel.prototype.setPosition=function(left,top)
{this.m_left=left;this.m_top=top;if(this.isCreated())
{this.m_htmlDiv.style.top=this.m_top+"px";this.m_htmlDiv.style.left=this.m_left+"px";if(this.m_useIFrame)
{this.m_iframe.style.left=this.m_left+"px";this.m_iframe.style.top=this.m_top+"px";}}}
PositionedPanel.prototype.getLeft=function()
{return this.m_left;}
PositionedPanel.prototype.setLeft=function(left)
{this.m_left=left;if(this.isCreated())
{this.m_htmlDiv.style.left=this.m_left+"px";if(this.m_useIFrame)
{this.m_iframe.style.left=this.m_left+"px";}}}
PositionedPanel.prototype.getTop=function()
{return this.m_top;}
PositionedPanel.prototype.setTop=function(top)
{this.m_top=top;if(this.isCreated())
{this.m_htmlDiv.style.top=this.m_top+"px";if(this.m_useIFrame)
{this.m_iframe.style.top=this.m_top+"px";}}}
PositionedPanel.prototype.setZIndex=function(val)
{this.m_zIndex=val;if(this.isCreated()&&this.m_zIndex!=null)
{this.m_htmlDiv.style.zIndex=this.m_zIndex;if(this.m_useIFrame)
{this.m_iframe.style.zIndex=this.m_zIndex-1;}}}
PositionedPanel.prototype.centerHorizontally=function()
{var width=this.getWidth();var winWidth=document.documentElement.clientWidth;winWidth-=width;if(winWidth<0)
{winWidth=0;}
var left=Math.round(winWidth/2);this.setLeft(left);}
PositionedPanel.prototype.centerVertically=function()
{var height=this.getHeight();var winHeight=document.documentElement.clientHeight;winHeight-=height;if(winHeight<0)
{winHeight=0;}
var top=Math.round(winHeight/2);this.setTop(top);}
PositionedPanel.prototype.setDragPanel=function(objPanel)
{this.m_dragPanel=objPanel;if(!this.isCreated()||!this.m_dragPanel.isCreated())
{throw new Exception("The drag panel must be created.");}
var htmlDragContainer=this.m_dragPanel.getHTMLContainer();htmlDragContainer.style.cursor="move";this.m_mousedownTitle=this.onStartMove.bind(this);EventUtils_attachEvent(htmlDragContainer,"mousedown",this.m_mousedownTitle);this.m_mouseupBody=this.onStopMove.bind(this);EventUtils_attachEvent(document,"mouseup",this.m_mouseupBody);}
PositionedPanel.prototype.onStartMove=function(event)
{if(!this.m_canMove)
{return;}
if(this.m_mousemoveBody==null)
{this.m_mousemoveBody=this.onMove.bind(this);EventUtils_attachEvent(document,"mousemove",this.m_mousemoveBody);}
this.m_startPosX=event.clientX;this.m_startPosY=event.clientY;}
PositionedPanel.prototype.onStopMove=function(event)
{EventUtils_detachEvent(document,"mousemove",this.m_mousemoveBody);this.m_mousemoveBody=null;}
PositionedPanel.prototype.onMove=function(event)
{var deltaX=event.clientX-this.m_startPosX;var deltaY=event.clientY-this.m_startPosY;if(Math.abs(deltaX)<2&&Math.abs(deltaY)<2)
{return;}
this.m_startPosX=event.clientX;this.m_startPosY=event.clientY;var posLeft=this.getLeft()+deltaX;var posTop=this.getTop()+deltaY;if(posLeft<-(this.getWidth()-100))
{posLeft=-(this.getWidth()-100);}
if(posTop<0)
{posTop=0;}
var winWidth=document.documentElement.clientWidth-20;var winHeight=document.documentElement.clientHeight-20;if(posLeft>winWidth)
{posLeft=winWidth;}
if(posTop>winHeight)
{posTop=winHeight;}
this.setPosition(posLeft,posTop);}
PositionedPanel.prototype.onresize=function()
{if(this.m_useIFrame)
{var newWidth=this.getAvailableWidth();var newHeight=this.getAvailableHeight();this.m_iframe.style.width=newWidth+"px";this.m_iframe.style.height=newHeight+"px";}}
PositionedPanel.prototype.show=function()
{Panel.prototype.show.apply(this,arguments);if(this.m_useIFrame)
{document.body.appendChild(this.m_iframe);}}
PositionedPanel.prototype.hide=function()
{Panel.prototype.hide.apply(this,arguments);if(this.m_useIFrame)
{if(this.m_iframe.parentNode!=null)
{document.body.removeChild(this.m_iframe);}}}
function FloatLayout()
{this.Panel();this.m_panels=new Array();}
copyPrototype(FloatLayout,Panel);FloatLayout.prototype.onCreate=function()
{Panel.prototype.onCreate.apply(this,arguments);for(var i=0;i<this.m_panels.length;i++)
{this.addPanelToLayout(this.m_panels[i]);}}
FloatLayout.prototype.addPanelToLayout=function(panel)
{panel.setOverflowMode("visible");panel.create(this.m_htmlDiv,this);panel.m_htmlDiv.style.cssFloat="left";panel.m_htmlDiv.style.styleFloat="left";}
FloatLayout.prototype.removePanel=function(index)
{this.m_panels[index].destroy();this.m_panels=removeFromArray(this.m_panels,index);}
FloatLayout.prototype.swapPanels=function(index1,index2)
{this.m_panels=arraySwap(this.m_panels,index1,index2);swapNodes(this.m_panels[index1].m_htmlDiv,this.m_panels[index2].m_htmlDiv);}
FloatLayout.prototype.addPanel=function(panel)
{this.m_panels.push(panel);if(this.isCreated())
{this.addPanelToLayout(panel);}}
FloatLayout.prototype.clear=function()
{for(var i=0;i<this.m_panels.length;i++)
{this.m_panels[i].destroy();}
this.m_panels=new Array();}
var TABLE_LAYOUT_REMAINDER="REMAINDER";var TABLE_LAYOUT_FLOW="FLOW";var TABLE_LAYOUT_AUTO="AUTO";function TableLayout()
{this.Panel();this.m_rows=new Array();this.m_remainderRow=null;this.setOverflowMode("visible");this.m_containsFlowRow=false;this.m_calculatedSizes=false;this.m_resize=true;}
copyPrototype(TableLayout,Panel);TableLayout.prototype.onCreate=function()
{Panel.prototype.onCreate.apply(this,arguments);this.onresize();}
TableLayout.prototype.destroy=function()
{for(var i=0;i<this.m_rows.length;i++)
{this.m_rows[i].destroy();}
this.m_height=0;Panel.prototype.destroy.apply(this,arguments);}
TableLayout.prototype.refresh=function()
{for(var i=0;i<this.m_rows.length;i++)
{for(var j=0;j<this.m_rows[i].getCellCount();j++)
{this.m_rows[i].getCell(j).m_initialAutoWidth=-1;}}
this.onresize();}
TableLayout.prototype.onresize=function()
{if(this.m_calculatedSizes&&!this.m_resize)
{return;}
this.m_calculatedSizes=false;this.updateLayout();}
TableLayout.prototype.addRow=function(height)
{if(height==TABLE_LAYOUT_FLOW)
{this.m_containsFlowRow=true;}
var tableLayoutRow=new TableLayoutRow(height,this);if(tableLayoutRow.isHeightRemainder())
{this.m_remainderRow=tableLayoutRow;}
this.m_rows.push(tableLayoutRow);}
TableLayout.prototype.setRowHeight=function(rowIndex,height)
{var tableLayoutRow=this.m_rows[rowIndex];tableLayoutRow.setHeight(height);if(tableLayoutRow.isHeightRemainder())
{this.m_remainderRow=tableLayoutRow;}}
TableLayout.prototype.getRowHeight=function(rowIndex)
{var tableLayoutRow=this.m_rows[rowIndex];return tableLayoutRow.getHeight();}
TableLayout.prototype.addCell=function(rowIndex,panel,width)
{var layoutRow=this.m_rows[rowIndex];layoutRow.addCell(panel,width);}
TableLayout.prototype.setCellvAlign=function(rowIndex,cellIndex,vAlign)
{var layoutRow=this.m_rows[rowIndex];layoutRow.setCellvAlign(cellIndex,vAlign);}
TableLayout.prototype.setCellExpandable=function(rowIndex,cellIndex,expandable)
{var layoutRow=this.m_rows[rowIndex];layoutRow.setCellExpandable(cellIndex,expandable);}
TableLayout.prototype.setCellWidth=function(rowIndex,cellIndex,width)
{var layoutRow=this.m_rows[rowIndex];layoutRow.setCellWidth(cellIndex,width);}
TableLayout.prototype.insertCell=function(rowIndex,cellIndex,panel,width)
{var layoutRow=this.m_rows[rowIndex];layoutRow.insertCell(cellIndex,panel,width);}
TableLayout.prototype.getPanel=function(rowIndex,cellIndex)
{if(rowIndex>=this.m_rows.length)
{new CoreException("Invalid row index "+rowIndex);}
var layoutRow=this.m_rows[rowIndex];var layoutCell=layoutRow.getCell(cellIndex);return layoutCell.getPanel();}
TableLayout.prototype.getHeight=function()
{if(!this.m_calculatedSizes)
{this.calculateRowSizes();}
var height=0;var curTableLayoutRow;for(var i=0;i<this.m_rows.length;i++)
{curTableLayoutRow=this.m_rows[i];if(!curTableLayoutRow.isHidden())
{height+=curTableLayoutRow.getCalculatedHeight();}}
height+=this.m_borderTop;height+=this.m_borderBottom;height+=this.m_paddingTop;height+=this.m_paddingBottom;height+=this.m_marginTop;height+=this.m_marginBottom;var panelHeight=Panel.prototype.getHeight.apply(this,arguments);if(panelHeight>height)
{height=panelHeight;}
this.m_height=height;return height;}
TableLayout.prototype.getWidth=function()
{if(!this.m_calculatedSizes)
{this.calculateRowSizes();}
var width=0;var cWidth;for(var i=0;i<this.m_rows.length;i++)
{cWidth=this.m_rows[i].getCalculatedWidth();if(cWidth>width)
{width=cWidth;}}
width+=this.m_borderLeft;width+=this.m_borderRight
width+=this.m_paddingLeft;width+=this.m_paddingRight
width+=this.m_marginLeft;width+=this.m_marginRight;var panelWidth=Panel.prototype.getWidth.apply(this,arguments);if(panelWidth>width)
{width=panelWidth;}
this.m_width=width;return width;}
TableLayout.prototype.getMinWidth=function()
{var rWidth;var mWidth=0;for(var i=0;i<this.m_rows.length;i++)
{rWidth=this.m_rows[i].getMinWidth();if(rWidth>mWidth)
{mWidth=rWidth;}}
mWidth+=this.m_borderLeft;mWidth+=this.m_borderRight
mWidth+=this.m_paddingLeft;mWidth+=this.m_paddingRight
mWidth+=this.m_marginLeft;mWidth+=this.m_marginRight
return mWidth;}
TableLayout.prototype.clear=function()
{for(var i=0;i<this.m_rows.length;i++)
{this.m_rows[i].destroy();}
this.m_rows=new Array();this.m_remainderRow=null;if(this.isCreated())
{this.getHTMLContainer().innerHTML="";}}
TableLayout.prototype.getRowCount=function()
{return this.m_rows.length;}
TableLayout.prototype.getCellCount=function(rowIndex)
{return this.m_rows[rowIndex].getCellCount();}
TableLayout.prototype.replaceCell=function(rowIndex,cellIndex,panel)
{var layoutRow=this.m_rows[rowIndex];var layoutCell=layoutRow.getCell(cellIndex);var curPanel=layoutCell.getPanel();if(curPanel.isCreated())
{curPanel.destroy();}
layoutCell.setPanel(panel);if(!this.isCreated())
{return;}
this.refresh();}
TableLayout.prototype.removeCell=function(rowIndex,cellIndex)
{var layoutRow=this.m_rows[rowIndex];var tableCell=layoutRow.removeCell(cellIndex);var cellPanel=tableCell.getPanel();if(cellPanel.isCreated())
{cellPanel.deletePanel();var htmlCell=tableCell.getHTMLCell();var htmlParent=htmlCell.parentNode;htmlParent.removeChild(htmlCell);}
if(!this.isCreated())
{return;}
this.refresh();}
TableLayout.prototype.removeRow=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];layoutRow.destroy();this.m_rows=removeFromArray(this.m_rows,rowIndex);this.refresh();}
TableLayout.prototype.swapRows=function(rowIndex1,rowIndex2)
{var layoutRow1=this.m_rows[rowIndex1];var layoutRow2=this.m_rows[rowIndex2];swapNodes(layoutRow1.getHTMLTable(),layoutRow2.getHTMLTable());this.m_rows=arraySwap(this.m_rows,rowIndex1,rowIndex2);}
TableLayout.prototype.updateLayout=function()
{var htmlParent;if(this.isCreated())
{this.m_htmlDiv.style.display="none";}
if(!this.m_calculatedSizes)
{this.calculateRowSizes();}
if(this.isCreated())
{this.updateLayoutRows();this.m_htmlDiv.style.display="block";}}
TableLayout.prototype.updateLayoutRows=function()
{var availableWidth=this.getAvailableWidth();var curRow;for(var i=0;i<this.m_rows.length;i++)
{this.updateLayoutRow(this.m_rows[i],availableWidth);}}
TableLayout.prototype.updateLayoutRow=function(layoutRow,availableWidth)
{var rowHeight=layoutRow.getCalculatedHeight();if(!layoutRow.getRequiresUpdate()&&!layoutRow.getRequiresResize())
{return;}
var htmlTable=layoutRow.getHTMLTable();if(htmlTable==null)
{htmlTable=createTable("tableLayout",null);htmlTable.style.padding="0";htmlTable.style.margin="0";htmlTable.style.border="0";createTableRow("",htmlTable);if(layoutRow.m_pageBreakBefore)
{htmlTable.style.pageBreakBefore="always";}
if(layoutRow.m_pageBreakInside)
{htmlTable.style.pageBreakInside="avoid";}
this.m_htmlDiv.appendChild(htmlTable);layoutRow.setHTMLTable(htmlTable);}
else if(htmlTable.parentNode!=this.m_htmlDiv)
{htmlTable.parentNode.removeChild(htmlTable);this.m_htmlDiv.appendChild(htmlTable);}
if(!layoutRow.isHeightFlow())
{htmlTable.style.height=rowHeight+"px";}
htmlTable.style.overflow="visible";layoutRow.updateCells(availableWidth);layoutRow.setRequiresResize(false);}
TableLayout.prototype.calculateRowSizes=function()
{var rowHeight=0;var curRow;var availableHeight=this.getAvailableHeight();var availableWidth=this.getAvailableWidth();var absoluteHeight=0;for(var i=0;i<this.m_rows.length;i++)
{curRow=this.m_rows[i];if(curRow.isHeightAbsolute())
{rowHeight=curRow.getHeightAbsolute();curRow.setCalculatedHeight(rowHeight);absoluteHeight+=rowHeight;}
if(curRow.isHeightAuto())
{rowHeight=curRow.getHeightAuto();curRow.setCalculatedHeight(rowHeight);absoluteHeight+=rowHeight;}}
var remainderHeight=availableHeight-absoluteHeight;if(remainderHeight<0)
{remainderHeight=0;}
availableHeight=remainderHeight;for(var i=0;i<this.m_rows.length;i++)
{curRow=this.m_rows[i];if(curRow.isHeightPercentage())
{rowHeight=curRow.getHeightPercentage(availableHeight);if(remainderHeight-rowHeight<0)
{rowHeight+=remainderHeight-rowHeight;}
curRow.setCalculatedHeight(rowHeight);remainderHeight-=rowHeight;}}
if(remainderHeight<0)
{remainderHeight=0;}
if(this.m_remainderRow!=null)
{this.m_remainderRow.setCalculatedHeight(remainderHeight);}
var rowAbsoluteWidth=-1;var widestRowWidth=-1;for(var i=0;i<this.m_rows.length;i++)
{curRow=this.m_rows[i];rowAbsoluteWidth=curRow.calculateCellWidths(availableWidth);if(widestRowWidth<rowAbsoluteWidth)
{widestRowWidth=rowAbsoluteWidth;}}
if(widestRowWidth>availableWidth)
{for(var i=0;i<this.m_rows.length;i++)
{curRow=this.m_rows[i];curRow.calculateCellWidths(widestRowWidth);}}
this.m_calculatedSizes=true;}
TableLayout.prototype.getCellWidth=function(rowIndex,cellIndex)
{var layoutRow=this.m_rows[rowIndex];var layoutCell=layoutRow.getCell(cellIndex);return layoutCell.getCalculatedWidth();}
TableLayout.prototype.hideCell=function(rowIndex,cellIndex)
{var layoutRow=this.m_rows[rowIndex];var layoutCell=layoutRow.getCell(cellIndex);layoutCell.setHidden(true);}
TableLayout.prototype.showCell=function(rowIndex,cellIndex)
{var layoutRow=this.m_rows[rowIndex];var layoutCell=layoutRow.getCell(cellIndex);layoutCell.setHidden(false);}
TableLayout.prototype.hideRow=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];layoutRow.setHidden(true);}
TableLayout.prototype.isRowHidden=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];return layoutRow.isHidden();}
TableLayout.prototype.showRow=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];layoutRow.setHidden(false);}
TableLayout.prototype.deletePanel=function()
{this.destroy();for(var i=0;i<this.m_rows.length;i++)
{for(var j=0;j<this.m_rows[i].getCellCount();j++)
{deleteObject(this.m_rows[i].getCell(j));}
deleteObject(this.m_rows[i]);}
this.m_rows=null;Panel.prototype.deletePanel.apply(this,arguments);}
TableLayout.prototype.pageBreakBeforeRow=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];layoutRow.m_pageBreakBefore=true;}
TableLayout.prototype.pageBreakInsideRow=function(rowIndex)
{var layoutRow=this.m_rows[rowIndex];layoutRow.m_pageBreakInside=true;}
function TableLayoutRow(height,tableLayout)
{this.m_height=height;this.m_cells=new Array();this.m_calculatedHeight=0;this.m_htmlTable=null;this.m_htmlRow=null;this.m_remainderCell=null;this.m_tableLayout=tableLayout;this.m_requiresResize=true;this.m_hidden=false;this.m_pageBreakBefore=false;this.m_pageBreakInside=false;}
TableLayoutRow.prototype.getHeight=function()
{return this.m_height;}
TableLayoutRow.prototype.setHeight=function(height)
{this.m_height=height;}
TableLayoutRow.prototype.isHeightAuto=function()
{return this.m_height==TABLE_LAYOUT_AUTO;}
TableLayoutRow.prototype.getHeightAuto=function()
{var curPanel;var maxHeight=0;for(var i=0;i<this.m_cells.length;i++)
{curPanel=this.m_cells[i].getPanel();var pHeight=curPanel.getHeight();if(pHeight>maxHeight)
{maxHeight=pHeight;}}
return maxHeight;}
TableLayoutRow.prototype.isHeightAbsolute=function()
{var strHeight=(this.m_height+"");if(strHeight.indexOf("%")==-1&&strHeight.indexOf(TABLE_LAYOUT_REMAINDER)==-1&&strHeight.indexOf(TABLE_LAYOUT_FLOW)==-1&&strHeight.indexOf(TABLE_LAYOUT_AUTO)==-1)
{return true;}
return false;}
TableLayoutRow.prototype.getHeightAbsolute=function()
{var height=parseInt((this.m_height+""));return height;}
TableLayoutRow.prototype.isHeightPercentage=function()
{var strHeight=(this.m_height+"");if(strHeight.indexOf("%")>-1)
{return true;}
return false;}
TableLayoutRow.prototype.getHeightPercentage=function(remainderHeight)
{var percentage=parseInt(this.m_height);return Math.floor((percentage*remainderHeight)/100);}
TableLayoutRow.prototype.isHeightRemainder=function()
{var strHeight=(this.m_height+"");if(strHeight.indexOf(TABLE_LAYOUT_REMAINDER)>-1)
{return true;}
return false;}
TableLayoutRow.prototype.isHeightFlow=function()
{var strHeight=(this.m_height+"");if(strHeight.indexOf(TABLE_LAYOUT_FLOW)>-1)
{return true;}
return false;}
TableLayoutRow.prototype.addCell=function(panel,width)
{var cellIndex=this.m_cells.length;this.insertCell(cellIndex,panel,width);}
TableLayoutRow.prototype.insertCell=function(index,panel,width)
{if(index<0||index>this.m_cells.length)
{new CoreException("TableLayoutRow.prototype.insertCell - invalid cell index "+index);}
var tableLayoutCell=new TableLayoutCell(panel,width,this.m_tableLayout);if(tableLayoutCell.isWidthRemainder())
{if(this.m_remainderCell!=null)
{new CoreException("You can only have one cell per row with its width set to remainder "+index+" "+" width "+width+"   "+panel.m_debugName+"   "+this.m_cells.length);}
this.m_remainderCell=tableLayoutCell;}
this.m_cells=insertIntoArray(this.m_cells,index,tableLayoutCell);}
TableLayoutRow.prototype.setCellvAlign=function(index,vAlign)
{var tableCell=this.m_cells[index];tableCell.setvAlign(vAlign);}
TableLayoutRow.prototype.setCellExpandable=function(index,expandable)
{var tableCell=this.m_cells[index];tableCell.setExpandable(expandable);}
TableLayoutRow.prototype.setCellWidth=function(index,width)
{this.m_requiresResize=true;var tableCell=this.m_cells[index];tableCell.setWidth(width);}
TableLayoutRow.prototype.getCellCount=function()
{return this.m_cells.length;}
TableLayoutRow.prototype.getCell=function(index)
{return this.m_cells[index];}
TableLayoutRow.prototype.setHTMLTable=function(htmlTable)
{this.m_htmlTable=htmlTable;this.m_htmlRow=this.m_htmlTable.firstChild.firstChild;this.setHidden(this.m_hidden);}
TableLayoutRow.prototype.getHTMLTable=function()
{return this.m_htmlTable;}
TableLayoutRow.prototype.getRemainderCell=function()
{return this.m_remainderCell;}
TableLayoutRow.prototype.setCalculatedHeight=function(height)
{if(height!=this.m_calculatedHeight)
{this.m_requiresResize=true;this.m_calculatedHeight=height;for(var i=0;i<this.m_cells.length;i++)
{this.m_cells[i].setRequiresResize(true);}}}
TableLayoutRow.prototype.getCalculatedHeight=function()
{return this.m_calculatedHeight;}
TableLayoutRow.prototype.getCalculatedWidth=function()
{var width=0;for(var i=0;i<this.m_cells.length;i++)
{width+=this.m_cells[i].getCalculatedWidth();}
return width;}
TableLayoutRow.prototype.removeCell=function(index)
{if(index<0||index>this.m_cells.length)
{new CoreException("TableLayoutRow.prototype.insertCell - invalid cell index");}
var tableCell=this.m_cells[index];this.m_cells=removeFromArray(this.m_cells,index);return tableCell;}
TableLayoutRow.prototype.getRequiresUpdate=function()
{for(var i=0;i<this.m_cells.length;i++)
{if(this.m_cells[i].getRequiresUpdate())
{return true;}}
return false;}
TableLayoutRow.prototype.setRequiresResize=function(val)
{this.m_requiresResize=val;}
TableLayoutRow.prototype.getRequiresResize=function()
{if(this.m_requiresResize)
{return true;}
for(var i=0;i<this.m_cells.length;i++)
{if(this.m_cells[i].getRequiresResize())
{return true;}}
return false;}
var SAVE_ADDED=false;TableLayoutRow.prototype.calculateCellWidths=function(availableWidth)
{var temp=availableWidth;var cellWidth=0;var curCell;var expandableCells=new Array();var absoluteWidth=0;for(var i=0;i<this.m_cells.length;i++)
{curCell=this.m_cells[i];if(curCell.getExpandable())
{expandableCells.push(curCell);}
if(curCell.isWidthAbsolute())
{cellWidth=curCell.getWidthAbsolute();curCell.setCalculatedWidth(cellWidth);absoluteWidth+=cellWidth;}
else if(curCell.isWidthAuto())
{cellWidth=curCell.getWidthAuto();curCell.setCalculatedWidth(cellWidth);absoluteWidth+=cellWidth;}}
var remainderWidth=availableWidth-absoluteWidth;if(remainderWidth<0)
{remainderWidth=0;}
availableWidth=remainderWidth;for(var i=0;i<this.m_cells.length;i++)
{curCell=this.m_cells[i];if(curCell.isWidthPercentage())
{cellWidth=curCell.getWidthPercentage(availableWidth);if(remainderWidth-cellWidth<0)
{cellWidth-=remainderWidth-cellWidth;}
curCell.setCalculatedWidth(cellWidth);remainderWidth-=cellWidth;}}
if(remainderWidth<0)
{remainderWidth=0;}
if(remainderWidth>0&&expandableCells.length>0)
{if(expandableCells.length==1)
{expandableCells[0].setCalculatedWidth(expandableCells[0].getCalculatedWidth()+remainderWidth);remainderWidth=0;}
else
{var curCell=0;while(remainderWidth>0)
{expandableCells[curCell].setCalculatedWidth(expandableCells[curCell].getCalculatedWidth()+1);remainderWidth--;curCell++;if(curCell==expandableCells.length)
{curCell=0;}}}}
if(this.m_remainderCell!=null)
{this.m_remainderCell.setCalculatedWidth(remainderWidth);if(this.m_remainderCell.m_panel.getMinWidth()>this.m_remainderCell.getCalculatedWidth())
{remainderWidth=this.m_remainderCell.m_panel.getMinWidth();this.m_remainderCell.setCalculatedWidth(remainderWidth);}
absoluteWidth+=remainderWidth;}
return absoluteWidth;}
TableLayoutRow.prototype.updateCells=function()
{for(var i=0;i<this.m_cells.length;i++)
{this.updateCell(this.m_cells[i],i)}}
TableLayoutRow.prototype.updateCell=function(layoutCell,cellIndex)
{var requiresUpdate=layoutCell.getRequiresUpdate();if(!requiresUpdate&&!layoutCell.getRequiresResize())
{return;}
var cellPanel=layoutCell.getPanel();var htmlCell=layoutCell.getHTMLCell();if(requiresUpdate)
{if(htmlCell!=null)
{if(cellPanel.isCreated())
{cellPanel.destroy();}
htmlCell.innerHTML="";}
else
{if(cellIndex==0)
{htmlCell=createTableCell("tableLayout",this.m_htmlRow);}
else
{htmlCell=createTableCell("tableLayout",null);var prevSibling=this.m_htmlRow.childNodes[cellIndex-1];insertAfter(htmlCell,prevSibling);}
layoutCell.setHTMLCell(htmlCell);htmlCell.vAlign=layoutCell.getvAlign();htmlCell.style.verticalAlign=layoutCell.getvAlign();}}
if(!this.isHeightFlow())
{var height=this.m_calculatedHeight;htmlCell.style.height=height+"px";cellPanel.setHeight(height);}
else
{cellPanel.m_controlHeight=false;}
if(!layoutCell.isWidthFlow())
{var width=layoutCell.getCalculatedWidth();htmlCell.style.width=width+"px";cellPanel.m_controlWidth=true;cellPanel.setWidth(width);}
else
{cellPanel.m_controlWidth=false;}
if(requiresUpdate)
{cellPanel.create(htmlCell,this.m_tableLayout);}
cellPanel.getHTMLContainer().style.verticalAlign=layoutCell.getvAlign();layoutCell.setRequiresResize(false);}
TableLayoutRow.prototype.destroy=function()
{for(var i=0;i<this.m_cells.length;i++)
{this.m_cells[i].destroy();}
if(this.m_htmlTable!=null&&this.m_htmlTable.parentNode!=undefined&&this.m_htmlTable.parentNode!=null)
{this.m_htmlTable.parentNode.removeChild(this.m_htmlTable);}
this.m_htmlTable=null;this.m_htmlRow=null;this.m_requiresResize=true;this.m_calculatedHeight=0;}
TableLayoutRow.prototype.getMinWidth=function()
{var curCell;var mWidth=0;var cellMinWidth;for(var i=0;i<this.m_cells.length;i++)
{curCell=this.m_cells[i];cellMinWidth=0;if(curCell.isWidthAbsolute())
{cellMinWidth+=curCell.getWidthAbsolute();}
var cellPanel=this.m_cells[i].getPanel();if(cellMinWidth<cellPanel.getMinWidth())
{cellMinWidth=cellPanel.getMinWidth();}
mWidth+=cellMinWidth;}
return mWidth;}
TableLayoutRow.prototype.setHidden=function(val)
{this.m_hidden=val;if(this.m_htmlTable!=null)
{if(this.m_hidden)
{this.m_htmlTable.style.display="none";}
else
{this.m_htmlTable.style.display="";}}}
TableLayoutRow.prototype.isHidden=function()
{return this.m_hidden;}
function TableLayoutCell(panel,width,tableLayout)
{this.m_panel=panel;this.m_width=width;this.m_htmlCell=null;this.m_vAlign="top";this.m_calculatedWidth=0;this.m_tableLayout=tableLayout;this.m_requiresResize=true;this.m_expandable=false;this.m_hidden=false;this.m_initialWidth=null;this.m_initialAutoWidth=-1;}
TableLayoutCell.prototype.setWidth=function(width)
{this.m_width=width;this.m_requiresResize=true;this.m_calculatedWidth=0;}
TableLayoutCell.prototype.setExpandable=function(val)
{this.m_expandable=val;}
TableLayoutCell.prototype.getExpandable=function()
{return this.m_expandable;}
TableLayoutCell.prototype.isWidthAuto=function()
{return this.m_width==TABLE_LAYOUT_AUTO;}
TableLayoutCell.prototype.getWidthAuto=function()
{if(this.m_initialAutoWidth==-1)
{this.m_initialAutoWidth=this.m_panel.getWidth();this.m_requiresResize=true;}
return this.m_initialAutoWidth;}
TableLayoutCell.prototype.getWidthRemainder=function()
{if(this.m_initialWidth==null)
{this.m_initialWidth=this.m_panel.getWidth();}
return this.m_initialWidth;}
TableLayoutCell.prototype.isWidthAbsolute=function()
{var strWidth=(this.m_width+"");if(strWidth.indexOf("%")==-1&&strWidth.indexOf(TABLE_LAYOUT_REMAINDER)==-1&&strWidth.indexOf(TABLE_LAYOUT_AUTO)==-1&&strWidth.indexOf(TABLE_LAYOUT_FLOW)==-1)
{return true;}
return false;}
TableLayoutCell.prototype.getWidthAbsolute=function()
{return parseInt(this.m_width);}
TableLayoutCell.prototype.isWidthPercentage=function()
{var strWidth=(this.m_width+"");if(strWidth.indexOf("%")>-1)
{return true;}
return false;}
TableLayoutCell.prototype.getWidthPercentage=function(remainderWidth)
{var percentage=parseInt(this.m_width);var width=Math.floor((percentage*remainderWidth)/100);return width;}
TableLayoutCell.prototype.isWidthRemainder=function()
{var strWidth=(this.m_width+"");if(strWidth.indexOf(TABLE_LAYOUT_REMAINDER)>-1)
{return true;}
return false;}
TableLayoutCell.prototype.isWidthFlow=function()
{var strWidth=(this.m_width+"");if(strWidth.indexOf(TABLE_LAYOUT_FLOW)>-1)
{return true;}
return false;}
TableLayoutCell.prototype.setHTMLCell=function(htmlCell)
{this.m_htmlCell=htmlCell;if(this.m_hidden)
{this.m_htmlCell.style.display="none";}
else
{this.m_htmlCell.style.display="";}}
TableLayoutCell.prototype.getHTMLCell=function()
{return this.m_htmlCell;}
TableLayoutCell.prototype.getPanel=function()
{return this.m_panel;}
TableLayoutCell.prototype.setPanel=function(panel)
{this.m_panel=panel;}
TableLayoutCell.prototype.setvAlign=function(vAlign)
{this.m_vAlign=vAlign;if(this.m_htmlCell!=null)
{this.m_htmlCell.vAlign=this.m_vAlign;}}
TableLayoutCell.prototype.getvAlign=function()
{return this.m_vAlign;}
TableLayoutCell.prototype.getRequiresUpdate=function()
{return!this.m_panel.isCreated();}
TableLayoutCell.prototype.setRequiresResize=function(val)
{this.m_requiresResize=val;}
TableLayoutCell.prototype.getRequiresResize=function()
{if(this.m_requiresResize)
{return true;}
return false;}
TableLayoutCell.prototype.setCalculatedWidth=function(width)
{if(width!=this.m_calculatedWidth)
{this.m_requiresResize=true;this.m_calculatedWidth=width;}}
TableLayoutCell.prototype.getCalculatedWidth=function()
{return this.m_calculatedWidth;}
TableLayoutCell.prototype.destroy=function()
{if(this.m_panel.isCreated())
{this.m_panel.destroy();}
this.m_htmlCell=null;this.m_calculatedWidth=0;this.m_requiresResize=true;}
TableLayoutCell.prototype.setHidden=function(val)
{this.m_hidden=val;if(this.m_htmlCell!=null)
{if(this.m_hidden)
{this.m_htmlCell.style.display="none";}
else
{this.m_htmlCell.style.display="";}}}
function Label(caption)
{this.Panel();this.m_caption=""+caption;this.m_tooltip="";this.setHeight(20);this.m_color=SKIN_LABEL_COLOR;this.m_fontFamily=SKIN_FONT_FAMILY;this.m_fontSize=SKIN_FONT_SIZE;this.m_bold=false;this.m_italic=false;this.m_underline=false;this.m_align="left";this.m_vAlign=null;this.m_wrap=true;this.m_captureClick=false;this.m_captureDblClick=false;this.m_htmlTable=null;}
copyPrototype(Label,Panel);Label.prototype.onCreate=function()
{Panel.prototype.onCreate.apply(this,arguments);var htmlContainer=this.getHTMLContainer();htmlContainer.style.textAlign=this.m_align;if(!this.m_wrap)
{htmlContainer.style.whiteSpace="nowrap";}
if(this.m_bold)
{htmlContainer.style.fontWeight="bold";}
if(this.m_italic)
{htmlContainer.style.fontStyle="italic";}
if(this.m_underline)
{htmlContainer.style.textDecoration="underline";}
this.setCaption(this.m_caption);if(this.m_captureClick)
{EventDispatcher_addEventListener(htmlContainer,"click",this);}
if(this.m_captureDblClick)
{EventDispatcher_addEventListener(htmlContainer,"dblclick",this);}}
Label.prototype.destroy=function()
{var htmlContainer=this.getHTMLContainer();if(this.m_captureClick)
{EventDispatcher_removeEventListener(htmlContainer,"click",this);}
if(this.m_captureDblClick)
{EventDispatcher_removeEventListener(htmlContainer,"dblclick",this);}
Panel.prototype.destroy.apply(this,arguments);}
Label.prototype.onclick=function(event,htmlObj)
{this.notifyListeners("onLabelClick",this);}
Label.prototype.ondblclick=function(event,htmlObj)
{this.notifyListeners("onLabelDblClick",this);}
Label.prototype.setBold=function(val)
{this.m_bold=val;if(this.isCreated())
{var htmlContainer=this.getHTMLContainer();if(this.m_bold)
{htmlContainer.style.fontWeight="bold";}
else
{htmlContainer.style.fontWeight="";}}}
Label.prototype.setItalic=function(val)
{this.m_italic=val;if(this.isCreated())
{var htmlContainer=this.getHTMLContainer();if(this.m_italic)
{htmlContainer.style.fontStyle="italic";}
else
{htmlContainer.style.fontStyle="";}}}
Label.prototype.setvAlign=function(val)
{this.m_vAlign=val;}
Label.prototype.setAlign=function(val)
{this.m_align=val;}
Label.prototype.setTooltip=function(val)
{this.m_tooltip=val;}
Label.prototype.getCaption=function()
{return this.m_caption;}
Label.prototype.setCaption=function(caption)
{this.m_caption=""+caption;if(this.isCreated())
{var htmlContainer=this.getHTMLContainer();htmlContainer.innerHTML="";this.m_htmlTable=null;if(this.m_caption.length>0)
{if(this.m_vAlign!=null)
{this.m_htmlTable=createTable(null,htmlContainer);this.m_htmlTable.style.fontSize=this.m_fontSize;this.m_htmlTable.style.fontFamily=this.m_fontFamily;var row=createTableRow(null,this.m_htmlTable);var cell=createTableCell(null,row);cell.vAlign=this.m_vAlign;cell.style.verticalAlign=this.m_vAlign;var htmlCaption=createTooltip("",this.m_caption,this.m_tooltip,cell);if(this.m_color!=null)
{this.m_htmlTable.style.color=this.m_color;}
if(this.m_controlHeight)
{var newHeight=this.getAvailableHeight();this.m_htmlTable.style.height=newHeight+"px";}}
else
{var htmlCaption=createTooltip("",this.m_caption,this.m_tooltip,htmlContainer);}}}}
Label.prototype.onresize=function()
{if(this.m_htmlTable!=null)
{if(this.m_controlWidth)
{var newWidth=this.getAvailableWidth();this.m_htmlTable.style.width=newWidth+"px";}
if(this.m_controlHeight)
{var newHeight=this.getAvailableHeight();this.m_htmlTable.style.height=newHeight+"px";}}}
Label.prototype.setWrap=function(val)
{this.m_wrap=val;}
Label.prototype.setCaptureClick=function(val)
{this.m_captureClick=val;}
Label.prototype.setCaptureDblClick=function(val)
{this.m_captureDblClick=val;}
function ImageControl(imgUrl,imgWidth,imgHeight,stretch)
{this.Panel();this.m_imgUrl=imgUrl;this.m_imgWidth=imgWidth;this.m_imgHeight=imgHeight;this.m_vAlign="middle";this.m_align=null;this.m_stretch=stretch;this.m_mouseDownImage=null;this.m_mouseOverImage=null;this.m_mouseOver=false;this.m_showImage=true;this.m_tooltip=null;}
copyPrototype(ImageControl,Panel);ImageControl.prototype.onCreate=function()
{Panel.prototype.onCreate.apply(this,arguments);if(this.m_tooltip!=null)
{attachTooltip(this.m_htmlDiv,this.m_tooltip);}
if(!this.m_stretch)
{this.m_htmlImage=createImage(this.m_imgUrl,this.m_htmlDiv,this.m_imgWidth,this.m_imgHeight);this.m_htmlImage.style.verticalAlign=this.m_vAlign;if(this.m_align!=null)
{this.m_htmlDiv.style.textAlign=this.m_align;}
EventDispatcher_addEventListener(this.m_htmlImage,"click",this);if(this.m_mouseDownImage!=null)
{EventDispatcher_addEventListener(this.m_htmlImage,"mousedown",this);EventDispatcher_addEventListener(this.m_htmlImage,"mouseup",this);EventDispatcher_addEventListener(this.m_htmlImage,"mouseout",this);}
if(this.m_mouseOverImage!=null)
{EventDispatcher_addEventListener(this.m_htmlImage,"mouseover",this);}}
else
{this.m_htmlTable=createTable("tab",this.m_htmlDiv);var row=createTableRow("",this.m_htmlTable);this.m_cell=createTableCell("",row);if(isInternetExplorer())
{this.m_cell.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.m_imgUrl+"', sizingMethod='scale' )";}
else
{this.m_cell.style.backgroundImage="url("+this.m_imgUrl+")";}
this.m_cell.innerHTML="&nbsp;";EventDispatcher_addEventListener(this.m_cell,"click",this);if(this.m_mouseDownImage!=null)
{EventDispatcher_addEventListener(this.m_cell,"mousedown",this);EventDispatcher_addEventListener(this.m_cell,"mouseup",this);EventDispatcher_addEventListener(this.m_cell,"mouseout",this);}
if(this.m_mouseOverImage!=null)
{EventDispatcher_addEventListener(this.m_cell,"mouseover",this);}}
if(!this.m_showImage)
{this.hideImage();}}
ImageControl.prototype.destroy=function()
{if(!this.m_stretch)
{EventDispatcher_removeEventListener(this.m_htmlImage,"click",this);if(this.m_mouseDownImage!=null)
{EventDispatcher_removeEventListener(this.m_htmlImage,"mousedown",this);EventDispatcher_removeEventListener(this.m_htmlImage,"mouseup",this);EventDispatcher_removeEventListener(this.m_htmlImage,"mouseout",this);}
if(this.m_mouseOverImage!=null)
{EventDispatcher_removeEventListener(this.m_htmlImage,"mouseover",this);}}
else
{EventDispatcher_removeEventListener(this.m_cell,"click",this);if(this.m_mouseDownImage!=null)
{EventDispatcher_removeEventListener(this.m_cell,"mousedown",this);EventDispatcher_removeEventListener(this.m_cell,"mouseup",this);EventDispatcher_removeEventListener(this.m_cell,"mouseout",this);}
if(this.m_mouseOverImage!=null)
{EventDispatcher_removeEventListener(this.m_cell,"mouseover",this);}}
Panel.prototype.destroy.apply(this,arguments);}
ImageControl.prototype.hideImage=function()
{this.m_showImage=false;if(!this.isCreated())
{return;}
if(!this.m_stretch)
{this.m_htmlImage.style.display="none";}
else
{this.m_htmlTable.style.display="none";}}
ImageControl.prototype.showImage=function()
{this.m_showImage=true;if(!this.isCreated())
{return;}
if(!this.m_stretch)
{this.m_htmlImage.style.display="";}
else
{this.m_htmlTable.style.display="";}}
ImageControl.prototype.setMouseDownImage=function(imageUrl)
{this.m_mouseDownImage=imageUrl;}
ImageControl.prototype.setMouseOverImage=function(imageUrl)
{this.m_mouseOverImage=imageUrl;}
ImageControl.prototype.setImage=function(imageUrl)
{this.m_imgUrl=imageUrl;if(this.isCreated())
{changeImage(this.m_htmlImage,this.m_imgUrl);}}
ImageControl.prototype.onclick=function(event,htmlObj)
{if(this.m_stretch&&htmlObj==this.m_cell)
{this.notifyListeners("onImageClick",this);}
else if(!this.m_stretch&&htmlObj==this.m_htmlImage)
{this.notifyListeners("onImageClick",this);}}
ImageControl.prototype.onmouseover=function(event,htmlObj)
{if(this.m_mouseOver)
{return;}
this.m_mouseOver=true;if(this.m_stretch&&htmlObj==this.m_cell)
{if(isInternetExplorer())
{this.m_cell.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.m_mouseOverImage+"', sizingMethod='scale' )";}
else
{this.m_cell.style.backgroundImage="url("+this.m_mouseOverImage+")";}}
else if(!this.m_stretch&&htmlObj==this.m_htmlImage)
{changeImage(this.m_htmlImage,this.m_mouseOverImage);}}
ImageControl.prototype.onmousedown=function(event,htmlObj)
{if(this.m_stretch&&htmlObj==this.m_cell)
{if(isInternetExplorer())
{this.m_cell.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.m_mouseDownImage+"', sizingMethod='scale' )";}
else
{this.m_cell.style.backgroundImage="url("+this.m_mouseDownImage+")";}}
else if(!this.m_stretch&&htmlObj==this.m_htmlImage)
{changeImage(this.m_htmlImage,this.m_mouseDownImage);}}
ImageControl.prototype.onmouseup=function(event,htmlObj)
{if(this.m_stretch&&htmlObj==this.m_cell)
{if(isInternetExplorer())
{this.m_cell.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.m_imgUrl+"', sizingMethod='scale' )";}
else
{this.m_cell.style.backgroundImage="url("+this.m_imgUrl+")";}}
else if(!this.m_stretch&&htmlObj==this.m_htmlImage)
{changeImage(this.m_htmlImage,this.m_imgUrl);}}
ImageControl.prototype.onmouseout=function(event,htmlObj)
{this.m_mouseOver=false;if(this.m_stretch&&htmlObj==this.m_cell)
{if(isInternetExplorer())
{this.m_cell.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.m_imgUrl+"', sizingMethod='scale' )";}
else
{this.m_cell.style.backgroundImage="url("+this.m_imgUrl+")";}}
else if(!this.m_stretch&&htmlObj==this.m_htmlImage)
{changeImage(this.m_htmlImage,this.m_imgUrl);}}
ImageControl.prototype.onresize=function()
{if(!this.isCreated()||!this.m_stretch)
{return;}
var newWidth=this.getAvailableWidth();var newHeight=this.getAvailableHeight();this.m_htmlTable.style.width=newWidth+"px";this.m_htmlTable.style.height=newHeight+"px";}
ImageControl.prototype.setAlign=function(val)
{this.m_align=val;}
ImageControl.prototype.setVAlign=function(val)
{this.m_vAlign=val;}
ImageControl.prototype.setTooltip=function(val)
{this.m_tooltip=val;}
function AcquiroProject(thumbnailUrl,imageUrl,prjName,description,isWebDesign,isPrint,isDev,isInterface,width,height)
{this.m_thumbnailImg=thumbnailUrl;this.m_imageUrl=imageUrl;this.m_name=prjName;this.m_description=description;this.m_isWebDesign=isWebDesign;this.m_isPrint=isPrint;this.m_isDev=isDev;this.m_isInterface=isInterface;this.m_imgWidth=width;this.m_imgHeight=height;}
function AcquiroProjectIcon(project)
{this.TableLayout();this.m_controlHeight=true;this.setMargin(25,0,0,0);this.setSize(185,145);this.m_project=project;this.createLayout();}
copyPrototype(AcquiroProjectIcon,TableLayout);AcquiroProjectIcon.prototype.onCreate=function()
{TableLayout.prototype.onCreate.apply(this,arguments);var htmlContainer=this.getHTMLContainer();htmlContainer.style.cursor="pointer";this.m_image.getHTMLContainer().style.cursor="pointer";attachTooltip(htmlContainer,getResource(ACQUIRO_PORTFOLIO_ICON_TOOLTIP));EventDispatcher_addEventListener(htmlContainer,"click",this);}
AcquiroProjectIcon.prototype.onclick=function()
{this.notifyListeners("onProjectIconClick",this);}
AcquiroProjectIcon.prototype.createLayout=function(htmlDiv)
{this.m_image=new ImageControl(this.m_project.m_thumbnailImg,150,75,false);if(isInternetExplorer())
{this.m_image.setSize(160,85);this.m_image.m_vAlign="top";}
else
{this.m_image.setSize(160,85);}
this.m_image.setBackgroundColor("#F4F4F4");this.m_image.setPadding(4,4,4,4);this.m_image.setBorder(1,1,1,1,"solid","#B4B5B7");this.addRow(TABLE_LAYOUT_AUTO);this.addCell(this.getRowCount()-1,this.m_image,"160");this.m_label=new Label(this.m_project.m_name);this.m_label.setTooltip(this.m_project.m_description);this.m_label.setMargin(0,0,6,6);this.m_label.setFontFamily("Helvetica, Verdana, sans-serif");this.m_label.setFontSize("12px");this.m_label.setColor("#697076");this.addRow(TABLE_LAYOUT_FLOW);this.addCell(this.getRowCount()-1,this.m_label,TABLE_LAYOUT_REMAINDER);var img;if(this.m_project.m_isPrint)
{img=new ImageControl("images/acquiro/website/print.jpg",13,12,false);this.addCell(this.getRowCount()-1,img,"13");this.setCellvAlign(this.getRowCount()-1,this.getCellCount(this.getRowCount()-1)-1,"middle");}
if(this.m_project.m_isWebDesign)
{img=new ImageControl("images/acquiro/website/webdesign.jpg",13,12,false);this.addCell(this.getRowCount()-1,img,"13");this.setCellvAlign(this.getRowCount()-1,this.getCellCount(this.getRowCount()-1)-1,"middle");}
if(this.m_project.m_isInterface)
{img=new ImageControl("images/acquiro/website/interface.jpg",13,12,false);this.addCell(this.getRowCount()-1,img,"13");this.setCellvAlign(this.getRowCount()-1,this.getCellCount(this.getRowCount()-1)-1,"middle");}
if(this.m_project.m_isDev)
{img=new ImageControl("images/acquiro/website/dev.jpg",13,12,false);this.addCell(this.getRowCount()-1,img,"13");this.setCellvAlign(this.getRowCount()-1,this.getCellCount(this.getRowCount()-1)-1,"middle");}
this.addRow("15");this.addCell(this.getRowCount()-1,new Panel(),TABLE_LAYOUT_REMAINDER);}
function AcquiroProjectViewer()
{this.FloatLayout();this.m_controlHeight=false;this.m_controlWidth=false;this.m_projects=new Array();this.m_projectIcons=new Array();}
copyPrototype(AcquiroProjectViewer,FloatLayout);AcquiroProjectViewer.prototype.addProject=function(project)
{this.m_projects.push(project);var prjIcon=new AcquiroProjectIcon(project);prjIcon.addListener(this);this.m_projectIcons.push(prjIcon);this.addPanel(prjIcon);}
AcquiroProjectViewer.prototype.onProjectIconClick=function(prjIcon)
{this.lockUI();var index=getArrayIndex(this.m_projectIcons,prjIcon);var posTop=document.documentElement.scrollTop+30;this.m_prjWindow=new AcquiroProjectWindow(this.m_projects,index);this.m_prjWindow.create(document.body,this);this.m_prjWindow.centerHorizontally();this.m_prjWindow.setTop(posTop);this.m_prjWindow.setZIndex(201);this.m_prjWindow.addListener(this);}
AcquiroProjectViewer.prototype.onProjectWindowClose=function()
{this.unlockUI();}
AcquiroProjectViewer.prototype.lockUI=function()
{window.onresize=this.onBrowserResize.bind(this);this.m_lockDiv=createDiv("",document.body);this.m_lockDiv.style.position="absolute";this.m_lockDiv.style.top="0";this.m_lockDiv.style.left="0";this.m_lockDiv.style.zIndex="200";this.m_lockDiv.style.display="none";var winWidth=document.documentElement.clientWidth;var winHeight=document.documentElement.scrollHeight;this.m_lockDiv.style.width=winWidth+"px";this.m_lockDiv.style.height=winHeight+"px";this.m_lockDiv.style.display="block";this.m_lockDiv.style.backgroundColor="black";setOpacity(this.m_lockDiv,65);}
AcquiroProjectViewer.prototype.onBrowserResize=function()
{var winWidth=document.documentElement.clientWidth;var winHeight=document.documentElement.scrollHeight;this.m_lockDiv.style.width=winWidth+"px";this.m_lockDiv.style.height=winHeight+"px";this.m_prjWindow.centerHorizontally();}
AcquiroProjectViewer.prototype.onProjectWindowClose=function()
{this.m_prjWindow.destroy();this.m_prjWindow=null;this.unlockUI();}
AcquiroProjectViewer.prototype.unlockUI=function()
{window.onresize=null;if(this.m_lockDiv!=null&&this.m_lockDiv.parentNode==document.body)
{document.body.removeChild(this.m_lockDiv);}
this.m_lockDiv=null;}
function AcquiroProjectWindow(projects,curIndex)
{this.PositionedPanel();this.m_controlHeight=false;this.setBackgroundColor("white");this.m_projects=projects;this.m_curIndex=curIndex;this.m_projectLayout=null;}
copyPrototype(AcquiroProjectWindow,PositionedPanel);AcquiroProjectWindow.prototype.onCreate=function()
{this.createProjectLayout();var htmlContainer=this.getHTMLContainer();this.m_projectLayout.create(htmlContainer,this);PositionedPanel.prototype.onCreate.apply(this,arguments);}
AcquiroProjectWindow.prototype.getWidth=function()
{return this.m_projectLayout.getWidth();}
AcquiroProjectWindow.prototype.createProjectLayout=function()
{this.m_projectLayout=new TableLayout();this.m_projectLayout.m_controlHeight=false;this.m_projectLayout.setPadding(15,15,15,15);this.m_closeBtn=new ImageControl("images/acquiro/website/close_win.jpg",18,18,false);this.m_closeBtn.addListener(this);this.m_closeBtn.setPadding(0,0,12,8);this.m_projectLayout.addRow("38");this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,new Panel(),TABLE_LAYOUT_REMAINDER);this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,this.m_closeBtn,"18");this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,new Panel(),"15");var width=this.m_projects[this.m_curIndex].m_imgWidth;var height=this.m_projects[this.m_curIndex].m_imgHeight;this.m_prjImgCtrl=new ImageControl(this.m_projects[this.m_curIndex].m_imageUrl,width,height,false);this.m_projectLayout.addRow(height);this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,this.m_prjImgCtrl,width);var desc=this.m_projects[this.m_curIndex].m_name+"<br><br>"+this.m_projects[this.m_curIndex].m_description;this.m_prjDescLbl=new Label(desc);this.m_prjDescLbl.m_controlHeight=false;this.m_prjDescLbl.setColor("#697076");this.m_prjDescLbl.setPadding(0,15,8,6);this.m_prjDescLbl.setFontFamily("Helvetica, Verdana, sans-serif");var prevStr="< Prev.";if(USER_LANGUAGE=="fr")
{prevStr="< Préc.";}
this.m_previousLbl=new Label(prevStr);this.m_previousLbl.m_controlHeight=false;this.m_previousLbl.setColor("#697076");this.m_previousLbl.m_captureClick=true;this.m_previousLbl.addListener(this);this.m_previousLbl.setFontFamily("Helvetica, Verdana, sans-serif");this.m_previousLbl.setFontSize("10px");this.m_previousLbl.setAlign("right");this.m_previousLbl.setPadding(0,0,8,0);var nextStr="Next >";if(USER_LANGUAGE=="fr")
{nextStr="Suiv. >";}
this.m_nextLbl=new Label(nextStr);this.m_nextLbl.setColor("#697076");this.m_nextLbl.m_captureClick=true;this.m_nextLbl.addListener(this);this.m_nextLbl.setFontFamily("Helvetica, Verdana, sans-serif");this.m_nextLbl.setFontSize("10px");this.m_nextLbl.setAlign("right");this.m_nextLbl.setPadding(0,18,8,0);this.m_prjDescLbl.setOverflowMode("visible");this.m_previousLbl.setOverflowMode("visible");this.m_previousLbl.setOverflowMode("visible");this.m_projectLayout.addRow(TABLE_LAYOUT_FLOW);this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,this.m_prjDescLbl,TABLE_LAYOUT_REMAINDER);this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,this.m_previousLbl,"55");this.m_projectLayout.addCell(this.m_projectLayout.getRowCount()-1,this.m_nextLbl,"58");this.setWidth(this.m_projectLayout.getWidth());}
AcquiroProjectWindow.prototype.postCreate=function()
{PositionedPanel.prototype.postCreate.apply(this,arguments);this.m_nextLbl.m_htmlDiv.style.textDecoration="underline";this.m_previousLbl.m_htmlDiv.style.textDecoration="underline";this.m_nextLbl.m_htmlDiv.style.cursor="pointer";this.m_previousLbl.m_htmlDiv.style.cursor="pointer";}
AcquiroProjectWindow.prototype.onImageClick=function(objImg)
{this.notifyListeners("onProjectWindowClose",this);}
AcquiroProjectWindow.prototype.onLabelClick=function(objLbl)
{if(objLbl==this.m_nextLbl)
{this.m_curIndex++;}
else
{this.m_curIndex--;}
if(this.m_curIndex>=this.m_projects.length)
{this.m_curIndex=0;}
if(this.m_curIndex<0)
{this.m_curIndex=this.m_projects.length-1;}
var desc=this.m_projects[this.m_curIndex].m_name+"<br><br>"+this.m_projects[this.m_curIndex].m_description;this.m_prjDescLbl.setCaption(desc);var width=this.m_projects[this.m_curIndex].m_imgWidth;var height=this.m_projects[this.m_curIndex].m_imgHeight;this.m_prjImgCtrl=new ImageControl(this.m_projects[this.m_curIndex].m_imageUrl,width,height,false);this.m_projectLayout.setRowHeight(1,height);this.m_projectLayout.setCellWidth(1,0,width);this.m_projectLayout.replaceCell(1,0,this.m_prjImgCtrl);this.m_projectLayout.setWidth(0);this.m_projectLayout.refresh();this.setWidth(this.m_projectLayout.getWidth());this.centerHorizontally();}
