LF="\n"; // Adds trim function to string object. String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); }; //String.prototype.trim = function() { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1");}; function doBlink() { var blk = document.all.tags("BLINK") if(blk!=null && blk!='undefined') for (var i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0) for(var i = 0; i < mynbHides; i++) myppHideSelect[i].style.visibility = "visible"; } function myHideElms(elmTag, nonHideTagName) { mynbHides=0; for (i=0; i=0) c=''; else c=46; }else if(c >= n0 && c < n0+11){ if(v0>=0 && len >= v0+3) c='' else if(v0<0 && len>=l) c=''; }else c=''; event.keyCode=c; } function fltrduree(obj){ var l=3; var c=event.keyCode; var n0=0x30; v0=obj.value.indexOf(':'); len=obj.value.length; if(c==44 || c==46 || c==58){// ',' || '.' if(v0>=0) c=''; else c=58;//':' }else if(c >= n0 && c < n0+11){ if(v0>=0 && len >= v0+3) c='' else if(v0<0 && len>=l) c=''; }else c=''; event.keyCode=c; } //////////////////// // tbMask v1.1 // // Textbox 'masking' on client-side in Internet Explorer. // // Written By John McGlothlin - April 17th, 2004 // Mask Characters // 9 = Numeric only // A = Alpha only // X = Alphanumeric // // All other chars treated as literals. // // Modified, debugged by Daniel Schott - 24/07/2004 // var CTRL_PASTE = 22; var CTRL_COPY = 3; var CTRL_CUT = 24; var TAB_KEY = 9; var DELETE_KEY = 46; var BACKSPACE_KEY = 8; var ENTER_KEY = 13; var RIGHT_ARROW_KEY = 39; var DOWN_ARROW_KEY = 40; var UP_ARROW_KEY = 38; var LEFT_ARROW_KEY = 37; var HOME_KEY = 36; var END_KEY = 35; var PAGEUP_KEY = 33; var PAGEDOWN_KEY = 34; var CAPS_LOCK_KEY = 20; var ESCAPE_KEY = 27; // -------------------------------------------------------------------- // Main function // Gets the current keystroke and deals with it....lol // -------------------------------------------------------------------- function tbMask(textBox) { var keyCode = event.keyCode; // get character from keyCode....dealing with the "Numeric KeyPad" // keyCodes so that it can be used var keyCharacter = cleanKeyCode(keyCode); var retVal = false; // grab the mask var mask = textBox.mask; var c = getCursorPos(textBox); switch(keyCode){ case BACKSPACE_KEY: if(c > 0) { var currentMaskChar; // get next available char to delete except mask chars while(c > 0) { c--; currentMaskChar = mask.charAt(c); if(currentMaskChar == '9' || currentMaskChar == 'X' || currentMaskChar == 'A') { // found a spot.....replace that char with '_' var x = textBox.value.substring(0,c); var y = textBox.value.substring(c+1,textBox.value.length); textBox.value = x + '_' + y; setCursorPos(textBox,c); textBox.curPos = c; break; } } } break; case TAB_KEY: // keep track of cursor b4 tabbing out of field textBox.curPos = c; retVal = true; break; case HOME_KEY: // just move/keep track of cursor setCursorPos(textBox,0); textBox.curPos = 0; break; case END_KEY: // just move/keep track of cursor setCursorPos(textBox,textBox.value.length); textBox.curPos = textBox.value.length; break; case ENTER_KEY: retVal = true; break; case DELETE_KEY: if(c > -1) { var currentMaskChar = mask.charAt(c); // only allow delete if it's a valid char if(currentMaskChar == '9' || currentMaskChar == 'X' || currentMaskChar == 'A') { var x = textBox.value.substring(0,c); var y = textBox.value.substring(c+1,textBox.value.length); textBox.value = x + '_' + y; setCursorPos(textBox,c); textBox.curPos = c; } } break; case LEFT_ARROW_KEY: // just move/keep track of cursor if(c > 0) { setCursorPos(textBox,c-1); textBox.curPos = c-1; } break; case RIGHT_ARROW_KEY: // just move/keep track of cursor if(c < textBox.value.length) { setCursorPos(textBox,c+1); textBox.curPos = c+1; } break; default: // adding a new char somewhere in the field var currentMaskChar; // get next available to change.....except masking chars // **Si le mask est une heure, quand le texte est selectionné on permet d'effacer le champ a la saisie ************ // if (document.getSelection) sel = document.getSelection(); else if (document.selection) sel = document.selection.createRange().text; else return; if(sel.length == 5) c=0; // **************************************************************************************************************** // while(c < textBox.value.length) { currentMaskChar = mask.charAt(c); if(currentMaskChar == '9' || currentMaskChar == 'X' || currentMaskChar == 'A') break; c++; } switch(currentMaskChar){ case '9': // numeric only if('0123456789'.indexOf(keyCharacter) != -1) addNewKey(textBox,keyCharacter,c); break; case 'A': // alpha only if('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.indexOf(keyCharacter) != -1) addNewKey(textBox,keyCharacter,c); break; case 'X': // alphanumeric if('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.indexOf(keyCharacter) != -1) addNewKey(textBox,keyCharacter,c); break; default: break; } } c=getCursorPos(textBox); return retVal; } // -------------------------------------------------------------------- // Accept a TextBox, a keycharacter and an integer position // adds the key to the position and then sets cursor to next availble spot // -------------------------------------------------------------------- function addNewKey(tb,key,pos) { // add the new key to the textbox at pos var startSel = tb.value.substring(0,pos); var endSel = tb.value.substring(pos+1,tb.value.length); tb.value = startSel + key + endSel; var tbmlen = tb.mask.length; // advance cursor to next '_' while(pos < tbmlen) { pos++; curMChar = tb.mask.charAt(pos); if(curMChar == '9' || curMChar == 'X' || curMChar == 'A') break; } setCursorPos(tb,pos); tb.curPos = pos; } // -------------------------------------------------------------------- // Loops thru pasted value and checks each char against the mask // // Leaves old value and return false if *any* char is off // Creates new masked value if all pasted data is ok // -------------------------------------------------------------------- function tbPaste(textBox) { // grab the textBox value and the mask var pastedVal = window.clipboardData.getData("Text"); var mask = textBox.mask; var newVal = ''; var curPastedVal = 0; for(var i=0;i=4); this.ns4=(this.b=="ns" && this.v==4); this.ns5=(this.b=="ns" && this.v==5); this.ie=(this.b=="ie" && this.v>=4); this.ie4=(this.version.indexOf('MSIE 4')>0); this.ie5=(this.version.indexOf('MSIE 5')>0); this.ie55=(this.version.indexOf('MSIE 5.5')>0); this.ie6=(this.version.indexOf('MSIE 6')>0); this.op = (this.b=="op"); this.op4 = (this.b=="op" && this.v==4); this.op5 = (this.b=="op" && this.v==5); } at=new UserAgent(); //if you want to create the frame or layer dynamically, do not //specify a name, do something like this, new exchanger(); function exchanger(name){ //hold the dynamically created iframe or layer this.lyr = null; //to remember if the iframe or layer is created dynamically. this.isDynamic = false; this.name=name||""; this.fakeid=0; if (name == null || name==""){ this.isDynamic = true; this.create(); }else{ this.name=name; if (at.ns4) this.lyr = window.document.layers[this.name]; } } //this function should not be called directly exchanger.prototype.create=function(){ if (at.ns4){ this.lyr=new Layer(0); this.visibility = "hide"; } else if (at.ie || at.ns5){ this.lyr=document.createElement("IFRAME"); this.lyr.width=0; this.lyr.height=0; this.lyr.marginWidth=0; this.lyr.marginHeight=0; this.lyr.frameBorder=0; this.lyr.style.visibility="hidden"; this.lyr.style.position="absolute"; // this.lyr.src="javascript: ;"; // génére un popup sous https this.lyr.src="/blank.html"; this.name="tongIFrame"+window.frames.length; //this will make IE work. this.lyr.setAttribute("id",this.name); //this will make netscape work. this.lyr.setAttribute("name",this.name); // dan: TODO: investigate what's this for: document.body.appendChild(this.lyr); } } exchanger.prototype.sendData=function(url){ this.fakeid += 1; var newurl = ""; if (url.indexOf("?") >= 0) url=url+"&"; else url=url+"?"; newurl = url + "fakeId" + this.fakeid; if (this.isDynamic||at.ns4) this.lyr.src=newurl; else if (at.ie || at.ns5 || at.op) window.frames[this.name].document.location.replace(newurl); } exchanger.prototype.retrieveData=function(varName){ if (at.ns4) return eval("this.lyr." + varName); else if (at.ie || at.ns5 || at.op) return eval("window.frames['" + this.name + "']." + varName); } //// actb // Stop an event from bubbling up the event DOM function stopEvent(evt){ evt || window.event; if (evt.stopPropagation){ evt.stopPropagation(); evt.preventDefault(); }else if(evt.cancelBubble != undefined){ evt.cancelBubble = true; evt.returnValue = false; } return false; } // Get the obj that starts the event function getElement(evt){ if (window.event) return window.event.srcElement; else return evt.currentTarget; } // Get the obj that triggers off the event function getTargetElement(evt){ if (window.event) return window.event.srcElement; else return evt.target; } // For IE only, stops the obj from being selected function stopSelect(obj){ if (obj.onselectstart != undefined){ dw_event.add(obj,"selectstart",function(){ return false;}, false); } } /* Caret Functions */ // Get the end position of the caret in the object. Note that the obj needs to be in focus first function getCaretEnd(obj){ if(obj.selectionEnd != undefined){ return obj.selectionEnd; }else if(document.selection&&document.selection.createRange){ var M=document.selection.createRange(); try{ var Lp = M.duplicate(); Lp.moveToElementText(obj); }catch(e){ var Lp=obj.createTextRange(); } Lp.setEndPoint("EndToEnd",M); var rb=Lp.text.length; if(rb>obj.value.length){ return -1; } return rb; } } // Get the start position of the caret in the object function getCaretStart(obj){ if(obj.selectionStart != undefined){ return obj.selectionStart; }else if(document.selection&&document.selection.createRange){ var M=document.selection.createRange(); try{ var Lp = M.duplicate(); Lp.moveToElementText(obj); }catch(e){ var Lp=obj.createTextRange(); } Lp.setEndPoint("EndToStart",M); var rb=Lp.text.length; if(rb>obj.value.length){ return -1; } return rb; } } // sets the caret position to pos in the object function setCaret_new(obj, pos) { if(obj){ if(obj.createTextRange) { /* Create a TextRange, set the internal pointer to a specified position and show the cursor at this position */ var range = obj.createTextRange(); range.move("character", pos); range.collapse(); range.select(); } else if(obj.selectionStart) { /* Gecko is a little bit shorter on that. Simply focus the element and set the selection to a specified position */ obj.focus(); obj.setSelectionRange(pos, pos); } } } function setCaret(obj,l){ if(obj){ obj.focus(); if (obj.setSelectionRange){ obj.setSelectionRange(l,l); }else if(obj.createTextRange){ m = obj.createTextRange(); m.moveStart('character',l); m.collapse(); m.select(); } } } // sets the caret selection from s to e in the object function setSelection(obj,s,e){ obj.focus(); if (obj.setSelectionRange){ obj.setSelectionRange(s,e); }else if(obj.createTextRange){ m = obj.createTextRange(); m.moveStart('character',s); m.moveEnd('character',e); m.select(); } } /* Escape function */ String.prototype.addslashes = function(){ return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g, '\\$1'); // " } /* --- Escape --- */ /* Offset position from top of the screen */ function curTop(obj){ toreturn = 0; while(obj){ toreturn += parseInt(obj.offsetTop); obj = obj.offsetParent; } return toreturn; } function curLeft(obj){ toreturn = 0; while(obj){ toreturn += parseInt(obj.offsetLeft); obj = obj.offsetParent; } return toreturn; } /* ------ End of Offset function ------- */ /* Types Function */ // is a given input a number? function isNumber(a) { return typeof a == 'number' && isFinite(a); } /* Object Functions */ function replaceHTML(obj,text){ while(el = obj.childNodes[0]){ obj.removeChild(el); }; obj.appendChild(document.createTextNode(text)); } function chgro(b, obj, nclass){ if(b){ ro=false; bcol="#FFF"; col="#000"; fsty=""; }else{ nclass=''; ro=true; bcol="#eee"; col="#222"; fsty="italic"; } setattr(obj, ro, bcol, col, fsty, nclass); } function setattr(obj, ro, bcol, col, fstyl, nclass){ os=obj.style; if(nclass!=''){ os.removeAttribute('backgroundColor',0); os.removeAttribute('color',0); os.removeAttribute('fontStyle',0); obj.className=nclass; }else{ os.backgroundColor=bcol; os.color=col; os.fontStyle=fstyl; } obj.readOnly=ro; obj.disabled=ro; } function chkautofield(o, sfill, evt, focustxt){ // pour permettre des entrées avec remplissage automatique if(sfill == undefined) sfill="-AUTOM.-"; if(focustxt == undefined) focustxt=""; var ev; if(evt == undefined) ev=window.event; else ev=evt; if(ev.type=="blur"){ if(o.value==focustxt || o.value=="") o.value = sfill; }else if(ev.type=="focus"){ if(o.value == sfill){ o.value=focustxt; if(focustxt.length) setCaret_new(o, focustxt.length); } } } ////////////////////// function resizeOuterTo(w,h) { if (parseInt(navigator.appVersion)>3){ if (navigator.appName=="Netscape"){ top.outerWidth=w; top.outerHeight=h; }else top.resizeTo(w,h); } } ////////////////////// function NewFullScreenWindow(desturl){ s="scrollbars"; if(at.ie) s=s+",fullscreen" var newwin=window.open("","",s) if (document.all){ newwin.moveTo(0,0) newwin.resizeTo(screen.width,screen.height) } newwin.location=desturl } // cookies: /* name - name of the cookie value - value of the cookie [expires] - expiration date of the cookie (defaults to end of current session) [path] - path for which the cookie is valid (defaults to path of calling document) [domain] - domain for which the cookie is valid (defaults to domain of calling document) [secure] - Boolean value indicating if the cookie transmission requires a secure transmission * an argument defaults when it is assigned null as a placeholder * a null placeholder is not required for trailing omitted arguments */ function setCookie(name, value, expires, path, domain, secure) { if(!(path)) path="/"; // PLATFORM_ROOTDIR var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; } /* name - name of the desired cookie return string containing value of specified cookie or null if cookie does not exist */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } /* name - name of the cookie [path] - path of the cookie (must be same as path used to create cookie) [domain] - domain of the cookie (must be same as domain used to create cookie) path and domain default if assigned null or omitted if no explicit argument proceeds */ function deleteCookie(name, path, domain) { if (getCookie(name)) { if(!(path)) path="/"; //PLATFORM_ROOTDIR document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // formate un chiffre avec 'decimal' chiffres après la virgule et un separateur function format(valeur,decimal,separateur) { var deci=Math.round( Math.pow(10,decimal)*(Math.abs(valeur)-Math.floor(Math.abs(valeur)))) ; var val=Math.floor(Math.abs(valeur)); if ((decimal==0)||(deci==Math.pow(10,decimal))) {val=Math.floor(Math.abs(valeur)); deci=0;} var val_format=val+""; var nb=val_format.length; for (var i=1;i<4;i++) { if (val>=Math.pow(10,(3*i))) { val_format=val_format.substring(0,nb-(3*i))+separateur+val_format.substring(nb-(3*i)); } } if (decimal>0) { var decim=""; for (var j=0;j<(decimal-deci.toString().length);j++) {decim+="0";} deci=decim+deci.toString(); val_format=val_format+"."+deci; } if (parseFloat(valeur)<0) {val_format="-"+val_format;} return val_format; } function insert_SelValues(oselsour, odest, desttxt, separ ){ // ajoute à la fin d'un < textarea > (odest), texte (desttxt) plus la liste des valeurs selectionnées dans un < select > (oselsour). Separé par un CR par defaut, sinon par (separ) if (separ != 'monochamps' && separ != 'copie_champs') { var s=""; if(separ==undefined || separ=='') separ="\n"; for (var i=0; i 2) champ.value = champ.value.substring(0,2)+' '+champ.value.substring(2,taille); if(champ.value.charAt(5) != ' ' && taille > 5) champ.value = champ.value.substring(0,5)+' '+champ.value.substring(5,taille); if(champ.value.charAt(8) != ' ' && taille > 8) champ.value = champ.value.substring(0,8)+' '+champ.value.substring(8,taille); if(champ.value.charAt(11) != ' ' && taille > 11) champ.value = champ.value.substring(0,11)+' '+champ.value.substring(11,taille); if(champ.value.length > 14) champ.value = champ.value.substring(0,14); else{ while(champ.value.length < 14){ if(champ.value.length == 2 || champ.value.length == 5 || champ.value.length == 8 || champ.value.length == 11) champ.value += ' '; else champ.value += '_'; } } } champ.size = '15'; champ.maxLength = '14'; } } function changeNumCP(nom_champ, inter){ // Modifie le comportement (propriétés, masque, taille) du champs suivant que ce soit un code postal francais ou internationale // nom_champs est le nom du champ à traiter // inter: si = 1, appliquer les caractéristiques d'un cp internationale // si = 0, appliquer les caractéristiques d'un cp francais var champ = document.getElementById(nom_champ); if(inter){ champ.size = '10'; champ.maxLength = '10'; champ.onchange = null; } else { champ.onchange = function(){return inj_sect(champ);}; champ.size = '5'; champ.maxLength = '5'; } } /************************************************************************* dw_event.js (version date Feb 2004) This code is from Dynamic Web Coding at http://www.dyn-web.com/ See Terms of Use at http://www.dyn-web.com/bus/terms.html regarding conditions under which you may use this code. This notice must be retained in the code as is! *************************************************************************/ var dw_event = { add: function(obj, etype, fp, cap) { cap = cap || false; if (obj.addEventListener) obj.addEventListener(etype, fp, cap); else if (obj.attachEvent) obj.attachEvent("on" + etype, fp); }, remove: function(obj, etype, fp, cap) { cap = cap || false; if (obj.removeEventListener) obj.removeEventListener(etype, fp, cap); else if (obj.detachEvent) obj.detachEvent("on" + etype, fp); }, DOMit: function(e) { e = e? e: window.event; e.tgt = e.srcElement? e.srcElement: e.target; if (!e.preventDefault) e.preventDefault = function () { return false; } if (!e.stopPropagation) e.stopPropagation = function () { if (window.event) window.event.cancelBubble = true; } return e; } } /************************************************************************* dw_viewport.js version date Nov 2003 This code is from Dynamic Web Coding at http://www.dyn-web.com/ Copyright 2003 by Sharon Paine See Terms of Use at http://www.dyn-web.com/bus/terms.html regarding conditions under which you may use this code. This notice must be retained in the code as is! *************************************************************************/ var viewport = { getWinWidth: function () { this.width = 0; if (window.innerWidth) this.width = window.innerWidth - 18; else if (document.documentElement && document.documentElement.clientWidth) this.width = document.documentElement.clientWidth; else if (document.body && document.body.clientWidth) this.width = document.body.clientWidth; }, getWinHeight: function () { this.height = 0; if (window.innerHeight) this.height = window.innerHeight - 18; else if (document.documentElement && document.documentElement.clientHeight) this.height = document.documentElement.clientHeight; else if (document.body && document.body.clientHeight) this.height = document.body.clientHeight; }, getScrollX: function () { this.scrollX = 0; if (typeof window.pageXOffset == "number") this.scrollX = window.pageXOffset; else if (document.documentElement && document.documentElement.scrollLeft) this.scrollX = document.documentElement.scrollLeft; else if (document.body && document.body.scrollLeft) this.scrollX = document.body.scrollLeft; else if (window.scrollX) this.scrollX = window.scrollX; }, getScrollY: function () { this.scrollY = 0; if (typeof window.pageYOffset == "number") this.scrollY = window.pageYOffset; else if (document.documentElement && document.documentElement.scrollTop) this.scrollY = document.documentElement.scrollTop; else if (document.body && document.body.scrollTop) this.scrollY = document.body.scrollTop; else if (window.scrollY) this.scrollY = window.scrollY; }, getAll: function () { this.getWinWidth(); this.getWinHeight(); this.getScrollX(); this.getScrollY(); } } // mini ajax: var majax= { getRequester: function (){ try { return new ActiveXObject('MSXML2.XMLHTTP'); } catch(e){} try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch(e){} try { return new XMLHttpRequest(); } catch(e){} return false; }, open: function (url, fl_async){ if(fl_async == undefined) fl_async=true; var httpobj=this.getRequester(); if(httpobj){ httpobj.open('POST', url, fl_async); } return httpobj; }, rawsend: function (httpobj, data){ httpobj.setRequestHeader('Content-Length', data.length); httpobj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); httpobj.send(data); } } ///////////////////////////////////////////////////////////////////////////////////////////// // ------------------------------------------------------------------- // DHTML Window Widget- By Dynamic Drive, available at: http://www.dynamicdrive.com // v1.0: Script created Feb 15th, 07' // v1.01: Feb 21th, 07' (see changelog.txt) // v1.02: March 26th, 07' (see changelog.txt) // v1.03: May 5th, 07' (see changelog.txt) // v1.1: Oct 29th, 07' (see changelog.txt) // ------------------------------------------------------------------- var dhtmlwindow={ imagefiles:['windowfiles/min.gif', 'windowfiles/close.gif', 'windowfiles/restore.gif', 'windowfiles/resize.gif'], //Path to 4 images used by script, in that order ajaxbustcache: true, //Bust caching when fetching a file via Ajax? ajaxloadinghtml: 'Loading Page. Please wait...', //HTML to show while window fetches Ajax Content? minimizeorder: 0, zIndexvalue:100, tobjects: [], //object to contain references to dhtml window divs, for cleanup purposes lastactivet: {}, //reference to last active DHTML window init:function(t){ var domwindow=document.createElement("div") //create dhtml window div domwindow.id=t domwindow.className="dhtmlwindow" var domwindowdata='' domwindowdata='
' domwindowdata+='DHTML Window
' domwindowdata+='
' domwindowdata+='
' domwindowdata+='
 
