var Telligent_Common=new Object();Telligent_Common._state=new Array();Telligent_Common.ConvertHsvColorToRgbColor=function(hsv) {var h=hsv[0];var s=hsv[1];var v=hsv[2];var r;var g;var b;if(s==0) return new Array(v,v,v);var htemp;if(h==360) htemp=0;else htemp=h;htemp=htemp/60;var i=Math.floor(htemp);var f=htemp-i;var p=v*(1-s);var q=v*(1-(s*f));var t=v*(1-(s*(1-f)));if(i==0){r=v;g=t;b=p;} if(i==1){r=q;g=v;b=p;} if(i==2){r=p;g=v;b=t;} if(i==3){r=p;g=q;b=v;} if(i==4){r=t;g=p;b=v;} if(i==5){r=v;g=p;b=q;} r=Math.round(r);g=Math.round(g);b=Math.round(b);return new Array(r,g,b);} Telligent_Common.ConvertRgbColorToHsvColor=function(rgb) {var r=rgb[0];var g=rgb[1];var b=rgb[2];var h;var s;var v=Math.max(Math.max(r,g),b);var min=Math.min(Math.min(r,g),b);var delta=v-min;if(v==0) s=0 else s=delta/v;if(s==0) h=0;else {if(r==v) h=60*(g-b)/delta;else if(g==v) h=120+60*(b-r)/delta;else if(b==v) h=240+60*(r-g)/delta;} if(h<0) h+=360;return new Array(h,s,v);} Telligent_Common.ConvertDecimalToHexadecimal=function(d,digits) {var chars="0123456789abcdef";var h='';var mod;while(d>0) {mod=d%16;h=chars.substr(mod,1)+h;d-=mod;d/=16;} if(digits) {while(h.length1024) return"#000000";else return"#ffffff";} Telligent_Common.GetElementInfo=function(element) {var curleft=0;var curtop=0;var obj=element;var leftComplete=false;var topComplete=false;var isIE=Telligent_Common.IsIE();while(obj) {if(!leftComplete) curleft+=obj.offsetLeft;if(!topComplete) curtop+=obj.offsetTop;if(isIE&&obj.offsetParent&&obj.offsetParent.style.position=='relative') {if(!obj.offsetParent.style.width) {leftComplete=true;if((obj.offsetParent.style.top||obj.offsetParent.style.bottom)) {curtop+=obj.offsetHeight;topComplete=true;}}} obj=obj.offsetParent;} var elementInfo=new Object();elementInfo.Left=curleft;elementInfo.Top=curtop;elementInfo.Width=element.offsetWidth;elementInfo.Height=element.offsetHeight;return elementInfo;} Telligent_Common.GetWindowInfo=function() {var scrollX=0,scrollY=0,width=0,height=0;if(typeof(window.pageXOffset)=='number') {scrollX=window.pageXOffset;scrollY=window.pageYOffset;} else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)) {scrollX=document.body.scrollLeft;scrollY=document.body.scrollTop;} else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)) {scrollX=document.documentElement.scrollLeft;scrollY=document.documentElement.scrollTop;} if(typeof(window.innerWidth)=='number') {width=window.innerWidth;height=window.innerHeight;} else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)) {width=document.documentElement.clientWidth;height=document.documentElement.clientHeight;} else if(document.body&&(document.body.clientWidth||document.body.clientHeight)) {width=document.body.clientWidth;height=document.body.clientHeight;} if(document.documentElement&&(document.documentElement.scrollHeight||document.documentElement.offsetHeight)) {if(document.documentElement.scrollHeight>document.documentElement.offsetHeight) {contentWidth=document.documentElement.scrollWidth;contentHeight=document.documentElement.scrollHeight;} else {contentWidth=document.documentElement.offsetWidth;contentHeight=document.documentElement.offsetHeight;}} else if(document.body&&(document.body.scrollHeight||document.body.offsetHeight)) {if(document.body.scrollHeight>document.body.offsetHeight) {contentWidth=document.body.scrollWidth;contentHeight=document.body.scrollHeight;} else {contentWidth=document.body.offsetWidth;contentHeight=document.body.offsetHeight;}} else {contentWidth=width;contentHeight=height;} if(height>contentHeight) height=contentHeight;if(width>contentWidth) width=contentWidth;var rect=new Object();rect.ScrollX=scrollX;rect.ScrollY=scrollY;rect.Width=width;rect.Height=height;rect.ContentWidth=contentWidth;rect.ContentHeight=contentHeight;return rect;} Telligent_Common.GetCurrentStyleValue=function(element,styleRule,jsStyleRule,defaultValue) {var value='';try {if(document.defaultView&&document.defaultView.getComputedStyle) value=document.defaultView.getComputedStyle(element,"").getPropertyValue(styleRule);else if(element.currentStyle) value=element.currentStyle[jsStyleRule];}catch(e){} if((value=='inherit'||value=='transparent')&&element.parentNode!=null) return Telligent_Common.GetCurrentStyleValue(element.parentNode,styleRule,jsStyleRule,defaultValue);else if(value!=''&&value!=undefined&&value!='rgba(0, 0, 0, 0)') return value;else return defaultValue;} Telligent_Common.GetStyleOffset=function(element) {var result=new Object();result.Height=Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'border-top-width','borderTopWidth','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'border-bottom-width','borderBottomWidth','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'padding-top','paddingTop','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'padding-bottom','paddingBottom','0')),0);result.Width=Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'border-left-width','borderLeftWidth','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'border-right-width','borderRightWidth','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'padding-left','paddingLeft','0')),0)+ Telligent_Common.IsNanDefault(parseInt(Telligent_Common.GetCurrentStyleValue(element,'padding-right','paddingRight','0')),0);return result;} Telligent_Common.IsNanDefault=function(value,defaultValue) {if(isNaN(value)) return defaultValue;else return value;} Telligent_Common.EscapeForRegExp=function(value) {return value.replace(/([\\\(\^\$\*\+\?\{\}\.\)\|\-])/g,'\\$1');} Telligent_Common.GetSelectedHtmlInElement=function(element,includeAllContentIfNoSelection,includeAllContentIfInvalidSelection,invalidSelectionMessage) {var selectionIsValid=true;var content=null;if(window.getSelection) {var selection=window.getSelection();if(selection&&selection.rangeCount>0&&selection.toString().length>0) {selectionIsValid=false;var selectedRange=selection.getRangeAt(0);var availableRange=document.createRange();availableRange.selectNode(element);if(availableRange.compareBoundaryPoints(Range.START_TO_START,selectedRange)<=0&&availableRange.compareBoundaryPoints(Range.END_TO_END,selectedRange)>=0) {var temp=document.createElement('div');temp.appendChild(selectedRange.cloneContents());content=temp.innerHTML;} else if(invalidSelectionMessage) alert(invalidSelectionMessage);}} else if(document.selection) {var range=document.selection.createRange();if(range&&range.text) {selectionIsValid=false;var parent=range.parentElement();if(parent!=null&&Telligent_Common.ElementContainsElement(element,parent)) content=range.htmlText;else if(invalidSelectionMessage) alert(invalidSelectionMessage);}} if(content==null&&((selectionIsValid&&includeAllContentIfNoSelection)||includeAllContentIfInvalidSelection)) content=element.innerHTML;return content;} Telligent_Common.ElementContainsElement=function(parent,child) {if(!parent||!child) return false;if(parent==child) return true;if(parent&&parent.childNodes) {for(var i=0;i0) {for(var i=0;istateId&&stateId>=0&&Telligent_Common._state[stateId]&&Telligent_Common._state[stateId]._stateProcessId==processId) return Telligent_Common._state[stateId]._state;else return null;} Telligent_Common.GetStateByKey=function(key,processId) {for(var i=0;istateId&&stateId>=0&&Telligent_Common._state[stateId]&&Telligent_Common._state[stateId]._stateProcessId==processId) Telligent_Common._state[stateId]._state=state;} Telligent_Common.SaveStateByKey=function(key,processId,state) {var emptyIndex=-1;for(var i=0;istateId&&stateId>=0&&Telligent_Common._state[stateId]&&Telligent_Common._state[stateId]._stateProcessId==processId) Telligent_Common._state[stateId]=null;} Telligent_Common._hiddenSelects=new Array();Telligent_Common._elementsHidingSelects=new Array();Telligent_Common._addHiddenSelect=function(elementHidingSelect,selectElement) {var hiddenSelect=null;var emptyIndex=-1;for(var i=0;i