| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805 |
- // <script>
- _ie=(document.all!=null)?true:false
- _dom=(document.getElementById!=null)?true:false
- _isQuirksMode = (document.compatMode != 'CSS1Compat');
- _moz=_dom&&!_ie
- _show='visible'
- _hide='hidden'
- _hand=_ie?"hand":"pointer"
- _appVer=navigator.appVersion.toLowerCase();
- _mac=(_appVer.indexOf('macintosh')>=0)||(_appVer.indexOf('macos')>=0);
- _userAgent=navigator.userAgent?navigator.userAgent.toLowerCase():null
- _saf=_moz&&(_userAgent.indexOf("safari")>=0)
- _ctrl=0
- _shift=1
- _alt=2
- //_def_shortcut=_mac?"⌘":
- _ie6 = _ie&&(_appVer.indexOf("msie 5")<0)
- _small=(screen.height<=600)
- _curDoc=document
- _curWin=self
- _tooltipWin=self
- _tooltipDx=0
- _tooltipDy=0
- _codeWinName="_CW"
- _leftBtn=(_ie||_saf)?1:0
- _preloadArr=new Array
- _widgets=new Array
- _resizeW=_ie6?"col-resize":"E-resize"
- _resizeH=_ie6?"row-resize":"S-resize"
- _ddData=new Array
- _dontNeedEncoding=null;
- _thex=null;
- // ================================================================================
- // ================================================================================
- //
- // MANDATORY FUNCTIONS
- //
- // Must be called for the library to work
- //
- // IMPORTANT : must be used in a script tag in the doc header (not in loadCB for example)
- // ================================================================================
- // ================================================================================
- function initDom(skin,style,lang,curWin,codeUniqueName)
- // MUST be called after including dom.js
- // skin [String] skin path
- // lang [String] language code
- // curWin [Window - Optional] pointer on a window to redirect the interface
- // tooltipWin [Window - Optional] pointer on a window that displays drag & drop tooltips
- // codeUniqueName [String - Optional] must be set if curWin specfied - enter a unique keyword
- {
- _skin=skin;
- _lang=lang;
- _style=style;
- if (curWin)
- {
- _curWin=curWin
- _curDoc=curWin.document
- }
- _tooltipWin=_curWin
- if (codeUniqueName)
- _codeWinName="_CW"+codeUniqueName
- _curWin[_codeWinName]=self
- }
- function styleSheet()
- // MUST be called after initDom()
- // must be between scripts tags to avois sync problems
- // Include the default style sheet depending on the parameters of initDom()
- {
- includeCSS('style')
- //we use only one css file for all languages
- //switch(_lang)
- //{
- // case 'ja':
- // case 'ko':
- // case 'zh':
- // includeCSS('style_fe')
- // break;
- // default:
- // includeCSS('style')
- // break;
- //}
- }
- // ================================================================================
- function isLayerDisplayed(lyr)
- //check if the layer is displayed
- //and check its parents
- //if one parent is not displayed return false
- {
- var css=lyr?lyr.style:null
- if(css)
- {
- if(css.display == "none" || css.visibility=="hidden")
- return false
- else
- {
- var par=lyr.parentNode
- if(par!=null)
- return isLayerDisplayed(par)
- else
- return true
- }
- }
- else
- return true;
- }
- // ================================================================================
- function safeSetFocus(lyr)
- {
- if (lyr && lyr.focus && isLayerDisplayed(lyr))
- lyr.focus()
-
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newWidget (Constructor)
- //
- // Base Class for widgets
- //
- // ================================================================================
- // ================================================================================
- function newWidget(id)
- // CONSTRUCTOR
- // id [String] the id for DHTML processing
- {
- var o=new Object
- o.id=id
- o.layer=null
- o.css=null
- o.getHTML=Widget_getHTML
- o.beginHTML=Widget_getHTML
- o.endHTML=Widget_getHTML
- o.write=Widget_write
- o.begin=Widget_begin
- o.end=Widget_end
- o.init=Widget_init
- o.move=Widget_move
- o.resize=Widget_resize
- o.setBgColor=Widget_setBgColor
- o.show=Widget_show
- o.getWidth=Widget_getWidth
- o.getHeight=Widget_getHeight
- o.setHTML=Widget_setHTML
- o.setDisabled=Widget_setDisabled
- o.focus=Widget_focus
- o.setDisplay=Widget_setDisplay
- o.isDisplayed=Widget_isDisplayed
- o.appendHTML=Widget_appendHTML
- o.setTooltip=Widget_setTooltip
- o.initialized=Widget_initialized
- o.widx=_widgets.length
- _widgets[o.widx]=o
- return o
- }
- // ================================================================================
- function Widget_appendHTML()
- // Write the widget dynamically into the body
- {
- append(_curDoc.body,this.getHTML())
- }
- // ================================================================================
- function Widget_getHTML()
- // VIRTUAL Get the widget HTML
- // return [String] the HTML
- {
- return ''
- }
- // ================================================================================
- function Widget_write(i)
- // write the widget
- {
- _curDoc.write(this.getHTML(i))
- }
- // ================================================================================
- function Widget_begin()
- // for container widgets - write the HTML begin part
- {
- _curDoc.write(this.beginHTML())
- }
- // ================================================================================
- function Widget_end()
- // for container widgets - write the HTML begin part
- {
- _curDoc.write(this.endHTML())
- }
- // ================================================================================
- function Widget_init()
- // Inits the widget layer pointers
- {
- var o=this
- o.layer=getLayer(o.id)
- o.css=o.layer.style
- o.layer._widget=o.widx
- if (o.initialHTML)
- o.setHTML(o.initialHTML)
- }
- function Widget_move(x,y)
- // moves a widget
- // x [int optional] new abscissa
- // y [int optional] new ordinate
- {
- var c=this.css;if (x!=null){if (_moz) c.left=""+x+"px";else c.pixelLeft=x}if (y!=null){if (_moz) c.top=""+y+"px";else c.pixelTop=y}
- }
- // ================================================================================
- function Widget_focus()
- // Set the focus on the current widget
- {
- safeSetFocus(this.layer)
- }
- // ================================================================================
- function Widget_setBgColor(c)
- // Set the widget background color
- // c [String] HTML color code
- {
- this.css.backgroundColor=c
- }
- // ================================================================================
- function Widget_show(show)
- // Show/hide a widget (the widget layout always exists)
- // show [boolean]
- {
- this.css.visibility=show?_show:_hide
- }
- // ================================================================================
- function Widget_getWidth()
- // return [int] the widget width in pixels
- {
- return this.layer.offsetWidth
- }
- // ================================================================================
- function Widget_getHeight()
- // return [int] the widget height in pixels
- {
- return this.layer.offsetHeight
- }
- // ================================================================================
- function Widget_setHTML(s)
- // Set the widget HTML
- // s [String] the new HTML
- {
- var o=this
- if (o.layer)
- o.layer.innerHTML=s
- else
- o.initialHTML=s
- }
- // ================================================================================
- function Widget_setDisplay(d)
- // Show/hide a widget (the widget takes no space if d is false)
- // d [boolean]
- {
- if (this.css)
- this.css.display=d?"":"none"
- }
- // ================================================================================
- function Widget_isDisplayed()
- {
- if(this.css.display == "none")
- return false
- else
- return true
- }
- // ================================================================================
- function Widget_setDisabled(d)
- // Disable a widget (its becomes insensitive to key or mouse actions)
- // d [boolean]
- {
- if (this.layer)
- this.layer.disabled=d
- }
- // ================================================================================
- function Widget_resize(w,h)
- // Resize a widget
- // w [int optional] new width
- // h [int optional] new height
- {
- if (w!=null) this.css.width=''+(Math.max(0,w))+'px';if (h!=null) this.css.height=''+(Math.max(0,h))+'px';
- }
- // ================================================================================
- function Widget_setTooltip(tooltip)
- // Set the widget tooltip
- // tooltip [String]
- {
- this.layer.title=tooltip
- }
- // ================================================================================
- function Widget_initialized()
- // Return true if the widget is initialized
- {
- return this.layer!=null
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newGrabberWidget (Constructor)
- //
- // Class to add grabber for resizing zones
- //
- // ================================================================================
- // ================================================================================
- function newGrabberWidget(id,resizeCB,x,y,w,h,isHori,buttonCB,tooltip)
- // CONSTRUCTOR
- // id [String] the id for DHTML processing
- // resizeCB [Function] callback when grabber is moved
- // x [int] initial abscissa
- // y [int] initial ordinate
- // w [int] initial width
- // h [int] initial height
- // isHori [boolean] if true, moves horizontally, else vertically
- {
- o=newWidget(id)
- o.resizeCB=resizeCB
- o.x=x
- o.y=y
- o.w=w
- o.h=h
- o.dx=0
- o.dy=0
- o.min=null
- o.max=null
- o.isHori=isHori
- o.preloaded=new Image
- o.preloaded.src=_skin+"../resizepattern.gif"
- o.buttonCB=buttonCB
- o.allowGrab=true
- o.collapsed=false
- o.isFromButton=false
- o.showGrab=GrabberWidget_showGrab
- o.setCollapsed=GrabberWidget_setCollapsed
- o.tooltipButton=tooltip
- o.getHTML=GrabberWidget_getHTML
- o.enableGrab=GrabberWidget_enableGrab
- o.setMinMax=GrabberWidget_setMinMax
- if (window._allGrabbers==null)
- window._allGrabbers=new Array
- o.index=_allGrabbers.length
- _allGrabbers[o.index]=o
- o.buttonLyr=null
- o.setButtonImage=GrabberWidget_setButtonImage
- o.getImgOffset=GrabberWidget_getImgOffset
- return o
- }
- // ================================================================================
- function GrabberWidget_setCollapsed(collapsed,tooltip)
- {
- this.collapsed=collapsed
- this.setButtonImage(false,tooltip)
- }
- // ================================================================================
- function GrabberWidget_getImgOffset(isRollover)
- {
- // PRIVATE
- var o=this
- if (o.isHori)
- {
- o.dx=(o.collapsed?12:0)+(isRollover?6:0)
- o.dy=0
- }
- else
- {
- o.dy=(o.collapsed?12:0)+(isRollover?6:0)
- o.dx=0
- }
- }
- // ================================================================================
- function GrabberWidget_setButtonImage(isRollover,tooltip)
- {
- // PRIVATE
- var o=this
-
- o.getImgOffset(isRollover)
- o.tooltipButton=tooltip
-
- if (o.layer)
- {
- if (o.buttonLyr==null)
- o.buttonLyr=getLayer("grabImg_"+o.id)
- if (o.buttonLyr)
- {
- changeSimpleOffset(o.buttonLyr,o.dx,o.dy,null,tooltip)
- }
- }
- }
- // ================================================================================
- function GrabberWidget_enableGrab(bEnable)
- {
- var o=this
- o.allowGrab=bEnable
-
- if (o.css)
- o.css.cursor=o.allowGrab?(o.isHori?_resizeW:_resizeH):"default"
- }
- // ================================================================================
- function GrabberWidget_getHTML()
- // returns [String] widget HTML
- {
- var o=this,ho=o.isHori
- var cr=o.allowGrab?(ho?_resizeW:_resizeH):"default"
- var moveableCb='onselectstart="return false" ondragstart="return false" onmousedown="'+_codeWinName+'.GrabberWidget_down(event,\''+o.index+'\',this);return false;"'
- var imgG=_ie?('<img onselectstart="return false" ondragstart="return false" onmousedown="'+_codeWinName+'.eventCancelBubble(event)" border="0" hspace="0" vspace="0" src="'+_skin+'../transp.gif" id="modal_'+o.id+'" style="z-index:10000;display:none;position:absolute;top:0px;left:0px;width:1px;height:1px;cursor:'+cr+'">'):('<div onselectstart="return false" ondragstart="return false" onmousedown="'+_codeWinName+'.eventCancelBubble(event)" border="0" hspace="0" vspace="0" id="modal_'+o.id+'" style="z-index:10000;display:none;position:absolute;top:0px;left:0px;width:1px;height:1px;cursor:'+cr+'"></div>')
- var button=o.buttonCB?(_skin+(ho?"h":"v")+"grab.gif"):""
- if (button)
- {
- button=simpleImgOffset(button,ho?6:50,ho?50:6,o.dx,o.dy,"grabImg_"+o.id,'onmouseover="'+_codeWinName+'.GrabberWidget_buttonover(event,\''+o.index+'\',this);return false;" onmouseout="'+_codeWinName+'.GrabberWidget_buttonout(event,\''+o.index+'\',this);return false;" onmousedown="'+_codeWinName+'.GrabberWidget_button(event,\''+o.index+'\',this);return false;"',o.tooltipButton,'cursor:'+_hand+';')
- }
- return getBGIframe('grabIframe_'+o.id)+imgG+'<table cellpadding="0" cellspacing="0" border="0" '+moveableCb+' id="'+o.id+'" style="overflow:hidden;position:absolute;left:'+o.x+'px;top:'+o.y+'px;width:'+o.w+'px;height:'+o.h+'px;cursor:'+cr+'"><tr><td align="center" valign="middle">'+button+'</td></table>'
- }
- // ================================================================================
- function GrabberWidget_setMinMax(min,max)
- // Set the range in pixels
- // min [int] minimum value
- // min [int] maximum value
- {
- this.min=min
- this.max=max
- }
- // ================================================================================
- function GrabberWidget_button(e,index,lyr)
- // PRIVATE
- {
- var o=_allGrabbers[index]
- o.isFromButton=true
- lyr.onmouseup=eval('_curWin.'+_codeWinName+'.GrabberWidget_buttonup')
- }
- // ================================================================================
- function GrabberWidget_buttonover(e,index,lyr)
- // PRIVATE
- {
- var o=_allGrabbers[index]
- o.setButtonImage(true)
- }
- // ================================================================================
- function GrabberWidget_buttonout(e,index,lyr)
- // PRIVATE
- {
- var o=_allGrabbers[index]
- o.setButtonImage(false)
- }
- // ================================================================================
- function GrabberWidget_buttonup(e)
- // PRIVATE
- {
- GrabberWidget_up(e)
- }
- // ================================================================================
- function GrabberWidget_showGrab()
- {
- var o=this,mod=o.mod,ifr=o.iframe,stl=o.layer.style,st=mod.style
- ifr.setDisplay(true)
- }
- // ================================================================================
- function GrabberWidget_down(e,index,lyr)
- // PRIVATE
- {
- var o=_allGrabbers[index]
- window._theGrabber=o
- if (o.mod==null)
- {
- o.mod=getLayer('modal_'+o.id)
- o.iframe=newWidget('grabIframe_'+o.id)
- o.iframe.init()
- }
- o.mod.onmousemove=eval('_curWin.'+_codeWinName+'.GrabberWidget_move')
- o.mod.onmouseup=eval('_curWin.'+_codeWinName+'.GrabberWidget_up')
- o.grabStartPosx=parseInt(lyr.style.left)
- o.grabStartPosy=parseInt(lyr.style.top)
- o.grabStartx=eventGetX(e)
- o.grabStarty=eventGetY(e)
-
- var mod=o.mod,ifr=o.iframe,stl=o.layer.style,st=mod.style
-
- stl.backgroundImage='url(\''+_skin+'../resizepattern.gif\')'
- o.prevZ=stl.zIndex
- stl.zIndex=9999
- ifr.css.zIndex=9998
- st.width='100%'
- st.height='100%'
- mod.style.display="block"
- var p=getPos(o.layer)
- ifr.move(p.x,p.y)
- ifr.resize(o.getWidth(),o.getHeight())
-
- if (!o.isFromButton)
- o.showGrab()
- return false
- }
- // ================================================================================
- function GrabberWidget_move(e)
- // PRIVATE
- {
- var o=_theGrabber,lyr=o.layer,mod=o.mod
- if (o.isFromButton)
- {
- if (o.isHori)
- {
- var x = eventGetX(e), ox=o.grabStartx
- if ((x < ox - 3) || (x > ox + 3))
- o.isFromButton = false
- }
- else
- {
- var Y = eventGetY(e), oy=o.grabStarty
- if ((y < oy - 3) || (y > oy + 3))
- o.isFromButton = false
- }
- if (!o.isFromButton)
- o.showGrab()
- }
-
-
- if (!o.isFromButton)
- {
- if (o.allowGrab)
- {
- var x=o.isHori?Math.max(0,o.grabStartPosx-o.grabStartx+eventGetX(e)):null
- var y=o.isHori?null:Math.max(0,o.grabStartPosy-o.grabStarty+eventGetY(e))
- if (o.isHori)
- {
- if (o.min!=null) x=Math.max(x,o.min)
- if (o.max!=null) x=Math.min(x,o.max)
- }
- else
- {
- if (o.min!=null) y=Math.max(y,o.min)
- if (o.max!=null) y=Math.min(y,o.max)
- }
- eventCancelBubble(e)
- o.move(x,y)
- getPos(o.layer)
- if (o.buttonCB)
- {
- var bCss=o.buttonLyr.style
- if (bCss.display!="none")
- bCss.display="none"
- }
-
- o.iframe.move(x,y)
- }
- }
- }
- // ================================================================================
- function GrabberWidget_up(e)
- {
- var o=_theGrabber,lyr=o.layer,mod=o.mod,stl=lyr.style
- stl.backgroundImage=''
- stl.zIndex=o.prevZ
- var ifr=o.iframe
- ifr.move(-100,-100)
- ifr.resize(1,1)
- ifr.setDisplay(false)
- eventCancelBubble(e)
- var st=mod.style
- st.display="none"
- st.width='0px'
- st.height='0px'
-
- if (o.buttonCB)
- o.buttonLyr.style.display=""
- if (o&&(o.isFromButton))
- {
- if (o.buttonCB)
- o.buttonCB()
- o.isFromButton=false
- }
- if (o.allowGrab&&(!o.isFromButton))
- {
- if (o.resizeCB)
- o.resizeCB(parseInt(lyr.style.left),parseInt(lyr.style.top))
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT ButtonWidget (Constructor)
- //
- // Class for building push buttons
- //
- // ================================================================================
- // ================================================================================
- function newButtonWidget(id,label,cb,width,hlp,tooltip,tabIndex,margin,url,w,h,dx,dy,imgRight,disDx,disDy)
- // CONSTRUCTOR
- // id [String] button ID
- // label [String Optional] button label
- // w [int optional] : text zone minimal width
- // hlp OBSOLETE
- // tooltip [String Optional] button tooltip
- // tabIndex [int Optional] for 508/IE : tab index for keyboard navigation
- // url [String Optional] : the combined image url
- // w [int Optional] the visible image part width
- // dx [int Optional] the horizontal offset in image
- // dy [int Optional] the vertical offset in image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- {
- var o=newWidget(id)
- o.label=label
- o.cb=cb
- o.width=width
- o.hlp=hlp
- o.tooltip=tooltip
- o.tabIndex=tabIndex
- o.isGray=false
- o.isDefault=false
- o.txt=null
- o.icn=null
- o.margin=margin?margin:0
- o.extraStyle=""
- if (url)
- {
- o.url=url
- o.w=w
- o.h=h
- o.dx=dx
- o.dy=dy
- o.disDx=(disDx!=null)?disDx:dx
- o.disDy=(disDy!=null)?disDy:dy
- o.imgRight=imgRight?true:false
- }
- o.getHTML=ButtonWidget_getHTML
- o.setDisabled=ButtonWidget_setDisabled
- o.setText=ButtonWidget_setText
- o.changeImg=ButtonWidget_changeImg
- o.oldInit=o.init
- o.init=ButtonWidget_init
- o.isDisabled=ButtonWidget_isDisabled
- o.setDefaultButton=ButtonWidget_setDefaultButton
- o.executeCB=ButtonWidget_executeCB
- o.setTooltip=ButtonWidget_setTooltip
- o.instIndex=ButtonWidget_currInst
- ButtonWidget_inst[ButtonWidget_currInst++]=o
- return o;
- }
- // ================================================================================
- ButtonWidget_inst=new Array
- ButtonWidget_currInst=0
- function ButtonWidget_getHTML()
- // returns [String] widget HTML
- {
- with (this)
- {
- var clk=_codeWinName+'.ButtonWidget_clickCB('+this.instIndex+');return false;"'
-
- var clcbs= 'onclick="'+clk+'" '
- if (_ie) clcbs+= 'ondblclick="'+clk+'" '
-
- //
- var isDefaultSty=(this.isDefault && !this.isGray);
- //add onkeydown for dialog default action (Enter)
- clcbs+= 'onkeydown=" return '+_codeWinName+'.ButtonWidget_keydownCB(event,'+this.instIndex+');" '
- var url1=_skin+"button.gif",addPar=' style="'+extraStyle+'cursor:'+_hand+';margin-left:'+margin+'px; margin-right:'+margin+'px; "'+clcbs+' ',tip=attr('title', tooltip),idText="theBttn"+id, idIcon="theBttnIcon"+id;
- var bg=backImgOffset(url1,0,isDefaultSty?105:42);
-
- var lnkB='<a '+attr('id',idText)+' '+tip+' '+attr('tabindex',tabIndex)+' href="javascript:void(0)" class="wizbutton">'
- var l=(label!=null)
- var im=(this.url?('<td align="'+(l?(this.imgRight?'right':'left'):'center')+'" style="'+bg+'" width="'+(!l&&(width!=null)?width+6:w+6)+'">'+(l?'':lnkB)+simpleImgOffset(url,w,h,this.isGray?disDs:dx,this.isGray?disDy:dy,idIcon,null,(l?'':tooltip),'cursor:'+_hand)+(l?'':'</a>')+'</td>'):'')
- // Justin... I've change the button left and right to use backImgOffset because IE would not hide the simpleImgOffset once it had been displayed in the cancel dialog.
- return '<table onmouseover="return true" '+attr('id',id)+' '+addPar+' border="0" cellspacing="0" cellpadding="0"><tr valign="middle">'+
- '<td height="21" width="5" style="' + backImgOffset(url1,0,isDefaultSty?63:0)+'"></td>'+
- (this.imgRight?'':im)+
- (l?('<td '+attr("width",width)+ attr('id',"theBttnCenterImg"+id)+' align="center" class="'+(this.isGray?'wizbuttongray':'wizbutton')+'" style="padding-left:3px;padding-right:3px;'+bg+'"><nobr>'+lnkB+label+'</a></nobr></td>'):'')+
- (this.imgRight?im:'')+
- '<td height="21" width="5" style="' + backImgOffset(url1,0,isDefaultSty?84:21)+'"></td></tr></table>';
- }
- }
- // ================================================================================
- function ButtonWidget_setDisabled(d)
- // Enable/Disable
- // s [boolean] if true disable the button
- // returns [void]
- {
- var o=this,newCur=d?'default':_hand
- o.isGray=d
- if (o.layer)
- {
- var newClassName=d?'wizbuttongray':'wizbutton'
-
- // Ensure the button state hasn't changed to avoid unnecessary processing
- // The text className is a safe way to do the test
- if (o.txt.className!=newClassName)
- {
- o.txt.className=newClassName
- o.txt.style.cursor=newCur
- o.css.cursor=newCur
-
- if(o.icn)
- {
- changeSimpleOffset(o.icn,o.isGray?o.disDx:o.dx,o.isGray?o.disDy:o.dy)
- o.icn.style.cursor=newCur
- }
-
- if(o.isDefault) //default button style
- {
- var isDefaultSty=!d,url=_skin+"button.gif";
- changeSimpleOffset(o.leftImg,0,isDefaultSty?63:0,url);
- changeOffset(o.centerImg,0,isDefaultSty?105:42,url);
- changeSimpleOffset(o.rightImg,0,isDefaultSty?84:21,url);
- }
- }
- }
- }
- // ================================================================================
- function ButtonWidget_setDefaultButton()
- {
- var o=this;
-
- if (o.layer)
- {
- var isDefaultSty = !o.isGray,url=_skin+"button.gif";
- changeSimpleOffset(o.leftImg,0,isDefaultSty?63:0,url);
- changeOffset(o.centerImg,0,isDefaultSty?105:42,url);
- changeSimpleOffset(o.rightImg,0,isDefaultSty?84:21,url);
- }
- o.isDefault=true;
- }
- // ================================================================================
- function ButtonWidget_isDisabled()
- {
- return this.isGray
- }
- // ================================================================================
- function ButtonWidget_setText(str)
- // Changes the button text
- // str [String] the new button text
- // returns [void]
- {
- this.txt.innerHTML=convStr(str)
- }
- function ButtonWidget_setTooltip(tooltip)
- // Set the widget tooltip
- // tooltip [String]
- {
- var o=this
- o.tooltip=tooltip
- o.layer.title=tooltip
- if (o.txt)
- o.txt.title=tooltip
- if (o.icn)
- o.icn.title=tooltip
- }
- // ================================================================================
- function ButtonWidget_init()
- // Inits the button
- // returns [void]
- {
- var o=this
- o.oldInit()
- o.txt=getLayer('theBttn'+this.id)
- o.icn=getLayer('theBttnIcon'+this.id)
-
- o.leftImg=getLayer('theBttnLeftImg'+this.id)
- o.centerImg=getLayer('theBttnCenterImg'+this.id)
- o.rightImg=getLayer('theBttnRightImg'+this.id)
-
- // reset if already initialized
- var newClassName=o.isGray?'wizbuttongray':'wizbutton'
- if (o.txt.className!=newClassName)
- {
- o.setDisabled(o.isGray)
- }
- }
- // ================================================================================
- function ButtonWidget_changeImg(dx,dy,disDx,disDy,url,tooltip)
- {
- var o=this
- if (url) o.url=url
- if (dx!=null) o.dx=dx
- if (dy!=null) o.dy=dy
- if (disDx!=null) o.disDx=disDx
- if (disDy!=null) o.disDy=disDy
- if (tooltip!=null) o.tooltip=tooltip
-
- if (o.icn)
- changeSimpleOffset(o.icn,o.isGray?o.disDx:o.dx,o.isGray?o.disDy:o.dy, o.url, o.tooltip)
- }
- // ================================================================================
- function ButtonWidget_clickCB(index)
- // PRIVATE internal click event handler
- {
- var btn=ButtonWidget_inst[index]
- if (btn && !btn.isGray)
- setTimeout("ButtonWidget_delayClickCB("+index+")",1)
- }
- // ================================================================================
- function ButtonWidget_delayClickCB(index)
- // PRIVATE internal click event handler
- {
- var btn=ButtonWidget_inst[index]
- btn.executeCB();
- /*
- if (btn.cb)
- {
- if (typeof btn.cb!="string")
- btn.cb()
- else
- eval(btn.cb)
- }*/
- }
- // ================================================================================
- function ButtonWidget_executeCB()
- // PRIVATE internal click event handler
- {
- var o=this
- if (o.cb)
- {
- if (typeof o.cb!="string")
- o.cb()
- else
- eval(o.cb)
- }
- }
- // ================================================================================
- function ButtonWidget_keydownCB(e,index)
- {
- var k=eventGetKey(e);
- var btn=ButtonWidget_inst[index]
- if(k == 13 && btn.cb )//enter
- {
- eventCancelBubble(e);
- }
- return true;
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT ScrolledZoneWidget (Constructor)
- //
- // Base Class for widgets
- //
- // ================================================================================
- // ================================================================================
- function newScrolledZoneWidget(id,borderW,padding,w,h,bgClass)
- // id [String] the id for DHTML processing
- // borderW [int] widget border width
- // padding [int] widget padding
- // w [int] widget width, including borders
- // h [int] widget height, including borders
- // Return [ScrolledZoneWidget] the instance
- {
- var o=newWidget(id)
- o.borderW=borderW
- o.padding=padding
- o.w=w
- o.h=h
- o.oldResize=o.resize
- o.beginHTML=ScrolledZoneWidget_beginHTML
- o.endHTML=ScrolledZoneWidget_endHTML
- o.resize=ScrolledZoneWidget_resize
- o.bgClass = (bgClass)? bgClass : 'insetBorder'
- return o;
- }
- // ================================================================================
- function ScrolledZoneWidget_beginHTML()
- // Returns : [String] the HTML beginning block
- {
- var w=this.w,h=this.h;
- var ofs=_moz?2*(this.borderW+this.padding):0
-
- if (typeof(w)=="number")
- {
- if (_moz)
- w=Math.max(0,w-ofs)
- w=""+w+"px"
- }
-
- if (typeof(h)=="number")
- {
- if (_moz)
- h=Math.max(0,h-ofs)
- h=""+h+"px"
- }
-
-
- return '<div align="left" onselectstart="return false" class="' + this.bgClass + '" id="'+this.id+'" style="border-width:'+this.borderW+'px;padding:'+this.padding+'px;'+sty("width",w)+sty("height",h)+'overflow:auto">'
- }
- // ================================================================================
- function ScrolledZoneWidget_endHTML()
- // Returns : [String] the HTML ending block
- {
- return '</div>'
- }
- // ================================================================================
- function ScrolledZoneWidget_resize(w,h)
- // w [int] widget width, including borders
- // h [int] widget height, including borders
- // Returns [void]
- {
- if (_moz)
- {
- var ofs=2*(this.borderW+this.padding)
- if (w!=null) w=Math.max(0,w-ofs)
- if (h!=null) h=Math.max(0,h-ofs)
- }
- this.oldResize(w,h)
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newTooltipWidget (Constructor)
- //
- // A tooltip widget. Only one by window/frame
- //
- // ================================================================================
- // ================================================================================
- /*
- function newTooltipWidget(maxw,maxh)
- // Return [TooltipWidget] the instance
- {
- if (window._theGlobalTooltip!=null)
- return window._theGlobalTooltip
- var o=newWidget('theGobalTooltip')
- o.maxw=maxw
- o.maxh=maxh
- o.getPrivateHTML=TooltipWidget_getPrivateHTML
- o.init=TooltipWidget_init
- o.oldShow=o.show
- o.show=TooltipWidget_show
- o.hide=TooltipWidget_hide
- o.setPos=TooltipWidget_setPos
- o.inputs=null
- window._theGlobalTooltip=o
- o.eventWin=_curWin
- preloadImg(_skin+'../swap.gif')
- return o;
- }
- // ================================================================================
- function TooltipWidget_init()
- {
- //cancels the default init behaviour
- }
- // ================================================================================
- function TooltipWidget_getPrivateHTML()
- // Returns [String] the HTML
- {
- var o=this
- return getBGIframe('tipIframe_'+o.id)+'<div class="dragTooltip" id="'+o.id+'" style="visibility:hidden;z-index:10000;position:absolute;top:0px;left:0px,visibility:'+_hide+'"'+attr("width",o.w)+attr("height",o.h)+'></div>'+
- '<img width="11" height="11" border="0" hspace="0" vspace="0" src="'+_skin+'../swap.gif" id="swap_'+o.id+'" style="position:absolute;top:0px;left:0px;display:none;z-index:10000;">'
- }
- // ================================================================================
- function TooltipWidget_show(show,str,url,w,h,dx,dy,isHTML, e)
- // show/hide the drag & drop tooltip
- // show [boolean] true for showing the tooltip
- // str [String] the tooltip text
- // url [String] combined image url
- {
- var o=this
- oldWin=_curWin
- _curWin=_tooltipWin
- _curDoc=_tooltipWin.document
- // object not init yet, 2 cases
- if (o.layer==null)
- {
- o.layer=getLayer(o.id)
- // another instance hasn't written it's HTML yet
- if (o.layer==null)
- {
- targetApp(o.getPrivateHTML())
- o.layer=getLayer(o.id)
- }
- o.css=o.layer.style
- o.swapLayer=getLayer("swap_"+o.id)
- o.iframe=newWidget('tipIframe_'+o.id)
- o.iframe.init()
- }
- // hides combo boxes or restore
- //if (show) o.inputs=hideAllInputs()
- //else restoreAllInputs(o.inputs)
- dx=dx!=null?dx:0
- dy=dy!=null?dy:0
- if (show)
- {
- var s=null
- if (url)
- //s='<span style="margin-right:2px;width:'+w+'px;height:'+h+'px;overflow:hidden">'+img(url,null,null,'top','style="position:relative;top:-'+dy+'px;left:-'+dx+'px"')+'</span>'
- s=simpleImgOffset(url,w,h,dx,dy,null,null,null,"margin-right:4px;margin-left:0px;",'top')
-
- //o.resize(0,0)
- o.css.width=''
- o.css.height=''
-
- o.setHTML('<table border="0" cellspacing="0" cellpadding="0"><tr valign="middle">'+(s?'<td align="center">'+s+'</td>':'')+'<td class="dragTxt"><nobr>'+(isHTML?str:convStr(str))+'</nobr></td></tr></table>')
- o.setPos(null,e)
-
- if (o.getWidth()>o.maxw)
- o.resize(o.maxw)
-
- o.oldShow(show)
- o.iframe.setDisplay(true)
- }
- else
- {
- o.oldShow(false)
- o.setHTML('')
- o.move(0,0)
- o.swapLayer.style.display="none"
- o.iframe.setDisplay(false)
- }
- _curWin=oldWin
- _curDoc=_curWin.document
- }
- // ================================================================================
- function TooltipWidget_hide()
- {
- var o=this
-
- o.show(false)
- }
- // ================================================================================
- function TooltipWidget_setPos(shift,e)
- // Return [void]
- {
- var o=this
- if (o.layer==null)
- return
- if (e) {
- var x=absxpos(e), y=absypos(e)
- } else {
- var ew=o.eventWin,x=ew.event.x+_curDoc.body.scrollLeft,y=ew.event.y+_curDoc.body.scrollTop
- }
- x+=_tooltipDx
- y+=_tooltipDy
- o.move(x+27,y+10);
-
- o.iframe.move(x+27,y+10);
- o.iframe.resize(o.getWidth(),o.getHeight())
- var c=o.swapLayer.style;
- c.display=shift?"":"none"
- if (shift)
- {
- y+=18
- x+=14
- if (_moz)
- {
- c.left=""+x+"px"
- c.top=""+y+"px"
- }
- else
- {
- c.pixelLeft=x
- c.pixelTop=y
- }
- }
- }
- // ================================================================================
- function initTooltipWin(tooltipWin)
- {
- _tooltipWin=tooltipWin
- }
- // ================================================================================
- function setTooltipOffset(dx,dy)
- {
- _tooltipDx=dx
- _tooltipDy=dy
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newComboWidget (Constructor)
- //
- // Combo box widget - based on SELECT tags
- //
- // ================================================================================
- // ================================================================================
- function newComboWidget(id,changeCB,noMargin,width,tooltip)
- // id [String] the id for DHTML processing
- // changeCB [Function] calback when selection is changed by the user
- // noMargin [boolean - optional] default is false - no margin (else 10px left margin )
- // width [int - optional] combo width (if not, auto width)
- // tooltip [String - optional] combo tooltip for 508
- // Return [ComboWidget] the widget instance
- {
- var o=newWidget(id)
- o.tooltip=tooltip
- o.size=1
- o.getHTML=ComboWidget_getHTML
- o.beginHTML=ComboWidget_beginHTML
- o.endHTML=ComboWidget_endHTML
- o.changeCB=changeCB
- o.noMargin=noMargin
- o.width=width==null?null:''+width+'px'
- o.add=ComboWidget_add
- o.del=ComboWidget_del
- o.getSelection=ComboWidget_getSelection
- o.select=ComboWidget_select
- o.valueSelect=ComboWidget_valueSelect
- o.getCount=ComboWidget_getCount
- o.oldSetDisabled=o.setDisabled
- o.setDisabled=ComboWidget_setDisabled
- o.setUndefined=ComboWidget_setUndefined
- o.delByID=ComboWidget_delByID
- o.move=ComboWidget_move
- o.findByValue=ComboWidget_findByValue
- o.findByText=ComboWidget_findByText
- o.getValue=ComboWidget_getValue
- o.isGrayed=ComboWidget_isGrayed
- o.isDisabled=false
- o.multi=false
- o.undef=false
- o.isCombo=true
- o.undefId=o.id+"__undef"
- o.disabledId=o.id+"__disabled"
- return o;
- }
- // ================================================================================
- _extrCmbS=(_moz?'font-size:12px;':'')
- function ComboWidget_beginHTML()
- {
- var o=this,_extrCmbS=((_moz&&!o.isCombo)?'font-size:12px;':'')
- return '<select '+(o.multi?'multiple':'')+' '+(o.noMargin?'style="'+sty("width",o.width)+_extrCmbS+'"':'style="'+sty("width",o.width)+'margin-left:10px;'+_extrCmbS+'"')+' class="listinputs" '+attr('onchange',_codeWinName+'.ComboWidget_changeCB(event,this)')+attr('onclick',_codeWinName+'.ComboWidget_clickCB(event,this)')+attr('ondblclick',_codeWinName+'.ComboWidget_dblClickCB(event,this)')+attr('onkeyup',_codeWinName+'.ComboWidget_keyUpCB(event,this)')+attr('onkeydown',_codeWinName+'.ComboWidget_keyDownCB(event,this)')+attr('id',o.id)+attr('name',o.id)+attr('title',o.tooltip)+'size="'+o.size+'">'
- }
- // ================================================================================
- function ComboWidget_endHTML()
- {
- return '</select>'
- }
- // ================================================================================
- function ComboWidget_getHTML(inner)
- {
- return this.beginHTML()+(inner?inner:'')+this.endHTML()
- }
- // ================================================================================
- function ComboWidget_add(s,val,sel,id,grayed)
- {
- var e=this.layer,opt=_curDoc.createElement('option');
- // Add item
- if (_ie)
- e.options.add(opt);
- else
- e.appendChild(opt);
- // Set text content
- if (opt.innerText!=null)
- opt.innerText=s;
- else
- opt.innerHTML=convStr(s);
-
- // Set other attributes
- opt.value=val;
- if(id!=null)
- opt.id=id;
- if (sel)
- opt.selected=true;
-
- if (grayed)
- {
- opt.style.color='gray'
- }
-
- return opt;
- }
- // ================================================================================
- function ComboWidget_move(delta)
- {
- var e=this.layer,i=e.selectedIndex,len=e.options.length-1,newI=i+delta
- if ((i==-1)||(newI<0)||(newI>len))
- return false
- var oldOpt = e.options[i],newOpt = e.options[newI]
- var oldVal=oldOpt.value,oldHTML=oldOpt.innerHTML,oldID=oldOpt.id,newID=newOpt.id,oldColor=oldOpt.style.color,newColor=newOpt.style.color
- oldOpt.value=newOpt.value
- oldOpt.innerHTML=newOpt.innerHTML
- newOpt.id=null
- oldOpt.id=newOpt.id
- oldOpt.style.color=newColor
- newOpt.value=oldVal
- newOpt.innerHTML=oldHTML
- newOpt.id=oldID
- newOpt.style.color=oldColor
- e.selectedIndex=newI
- return true
- }
- // ================================================================================
- function ComboWidget_getSelection()
- {
- var e=this.layer,i=e.selectedIndex;if (i<0) return null;var ret=new Object;ret.index=i;ret.value=e.options[i].value;ret.text=e.options[i].text;return ret
- }
- // ================================================================================
- function ComboWidget_select(i)
- {
- var o=this,e=o.layer,len=e.options.length
- if (i==null) e.selectedIndex=-1
- if ((i<0)||(i>=len))
- i=len-1
- if (i>=0)
- e.selectedIndex=i
- o.setUndefined(false)
- }
- // ================================================================================
- function ComboWidget_valueSelect(v)
- {
- var o=this,e=o.layer,opts=e.options,len=opts.length
- for (var i=0;i<len;i++)
- {
- if (opts[i].value==v)
- {
- //e.selectedIndex=i
- opts[i].selected=true
- o.setUndefined(false)
- break;
- }
- }
- }
- // ================================================================================
- function ComboWidget_del(i)
- {
- var e=this.layer
- if (i==null)
- e.options.length=0
- else
- {
- if (_ie) e.remove(i)
- else e.options[i]=null
- this.select(i)
- }
- }
- // ================================================================================
- function ComboWidget_changeCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l);if(o.changeCB) o.changeCB(e)
- }
- // ================================================================================
- function ComboWidget_clickCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l);if(o.clickCB) o.clickCB(e)
- }
- // ================================================================================
- function ComboWidget_dblClickCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l);if(o.dblClickCB) o.dblClickCB(e)
- }
- // ================================================================================
- function ComboWidget_keyUpCB(e,l)
- {
- var o=getWidget(l);if(o.keyUpCB) o.keyUpCB(e)
- }
- // ================================================================================
- function ComboWidget_keyDownCB(e,l)
- {
- var k=eventGetKey(e);
- var o=getWidget(l);
- //be careful ! usefull for dialog box close by Enter ou Escape keypressed
- if(o.isCombo && (k==27 || k==13))//Escape ou Enter
- {
- eventCancelBubble(e);
- }
- else if(k==13 && o.keyUpCB) //Enter can be attached to an action in listwidget
- {
- eventCancelBubble(e);
- }
- }
- // ================================================================================
- function ComboWidget_getCount()
- {
- return this.layer.options.length
- }
- // ================================================================================
- function ComboWidget_delByID(id)
- // PRIVATE
- {
- var opt=getLayer(id)
- if (opt!=null)
- this.del(opt.index)
- opt=null
- }
- // ================================================================================
- function ComboWidget_setDisabled(d,addEmptyElt)
- {
- var o=this
- o.oldSetDisabled(d);
- o.isDisabled=d;
- if (d==true)
- {
- var old=getLayer(o.disabledId)
- if (old==null)
- o.add('','',true,o.disabledId);
- else
- o.layer.selectedIndex=old.index
- }
- else
- o.delByID(o.disabledId)
- }
- // ================================================================================
- function ComboWidget_setUndefined(u)
- {
- var o=this
- o.undef=u;
- if (u==true)
- {
- var old=getLayer(o.undefId)
- if (old==null)
- o.add('','',true,o.undefId);
- else
- o.layer.selectedIndex=old.index
- }
- else
- o.delByID(o.undefId)
- }
- // ================================================================================
- function ComboWidget_findByValue(val)
- //return the data if already exist else null
- {
- var o=this,e=o.layer,opts=e.options,len=opts.length
- for (var i=0;i<len;i++)
- {
- if (opts[i].value==val)
- {
- var ret=new Object;
- ret.index=i;
- ret.value=e.options[i].value;
- ret.text=e.options[i].text;
- return ret
- }
- }
- return null
- }
- // ================================================================================
- function ComboWidget_findByText(txt)
- //return the data if already exist else null
- {
- var o=this,e=o.layer,opts=e.options,len=opts.length
- for (var i=0;i<len;i++)
- {
- if (opts[i].text==txt)
- {
- var ret=new Object;
- ret.index=i;
- ret.value=e.options[i].value;
- ret.text=e.options[i].text;
- return ret
- }
- }
- return null
- }
- // ================================================================================
- function ComboWidget_getValue(i)
- //return the value at index i
- {
- var o=this,e=o.layer,opts=e.options,len=opts.length
- if(i==null || i<0 || i>len) return null;
-
- var ret=new Object;
- ret.index=i;
- ret.value=e.options[i].value;
- return ret
- }
- // ================================================================================
- function ComboWidget_isGrayed(i)
- //return true is the option is gray
- {
- var o=this,e=o.layer,opts=e.options,len=opts.length
- if(i==null || i<0 || i>len) return false;
- return (e.options[i].style.color=="gray")
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newListWidget (Constructor)
- //
- // List box widget - based on SELECT tags
- //
- // ================================================================================
- // ================================================================================
- function newListWidget(id,changeCB,multi,width,lines,tooltip,dblClickCB,keyUpCB,clickCB)
- {
- var o=newComboWidget(id,changeCB,true,width,tooltip)
- o.clickCB=clickCB
- o.dblClickCB=dblClickCB
- o.keyUpCB=keyUpCB
- o.size=lines
- o.multi=multi
- o.getMultiSelection=ListWidget_getMultiSelection
- o.setUndefined=ListWidget_setUndefined
- o.isUndefined=ListWidget_isUndefined
- o.change=ListWidget_change
- o.isCombo=false
- return o;
- }
- // ================================================================================
- function ListWidget_setUndefined(u)
- {
- var o=this
- o.undef=u;
- if (u==true)
- {
- o.layer.selectedIndex = -1
- }
- }
- // ================================================================================
- function ListWidget_isUndefined()
- {
- return (this.layer.selectedIndex == -1)
- }
- // ================================================================================
- function ListWidget_getMultiSelection()
- {
- var e=this.layer,rets=new Array,len=e.options.length
- for (var i=0;i<len;i++)
- {
- var opt=e.options[i]
- if (opt.selected)
- {
- var ret=new Object;
- ret.index=i;ret.value=opt.value;ret.text=opt.text;rets[rets.length]=ret
- }
- }
- return rets
- }
- function ListWidget_change(multi,lines)
- {
- var o=this
- if(multi!=null)
- {
- o.multi=multi
- o.layer.multiple=multi
- }
- if(lines!=null)
- {
- o.size=lines
- o.layer.size=lines
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newInfoWidget (Constructor)
- //
- // List box widget - based on SELECT tags
- //
- // ================================================================================
- // ================================================================================
- function newInfoWidget(id,title,boldTitle,text,height)
- {
- var o=newWidget(id)
- o.title=title?title:""
- o.boldTitle=boldTitle?boldTitle:""
- o.text=text?text:""
- o.height=(height!=null)?height:55
- o.getHTML=InfoWidget_getHTML
- o.setText=InfoWidget_setText
- o.setTitle=InfoWidget_setTitle
- o.setTitleBold=InfoWidget_setTitleBold
- o.oldResize=o.resize
- o.resize=InfoWidget_resize
- o.textLayer=null
- return o
- }
- // ================================================================================
- function InfoWidget_setText(text,isHTML)
- {
- var o=this
- text=text?text:""
- o.text=text
- if (o.layer)
- {
- var l=o.textLayer
- if (l==null)
- l=o.textLayer=getLayer('infozone_'+o.id)
- if (l) l.innerHTML=isHTML?text:convStr(text,false,true)
- }
- }
- // ================================================================================
- function InfoWidget_setTitle(text)
- {
- var o=this
- text=text?text:""
- o.title=text
-
- if (o.layer)
- {
- var l=o.titleLayer
- if (l==null)
- l=o.titleLayer=getLayer('infotitle_'+o.id)
- if (l) l.innerHTML=convStr(text)
- }
- }
- // ================================================================================
- function InfoWidget_setTitleBold(text)
- {
- var o=this
- text=text?text:""
- o.boldTitle=text
-
- if (o.layer)
- {
- var l=o.titleLayerBold
- if (l==null)
- l=o.titleLayerBold=getLayer('infotitlebold_'+o.id)
- if (l) l.innerHTML=convStr(text)
- }
- }
- // ================================================================================
- function InfoWidget_getHTML()
- {
- var o=this
- return '<div class="dialogzone" align="left" style="overflow:hidden;'+sty("width",o.width)+sty("height",""+o.height+"px")+'" id="'+o.id+'">'+
- '<nobr>'+img(_skin+'../help.gif',16,16,'top',null,_helpLab)+
- '<span class="dialogzone" style="padding-left:5px" id="infotitle_'+o.id+'">'+convStr(o.title)+'</span><span style="padding-left:5px" class="dialogzonebold" id="infotitlebold_'+o.id+'">'+convStr(o.boldTitle)+'</span></nobr>'+
- '<br>'+getSpace(1,2)+
- '<div class="infozone" align="left" id="infozone_'+o.id+'" style="height:'+(o.height-18-(_moz?10:0))+'px;overflow'+(_ie?'-y':'')+':auto">'+convStr(o.text,false,true)+'</div>'+
- '</div>'
- }
- // ================================================================================
- function InfoWidget_resize(w,h)
- {
- var o=this;
- if (w!=null) o.w=w
- if (h!=null) o.h=h
- o.oldResize(w,h)
- if (o.layer)
- {
- var l=o.textLayer
- if (l==null)
- l=o.textLayer=getLayer('infozone_'+o.id)
- if (l)
- {
- if (o.h!=null) l.style.height=""+Math.max(0, o.h-(_ie?18:28))+"px"
- }
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newCheckWidget (Constructor)
- //
- // Check box widget
- //
- // ================================================================================
- // ================================================================================
- function newCheckWidget(id,text,changeCB,bold,imgUrl,imgW,imgH,bconvtext)
- {
- var o=newWidget(id)
- o.text=text
- o.convText=bconvtext
- o.changeCB=changeCB
- o.idCheckbox='check_'+id
- o.checkbox=null
- o.kind='checkbox'
- o.name=o.idCheckbox
- o.bold=bold
- o.imgUrl=imgUrl
- o.imgW=imgW
- o.imgH=imgH
- o.getHTML=CheckWidget_getHTML
- o.setText=CheckWidget_setText
- o.parentInit=Widget_init
- o.init=CheckWidget_init
- o.check=CheckWidget_check
- o.isChecked=CheckWidget_isChecked
- o.setDisabled=CheckWidget_setDisabled
- o.isDisabled=CheckWidget_isDisabled
- o.uncheckOthers=CheckWidget_uncheckOthers
- o.isIndeterminate=CheckWidget_isIndeterminate
- o.setIndeterminate=CheckWidget_setIndeterminate
- o.layerClass=('dialogzone'+(o.bold?'bold':''))
- o.nobr=true
- return o
- }
- // ================================================================================
- function CheckWidget_getHTML()
- {
- var o=this,cls=o.layerClass;
- return '<table border="0" onselectstart="return false" cellspacing="0" cellpadding="0" class="'+cls+'"'+attr('id',o.id)+'>' +
- '<tr valign="middle">'+
- '<td style="height:20px;width:21px"><input style="margin:'+(_moz?3:0)+'px" onclick="'+_codeWinName+'.CheckWidget_changeCB(event,this)" ' +
- 'type="'+o.kind+'"'+attr('id',o.idCheckbox)+attr('name',o.name)+'>' +
- '</td>'+
- (o.imgUrl?'<td><label style="padding-left:2px" for="'+o.idCheckbox+'">'+img(o.imgUrl,o.imgW,o.imgH)+'</label></td>':'')+
- '<td>'+(o.nobr?'<nobr>':'')+'<label style="padding-left:'+ (o.imgUrl?4:2) +'px" id="label_'+o.id+'" for="'+o.idCheckbox+'">'+(o.convText?convStr(o.text):o.text)+'</label>'+(o.nobr?'</nobr>':'')+'</td>'+
- '</tr></table>'
- }
- // ================================================================================
- function CheckWidget_setText(s)
- // Set the check text
- // s [String] the new text
- {
- var o=this
- o.text=s
-
- if (o.layer)
- {
- if (o.labelLyr==null)
- o.labelLyr=getLayer('label_'+o.id)
- o.labelLyr.innerHTML=o.convText?convStr(s):s
- }
- }
- function CheckWidget_init()
- {
- this.parentInit()
- this.checkbox=getLayer(this.idCheckbox)
- }
- // ================================================================================
- function CheckWidget_check(c) {this.checkbox.checked=c;if(c)this.uncheckOthers()}
- function CheckWidget_isChecked() {return this.checkbox.checked}
- function CheckWidget_changeCB(e,l) {var o=getWidget(l);o.uncheckOthers();if(o.changeCB) o.changeCB(e)}
- function CheckWidget_setDisabled(d) {this.checkbox.disabled=d;if(_moz) this.checkbox.className=(d?'dialogzone':'')}
- function CheckWidget_isDisabled(){ return this.checkbox.disabled }
- function CheckWidget_uncheckOthers() {}
- function CheckWidget_isIndeterminate() {return this.checkbox.indeterminate}
- function CheckWidget_setIndeterminate(b) {this.checkbox.indeterminate=b}
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newRadioWidget (Constructor)
- //
- // Class for radio buttons
- //
- // ================================================================================
- // ================================================================================
- function newRadioWidget(id,group,text,changeCB,bold,imgUrl,imgW,imgH,bconvtext)
- {
- var o=newCheckWidget(id,text,changeCB,bold,imgUrl,imgW,imgH,bconvtext)
- o.kind='radio'
- o.name=group
- if (_RadioWidget_groups[group]==null)
- _RadioWidget_groups[group]=new Array
- o.groupInstance=_RadioWidget_groups[group]
- var g=o.groupInstance
- o.groupIdx=g.length
- g[g.length]=o
- o.uncheckOthers=RadioWidget_uncheckOthers
- return o;
- }
- // ================================================================================
- var _RadioWidget_groups=new Array
- function RadioWidget_uncheckOthers()
- {
- var g=this.groupInstance,idx=this.groupIdx,len=g.length
- for (var i=0;i<len;i++)
- {
- if (i!=idx)
- {
- var c=g[i].checkbox
- if(c)
- c.checked=false
- }
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconNoTextCheckWidget (Constructor)
- //
- // Class for icon only checkbox
- //
- // ================================================================================
- // ================================================================================
- /*
- function newIconNoTextCheckWidget(id,changeCB,imgUrl,imgW,imgH,tooltip)
- {
- var o=newWidget(id)
- o.changeCB=changeCB
- o.idCheckbox='check_'+id
- o.checkbox=null
- o.kind='checkbox'
- o.name=o.idCheckbox
- o.imgUrl=imgUrl
- o.imgW=imgW
- o.imgH=imgH
- o.tooltip=(tooltip?tooltip:"")
- o.getHTML=IconNoTextCheckWidget_getHTML
- o.parentInit=Widget_init
- o.init=CheckWidget_init
- o.check=CheckWidget_check
- o.isChecked=CheckWidget_isChecked
- o.setDisabled=CheckWidget_setDisabled
- o.uncheckOthers=CheckWidget_uncheckOthers
- return o
- }
- // ================================================================================
- function IconNoTextCheckWidget_getHTML()
- {
- var o=this
- return '<table border="0" onselectstart="return false" cellspacing="0" cellpadding="0" title= "'+ convStr(o.tooltip) + '" ' + attr('id',o.id) +'>' +
- '<tr>'+
- '<td align="center"><label style="padding-left:2px" for="'+o.idCheckbox+'">'+img(o.imgUrl,o.imgW,o.imgH, null, null, convStr(o.tooltip))+'</label></td>'+
- '</tr>'+
- '<tr>'+
- '<td align="center"><input style="margin:'+(_moz?3:0)+'px" onclick="'+_codeWinName+'.CheckWidget_changeCB(event,this)" ' +
- 'type="'+o.kind+'"'+attr('id',o.idCheckbox)+attr('name',o.name)+'>' +
- '</td>'+
- '</tr></table>'
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIconNoTextCheckWidget (Constructor)
- //
- // Class for icon only radio button
- //
- // ================================================================================
- // ================================================================================
- function newIconNoTextRadioWidget(id,group,changeCB,imgUrl,imgW,imgH,tooltip)
- {
- var tip = tooltip?tooltip:""
- var o=newIconNoTextCheckWidget(id,changeCB,imgUrl,imgW,imgH,tip)
- o.kind='radio'
- o.name=group
- if (_RadioWidget_groups[group]==null)
- _RadioWidget_groups[group]=new Array
- o.groupInstance=_RadioWidget_groups[group]
- var g=o.groupInstance
- o.groupIdx=g.length
- g[g.length]=o
- o.uncheckOthers=RadioWidget_uncheckOthers
- return o;
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newTextFieldWidget (Constructor)
- //
- // Text field widget
- //
- // ================================================================================
- // ================================================================================
- function newTextFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width,focusCB,blurCB)
- {
- var o=newWidget(id)
- o.tooltip=tooltip
- o.changeCB=changeCB
- o.maxChar=maxChar
- o.keyUpCB=keyUpCB
- o.enterCB=enterCB
- o.noMargin=noMargin
- o.width=width==null?null:''+width+'px'
- o.focusCB=focusCB
- o.blurCB=blurCB
- o.disabled=false
- o.getHTML=TextFieldWidget_getHTML
- o.getValue=TextFieldWidget_getValue
- o.setValue=TextFieldWidget_setValue
- o.intValue=TextFieldWidget_intValue
- o.intPosValue=TextFieldWidget_intPosValue
- o.select=TextFieldWidget_select
- o.setDisabled=TextFieldWidget_setDisabled
- o.beforeChange=null
- o.wInit=o.init
- o.init=TextFieldWidget_init
- o.oldValue=""
- o.helpTxt=''
- o.isHelpTxt=false
- o.setHelpTxt=TextFieldWidget_setHelpTxt
- o.eraseHelpTxt=TextFieldWidget_eraseHelpTxt
- o.enterCancelBubble=true
- return o
- }
- // ================================================================================
- function TextFieldWidget_setDisabled(d)
- {
- var o=this
- o.disabled=d
-
- if (o.layer)
- o.layer.disabled=d
- }
- // ================================================================================
- function TextFieldWidget_init()
- {
- var o=this
- o.wInit()
- o.layer.value=""+ (o.oldValue != "")?o.oldValue : "";
-
- if(o.helpTxt && !o.oldValue)
- o.setHelpTxt(o.helpTxt);
- }
- // ================================================================================
- function TextFieldWidget_getHTML()
- {
- var o=this
- return '<input'+(o.disabled?' disabled':'')+' oncontextmenu="event.cancelBubble=true;return true" style="'+sty("width",this.width)+(_moz?'margin-top:1px;margin-bottom:1px;padding-left:2px;padding-right:2px;':'')+(_isQuirksMode? 'height:18px;' : 'height:14px;') + 'margin-left:'+(this.noMargin?0:10)+'px" onfocus="'+_codeWinName+'.TextFieldWidget_focus(this)" onblur="'+_codeWinName+'.TextFieldWidget_blur(this)" onchange="'+_codeWinName+'.TextFieldWidget_changeCB(event,this)" onkeydown=" return '+_codeWinName+'.TextFieldWidget_keyDownCB(event,this);" onkeyup=" return '+_codeWinName+'.TextFieldWidget_keyUpCB(event,this);" onkeypress=" return '+_codeWinName+'.TextFieldWidget_keyPressCB(event,this);" type="text" '+attr('maxLength',this.maxChar)+' ondragstart="event.cancelBubble=true;return true" onselectstart="event.cancelBubble=true;return true" class="textinputs" id="'+this.id+'" name="'+this.id+'"'+attr('title',this.tooltip)+' value="">'
-
- }
- // ================================================================================
- function TextFieldWidget_getValue()
- {
- var o=this
- if (o.isHelpTxt) {
- return ''
- }
- else
- {
- return o.layer ? o.layer.value : o.oldValue
- }
- }
- // ================================================================================
- function TextFieldWidget_setValue(s)
- {
- var o=this
- if (o.layer) {
- o.eraseHelpTxt()
- o.layer.value=''+s
- } else {
- o.oldValue=s
- }
- }
- // ================================================================================
- function TextFieldWidget_changeCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l)
- o.eraseHelpTxt()
- if(o.beforeChange)
- o.beforeChange()
- if(o.changeCB)
- o.changeCB(e)
- }
- // ================================================================================
- function TextFieldWidget_keyPressCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l)
- if (eventGetKey(e)==13)
- {
- // Only non-IME enter key press will come here
- o.enterKeyPressed = true;
- return false;
- }
- else
- {
- o.enterKeyPressed = false;
- }
- return true
- }
- // ================================================================================
- function TextFieldWidget_keyUpCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l)
- o.eraseHelpTxt()
- if (eventGetKey(e)==13 && o.enterKeyPressed) // Ignore the IME enter key up
- {
- if (o.beforeChange)
- o.beforeChange()
- if (o.enterCB)
- {
- if (o.enterCancelBubble)
- eventCancelBubble(e)
- o.enterCB(e)
- }
-
- return false
- }
- else if(o.keyUpCB)
- {
- o.keyUpCB(e)
- }
- o.enterKeyPressed = false;
- return true
- }
- // ================================================================================
- function TextFieldWidget_keyDownCB(e,l)
- // PRIVATE
- {
- var o=getWidget(l)
- o.eraseHelpTxt()
- o.enterKeyPressed = false;
- if (eventGetKey(e)==13)
- {
- return true
- }
- else if (eventGetKey(e)==8)//back space
- {
- eventCancelBubble(e);
- }
- return true;
- }
- // ================================================================================
- function TextFieldWidget_eraseHelpTxt()
- // PRIVATE
- {
- var o=this
- if (o.isHelpTxt) o.layer.value= ""
- o.isHelpTxt = false
- o.layer.style.color="black"
- }
- // ================================================================================
- function TextFieldWidget_focus(l)
- // PRIVATE
- {
- var o=getWidget(l)
- o.eraseHelpTxt()
- if (o.focusCB)
- o.focusCB()
- }
- // ================================================================================
- function TextFieldWidget_blur(l)
- // PRIVATE
- {
- var o=getWidget(l)
- if(o.beforeChange)
- o.beforeChange()
- if (o.blurCB)
- o.blurCB()
- }
- // ================================================================================
- function TextFieldWidget_intValue(nanValue)
- {
- var n=parseInt(this.getValue())
- return isNaN(n)?nanValue:n
- }
- // ================================================================================
- function TextFieldWidget_intPosValue(nanValue)
- {
- var n=this.intValue(nanValue)
- return (n<0)?nanValue:n
- }
- // ================================================================================
- function TextFieldWidget_select()
- {
- this.layer.select()
- }
- // ================================================================================
- function TextFieldWidget_setHelpTxt(h)
- {
- var o=this
- o.helpTxt=h
- if (o.layer && (o.layer.value == ""))
- {
- o.isHelpTxt=true
- o.layer.value=h
- o.layer.style.color="#808080"
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newIntFieldWidget (Constructor)
- //
- // Text field widget that handles integer numeric values
- //
- // ================================================================================
- // ================================================================================
- function newIntFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width,customCheckCB)
- {
- var o=newTextFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width)
- o.min=-Number.MAX_VALUE
- o.max=Number.MAX_VALUE
- o.customCheckCB=customCheckCB // Returns a boolean
- o.setMin=IntFieldWidget_setMin
- o.setMax=IntFieldWidget_setMax
- o.setValue=IntFieldWidget_setValue
- o.beforeChange=IntFieldWidget_checkChangeCB
- o.value=''
- return o
- }
- // ================================================================================
- function IntFieldWidget_setMin(min)
- {
- if (!isNaN(min))
- this.min=min
- }
- // ================================================================================
- function IntFieldWidget_setMax(max)
- {
- if (!isNaN(max))
- this.max=max
- }
- // ================================================================================
- function IntFieldWidget_setValue(s)
- {
- var o=this,l=o.layer
- s = '' + s
- if (s =='')
- {
- if (l)
- l.value= ''
- o.oldValue = ''
- return
- }
-
- var n=parseInt(s)
- value = ''
- if (!isNaN(n) && (n >= o.min) && (n <= o.max) && ((o.customCheckCB==null) || o.customCheckCB(n))) {
- value = n
- o.oldValue = value
- } else {
- if (o.oldValue)
- value = o.oldValue
- }
- if (l)
- l.value= '' + value
- }
- // ================================================================================
- function IntFieldWidget_checkChangeCB()
- {
- var o=this
- o.setValue(o.layer.value)
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newFloatFieldWidget (Constructor)
- //
- // Text field widget that handles floating point numeric values
- //
- // ================================================================================
- // ================================================================================
- /*
- function newFloatFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width,customCheckCB)
- {
- var o=newIntFieldWidget(id,changeCB,maxChar,keyUpCB,enterCB,noMargin,tooltip,width)
- o.setValue=FloatFieldWidget_setValue
- o.customCheckCB=customCheckCB // Returns a boolean
- o.setPrecision=FloatFieldWidget_setPrecision
- o.toPrecision=FloatFieldWidget_toPrecision
- o.setSeparator=FloatFieldWidget_setSeparator
- o.beforeChange=FloatFieldWidget_checkChangeCB
- o.precision=10 // default precision !!is it enough?
- o.sep='.' // default separator
- return o
- }
- // ================================================================================
- function FloatFieldWidget_setValue(s)
- {
- var o=this,l=o.layer
- s = '' + s
- if (s =='')
- {
- if (l)
- l.value= ''
- o.oldValue = ''
- return
- }
- var n=parseFloat(s)
- value = ''
- if (!isNaN(n) && (n >= o.min) && (n <= o.max) && ((o.customCheckCB==null) || o.customCheckCB(n))) {
- value = '' + o.toPrecision(n)
- o.oldValue = value
- } else {
- if (o.oldValue)
- value = o.oldValue
- }
- if (l)
- l.value = value
- }
- // ================================================================================
- function FloatFieldWidget_toPrecision(n)
- {
- var o=this
- n = '' + n
- var nAr = n.split(o.sep)
- if (nAr.length == 1) return nAr[0]
- var dec = (nAr[1].length >= o.precision)? nAr[1].substr(0, o.precision) : nAr[1]
- return nAr[0] + o.sep + dec
- }
- // ================================================================================
- function FloatFieldWidget_checkChangeCB()
- {
- var o=this
- o.setValue(o.layer.value)
- }
- // ================================================================================
- function FloatFieldWidget_setPrecision(p)
- {
- this.precision=p
- }
- // ================================================================================
- function FloatFieldWidget_setSeparator(s)
- {
- this.sep=s
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newTextAreaWidget (Constructor)
- //
- // Text Area widget
- //
- // ================================================================================
- // ================================================================================
- function newTextAreaWidget(id,rows,cols,tooltip,changeCB,enterCB,cancelCB)
- {
- var o=newWidget(id)
- o.rows=rows
- o.cols=cols
- o.allowCR=true
- o.tooltip=tooltip
- o.changeCB=changeCB
- o.enterCB=enterCB
- o.cancelCB=cancelCB
- o.getHTML=TextAreaWidget_getHTML
- o.getValue=TextAreaWidget_getValue
- o.setValue=TextAreaWidget_setValue
- o.resize=TextAreaWidget_resize
- o.wInit=o.init
- o.init=TextAreaWidget_init
- o.oldValue=""
-
-
- if ((o.rows!=null)&&!_ie&&!_saf)
- o.rows--
- return o
- }
- // ================================================================================
- function TextAreaWidget_init()
- {
- var o=this
- o.wInit()
- o.layer.value=""+o.oldValue
- }
- // ================================================================================
- function TextAreaWidget_getHTML()
- {
- return '<textarea oncontextmenu="event.cancelBubble=true;return true" id="'+this.id+'" '+attr('title',this.tooltip)+ 'rows="'+this.rows+'" cols="'+this.cols+'" class="textinputs" value="" onkeydown="return '+_codeWinName+'.TextAreaWidget_keyDownCB(event,this)" ondragstart="event.cancelBubble=true;return true" onselectstart="event.cancelBubble=true;return true" ></textarea>'
- }
- // ================================================================================
- function TextAreaWidget_getValue()
- {
- return this.layer.value
- }
- // ================================================================================
- function TextAreaWidget_setValue(s)
- {
- if (this.layer)
- this.layer.value=''+s
- else
- this.oldValue=s
- }
- // ================================================================================
- function TextAreaWidget_resize(lines,cols)
- {
- var o=this
-
- if(lines && lines >0) o.layer.rows=lines
- if(cols && cols>0) o.layer.cols=cols
- }
- // ================================================================================
- function TextAreaWidget_keyDownCB(e,l)
- {
- var key = eventGetKey(e),o=getWidget(l)
- if (key==13)//enter
- {
- if (o.enterCB)
- {
- eventCancelBubble(e)
- o.enterCB(e)
- }
- else if (o.allowCR)
- {
- eventCancelBubble(e);
- //change in textarea
- setTimeout("TextAreaWidget_delayedChangeCB("+key+","+o.widx+")",1)
- }
- return o.allowCR;
- }
- else if(key==27)//escape
- {
- if(o.cancelCB)
- return o.cancelCB(e)
- else
- return true;
- }
- else if(key == 8)// back space
- {
- eventCancelBubble(e);
- //change in textarea
- setTimeout("TextAreaWidget_delayedChangeCB("+key+","+o.widx+")",1)
-
- return true;
- }
- else
- {
- //setTimeout to be sure that the key is writen in the textarea
- //we do not use the keyup event because of rapid keyboard pression
- setTimeout("TextAreaWidget_delayedChangeCB("+key+","+o.widx+")",1)
- return true;
- }
- }
- // ================================================================================
- function TextAreaWidget_delayedChangeCB(key,widx)
- {
- var o=_widgets[widx]
- if (o.changeCB)
- o.changeCB(key)
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newFrameZoneWidget (Constructor)
- //
- // Text field widget that handles floating point numeric values
- //
- // ================================================================================
- // ================================================================================
- function newFrameZoneWidget(id,w,h,reverse)
- {
- var o=newWidget(id)
- o.w=(w!=null)?""+Math.max(0,w-10)+"px":null
- o.h=(h!=null)?""+Math.max(0,h-10)+"px":null
- o.reverse=(reverse!=null)?reverse:false
- o.cont=null
- o.beginHTML=FrameZoneWidget_beginHTML
- o.endHTML=FrameZoneWidget_endHTML
- o.oldResize=o.resize
- o.resize=FrameZoneWidget_resize
- return o
- }
- // ================================================================================
- function FrameZoneWidget_resize(w,h)
- {
- var o=this
- var d=o.layer.display!="none"
- if (d&_moz&&!_saf)
- o.setDisplay(false)
- o.oldResize(w,h)
- if (d&_moz&&!_saf)
- o.setDisplay(true)
- }
- // ================================================================================
- function FrameZoneWidget_beginHTML()
- {
- var o=this
- return '<table style="'+sty("width",o.w)+sty("height",o.h)+'" id="'+o.id+'" cellspacing="0" cellpadding="0" border="0"><tbody>'+
- '<tr height="5">'+
- '<td width="5">'+imgOffset(_skin+'dialogframe.gif',5,5,o.reverse?10:0,0)+'</td>'+
- '<td style="'+backImgOffset(_skin+"dialogframetopbottom.gif",0,o.reverse?10:0)+'"></td>'+
- '<td width="5">'+imgOffset(_skin+'dialogframe.gif',5,5,o.reverse?15:5,0)+'</td>'+
- '</tr>'+
- '<tr><td style="'+backImgOffset(_skin+"dialogframeleftright.gif",o.reverse?10:0,0)+'"></td><td valign="top" class="dialogzone" id="frame_cont_'+o.id+'">'
- }
- // ================================================================================
- function FrameZoneWidget_endHTML()
- {
- var o=this
- return '</td><td style="'+backImgOffset(_skin+"dialogframeleftright.gif",o.reverse?15:5,0)+'"></td></tr>'+
- '<tr height="5">'+
- '<td>'+imgOffset(_skin+'dialogframe.gif',5,5,o.reverse?10:0,5)+'</td>'+
- '<td style="'+backImgOffset(_skin+"dialogframetopbottom.gif",0,o.reverse?15:5)+'"></td>'+
- '<td>'+imgOffset(_skin+'dialogframe.gif',5,5,o.reverse?15:5,5)+'</td>'+
- '</tr>'+
- '</tbody></table>'
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newBOColor (Constructor)
- //
- // Color object
- //
- // ================================================================================
- // ================================================================================
- /*
- function newBOColor(r,g,b)
- {
- var o=new Object;
- if (r && (g==null) && (b==null))
- {
- s = r.split(",")
- o.r=parseInt(s[0])
- o.g=parseInt(s[1])
- o.b=parseInt(s[2])
- }
- else
- {
- o.r=r
- o.g=g
- o.b=b
- }
- o.set=BOColor_set
- o.getCopy=BOColor_getCopy
- o.getStringDef=BOColor_getStringDef
- o.getStyleColor=BOColor_getStyleColor
- return o;
- }
- // ================================================================================
- function BOColor_getStringDef()
- {
- var o=this
- return ""+o.r+","+o.g+","+o.b
- }
- // ================================================================================
- function BOColor_getCopy()
- {
- var f=this
- var o=newBOColor(f.r,f.g,f.b)
- return o;
- }
- // ================================================================================
- function BOColor_set(r,g,b)
- {
- this.r=r
- this.g=g
- this.b=b
- }
- // ================================================================================
- function BOColor_getStyleColor()
- {
- var o=this
- // if undefined
- if (o.r == -1 || o.r == null) return null;
- if (o.g == -1 || o.g == null) return null;
- if (o.b == -1 || o.b == null) return null;
- return "rgb(" + o.r + "," + o.g + "," + o.b + ")"
- }
- // ================================================================================
- // ================================================================================
- //
- // PRIVATE OBJECT newDragDropData (Constructor)
- //
- // Generic object fo Drag and drop support.
- //
- // ================================================================================
- // ================================================================================
- function newDragDropData(widget,dragStartCB,dragCB,dragEndCB,acceptDropCB,leaveDropCB,dropCB)
- // void dragStartCB (source,layer)
- // void dragCB (source,layer, shift)
- // void dragEndCB (source,layer)
- // boolean acceptDropCB (source, target, ctrl, shift, layer, enter)
- // void leaveDropCB (source, target, ctrl, shift, layer)
- // void dropCB (source, target, ctrl, shift, layer)
- {
- var o=new Object
- o.widget=widget
- o.dragStartCB=dragStartCB
- o.dragCB=dragCB
- o.dragEndCB=dragEndCB
- o.acceptDropCB=acceptDropCB
- o.leaveDropCB=leaveDropCB
- o.dropCB=dropCB
- o.attachCallbacks=DragDropData_attachCallbacks
- o.id=_ddData.length
- _ddData[o.id]=o
- return o
- }
- // ================================================================================
- function DragDropData_attachCallbacks(lyr,onlyDrop)
- {
- if (_ie)
- {
- onlyDrop=(onlyDrop==null)?false:onlyDrop
- if (!onlyDrop)
- {
- lyr.ondragstart=DDD_dragStart
- lyr.ondragend=DDD_dragEnd
- }
- lyr.ondrop=DDD_drop
- lyr.ondragleave=DDD_dragLeave
- lyr.ondragover=DDD_dragOver
- lyr.ondrag=DDD_drag
- lyr._dragDropData=this.id
- }
- }
- // ================================================================================
- function DDD_dragStart()
- {
- var e=_curWin.event,dt=e.dataTransfer
- dt.effectAllowed='copyMove'
- dt.dropEffect=_curWin.event.ctrlKey?'copy':'move'
- var o=_ddData[this._dragDropData]
- o.dragStartCB(o.widget,this)
- window._globalDDD=o.widget
- e.cancelBubble=true
- }
- // ================================================================================
- function DDD_drag()
- {
- var e=_curWin.event,dt=e.dataTransfer
- dt.dropEffect=e.ctrlKey?'copy':'move'
- var o=_ddData[this._dragDropData]
- o.dragCB(o.widget,this,e.ctrlKey?false:e.shiftKey)
- e.cancelBubble=true
- }
- // ================================================================================
- function DDD_dragEnd()
- {
- var o=_ddData[this._dragDropData]
- o.dragEndCB(o.widget,this)
- window._globalDDD=null
- }
- // ================================================================================
- function DDD_dragEnter()
- {
- DDD_dragOverEnter(this,true)
- }
- // ================================================================================
- function DDD_dragOver()
- {
- DDD_dragOverEnter(this,false)
- }
- // ================================================================================
- function DDD_dragOverEnter(layer,isEnter)
- {
- var o=_ddData[layer._dragDropData],e=_curWin.event
- e.dataTransfer.dropEffect=e.ctrlKey?'copy':'move'
- var o=_ddData[layer._dragDropData];
- if (o.acceptDropCB(window._globalDDD,o.widget,e.ctrlKey,e.ctrlKey?false:e.shiftKey,layer,isEnter))
- e.returnValue=false
- e.cancelBubble=true
- }
- // ================================================================================
- function DDD_dragLeave()
- {
- var o=_ddData[this._dragDropData],e=_curWin.event
- o.leaveDropCB(window._globalDDD,o.widget,e.ctrlKey,e.ctrlKey?false:e.shiftKey,this)
- }
- // ================================================================================
- function DDD_drop()
- {
- var o=_ddData[this._dragDropData],e=_curWin.event
- o.dropCB(window._globalDDD,o.widget,e.ctrlKey,e.ctrlKey?false:e.shiftKey,this)
- window._globalDDD=null
- e.cancelBubble=true
- }
- */
- // ================================================================================
- // ================================================================================
- //
- // GLOBAL FUNCTIONS : ARRAYS
- //
- // Dynamic array management
- //
- // ================================================================================
- // ================================================================================
- function arrayAdd(obj,fieldName,item,idx)
- {
- var array=obj[fieldName],len=array.length
- if ((idx==null)||(typeof idx!="number")) idx=-1
- if ((idx<0)||(idx>len)) idx=len
- if (idx!=len)
- {
- var end=array.slice(idx)
- array.length=idx+1
- array[idx]=item
- array=array.concat(end)
- }
- else array[idx]=item
- obj[fieldName]=array
- return idx
- }
- // ================================================================================
- function arrayRemove(obj,fieldName,idx)
- {
- var array=obj[fieldName],last=array.length-1
- if (idx==null)
- {
- array.length=0
- obj[fieldName]=array
- return -1
- }
- if ((idx<0)||(idx>last)) return -1
- if (idx==last) array.length=last
- else
- {
- var end=array.slice(idx+1)
- array.length=idx
- array=array.concat(end)
- }
- obj[fieldName]=array
- return idx
- }
- // ================================================================================
- function arrayMove(obj,fieldName,i,j)
- {
- var array=obj[fieldName],len=array.length
- if ((i<0)||(i>=len)||(j<0)||(j>=len)) return false
- var old=array[i]
- arrayRemove(obj,fieldName,i)
- arrayAdd(obj,fieldName,old,j)
- return true;
- }
- // ================================================================================
- function arrayGetCopy(arr)
- {
- var o=new Array,len=arr.length;
- for (var i=0;i<len;i++)
- o[i]=arr[i]
- return o;
- }
- // ================================================================================
- function arrayFind(obj,fieldName,v,subfield)
- //return the index of value in array
- {
- var array=obj[fieldName],len=array.length;
- for (var i=0;i<len;i++)
- {
- if(subfield)
- {
- if (array[i][subfield] == v) return i;
- }
- else
- if(array[i]==v) return i;
- }
- return -1;
- }
- // ================================================================================
- // ================================================================================
- //
- // GLOBAL FUNCTIONS : FRAMES
- //
- // Frame functions
- //
- // ================================================================================
- // ================================================================================
- function getFrame(name,par)
- {
- if (par==null) par=self
- var frames=par.frames,w=eval("frames."+name)
- if (w==null) return w
- var l=frames.length
- for (var i=0;i<l;i++)
- {
- w=frames[i]
- try {
- if (w.name==name)
- return w
- } catch (exc) {
- // keep on
- }
- }
- return null
- }
- // ================================================================================
- function frameNav(name,url,fillHistory,par,noRefreshDrillBar)
- // par [window optional]
- {
- var fr=null
- if (noRefreshDrillBar & name=="Report")
- {
- var topfs=getTopFrameset();
- fr=topfs.getReportFrame()
- } else {
- fr=getFrame(name,par)
- }
- if (fr) {
- var l=fr.location
-
- if (fillHistory)
- l.href=url
- else
- l.replace(url)
- } else {
- var lay = document.getElementById(name)
- if (lay)
- lay.src=url;
- }
- }
- // ================================================================================
- /*
- function genericIframeNav(url,fillHistory)
- {
-
- var l = getDynamicBGIFrameLayer()
- if (fillHistory)
- {
- l.href=url
- } else {
- l.replace(url)
- }
- }
- */
- // ================================================================================
- function frameGetUrl(win)
- {
- return win.location.href
- }
- // ================================================================================
- function frameReload(win)
- {
- var loc=win.location
- loc.replace(loc.href)
- }
- // ================================================================================
- function setTopFrameset()
- // Marks the current window as a "top frameset"
- // returns [void]
- {
- _curWin._topfs="topfs"
- }
- // ================================================================================
- function getTopFrameset(f)
- // get int the parents window the one marked as "top frameset"
- // returns [window] the top frameset, or null if not
- {
- if(f == null)
- f = self
- if(f._topfs=="topfs")
- {
- return f;
- }
- else
- {
- if(f!= top)
- return getTopFrameset(f.parent)
- else
- return null;
- }
- }
- // ================================================================================
- // ================================================================================
- //
- // GLOBAL FUNCTIONS : UTILITY FUNCTIONS
- //
- // Frame functions
- //
- // ================================================================================
- // ================================================================================
- function convStr(s,nbsp,br)
- {
- s=""+s
- var ret=s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")
- if (nbsp)
- ret=ret.replace(/ /g," ")
- if (br)
- ret=ret.replace(/\n/g,"<br>")
- return ret
- }
- // ================================================================================
- function escapeCR(s)
- {
- s=""+s
- var ret=s.replace(/\r/g,"").replace(/\n/g,"\\n");
- return ret
- }
- // ================================================================================
- function addDblClickCB(l,cb)
- // Adds a function double click event handler. fixes a Netscape bug
- // l [layer] the layer
- // cb [Function] the double click function handler
- {
- if (l.addEventListener && !_saf) {// ADAPT00521043 for Safari : Bug 7790: ondblclick doesn't fire when attached with addEventListener
- l.addEventListener("dblclick",cb,false)
- } else {
- l.ondblclick=cb
- }
- }
- // ================================================================================
- function img(src,w,h,align,att,alt)
- // get the HTML of an image
- // src [String] the combined image url
- // w [int] the width
- // h [int] the height
- // align [String optional] image alignment
- // att [String optional] optional attributes (do no use style & alt & align attribute)
- // alt [String optional] image tooltip
- {
- att=(att?att:'')
- if (alt==null) alt=''
- return '<img'+attr('width',w)+attr('height',h)+attr('src', src)+attr('alt',alt)+attr("align", align)+' border="0" hspace="0" vspace="0" '+(att?att:'')+'>'
- }
- // ================================================================================
- function imgOffset(url,w,h,dx,dy,id,att,alt,st,align)
- // get the HTML of an image that display only a part of a bigger one
- // url [String] the combined image url
- // w [int] the VISIBLE width
- // h [int] the VISIBLE height
- // dx [int] the horizontal offset in combined image
- // dy [int] the vertical offset in combined image
- // id [String optional] the DOM id
- // att [String optional] optional attributes (do no use style & alt & align attribute)
- // alt [String optional] image tooltip
- // st [String optional] optional style attributes
- // align [String optional] image alignment
- {
- return img(_skin+'../transp.gif',w,h,align,
- (att?att:'') +' '+attr('id',id)+' style="float:left;'+backImgOffset(url,dx,dy)+(st?st:'')+'"',
- alt)
- }
- // ================================================================================
- function simpleImgOffset(url,w,h,dx,dy,id,att,alt,st,align)
- // get the HTML of an image that display only a part of a bigger one
- // url [String] the combined image url
- // w [int] the VISIBLE width
- // h [int] the VISIBLE height
- // dx [int] the horizontal offset in combined image
- // dy [int] the vertical offset in combined image
- // id [String optional] the DOM id
- // att [String optional] optional attributes (do no use style & alt & align attribute)
- // alt [String optional] image tooltip
- // st [String optional] optional style attributes
- // align [String optional] optional style attributes
- {
- if (_ie)
- {
- if (dx==null) dx=0
- if (dy==null) dy=0
- return '<div '+(att?att:'')+' '+attr("id",id)+' style="position:relative;padding:0px;width:'+w+'px;height:'+h+'px;overflow:hidden;'+(st?st:'')+'">'+img(url,null,null,(align?align:'top'),'style="margin:0px;position:relative;top:'+(-dy)+'px;left:'+(-dx)+'px"',alt)+'</div>'
- }
- else
- return imgOffset(url,w,h,dx,dy,id,att,alt,st,align)
- }
- // ================================================================================
- function changeSimpleOffset(lyr,dx,dy,url,alt)
- // Generate a background image with a given offset
- // ONLY APPLIES TO HTML GENRATED BY simpleImgOffset !!
- // url [String] the combined image url
- // dx [int] the horizontal offset in combined image
- // dy [int] the vertical offset in combined image
- {
- if (_ie)
- {
- lyr=lyr.childNodes[0]
- var st=lyr.style
- if ((url!=null)&&(url!=lyr.src))
- lyr.src=url
- if (dx!=null)
- st.left=""+(-dx)+"px"
- if (dy!=null)
- st.top=""+(-dy)+"px"
- if (alt!=null)
- {
- lyr.title=alt
- lyr.alt = alt;
- }
- }
- else
- changeOffset(lyr,dx,dy,url,alt)
- }
- // ================================================================================
- function backImgOffset(url,dx,dy)
- // Generate a background image with a given offset
- // url [String] the combined image url
- // dx [int] the horizontal offset in combined image
- // dy [int] the vertical offset in combined image
- {
- return 'background-image:url(\''+url+'\');background-position:'+(-dx)+'px '+(-dy)+'px;'
- }
- // ================================================================================
- function changeOffset(lyr,dx,dy,url,alt)
- // Change the offset in backgroung image (and eventually the image)
- // lyr [layer] the layer
- // dx [int] the horizontal offset in combined image
- // dy [int] the vertical offset in combined image
- // url [String - Optional] the combined image url
- {
- var st=lyr.style
- if (st)
- {
- if ((dx!=null)&&(dy!=null))
- st.backgroundPosition=''+(-dx)+'px '+(-dy)+'px'
- if (url)
- st.backgroundImage='url(\''+url+'\')'
- }
- if(alt) lyr.title=alt
- }
- // ================================================================================
- function includeScript(url)
- // Include a script
- {
- document.write('<scr'+'ipt language="javascript" charset="UTF-8" src="'+url+'"><\/scr'+'ipt>')
- }
- // ================================================================================
- function includeCSS(css,noskin)
- // Include the CSS related to the current skin
- // css [String] file name with no extension
- // noskin [boolean optional] if true, search in the parent folder
- {
- if(typeof(_style) == 'string' && _style != "")
- {
- var url=""
- if( noskin )
- url=_style+'../'+css
- else
- url=_style+css
- url+='.css'
- _curDoc.write('<li'+'nk rel="stylesheet" type="text/css" href="'+url+'">')
- }
- }
- // ================================================================================
- function getLayer(id)
- // Get a layer from its ID
- // id [String] the id
- {
- return _curDoc.getElementById(id)
- }
- // ================================================================================
- function setLayerTransp(lyr,percent)
- // lyr [Object] : the layer
- // percent [number] : the opacity 0 .. 100
- {
- if (_ie)
- lyr.style.filter=(percent==null) ? "" : "progid:DXImageTransform.Microsoft.Alpha( style=0,opacity="+percent+")"
- else
- lyr.style.MozOpacity=(percent==null) ? 1 : percent/100
- }
- // ================================================================================
- function getPos(el,relTo)
- // Get the layer position in pixels
- // returns an object with (x,y) int fields
- {
- relTo = relTo?relTo:null
- for (var lx=0,ly=0;(el!=null)&&(el!=relTo);
- lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
- return {x:lx,y:ly}
- }
- // ================================================================================
- // Gets the position of el relativeto relTo
- // it fixes the cases where Safari with doctype fails
- function getPos2(el,relTo) {
- var relTo = relTo?relTo:null
- var posX = 0;
- var posY = 0;
-
- while(el.parentNode || el.offsetParent) {
- if(el.offsetParent) {
- posX +=el.offsetLeft;
- posY += el.offsetTop;
- el = el.offsetParent;
- }
- else if(el.parentNode) {
- if(el.style) {
- if(el.style.left) {
- posX += el.style.left;
- }
- if(el.style.top) {
- posY += el.style.top;
- }
- }
- el = el.parentNode;
- }
- else {
- break;
- }
- }
-
- if(relTo) {
- relToCord = getPos2(relTo);
- posX -= relToCord.x;
- posY -= relToCord.y;
- }
- return {x:posX,y:posY};
- }
- // ================================================================================
- function getPosScrolled(el,relTo)
- // Get the layer position in pixels
- // returns an object with (x,y) int fields
- {
- relTo = relTo?relTo:null
- if (_ie)
- {
- for (var lx=0,ly=0;(el!=null)&&(el!=relTo);
- lx+=el.offsetLeft-el.scrollLeft,ly+=el.offsetTop-el.scrollTop,el=el.offsetParent);
- }
- else
- {
- var oldEl=el
- for (var lx=0,ly=0;(el!=null)&&(el!=relTo);
- lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
- for (el=oldEl;(el!=null)&&(el!=relTo);el=el.parentNode)
- {
- if (el.scrollLeft!=null)
- {
- lx-=el.scrollLeft
- ly-=el.scrollTop
- }
- }
- }
-
- lx+=getScrollX()
- ly+=getScrollY()
- return {x:lx,y:ly}
- }
- // ================================================================================
- function getWidget(layer)
- // Apply only with layers generated by widgets
- // layer [layer] the layer
- // return [Widget] the widget (or null)
- {
- if (layer==null)
- return null
- var w=layer._widget
- if (w!=null)
- return _widgets[w]
- else
- return getWidget(layer.parentNode)
- }
- // ================================================================================
- function getWidgetFromID(id)
- // Retrieve a widget from its id
- // id [string] the id of the widget
- // return [Widget] the widget (or null)
- {
- if (id==null)
- return null
- var l=getLayer(id)
-
- return getWidget(l)
- }
- // ================================================================================
- function attr(key,val)
- // writes an HTML attribute (if val null, do nothing)
- // key [String] the attribute name
- // value [String or null] the attribute value
- // returs [String]
- {
- return (val!=null?' '+key+'="'+val+'" ':'')
- }
- // ================================================================================
- function sty(key,val)
- // writes style value (if val null, do nothing)
- // key [String] the style name
- // value [String or null] the attribute value
- // returs [String]
- {
- return (val!=null?key+':'+val+';' :'')
- }
- // ================================================================================
- function getSep(marg,solid)
- // get the HTML for a 3D look horizontal separator
- // marg [int optional] left & right margin
- // solid [boolean optional] solid look
- {
- if (marg==null)marg=0;var spc=marg>0?'<td width="'+marg+'">'+getSpace(marg,1)+'</td>':''; return '<table style="margin-top:5px;margin-bottom:5px;" width="100%" cellspacing="0" cellpadding="0"><tr>'+spc+'<td background="'+_skin+'sep'+(solid?'_solid':'')+'.gif" class="smalltxt"><img alt="" src="'+_skin+'../transp.gif" width="10" height="2"></td>'+spc+'</tr></table>'
- }
- // ================================================================================
- function writeSep(marg,solid)
- // writes a 3D look horizontal separator
- // marg [int optional] left & right margin
- // solid [boolean optional] solid look
- {
- _curDoc.write(getSep(marg,solid))
- }
- // ================================================================================
- function getSpace(w,h)
- // Return the HTML for forcing a space
- // Return [String]
- {
- return '<table height="'+h+'" border="0" cellspacing="0" cellpadding="0"><tr><td>'+img(_skin+'../transp.gif',w,h)+'</td></tr></table>'
- }
- // ================================================================================
- function writeSpace(w,h)
- // write the HTML for forcing a space
- // Return [void]
- {
- _curDoc.write(getSpace(w,h))
- }
- // ================================================================================
- function documentWidth(win)
- // Gets the document(page) width
- // return [int]
- {
-
- var win=win?win:_curWin;
- var width = Math.max(document.body.clientWidth,document.documentElement.clientWidth);
- width = Math.max(width,document.body.scrollWidth);
- return width;
- }
- // ================================================================================
- function documentHeight(win)
- // Gets the document(page) height
- // return [int]
- {
-
- var win=win?win:_curWin;
- var height = Math.max(document.body.clientHeight,document.documentElement.clientHeight);
- height = Math.max(height,document.body.scrollHeight);
- return height;
- }
- // ================================================================================
- function winWidth(win)
- // Gets the window width
- // return [int]
- {
- var width;
- var win=win?win:_curWin;
- if(_ie)
- {
- if(_isQuirksMode)
- {
- width = win.document.body.clientWidth;
- }
- else
- {
- width = win.document.documentElement.clientWidth;
- }
- }
- else
- {
- width = win.innerWidth;
- }
- return width;
- }
- // ================================================================================
- function winHeight(win)
- // Gets the window height
- // return [int]
- {
- var win=win?win:_curWin;
- var height;
- if(_ie)
- {
- if(_isQuirksMode)
- {
- height = document.body.clientHeight;
- }
- else
- {
- height = document.documentElement.clientHeight;
- }
- }
- else
- {
- height = win.innerHeight;
- }
- return height;
- }
- // ================================================================================
- function getScrollX(win)
- // Return [int] the scrolling horizontal value in pixels
- {
- var scrollLeft = 0;
- var win=win?win:_curWin;
-
- if(typeof(win.scrollX ) == 'number') {
- scrollLeft = win.scrollX;
- }
- else {
- scrollLeft = Math.max(win.document.body.scrollLeft,win.document.documentElement.scrollLeft);
- }
-
- return scrollLeft;
- }
- // ================================================================================
- function getScrollY(win)
- // Get the X scroll position in pixels
- // returns an int
- {
- var scrollTop = 0;
- var win=win?win:_curWin;
-
- if(typeof(win.scrollY ) == 'number') {
- scrollTop = window.scrollY;
- }
- else {
- scrollTop = Math.max(win.document.body.scrollTop,win.document.documentElement.scrollTop);
- }
- return scrollTop;
- }
- // ================================================================================
- function winScrollTo(x, y, win)
- // Scroll to the x, y position in pixels
- // takes 2 int
- {
- win=win?win:_curWin
- win.scrollTo(x,y)
- /*/if (_ie) {
- win.document.body.scrollLeft = x
- win.document.body.scrollTop = y
- } else {
- win.scrollTo(x,y)
- }*/
- }
- // ================================================================================
- function eventGetKey(e,win)
- // Get the event key code
- // e [event]
- {
- win=win?win:_curWin
- //return _ie?win.event.keyCode:e.which
- return _ie?win.event.keyCode:e.keyCode
- }
- // ================================================================================
- function eventGetX(e)
- // Get the event mouse abscissa
- // e [event]
- {
- return _ie?_curWin.event.clientX: e.clientX ? e.clientX : e.pageX;
- }
- // ================================================================================
- function eventGetY(e)
- // Get the event mouse ordinate
- // e [event]
- {
- return _ie?_curWin.event.clientY: e.clientY ? e.clientY : e.pageY;
- }
- // ================================================================================
- function xpos(o,e,doc,zoom)
- {
- if ((zoom==null)||(!_ie))
- zoom=1;
-
- return ((e.clientX/zoom)-getPos(o).x)+getScrollX();
- }
-
- // ================================================================================
- function ypos(o,e,doc,zoom)
- {
- if ((zoom==null)||(!_ie))
- zoom=1
- return ((e.clientY/zoom)-getPos(o).y)+(_ie?doc.body.scrollTop:0)
- }
- // ================================================================================
- function absxpos(e,zoom)
- {
- if ((zoom==null)||(!_ie)) {
- return e.clientX
- } else {
- return e.clientX/zoom
- }
- }
- // ================================================================================
- function absypos(e,zoom)
- {
- if ((zoom==null)||(!_ie)) {
- return e.clientY
- } else {
- return e.clientY/zoom
- }
- }
- // ================================================================================
- function eventCancelBubble(e,win)
- // Cancels event bubbling
- // e [event]
- {
-
- win=win?win:_curWin
- var ev =_ie? win.event : e;
- if(ev) {
- ev.cancelBubble = true;
- if(ev.stopPropagation) ev.stopPropagation();
- }
- }
- // ================================================================================
- function isHidden(lyr)
- // Test if a layer is hidden
- // lyr [layer]
- // return [boolean]
- {
- if ((lyr==null)||(lyr.tagName=="BODY")) return false;var sty=lyr.style;if ((sty==null)||(sty.visibility==_hide)||(sty.display=='none')) return true;return isHidden(lyr.parentNode)
- }
- // ================================================================================
- function opt(val,txt,sel)
- // get an option tag
- // val [String] the option value
- // txt [String] the option text
- // sel [boolean optional] set it selected
- // return [String]
- {
- return '<option value="'+val+'" '+(sel?'selected':'')+'>'+convStr(''+txt)+'</option>'
- }
- // ================================================================================
- function lnk(inner,clickCB,cls,id,att,dblClickCB)
- // writes a A link tag
- // inner [String] inner HTML
- // clickCB [String] click callback
- // cls [String] CSS class
- // id [String] tag ID
- // dblClickCB [String] double click callback
- {
- if (clickCB==null)
- clickCB="return false"
- att=att?att:'';return '<a'+attr('class',cls)+attr('id',id)+attr('href','javascript:void(0)')+attr('onclick',clickCB)+attr('ondblclick',dblClickCB)+att+'>'+inner +'</a>'
- }
- // ================================================================================
- _oldErrHandler=null
- function localErrHandler()
- {
- return true
- }
- // ================================================================================
- function canScanFrames(w)
- // PRIVATE
- {
- //_excludeFromFrameScan variable is set by a frame that does not want to
- // be scaned, when the frame is used to download document for instance.
-
- var ex=true,d=null
-
- if (_moz)
- {
- _oldErrHandler=window.onerror
- window.onerror=localErrHandler
- }
-
- try
- {
- d=w.document
- //if ((d!=null&&(typeof(d)).toLowerCase()!="unknown"))
- //ex=(w._excludeFromFrameScan==true)?w._excludeFromFrameScan:false
- ex=false
- }
- catch(expt)
- {
- }
- if (_moz)
- window.onerror=_oldErrHandler
- return (!ex&&(d!=null))
- }
- // ================================================================================
- function restoreAllInputs(win,level)
- // restore inputs
- {
- if (_ie&&_curWin._inptStackLevel!=null)
- {
- win=win?win:_curWin
- //_excludeFromFrameScan variable is set by a frame that does not want to
- // be scaned, when the frame is used to download document for instance.
-
- if (canScanFrames(win))
- {
- if (level==null)
- level=--_curWin._inptStackLevel
- var b=win.document.body,arr=b?b.getElementsByTagName("SELECT"):null,len=arr?arr.length:0
- for (var i=0;i<len;i++)
- {
- var inpt=arr[i]
- if (inpt._boHideLevel==level)
- {
- inpt.style.visibility=inpt._boOldVis
- inpt._boHideLevel=null
- }
- }
- // Process sub frames
- var frames=win.frames,flen=frames.length
- for (var k=0;k<flen;k++)
- restoreAllInputs(frames[k],level)
- }
- }
- }
- // ================================================================================
- function hideAllInputs(x,y,w,h,win,level)
- // Hide all inputs. If parameters passed, only in the specified rectangle
- // x [int optional] the rectangle abscissa
- // y [int optional] the rectangle ordinate
- // w [int optional] the rectangle width
- // h [int optional] the rectangle height
- {
- if (_ie)
- {
- win=win?win:_curWin
- //_excludeFromFrameScan variable is set by a frame that does not want to
- // be scaned, when the frame is used to download document for instance.
-
- if (canScanFrames(win))
- {
- var b=win.document.body,arr=b?b.getElementsByTagName("SELECT"):null,len=arr?arr.length:0
- if (level==null)
- {
- if (_curWin._inptStackLevel==null)
- _curWin._inptStackLevel=0
- level=_curWin._inptStackLevel++
- }
- for (var i=0;i<len;i++)
- {
- var inpt=arr[i],css=inpt.style;
- var inter=(x==null)||isLayerIntersectRect(inpt,x,y,w,h)
- if (!isHidden(inpt)&&inter)
- {
- inpt._boHideLevel=level
- inpt._boOldVis=css.visibility
- css.visibility=_hide
- }
- }
- // Process sub frames
- var frames=win.frames,flen=frames.length
- for (var k=0;k<flen;k++)
- hideAllInputs(null,null,null,null,frames[k],level)
- }
- }
- }
- // ================================================================================
- function getBGIframe(id)
- {
- return '<iframe id="'+id+'" name="'+id+'" style="display:none;left:0px;position:absolute;top:0px" src="' + _skin + '../../empty.html' + '" frameBorder="0" scrolling="no"></iframe>'
- }
- function getDynamicBGIFrameLayer()
- {
- var recycle=false
- if (_curWin.BGIFramePool)
- {
- BGIFrames = _curWin.BGIFramePool.split(",")
- BGIFCount = BGIFrames.length
- for (var id = 0; id < BGIFCount; id++) {
- if (BGIFrames[id] != "1") {
- recycle=true
- break
- }
- }
- } else {
- id = 0
- BGIFrames = new Array
- }
- BGIFrames[id] = "1"
- _curWin.BGIFramePool = BGIFrames.join(",")
- if (!recycle) {
- targetApp(getBGIframe("BGIFramePool_" + id))
- }
- return getLayer("BGIFramePool_" + id)
- }
- function holdBGIFrame(layerId) {
- var l = getLayer(layerId)
- if (l) {
- l.style.display=""
- }
- id = parseInt(layerId.split('_')[1])
- BGIFrames = _curWin.BGIFramePool.split(",")
- BGIFrames[id]=1
- _curWin.BGIFramePool = BGIFrames.join(",")
- }
- function releaseBGIFrame(layerId) {
- var l = getLayer(layerId)
- if (l) {
- l.style.display="none"
- }
- id = parseInt(layerId.split('_')[1])
- BGIFrames = _curWin.BGIFramePool.split(",")
- BGIFrames[id]=0
- _curWin.BGIFramePool = BGIFrames.join(",")
- }
- // ================================================================================
- // ================================================================================
- function append(e,s,c)
- // inserts HTML BEFORE the end of a given layer
- // e [layer] the layer
- // s [String] the HTML
- // c curDoc
- {
-
- if (_ie)
- e.insertAdjacentHTML("BeforeEnd",s)
- else
- {
- var curDoc = c?c:_curDoc
- var r=curDoc.createRange()
- r.setStartBefore(e)
- var frag=r.createContextualFragment(s)
- e.appendChild(frag)
- }
- }
- // ================================================================================
- function append2(e,s,c)
- // fixes IE's problem of appending elements to an element that hasn't been completely loaded
- // inserts HTML BEFORE the end of a given layer
- // e [layer] the layer
- // s [String] the HTML
- // c curDoc
- {
-
- if (_ie)
- e.insertAdjacentHTML("afterBegin",s)
- else
- {
- var curDoc = c?c:_curDoc
- var r=curDoc.createRange()
- r.setStartBefore(e)
- var frag=r.createContextualFragment(s)
- e.appendChild(frag)
- }
- }
- // ================================================================================
- function insBefore(e,s,c)
- // inserts HTML AFTER the end of a given layer
- // e [layer] the layer
- // s [String] the HTML
- {
- if (_ie)
- e.insertAdjacentHTML("BeforeBegin",s)
- else
- {
- var curDoc = c?c:_curDoc
- var r=_curDoc.createRange()
- r.setEndBefore(e)
- var frag=r.createContextualFragment(s)
- e.parentNode.insertBefore(frag,e)
- }
- }
- // ================================================================================
- function insBefore2(e,s,c)
- // Fixes Safari's problem of inserting HTML string before an element
- // inserts HTML AFTER the end of a given layer
- // e [layer] the layer
- // s [String] the HTML
- {
- if (_ie)
- e.insertAdjacentHTML("BeforeBegin",s)
- else
- {
- var curDoc = c?c:_curDoc
- var r=_curDoc.createRange()
- r.setStartBefore(e)
- var frag=r.createContextualFragment(s)
- e.parentNode.insertBefore(frag,e)
- }
- }
- // ================================================================================
- function targetApp(s)
- // Add HTML code at the end of the body
- // s [String] the HTML
- {
- append(_curDoc.body,s)
- }
- // ================================================================================
- function getBasePath()
- // Get the url path of the document WITHOUT the page name
- // Return [String] the path
- {
- var url=document.location.href,last1= url.lastIndexOf('?');if (last1>=0) url=url.slice(0,last1);var last = url.lastIndexOf('/');return (last>=0)?url.slice(0,last+1):url
- }
- // ================================================================================
- function isLayerIntersectRect(l,x1,y1,w,h)
- // Test if a layer intersection with a rectangle if non empty
- // l [layer]
- // x1 [int optional] the rectangle abscissa
- // y1 [int optional] the rectangle ordinate
- // w [int optional] the rectangle width
- // h [int optional] the rectangle height
- {
- var xl1=getPos(l).x,yl1=getPos(l).y,xl2=xl1+l.offsetWidth,yl2=yl1+l.offsetHeight,x2=x1+w,y2=y1+h
- return ((x1>xl1)||(x2>xl1))&&((x1<xl2)||(x2<xl2)) && ((y1>yl1)||(y2>yl1))&&((y1<yl2)||(y2<yl2))
- }
- // ================================================================================
- function preloadImg(url)
- // preload an image
- // url [String] the image URL
- {
- var img=_preloadArr[_preloadArr.length]=new Image;img.src=url
- }
- // ================================================================================
- function convURL(str)
- {
- if (_dontNeedEncoding == null)
- {
- //first time call for this page, generates "static" variables
- _dontNeedEncoding = new Array(256);
- for (var i = 0 ; i < 256 ; i++) _dontNeedEncoding[i] = false;
- for (var i = (new String('a')).charCodeAt(0); i <= (new String('z')).charCodeAt(0); i++) _dontNeedEncoding[i] = true;
- for (var i = (new String('A')).charCodeAt(0); i <= (new String('Z')).charCodeAt(0); i++) _dontNeedEncoding[i] = true;
- for (var i = (new String('0')).charCodeAt(0); i <= (new String('9')).charCodeAt(0); i++) _dontNeedEncoding[i] = true;
- _dontNeedEncoding[(new String(' ')).charCodeAt(0)] = true; /* encoding a space to a + is done in the encode() method */
- _dontNeedEncoding[(new String('-')).charCodeAt(0)] = true;
- _dontNeedEncoding[(new String('_')).charCodeAt(0)] = true;
- _dontNeedEncoding[(new String('.')).charCodeAt(0)] = true;
- _dontNeedEncoding[(new String('*')).charCodeAt(0)] = true;
- _thex = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
- }
- var encstr = "";
- for (var i = 0 ; i < str.length ; i++) encstr += URLEncodeUTF8Char(str.charAt(i));
- return encstr;
- }
- // ================================================================================
- function URLEncodeUTF8Char(c)
- {
- var unicodeval = c.charCodeAt(0);
- if (unicodeval < 128)
- {
- //first case should generate a simple byte with high bit at 0 (7 bit ASCII US)
- if (_dontNeedEncoding[unicodeval]) return (c == ' ' ? '+' : c);
- else return ("%" + _thex[unicodeval >> 4] + _thex[unicodeval & 15]);
- }
- else if (unicodeval < 2048)
- {
- //on 2 bytes 110xxxxx 10xxxxxx
- return ("%" + _thex[(unicodeval >> 10) | 12]
- + _thex[(unicodeval >> 6) & 15]
- + "%" + _thex[(unicodeval >> 4) & 3 | 8]
- + _thex[unicodeval & 15]);
- }
- else
- {
- //on 3 bytes 1110xxxx 10xxxxxx 10xxxxxx
- return ("%" + _thex[14]
- + _thex[unicodeval >> 12]
- + "%" + _thex[(unicodeval >> 10) & 3 | 8]
- + _thex[(unicodeval >> 6) & 15]
- + "%" + _thex[(unicodeval >> 4) & 3 | 8]
- + _thex[unicodeval & 15]);
- }
- }
- // ================================================================================
- function encString(s)
- // encString() allows to serialize collections of
- // string with beginnig by "[", terminated with "]"
- // and using "," as separator.
- // s [String] the string to encode
- // return [String] the encoded string
- {
- var res=''
- if (s!=null)
- {
- var len=s.length
- for (var i=0;i<len;i++)
- {
- var c=s.charAt(i)
- switch (c)
- {
- case '$': res+='$3'; break
- case ',': res+='$4'; break
- case '[': res+='$5'; break
- case ']': res+='$6'; break
- default: res+=c; break
- }
- }
- }
- return res
- }
- // ================================================================================
- function enc()
- // Encode several values
- // Variable number of parameters
- {
- var args=enc.arguments,len=args.length,s='['
- if (len>0) s+=args[0]
- for (var i=1;i<len;i++) s+=','+args[i]
- return s+']'
- }
- // ================================================================================
- //remove space caracters around a string
- function remSpaceAround(s)
- {
- var len = s.length;
- if(len<=0) return "";
- var start=0,end=len
- var c=s.substr(start,1);
- while (c==' ' && start<len)
- {
- start++
- c=s.substr(start,1);
- }
- if(start<len)
- {
- c=s.substr(end-1,1);
- while (c==' ')
- {
- end--
- c=s.substr(end-1,1);
- }
- }
- var sub = s.substring(start,end);
- // alert(sub.length +"-"+sub)
- return sub
- }
- // ================================================================================
- function getArrows(upCb,downCB,hori,newNode,newNodeCB)
- // OBSOLETE
- // Get the HTML String for move buttons if a list
- // upCb [String] : callback string when pushing the up (rep left if hori == true) button
- // downCb [String] : callback string when pushing the down (rep right if hori == true) button
- // hori [Boolean - optional, default is false] : if true, display left & right arrows. Else display top & bottom arrows.
- // Return [String] the HTML
- {
- if (hori==null) hori=false;
- var s=''
- if (hori) s+='<nobr>'
- s+=lnk(img(_skin+(hori?'left.gif':'up.gif'),12,12,'top',null,hori?"_LEFT ARROW":"_UP ARROW"),upCb,null,null,null,(_moz?null:upCb))
- s+=(hori?'':img(_skin+'../transp.gif',1,5)+'<br>')
- s+=lnk(img(_skin+(hori?'right.gif':'down.gif'),hori?11:12,hori?12:11,'top',null,hori?"_RIGHT ARROW":"_LEFT ARROW"),downCB,null,null,null,(_moz?null:downCB))
- if (newNode)
- {
- s+=img(_skin+'../transp.gif',1,5)+'<br>'
- s+=lnk(img(_skin+('node.gif'),12,12,'top',null,"_NEW NODE"),newNodeCB,null,null,null,(_moz?null:newNodeCB))
- }
- if (hori) s+='</nobr>'
- return s
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT newBlockWhileWait (Constructor)
- //
- // Class for dialog box
- //
- // ================================================================================
- // ================================================================================
- _staticUnicBlockWhileWaitWidgetID = "staticUnicBlockWhileWaitWidgetID"
- function hideBlockWhileWaitWidget()
- {
- var lyr=getLayer(_staticUnicBlockWhileWaitWidgetID)
- if (lyr)
- lyr.style.display="none"
- }
- function newBlockWhileWaitWidget(urlImg)
- // Return [TooltipWidget] the instance
- {
- if (window._BlockWhileWaitWidget!=null)
- return window._BlockWhileWaitWidget
- var o=newWidget(_staticUnicBlockWhileWaitWidgetID)
- o.getPrivateHTML=BlockWhileWaitWidget_getPrivateHTML
- o.init=BlockWhileWaitWidget_init
- o.show=BlockWhileWaitWidget_show
- window._BlockWhileWaitWidget=o
- return o
- }
- // ================================================================================
- function BlockWhileWaitWidget_init()
- {
- //cancels the default init behaviour
- }
- // ================================================================================
- function BlockWhileWaitWidget_getPrivateHTML()
- // Returns [String] the HTML
- {
- return '<div id="'+ this.id+'" onselectstart="return false" ondragstart="return false" onmousedown="'+_codeWinName+'.eventCancelBubble(event)" border="0" hspace="0" vspace="0" style="background-image:url('+_skin+'../transp.gif);z-index:5000;cursor:wait;position:absolute;top:0px;left:0px;width:100%;height:100%"></div>'
- }
- // ================================================================================
- function BlockWhileWaitWidget_show(show)
- // show [boolean] true for showing the tooltip
- {
- var o=this
- // object not init yet, 2 cases
- if (o.layer==null)
- {
- o.layer=getLayer(o.id)
- // another instance hasn't written it's HTML yet
- if (o.layer==null)
- {
- targetApp(o.getPrivateHTML())
- o.layer=getLayer(o.id)
- o.css=o.layer.style
- }
- else
- { // convenient use of css property
- o.css=o.layer.style
- }
- }
- o.setDisplay(show)
- }
- /*
- // ================================================================================
- // like Request.QueryString function
- // ================================================================================
- function RObj(ea){var LS="";var QS=new Object();var un="undefined";var f="function";var n="number";var r="string";var e1="ERROR:Index out of range in\r\nRequest.QueryString";var e2="ERROR:Wrong number of arguments or invalid property assignment\r\nRequest.QueryString";var e3="ERROR:Object doesn't support this property or method\r\nRequest.QueryString.Key";
- function Err(arg){if(ea)alert("Request Object:\r\n"+arg)};
- function URID(t){var d="";if(t){for(var i=0;i<t.length;++i){var c=t.charAt(i);d+=(c=="+"?" ":c);};};return unescape(d);};
- function OL(o){var l=0;for(var i in o){if(typeof(o[i])!=f) l++;};return l;};
- function AK(key){var auk=true;for(var u in QS){if(typeof(QS[u])!=f&&u.toString().toLowerCase()==key.toLowerCase()){auk=false;return u;}};if(auk){QS[key]=new Object();QS[key].toString=function(){return TS(QS[key])};QS[key].Count=function(){return OL(QS[key])};QS[key].Count.toString=function(){return OL(QS[key]).toString()};QS[key].Item=function(e){if(typeof(e)==un) return QS[key];else {if(typeof(e)==n){var a=QS[key][Math.ceil(e)];if(typeof(a)==un) Err(e1+"(\""+key+"\").Item("+e+")");return a;}else Err("ERROR:Expecting numeric input in\r\nRequest.QueryString(\""+key+"\").Item(\""+e+"\")");}};QS[key].Item.toString=function(e){if(typeof(e)==un) return QS[key].toString();else {var a=QS[key][e];if(typeof(a)==un) Err(e1+"(\""+key+"\").Item("+e+")");return a.toString();};};QS[key].Key=function(e){var t=typeof(e);if(t==r){var a=QS[key][e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e3+"("+(e?e:"")+")");};QS[key].Key.toString=function(){return un};};return key};
- function AVTK(key,val){if(key!=""){var key=AK(key);var l=OL(QS[key]);QS[key][l+1]=val;}};
- function TS(o){var s="";for(var i in o){var ty=typeof(o[i]);if(ty=="object") s+=TS(o[i]);else if(ty!=f) s+=o[i]+", ";};var l=s.length;if(l>1)return(s.substring(0,l-2));return(s==""?un:s);};
- function KM(k,o){var k=k.toLowerCase();for(var u in o){if(typeof(o[u])!=f&&u.toString().toLowerCase()==k) return u;};}if(window.location&&window.location.search){LS=window.location.search;var l=LS.length;if(l>0){LS=LS.substring(1,l);var preAmpAt=0;var ampAt=-1;var eqAt=-1;var k=0;var skip=false;for(var i=0;i<l;++i){var c=LS.charAt(i);if(LS.charAt(preAmpAt)=="="||(preAmpAt==0&&i==0&&c=="=")) skip=true;if(c=="="&&eqAt==-1&&!skip) eqAt=i;if(c=="&"&&At==-1){if(eqAt!=-1) ampAt=i;if(skip) preAmpAt=i+1;skip=false;};if(ampAt>eqAt){AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,ampAt)));preAmpAt=ampAt+1;eqAt=ampAt=-1;++k;};};if(LS.charAt(preAmpAt)!="="&&(preAmpAt!=0||i!=0||c!="=")){if(preAmpAt!=l){if(eqAt!=-1) AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,l)));else if(preAmpAt!=l-1) AVTK(URID(LS.substring(preAmpAt,l)),"");};if(l==1) AVTK(LS.substring(0,1),"");};};};var TC=OL(QS);if(!TC) TC=0;QS.toString=function(){return LS.toString()};QS.Count=function(){return(TC?TC:0)};QS.Count.toString=function(){return(TC?TC.toString():"0")};QS.Item=function(e){if(typeof(e)==un) return LS;else {if(typeof(e)==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return QS[i];};Err(e1+"().Item("+e+")");}else return QS[KM(e,QS)];};return un;};QS.Item.toString=function(){return LS.toString()};QS.Key=function(e){var t=typeof(e);if(t==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return i;}}else if(t==r){var e=KM(e,QS);var a=QS[e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e2+"().Key("+(e?e:"")+")");Err(e1+"().Item("+e+")");};QS.Key.toString=function(){Err(e2+"().Key");};this.QueryString=function(k){if(typeof(k)==un) return QS;else {var k=KM(k,QS);if(typeof(QS[k])==un){t=new Object();t.Count=function(){return 0};t.Count.toString=function(){return "0"};t.toString=function(){return un};t.Item=function(e){return un};t.Item.toString=function(){return un};t.Key=function(e){Err(e3+"("+(e?e:"")+")");};t.Key.toString=function(){return un};return t;}if(typeof(k)==n) return QS.Item(k);else return QS[k];}};this.QueryString.toString=function(){return LS.toString();};this.QueryString.Count=function(){return(TC?TC:0)};this.QueryString.Count.toString=function(){return(TC?TC.toString():"0")};this.QueryString.Item=function(e){if(typeof(e)==un) return LS.toString();else {if(typeof(e)==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return QS[i];};Err(e1+".Item("+e+")");}else return QS[KM(e,QS)];}if(typeof(e)==(n)) Err(e1+".Item("+e+")");return un;};this.QueryString.Item.toString=function(){return LS.toString()};this.QueryString.Key=function(e){var t=typeof(e);if(t==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])=="object"&&(++c==e)){return i;}}}else if(t==r){var e=KM(e,QS);var a=QS[e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e2+".Key("+(e?e:"")+")");Err(e1+".Item("+e+")");};this.QueryString.Key.toString=function(){Err(e2+".Key");};this.Version=1.2;this.Author="Andrew Urquhart (www.andrewu.co.uk)";};var Request=new RObj(false);
- */
- var regLang= /^[a-zA-Z]{2}$|^[a-zA-Z]{2}_[a-zA-Z]{2}$/, regIntPos=/^\d+$/, regYes=/^yes$/, regPath=/^[\w|\/|:|.|-]+$/, regAlphanumDot=/^\w+\.+\w+$/, regAlphanumDotEx=/^\w+\.*\w+\.*\w+$/
- var paramRegs = new Array()
- paramRegs["ID"]=regAlphanumDot
- paramRegs["allTableCells"]=regYes
- paramRegs["gotoPivot"]=regYes
- paramRegs["reportIndex"]=regIntPos
- paramRegs["fromLPane"]=regYes
- paramRegs["skin"]=regPath
- paramRegs["lang"]=regLang
- paramRegs["noGrabber"]=regYes
- paramRegs["isFormulaEdit"]=regYes
- paramRegs["fromQuery"]=regYes
- paramRegs["isFromHyperlinkEditor"]=regYes
- paramRegs["iAction"]=regIntPos
- paramRegs["callback"]=regAlphanumDotEx
- paramRegs["callbackin"]=regAlphanumDotEx
- paramRegs["callbackout"]=regAlphanumDotEx
- function requestQueryString(win, par){
- params = win.location.search.substr(1).split("&")
- for(i=0;i<params.length;i++){
- var param = params[i].split("="), key = param[0], val = param[1]
- if (key == par){
- var reg = new RegExp(paramRegs[key])
- if ((val == "") || (reg.test(val))) {
- return val
- } else {
- //alert("bad param error, val=" + val + ", key=" + key)
- // the following code is not library independant at all...
- var tpfs = getTopFrameset()
- if (tpfs != null) {
- tpfs._dontCloseDoc=true
- tpfs.document.location.replace(tpfs._root+"html/badparamserror.html");
- } else {
- tpfs=getTopFrameset(window.opener)
- if (tpfs != null)
- {
- document.location.replace(tpfs._skin+"../../../html/badparamserror.html");
- }
- }
- }
- }
- }
- }
- // ================================================================================
- // Manipulating String function
- // ================================================================================
- function trim(strString) {
- if (strString != null) {
- var iLength = strString.length;
- //Left side
- var i;
- for (i=0; i<iLength; i++) {
- if (strString.charAt(i) != " ") {
- break;
- }
- }
- strString = strString.substring(i);
- iLength = strString.length;
- //Right Side
- for (i=iLength; i>0; i--) {
- if (strString.charAt(i-1) != " ") {
- break;
- }
- }
- strString = strString.substring(0,i);
- }
- return strString;
- }
- function startsWithIgnoreCase(strString, strToFind) {
- var blnRet = false;
- if (strToFind != null) {
- var strVar = strString.substring(0, strToFind.length);
- if (strVar.toLowerCase() == strToFind.toLowerCase()) {
- blnRet = true;
- }
- }
- return blnRet;
- }
- function endsWithIgnoreCase(strString, strToFind) {
- var blnRet = false;
- if (strToFind != null) {
- var iRight = strString.length- strToFind.length;
- if (iRight >= 0) {
- var strVar = strString.substring(iRight);
- if (strVar.toLowerCase() == strToFind.toLowerCase()) {
- blnRet = true;
- }
- }
- }
- return blnRet;
- }
- // ================================================================================
- function isTextInput(ev)
- {
- var source = _ie?ev.srcElement:ev.target;
- var isText=false;
- if(source.tagName=="TEXTAREA")
- isText=true
- if((source.tagName=="INPUT") && (source.type.toLowerCase()=="text"))
- isText=true
-
- return isText;
- }
- function isTextArea(ev)
- {
- var source = _ie?ev.srcElement:ev.target;
- if(source.tagName=="TEXTAREA")
- return true;
- else
- return false;
- }
- // function shrink text, used for tooltip, because a too long tooltip flickers ADAPT00465457
- // max n chars ?
- function shrinkTooltip(t,n)
- {
- var n = n?n:360
- return (t.length < n)? t : (t.substring(0,n) + "...")
- }
-
- // ================================================================================
- // ================================================================================
- //
- // Functions to format a date
- //
- // ================================================================================
- // ================================================================================
- function setDateValue(strDateValue, strInputFormat)
- {
- var strRet = ",,";
- var strYear = "";
- var strMonth = "";
- var strDay = "";
- //Get separator
- var length = strInputFormat.length;
- var sep = "";
- for (var i=0; i<length; i++)
- {
- var c = strInputFormat.charAt(i);
- switch(c)
- {
- case "/":
- case "-":
- case ".":
- case ",":
- case "\"": sep = c; break;
- }
- if (sep != "") break;
- }
- if (sep != "")
- {
- var arrInputFormat = strInputFormat.split(sep);
- var arrDateValue = strDateValue.split(sep);
- for (var i=0; i<arrDateValue.length; i++)
- {
- if (arrInputFormat[i] != null && typeof(arrInputFormat[i]) != "undefined")
- {
- //Year
- if (arrInputFormat[i].indexOf('y')>=0)
- {
- var iPosA = arrInputFormat[i].indexOf('y');
- var iPosB = arrInputFormat[i].lastIndexOf('y');
- if (iPosB>=0)
- {
- strYear = arrInputFormat[i].substring(iPosA, iPosB + 1);
- if (strYear.length >= arrDateValue[i].length) strYear = arrDateValue[i];
- else
- {
- iPosB = iPosA;
- for (var j=iPosA; j<arrDateValue[i].length; j++)
- {
- var c = arrDateValue[i].charAt(j);
- if (c < '0' || c > '9') break;
- else iPosB = j + 1;
- }
- strYear = arrDateValue[i].substring(iPosA, iPosB);
- if (strYear.length <= 2)
- {
- var iYear = parseInt(strYear);
- if (iYear>=70) iYear += 1900;
- else iYear += 2000;
- strYear = iYear.toString();
- }
- }
- }
- else
- {
- return strRet;
- }
- }
- //Month
- else if (arrInputFormat[i].indexOf('M')>=0)
- {
- var iPosA = arrInputFormat[i].indexOf('M');
- var iPosB = arrInputFormat[i].lastIndexOf('M');
- if (iPosB>=0)
- {
- strMonth = arrInputFormat[i].substring(iPosA, iPosB + 1);
- if (strMonth.length >= arrDateValue[i].length) strMonth = arrDateValue[i];
- else
- {
- iPosB = iPosA;
- for (var j=iPosA; j<arrDateValue[i].length; j++)
- {
- var c = arrDateValue[i].charAt(j);
- if (c < '0' || c > '9') break;
- else iPosB = j + 1;
- }
- strMonth = arrDateValue[i].substring(iPosA, iPosB);
- }
- }
- else
- {
- return strRet;
- }
- }
- //Day
- else if (arrInputFormat[i].indexOf('d')>=0)
- {
- var iPosA = arrInputFormat[i].indexOf('d');
- var iPosB = arrInputFormat[i].lastIndexOf('d');
- if (iPosB>=0)
- {
- strDay = arrInputFormat[i].substring(iPosA, iPosB + 1);
- if (strDay.length >= arrDateValue[i].length) strDay = arrDateValue[i];
- else {
- iPosB = iPosA;
- for (var j=iPosA; j<arrDateValue[i].length; j++)
- {
- var c = arrDateValue[i].charAt(j);
- if (c < '0' || c > '9') break;
- else iPosB = j + 1;
- }
- strDay = arrDateValue[i].substring(iPosA, iPosB);
- }
- }
- else
- {
- return strRet;
- }
- }
- }
- }
- if (strMonth != "" && strDay != "" && strYear != "" && !(isNaN(strMonth) || isNaN(strDay) || isNaN(strYear)))
- {
- //Set Date
- strRet = strMonth + ',' + strDay + ',' + strYear;
- }
- }
- return strRet;
- }
- // ================================================================================
- function LZ(x) {
- return(x<0||x>9?"":"0")+x
- }
- // ================================================================================
- function formatDate(date,format)
- {
- var format=format+"";
- var result="";
- var i_format=0;
- var c="";
- var token="";
- var y=date.getFullYear()+"";
- var M=date.getMonth()+1;
- var d=date.getDate();
- var E=date.getDay();
- var H=date.getHours();
- var m=date.getMinutes();
- var s=date.getSeconds();
- var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
- // Convert real date parts into formatted versions
- var value=new Object();
- if (y.length==2) {
- if (y-0>=70) y=""+(y-0+1900);
- else y=""+(y-0+2000);
- }
- value["y"]=""+y;
- value["yyyy"]=y;
- value["yy"]=y.substring(2,4);
- value["M"]=M;
- value["MM"]=LZ(M);
- value["MMM"]=_month[M-1];
- value["NNN"]=_month[M+11];
- value["d"]=d;
- value["dd"]=LZ(d);
- value["E"]=_day[E+7];
- value["EE"]=_day[E];
- value["H"]=H;
- value["HH"]=LZ(H);
- if (H==0){value["h"]=12;}
- else if (H>12){value["h"]=H-12;}
- else {value["h"]=H;}
- value["hh"]=LZ(value["h"]);
- if (H>11){value["K"]=H-12;} else {value["K"]=H;}
- value["k"]=H+1;
- value["KK"]=LZ(value["K"]);
- value["kk"]=LZ(value["k"]);
- if (H > 11) { value["a"]=_PM; value["aa"]=_PM;; }
- else { value["a"]=_AM; value["aa"]=_AM; }
- value["m"]=m;
- value["mm"]=LZ(m);
- value["s"]=s;
- value["ss"]=LZ(s);
- while (i_format < format.length) {
- c=format.charAt(i_format);
- token="";
- while ((format.charAt(i_format)==c) && (i_format < format.length)) {
- token += format.charAt(i_format++);
- }
- if (value[token] != null) { result=result + value[token]; }
- else { result=result + token; }
- }
- return result;
- }
- // ================================================================================
- // ================================================================================
- //
- // Search Widget
- //
- // ================================================================================
- // ================================================================================
- function newSearchWidget(id,w,searchCB,helpText)
- {
- var o=newWidget(id)
-
- o.bMatchCase = false;
-
- o.searchField = newTextFieldWidget(id+"_searchVal",null,50,SearchWidget_keyUpCB,SearchWidget_searchCB,true,_lovSearchFieldLab,w?(w-40):null);
- o.searchField.par = o;
- o.searchField.setHelpTxt(helpText?helpText:_lovSearchFieldLab);
-
- o.searchIcn = newIconMenuWidget(id+"_searchIcn",_skin+'../lov.gif',SearchWidget_searchCB,null,_lovSearchLab,16,16,0,0,0,0)
- o.searchIcn.par = o
- o.searchMenu = o.searchIcn.getMenu()
- o.normal = o.searchMenu.addCheck(id+"normal",_lovNormalLab,SearchWidget_normalClickCB)
- o.matchCase = o.searchMenu.addCheck(id+"matchCase",_lovMatchCase,SearchWidget_matchCaseClickCB)
-
- o.oldInit = o.init
- o.searchCB = searchCB
- o.init = SearchWidget_init
- o.getHTML = SearchWidget_getHTML
- o.setCaseSensitive = SearchWidget_setCaseSensitive
- o.isCaseSensitive = SearchWidget_isCaseSensitive
- o.updateMatchCase = SearchWidget_updateMatchCase
- o.getSearchValue = SearchWidget_getSearchValue;
- o.setSearchValue = SearchWidget_setSearchValue;
- o.resize = SearchWidget_resize;
-
- return o;
- }
- function SearchWidget_getHTML()
- {
- var o=this, s =''
- s= '<table id="'+o.id+'" border="0" cellspacing="0" cellpadding="0"><tbody>' +
- '<tr>' +
- '<td>' + o.searchField.getHTML() + '</td>' +
- '<td>' + o.searchIcn.getHTML() + '</td>' +
- '</tr>' +
- '</tbody></table>';
-
- return s
- }
- function SearchWidget_resize(w,h)
- {
- var o = this
-
- o.searchField.resize(w-40,h);
- }
- function SearchWidget_init()
- {
- var o=this
-
- o.oldInit();
- o.searchField.init()
- o.searchIcn.init()
- o.searchIcn.setDisabled((o.searchField.getValue()=='')) // Disabled if no value set on loading widget
- o.updateMatchCase(o.bMatchCase)
- }
- // function isCaseSensitive
- // indicates if the option is checked
- function SearchWidget_isCaseSensitive()
- // return [boolean] true if the option is checked
- {
- return this.bMatchCase;
- }
- // function setCaseSensitive
- // check or uncheck the match case checkbox
- // update the icon
- function SearchWidget_setCaseSensitive(b)
- // b [boolean] used as is
- {
- var o=this
-
- if(o.bMatchCase!=b)
- {
- o.updateMatchCase(b);
- o.bMatchCase=b;
- }
- }
- function SearchWidget_updateMatchCase(b)
- {
- var o=this
-
- o.normal.check(!b)
- o.matchCase.check(b)
-
- if (b)
- o.searchIcn.icon.changeImg(55,0) // match case icon
- else
- o.searchIcn.icon.changeImg(0,0) // normal icon
- }
- function SearchWidget_normalClickCB()
- {
- var o=this.par.parIcon.par
-
- if(o.bMatchCase)
- o.bMatchCase=false;
-
- o.updateMatchCase(o.bMatchCase);
- }
- function SearchWidget_matchCaseClickCB()
- {
- var o=this.par.parIcon.par
-
- if(!o.bMatchCase)
- o.bMatchCase=true;
-
- o.updateMatchCase(o.bMatchCase);
- }
- function SearchWidget_keyUpCB()
- {
- var p=this.par
-
- p.searchIcn.setDisabled((this.getValue()==''))
- }
- function SearchWidget_searchCB()
- {
- var p=this.par;
-
- if (p.searchCB != null)
- p.searchCB();
- }
- // getSearchValue()
- // Return the value inserted in the search text field
- function SearchWidget_getSearchValue()
- // return a string with the value entered in the search field
- {
- var o=this;
- return o.searchField.getValue();
- }
- // setSearchValue(s)
- // Set the value of the search text field
- function SearchWidget_setSearchValue(s)
- // s [String] string that will be displayed in the textfield
- {
- var o=this;
- o.searchField.setValue(s);
- }
- // ================================================================================
- // ================================================================================
- //
- // OBJECT ToggleButtonWidget (Constructor)
- //
- // Class for building push buttons
- //
- // ================================================================================
- // ================================================================================
- /*
- function newToggleButtonWidget(id,label,cb,width,hlp,tooltip,tabIndex,margin,url,w,h,dx,dy,imgRight,disDx,disDy,togX,togY)
- {
- // CONSTRUCTOR
- // id [String] button ID
- // label [String Optional] button label
- // w [int optional] : text zone minimal width
- // hlp OBSOLETE
- // tooltip [String Optional] button tooltip
- // tabIndex [int Optional] for 508/IE : tab index for keyboard navigation
- // url [String Optional] : the combined image url
- // w [int Optional] the visible image part width
- // dx [int Optional] the horizontal offset in image
- // dy [int Optional] the vertical offset in image
- // disDx : [int - optional] horizontal offset for disabled state
- // disDy : [int - optional] vertical offset for disabled state
- var o=newButtonWidget(id,label,cb,width,hlp,tooltip,tabIndex,margin,url,w,h,dx,dy,imgRight,disDx,disDy)
- o.togX = togX
- o.togY = togY
- o.checked=false
- o.executeCB=ToggleButtonWidget_executeCB
- o.check=ToggleButtonWidget_check
- o.isChecked=ToggleButtonWidget_isChecked
- o.init=ButtonWidget_init
- return o
- }
- // ================================================================================
- function ToggleButtonWidget_executeCB()
- // PRIVATE internal click event handler
- {
- var o=this
-
- o.check(!o.checked) // toggle
-
- if (o.cb)
- {
- if (typeof o.cb!="string")
- o.cb()
- else
- eval(o.cb)
- }
- }
- function ToggleButtonWidget_check(checked)
- // check or uncheck an icon check widget
- // check : [boolean] specified if the check icon must be checked or not
- {
- var o=this
-
- if (o.checked != checked)
- {
- o.checked=checked
- if (o.checked)
- {
- changeSimpleOffset(o.icn,o.togX,o.togY,o.url)
- } else {
- changeSimpleOffset(o.icn,o.dx,o.dy,o.url);
- }
- }
-
- if (o.checked&&o.beforeClickCB)
- {
- if (o.layer)
- o.beforeClickCB()
- }
- }
- // ================================================================================
- function ToggleButtonWidget_isChecked()
- // return true if checked
- {
- return this.checked
- }
- */
|