' domwindowdata+='' domwindow.innerHTML=domwindowdata document.getElementById("dhtmlwindowholder").appendChild(domwindow) //this.zIndexvalue=(this.zIndexvalue)? this.zIndexvalue+1 : 100 //z-index value for DHTML window: starts at 0, increments whenever a window has focus var t=document.getElementById(t) var divs=t.getElementsByTagName("div") for (var i=0; i' window.frames["_iframe-"+t.id].location.replace(contentsource) //set location of iframe window to specified URL } else if (contenttype=="ajax"){ this.ajax_connect(contentsource, t) //populate window with external contents fetched via Ajax } t.contentarea.datatype=contenttype //store contenttype of current window for future reference }, setupdrag:function(e){ var d=dhtmlwindow //reference dhtml window object var t=this._parent //reference dhtml window div d.etarget=this //remember div mouse is currently held down on ("handle" or "resize" div) var e=window.event || e d.initmousex=e.clientX //store x position of mouse onmousedown d.initmousey=e.clientY d.initx=parseInt(t.offsetLeft) //store offset x of window div onmousedown d.inity=parseInt(t.offsetTop) d.width=parseInt(t.offsetWidth) //store width of window div d.contentheight=parseInt(t.contentarea.offsetHeight) //store height of window div's content div if (t.contentarea.datatype=="iframe"){ //if content of this window div is "iframe" t.style.backgroundColor="#F8F8F8" //colorize and hide content div (while window is being dragged) t.contentarea.style.visibility="hidden" } document.onmousemove=d.getdistance //get distance travelled by mouse as it moves document.onmouseup=function(){ if (t.contentarea.datatype=="iframe"){ //restore color and visibility of content div onmouseup t.contentarea.style.backgroundColor="white" t.contentarea.style.visibility="visible" } d.stop() } return false }, getdistance:function(e){ var d=dhtmlwindow var etarget=d.etarget var e=window.event || e d.distancex=e.clientX-d.initmousex //horizontal distance travelled relative to starting point d.distancey=e.clientY-d.initmousey if (etarget.className=="drag-handle") //if target element is "handle" div d.move(etarget._parent, e) else if (etarget.className=="drag-resizearea") //if target element is "resize" div d.resize(etarget._parent, e) return false //cancel default dragging behavior }, getviewpoint:function(){ //get window viewpoint numbers var ie=document.all && !window.opera var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000 //Preliminary doc width in non IE browsers this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16) this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight }, rememberattrs:function(t){ //remember certain attributes of the window when it's minimized or closed, such as dimensions, position on page this.getviewpoint() //Get current window viewpoint numbers t.lastx=parseInt((t.style.left || t.offsetLeft))-dhtmlwindow.scroll_left //store last known x coord of window just before minimizing t.lasty=parseInt((t.style.top || t.offsetTop))-dhtmlwindow.scroll_top t.lastwidth=parseInt(t.style.width) //store last known width of window just before minimizing/ closing }, move:function(t, e){ t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px" t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px" }, resize:function(t, e){ t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex, 150)+"px" t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey, 100)+"px" }, enablecontrols:function(e){ var d=dhtmlwindow var sourceobj=window.event? window.event.srcElement : e.target //Get element within "handle" div mouse is currently on (the controls) if (/Minimize/i.test(sourceobj.getAttribute("title"))) //if this is the "minimize" control d.minimize(sourceobj, this._parent) else if (/Restore/i.test(sourceobj.getAttribute("title"))) //if this is the "restore" control d.restore(sourceobj, this._parent) else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control d.close(this._parent) return false }, minimize:function(button, t){ dhtmlwindow.rememberattrs(t) button.setAttribute("src", dhtmlwindow.imagefiles[2]) button.setAttribute("title", "Restore") t.state="minimized" //indicate the state of the window as being "minimized" t.contentarea.style.display="none" t.statusarea.style.display="none" if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows dhtmlwindow.minimizeorder++ //increment order t.minimizeorder=dhtmlwindow.minimizeorder } t.style.left="10px" //left coord of minmized window t.style.width="200px" var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s) t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px" }, restore:function(button, t){ dhtmlwindow.getviewpoint() button.setAttribute("src", dhtmlwindow.imagefiles[0]) button.setAttribute("title", "Minimize") t.state="fullview" //indicate the state of the window as being "fullview" t.style.display="" t.contentarea.style.display="" if (t.resizeBool) //if this window is resizable, enable the resize icon t.statusarea.style.display="" t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px" t.style.width=parseInt(t.lastwidth)+"px" }, close:function(t){ try{ var closewinbol=t.onclose() } catch(err){ //In non IE browsers, all errors are caught, so just run the below var closewinbol=true } finally{ //In IE, not all errors are caught, so check if variable isn't defined in IE in those cases if (typeof closewinbol=="undefined"){ alert("An error has occured somwhere inside your \"onclose\" event handler") var closewinbol=true } } if (closewinbol){ //if custom event handler function returns true if (t.state!="minimized") //if this window isn't currently minimized dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing if (window.frames["_iframe-"+t.id]) //if this is an IFRAME DHTML window window.frames["_iframe-"+t.id].location.replace("about:blank") else t.contentarea.innerHTML="" t.style.display="none" t.isClosed=true //tell script this window is closed (for detection in t.show()) } return closewinbol }, setopacity:function(targetobject, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between) if (!targetobject) return if (targetobject.filters && targetobject.filters[0]){ //IE syntax if (typeof targetobject.filters[0].opacity=="number") //IE6 targetobject.filters[0].opacity=value*100 else //IE 5.5 targetobject.style.filter="alpha(opacity="+value*100+")" } else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax targetobject.style.MozOpacity=value else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax targetobject.style.opacity=value }, setfocus:function(t){ //Sets focus to the currently active window this.zIndexvalue++ t.style.zIndex=this.zIndexvalue t.isClosed=false //tell script this window isn't closed (for detection in t.show()) this.setopacity(this.lastactivet.handle, 0.5) //unfocus last active window this.setopacity(t.handle, 1) //focus currently active window this.lastactivet=t //remember last active window }, show:function(t){ if (t.isClosed){ alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.") return } if (t.lastx) //If there exists previously stored information such as last x position on window attributes (meaning it's been minimized or closed) dhtmlwindow.restore(t.controls.firstChild, t) //restore the window using that info else t.style.display="" this.setfocus(t) t.state="fullview" //indicate the state of the window as being "fullview" }, hide:function(t){ t.style.display="none" }, ajax_connect:function(url, t){ var page_request = false var bustcacheparameter="" if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc page_request = new XMLHttpRequest() else if (window.ActiveXObject){ // if IE6 or below try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP") } catch (e){} } } else return false t.contentarea.innerHTML=this.ajaxloadinghtml page_request.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(page_request, t)} if (this.ajaxbustcache) //if bust caching of external page bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() page_request.open('GET', url+bustcacheparameter, true) page_request.send(null) }, ajax_loadpage:function(page_request, t){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){ t.contentarea.innerHTML=page_request.responseText } }, stop:function(){ dhtmlwindow.etarget=null //clean up document.onmousemove=null document.onmouseup=null }, addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload) var tasktype=(window.addEventListener)? tasktype : "on"+tasktype if (target.addEventListener) target.addEventListener(tasktype, functionref, false) else if (target.attachEvent) target.attachEvent(tasktype, functionref) }, cleanup:function(){ for (var i=0; i.') //container that holds all dhtml window divs on page window.onunload=dhtmlwindow.cleanup // ------------------------------------------------------------------- // DHTML Modal window- By Dynamic Drive, available at: http://www.dynamicdrive.com // v1.0: Script created Feb 27th, 07' // v1.01 May 5th, 07' Minor change to modal window positioning behavior (not a bug fix). Only this file changed. // REQUIRES: DHTML Window Widget (v1.01 or higher): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/ // ------------------------------------------------------------------- if (typeof dhtmlwindow=="undefined") alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!') var dhtmlmodal={ veilstack: 0, open:function(t, contenttype, contentsource, title, attr, recalonload){ var d=dhtmlwindow //reference dhtmlwindow object this.interVeil=document.getElementById("interVeil") //Reference "veil" div this.veilstack++ //var to keep track of how many modal windows are open right now this.loadveil() if (typeof recalonload!="undefined" && recalonload=="recal" && d.scroll_top==0) d.addEvent(window, function(){dhtmlmodal.loadveil()}, "load") var t=d.open(t, contenttype, contentsource, title, attr, recalonload) t.controls.firstChild.style.display="none" //Disable "minimize" button t.controls.onclick=function(){dhtmlmodal.forceclose(this._parent)} //OVERWRITE default control action with new one t.show=function(){dhtmlmodal.show(this)} //OVERWRITE default t.show() method with new one t.hide=function(){dhtmlmodal.close(this)} //OVERWRITE default t.hide() method with new one return t }, loadveil:function(){ var d=dhtmlwindow d.getviewpoint() this.docheightcomplete=(d.standardbody.offsetHeight>d.standardbody.scrollHeight)? d.standardbody.offsetHeight : d.standardbody.scrollHeight this.interVeil.style.width=d.docwidth+"px" //set up veil over page this.interVeil.style.height=this.docheightcomplete+"px" //set up veil over page this.interVeil.style.left=0 //Position veil over page this.interVeil.style.top=0 //Position veil over page this.interVeil.style.visibility="visible" //Show veil over page this.interVeil.style.display="" //Show veil over page }, adjustveil:function(){ //function to adjust veil when window is resized if (this.interVeil && this.interVeil.style.display=="") //If veil is currently visible on the screen this.loadveil() //readjust veil }, close:function(t){ //user initiated function used to close modal window t.contentDoc=(t.contentarea.datatype=="iframe")? window.frames["_iframe-"+t.id].document : t.contentarea //return reference to modal window DIV (or document object in the case of iframe var closewinbol=dhtmlwindow.close(t) if (closewinbol){ //if var returns true this.veilstack-- if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed this.interVeil.style.display="none" } }, forceclose:function(t){ //function attached to default "close" icon of window to bypass "onclose" event, and just close window dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing t.style.display="none" this.veilstack-- if (this.veilstack==0) //if this is the only modal window visible on the screen, and being closed this.interVeil.style.display="none" }, show:function(t){ dhtmlmodal.veilstack++ dhtmlmodal.loadveil() dhtmlwindow.show(t) } } //END object declaration document.write('
') dhtmlwindow.addEvent(window, function(){if (typeof dhtmlmodal!="undefined") dhtmlmodal.adjustveil()}, "resize") function lon(target){ try { if (!target) target = this; if (!target._lon_disabled_arr) target._lon_disabled_arr = new Array(); else if (target._lon_disabled_arr.length > 0) return true; var d=target.document.getElementById("loaderWaiter"); if(d){ var topy = parseInt(document.body.scrollTop); var scr1posy = parseInt(d.style.top); if(isNaN(scr1posy)) scr1posy=0; var t = scr1posy + topy +"px" ;//+ document.body.scrollTop d.style.top = t; d.style.display = ""; } var select_arr = target.document.getElementsByTagName("select"); for (var i = 0; i < select_arr.length; i++) { if (select_arr[i].disabled) continue; select_arr[i].disabled = true; _lon_disabled_arr.pop(select_arr[i]); var clone = target.document.createElement("input"); clone.type = "hidden"; clone.name = select_arr[i].name; var values = new Array(); for (var n = 0; n < select_arr[i].length; n++) { if (select_arr[i][n].selected) { values[values.length] = select_arr[i][n].value; } } clone.value = values.join(","); select_arr[i].parentNode.insertBefore(clone, select_arr[i]); } } catch (e) { return false; } return true; } function loff(target) { try { if (!target) target = this; target.document.getElementById("loaderWaiter").style.display = "none"; if (target._lon_disabled_arr) { while(_lon_disabled_arr.length > 0) { var select = _lon_disabled_arr.push(); select.disabled = false; var clones_arr = target.document.getElementsByName(select.name); for (var n = 0; n < clones_arr.length; n++) { if ("hidden" == clones_arr[n].type) clones_arr[n].parent.removeChild(clones_arr[n]); } } } } catch (e) { return false; } return true; } function putloader(sousrep){ if(sousrep==undefined) sousrep="../"; document.write(''); } // This function gets called when the end-user clicks on some date. function cal1_selected(cal, date) { //cal.sel.value = date; // just update the date in the input field. //cal.callCloseHandler(); var update = (cal.dateClicked ); if (update && cal.dateClicked){ cal.sel.value = date; cal.callCloseHandler(); } } // And this gets called when the end-user clicks on the _selected_ date, // or clicks on the "Close" button. It just hides the calendar without // destroying it. function cal1_closeHandler(cal) { cal.hide(); // hide the calendar // cal.destroy(); _dynarch_popupCalendar = null; } // This function shows the calendar under the element having the given id. // It takes care of catching "mousedown" signals on document and hiding the // calendar if the click was outside. function cal1_showCalendar(id, align, format, showsTime, showsOtherMonths) { var el = document.getElementById(id); if (_dynarch_popupCalendar != null) { // we already have some calendar created _dynarch_popupCalendar.hide(); // so we hide it first. } else { // first-time call, create the calendar. var cal = new Calendar(1, null, cal1_selected, cal1_closeHandler); // uncomment the following line to hide the week numbers cal.weekNumbers = false; if (typeof showsTime == "string") { cal.showsTime = true; cal.time24 = (showsTime == "24"); } if (showsOtherMonths) { cal.showsOtherMonths = true; } _dynarch_popupCalendar = cal; // remember it in the global var cal.setRange(1900, 2070); // min/max year allowed. cal.singleClick= false; cal.create(); } if (format != undefined) _dynarch_popupCalendar.setDateFormat(format); // set the specified date format else _dynarch_popupCalendar.setDateFormat("%d-%m-%Y"); // set the specified date format _dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field _dynarch_popupCalendar.sel = el; // inform it what input field we use // the reference element that we pass to showAtElement is the button that // triggers the calendar. In this example we align the calendar bottom-right // to the button. var va="B"; var ha="r"; if(align != undefined){ va=align.substr(0, 1); if(align.length>1) ha=align.substr(1, 1); } _dynarch_popupCalendar.showAtElement(el, va+ha); // show the calendar return false; } function html_entity_decode(str){ try{ var tarea=document.createElement('textarea'); tarea.innerHTML = str; return tarea.value; tarea.parentNode.removeChild(tarea); } catch(e){ //for IE add to the page var ddiv=document.createElement('DIV'); ddiv.setAttribute('id', 'htmlconverter'); document.body.appendChild(ddiv); //ddiv.style.visibility = 'none'; document.getElementById("htmlconverter").innerHTML = ''; var content = document.getElementById("innerConverter").value; document.getElementById("htmlconverter").innerHTML = ""; ddiv.parentNode.removeChild(ddiv); return content; } }