// Damien - 2003-06-18 21:42:26 - V1.0.4 // Reno - 2003-06-12 17:07:34 - V1.0.3 // Reno - 2003-05-30 19:44:14 - V1.0.2 // Damien - 2003-05-19 14:04:00 - V1.0.1 // Reno - 2003-03-15 15:51:49 - V1.0.0 // contient // DETECT.JS // DHTMLLIB.JS // GFS.JS // IMG.JS // UTIL.JS //******************************************************************************* //------------------------------------------------------------------------------- // DETECT.JS //------------------------------------------------------------------------------- //******************************************************************************* /*************** Script functions in this file ************** Filename: detect.js; as of 09/24/2001 FUNCTION: LINE: Fl_DetectFlash() 72 Fl_DetectFlashVb() 61 ************ (end Script functions in this file) ***********/ // Determine Versions var agent=navigator.userAgent.toLowerCase(); var browser=navigator.appName.toLowerCase(); var versMajor = parseInt(navigator.appVersion); var versMinor = parseFloat(navigator.appVersion); // Determine browser. var isNS = (browser.indexOf("netscape") >= 0); var isIE = (browser.indexOf("internet explorer") >= 0); // (agent.indexOf("msie") != -1); var isOpera = (agent.indexOf('opera') != -1); var isAOL = (agent.indexOf("aol") != -1); var isWebTV = (agent.indexOf("webtv") != -1); // NS var isNS2 = (isNS && (versMajor == 2)); var isNS3 = (isNS && (versMajor == 3)); var isNS4 = (isNS && (versMajor == 4)); var isNS5 = (isNS && (versMajor == 5)); var isNS6 = (isNS && document.getElementById != null); var isMinNS6 = isNS6; var isMinNS4 = (isNS && (versMajor >= 4)) && ! isMinNS6; var isMinNS5 = (isNS && (versMajor >= 5)); // IE var isIE3 = (isIE && (versMajor < 4)); var isIE4 = (isIE && (versMajor == 4) && (agent.indexOf("msie 5.")==-1) && (agent.indexOf("msie 6.")==-1)); var isIE5 = (isIE && (versMajor == 4) && (agent.indexOf("msie 6.")==-1) && (agent.indexOf("msie 5.")!=-1)); var isIE55 = (isIE5 && (navigator.appVersion.indexOf("5.5") >= 0)); var isIE6 = (navigator.appVersion.indexOf("6.") >= 0); var isMinIE4 = (isIE && versMajor >= 4); var isMinIE6 = isIE6; var isMinIE5 = (isMinIE4 && (navigator.appVersion.indexOf("5.") >= 0) || isMinIE6); var isMinIE55 = (isMinIE4 && (navigator.appVersion.indexOf("5.5") >= 0)); var isIENS6 = isIE || isMinNS6 ; // AOL var isAOL3 = (isAOL && isIE3); var isAOL4 = (isAOL && isIE4); // Determine OS var isMac = (navigator.appVersion.indexOf("Mac") >= 0); var isWin = (navigator.appVersion.indexOf("Win") >= 0); var isLinux = (navigator.appVersion.indexOf("Linux") >= 0); // Versions if (isNS2) browserVersion = "2"; if (isIE3 || isNS3) browserVersion = "3"; if (isIE4 || isNS4) browserVersion = "4"; if (isIE5) browserVersion = "5"; if (isMinIE55) browserVersion = "5.5"; if (isNS6) browserVersion = "6"; // Determine Flash // ********************************** FALSH DETECT var Fl_requiredVersion = 4; // version the user needs to view site (max is 5, min is 2) var Fl_flash2Installed = false; // boolean. true if flash 2 is installed var Fl_flash3Installed = false; // boolean. true if flash 3 is installed var Fl_flash4Installed = false; // boolean. true if flash 4 is installed var Fl_flash5Installed = false; // boolean. true if flash 5 is installed var Fl_maxVersion = 5; // highest version we can actually detect var Fl_actualVersion = 0; // version the user really has var Fl_hasRightVersion = false; // boolean. true if it's safe to embed the flash movie in the page var Fl_isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; // true if we're on ie var Fl_isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true: false; // true if we're on windows function Fl_DetectFlashVb() { if(Fl_isIE && Fl_isWin){ // don't write vbscript tags on anything but ie win document.write(' \n'); document.write('on error resume next \n'); document.write('Fl_flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n'); document.write('Fl_flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n'); document.write('Fl_flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n'); document.write('Fl_flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n'); document.write(' \n'); // break up end tag so it doesn't end our script } } function Fl_DetectFlash() { if (navigator.plugins){ // does navigator.plugins exist? if (navigator.plugins["Shockwave Flash 2.0"] // yes>> then is Flash 2 || navigator.plugins["Shockwave Flash"]){ // or flash 3+ installed? var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0": ""; var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description; var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1)); Fl_flash2Installed = flashVersion == 2; Fl_flash3Installed = flashVersion == 3; Fl_flash4Installed = flashVersion == 4; Fl_flash5Installed = flashVersion == 5; } } for (var i = 2; i <= Fl_maxVersion; i++) { if (eval("Fl_flash" + i + "Installed") == true) Fl_actualVersion = i; } if(navigator.userAgent.indexOf("WebTV") != -1) Fl_actualVersion = 2; if (Fl_actualVersion >= Fl_requiredVersion) { // user has a new enough version Fl_hasRightVersion = true; // flag: it's okay to write out the object/embed tags later return true; } return false; } // -------------------------------- // Plugin Detection // -------------------------------- /* Plugin Detector() Source: Webmonkey Code Library (http://www.hotwired.com/webmonkey/javascript/code_library/) Author: Nadav Savio Author Email: webmonkey@giantant.com */ // this is where we write out the VBScript for MSIE Windows var WM_startTagFix = ''); document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.'); document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.'); document.writeln('Dim WM_detect_through_vb'); document.writeln('WM_detect_through_vb = 0'); document.writeln('If ScriptEngineMajorVersion >= 2 then'); document.writeln(' WM_detect_through_vb = 1'); document.writeln('End If'); document.writeln('Function WM_activeXDetect(activeXname)'); document.writeln(' on error resume next'); document.writeln(' If ScriptEngineMajorVersion >= 2 then'); document.writeln(' WM_activeXDetect = False'); document.writeln(' WM_activeXDetect = IsObject(CreateObject(activeXname))'); document.writeln(' If (err) then'); document.writeln(' WM_activeXDetect = False'); document.writeln(' End If'); document.writeln(' Else'); document.writeln(' WM_activeXDetect = False'); document.writeln(' End If'); document.writeln('End Function'); document.writeln(WM_startTagFix+'script>'); } function WM_pluginDetect(plugindescription, pluginxtension, pluginmime, activeXname){ //This script block will test all user agents that have a real plug-in array //(i.e. Netscape) and set the variables, otherwise it directs the routine // to WM_activeXDetect to detect the activeX control. // First define some variables var i,plugin_undetectable=0,detected=0, daPlugin=new Object(); plugin_undetectable = (msie_windows && WM_detect_through_vb)?0:1; // If it has a real plugins or mimetypes array, we look there for the plugin first if (navigator.plugins) { numPlugins = navigator.plugins.length; if (numPlugins > 1) { if (navigator.mimeTypes && navigator.mimeTypes[pluginmime] && navigator.mimeTypes[pluginmime].enabledPlugin && (navigator.mimeTypes[pluginmime].suffixes.indexOf(pluginxtension) != -1)) { // seems like we have it, let's just make sure and check the version (if specified) if ((navigator.appName == 'Netscape') && (navigator.appVersion.indexOf('4.0') != -1)) { // stupid, stupid Netscape can't handle the references to navigator.plugins by number, sooo... for(i in navigator.plugins) { if ((navigator.plugins[i].description.indexOf(plugindescription) != -1) || (i.indexOf(plugindescription) != -1)) { // some versions of quicktime have no description. feh! detected=1; break; } } } else { for (i = 0; i < numPlugins; i++) { daPlugin = navigator.plugins[i]; if ((daPlugin.description.indexOf(plugindescription) != -1) || (daPlugin.name.indexOf(plugindescription) != -1)) { detected=1; break; } } } // Mac weirdness if (navigator.mimeTypes[pluginmime] == null) { detected = 0; } } return detected; } else if((msie_windows == 1) && !plugin_undetectable){ return WM_activeXDetect(activeXname); } else { return 0; } } else { return 0; } } // this next function just makes it easy to detect the common plugins function WM_easyDetect(whichPlugin) { // this function just makes it easy to do basic plug-in detection without // knowing all the mimetypes and activeX names and such var isItThere = 0; if( (whichPlugin == 'flash') || (whichPlugin == 'Flash') ) { isItThere = WM_pluginDetect('Flash', 'swf', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash'); } else if( (whichPlugin == 'director') || (whichPlugin == 'Director') ) { isItThere = WM_pluginDetect('Shockwave', 'dcr', 'application/x-director', 'SWCtl.SWCtl.1'); } else if( (whichPlugin == 'quicktime') || (whichPlugin == 'Quicktime') || (whichPlugin == 'QuickTime') ) { isItThere = WM_pluginDetect('QuickTime', 'mov', 'video/quicktime', ''); } else if( (whichPlugin == 'realaudio') || (whichPlugin == 'Realaudio') || (whichPlugin == 'RealAudio') ) { isItThere = (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin', 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','rmocx.RealPlayer G2 Control')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)')) || (WM_pluginDetect('RealPlayer', 'rpm', 'audio/x-pn-realaudio-plugin','RealVideo.RealVideo(tm) ActiveX Control (32-bit)')) } else { alert('You need to tell me which plug-in to look for, like so:\n\n' + ' WM_easyDetect(\'flash\')\n\n' + ' WM_easyDetect(\'director\')\n\n' + ' WM_easyDetect(\'quicktime\')\n\n' + ' WM_easyDetect(\'realaudio\')'); } return isItThere; } //******************************************************************************* //------------------------------------------------------------------------------- // DHTMLLIB.JS //------------------------------------------------------------------------------- //******************************************************************************* /****************************************************************************** * dhtmllib.js * * * * Copyright 1999 by Mike Hall. * * Web address: http://www.brainjar.com * * Last update: February 26, 2000. * * * * Provides basic functions for DHTML positioned elements which will work on * * both Netscape Communicator and Internet Explorer browsers (version 4.0 and * * up). * ******************************************************************************/ // requiert detect.js // Compatible NS6 - Nicolas - last modified : 10/12/01 //----------------------------------------------------------------------------- // Global var //----------------------------------------------------------------------------- var bDHTMLDebug = true; // show debug (object not found) //----------------------------------------------------------------------------- // Common function //----------------------------------------------------------------------------- function isNullLayer(layer,strFunc) { if (!bDHTMLDebug) return; if (strFunc == null) strFunc = ""; if (layer == null) { alert(strFunc+" : layer is null"); return true; } return false; } //----------------------------------------------------------------------------- // Layer visibility. //----------------------------------------------------------------------------- function hideLayer(layer) { if (isNullLayer(layer,"hide")) return; if (isMinNS4) layer.visibility = "hide"; if (isIENS6) layer.style.visibility = "hidden"; return; } function showLayer(layer) { if (isNullLayer(layer,"show")) return; if (isMinNS4) layer.visibility = "show"; if (isIENS6) layer.style.visibility = "visible"; return; } function inheritLayer(layer) { if (isNullLayer(layer,"inherit")) return; if (isMinNS4) layer.visibility = "inherit"; if (isIENS6) layer.style.visibility = "inherit"; return; } function getVisibility(layer) { if (isNullLayer(layer,"visibility")) return; if (isMinNS4) { if (layer.visibility == "show") return "visible"; if (layer.visibility == "hide") return "hidden"; return layer.visibility; } if (isIENS6) return layer.style.visibility; return; } //----------------------------------------------------------------------------- // Layer content modification. //----------------------------------------------------------------------------- function writeLayer(layer,txt) { if (isNullLayer(layer,"write")) return; if (isMinNS4) { layer.document.close(); layer.document.write(txt); layer.document.close(); } if (isIENS6) if (layer.innerHTML != null)layer.innerHTML = txt; else if (layer.document) layer.document.body.innerHTML = txt; return; } // keep for compatibility function writeILayer(layer,txt){writeLayer(layer,txt);return;} function writeILayerOuter(layer,txt) { if (isNullLayer(layer,"writeILayer")) return; if (isMinNS4) writeLayer(layer,txt); // pas supporté par NS4 if (isIENS6) layer.document.body.outerHTML = txt; return; } //----------------------------------------------------------------------------- // visibility + positionning. //----------------------------------------------------------------------------- function SetOff() { var a=SetOff.arguments; for (i = 0; i < a.length; i++) { objOn = getLayer(a[i]); if (objOn) hideLayer(objOn); } } function SetLayer(IdOn, IdOff, cx, cy) { if (IdOn) { objOn = getLayer(IdOn); if (!objOn) return; if (isMinNS4) { cx-=0; cy-=0; } // if (isIENS6) { cx += getPageScrollX(); cy += getPageScrollY(); // } moveLayerTo(objOn, cx, cy); showLayer(objOn); } if (IdOff){ objOff = getLayer(IdOff); if (!objOff) return; hideLayer(objOff); } } var SL_pull_Int = false; var SL_pull_To = 30; var SL_pull_Pad = 15; var SL_pull_IdOn = false; var SL_pull_Cy = 0; function SetLayer_pullengine(IdOn, cy){ pObj = getLayer(IdOn); if (!pObj) return; if (getClipHeight(pObj) < cy) { clipLayer(pObj, 0, 0, getClipRight(pObj), getClipBottom(pObj)+SL_pull_Pad); } else { clearInterval(SL_pull_Int); SL_pull_Int = false; SL_pull_IdOn = false; } } function SetLayer_pull(IdOn, IdOff, cx, cy, bNotPull) { if (SL_pull_IdOn) { if (SL_pull_Int) clearInterval(SL_pull_Int); objOn = getLayer(SL_pull_IdOn); clipLayer(objOn, 0, 0, getWidth(objOn)+10, SL_pull_Cy); } if (bNotPull) return SetLayer(IdOn, IdOff, cx, cy); if (IdOff){ objOff = getLayer(IdOff); hideLayer(objOff); } if (IdOn) { SL_pull_IdOn = IdOn; objOn = getLayer(IdOn); if (isMinNS4) { cx-=0; cy-=0; } moveLayerTo(objOn, cx, cy); SL_pull_Cy = getHeight(objOn); clipLayer(objOn, 0, 0, getWidth(objOn)+10, 15); showLayer(objOn); SL_pull_Int = setInterval("SetLayer_pullengine('"+IdOn+"', "+SL_pull_Cy+")", SL_pull_To); } } //----------------------------------------------------------------------------- // Layer properties. //----------------------------------------------------------------------------- function getLeft(layer) { if (isNullLayer(layer,"left")) return; if (isMinNS4) return layer.left; if (isIENS6) return layer.style.pixelLeft; return; } function getTop(layer) { if (isNullLayer(layer,"top")) return; if (isMinNS4) return layer.top; if (isIENS6) return layer.style.pixelTop; return; } function getRight(layer) { if (isNullLayer(layer,"right")) return; if (isIENS6) return getLeft(layer) + getWidth(layer); return; } function getBottom(layer) { if (isNullLayer(layer,"bottom")) return; if (isIENS6) return getTop(layer) + getHeight(layer); return; } function getPageLeft(layer) { if (isNullLayer(layer,"left")) return; if (isMinNS4) return layer.pageX; if (isIENS6) { x = 0; while (layer.offsetParent != null) { x += layer.offsetLeft; layer = layer.offsetParent; } x += layer.offsetLeft; return x; } return; } function getPageRight(layer) { if (isNullLayer(layer,"right")) return; return getPageLeft(layer)+getWidth(layer); } function getPageTop(layer) { if (isNullLayer(layer,"top")) return; if (isMinNS4) return layer.pageY; if (isIENS6) { y = 0; while (layer.offsetParent != null) { y += layer.offsetTop; layer = layer.offsetParent; } y += layer.offsetTop; return y; } return; } function getPageBottom(layer) { if (isNullLayer(layer,"bottom")) return; return getPageTop(layer)+getHeight(layer); } function getWidth(layer) { if (isNullLayer(layer,"width")) return; if (isMinNS4) { if (layer.document.width) return layer.document.width; else return layer.clip.right - layer.clip.left; } if (isMinNS6) return parseInt(layer.offsetWidth); if (isMinIE4) if (layer.style.pixelWidth) return layer.style.pixelWidth; else return layer.clientWidth; return; } function getHeight(layer) { if (isNullLayer(layer,"height")) return; if (isMinNS4) { if (layer.document.height) return layer.document.height; else return layer.clip.bottom - layer.clip.top; } if (isMinNS6) { return parseInt(layer.offsetHeight); } if (isMinIE4) { if (layer.style.pixelHeight) return layer.style.pixelHeight; else return layer.clientHeight; } return; } function getContentHeight(layer) { if (isNullLayer(layer,"height")) return; if (isMinNS4) { if (layer.document.height) return layer.document.height; else return layer.clip.bottom - layer.clip.top; } if (isIENS6) return parseInt(layer.scrollHeight); return; } function getContentWidth(layer) { if (isNullLayer(layer,"width")) return; if (isMinNS4) { if (layer.document.width) return layer.document.width; else return layer.clip.right - layer.clip.left; } if (isIENS6) return parseInt(layer.scrollWidth); return; } function resizeLayerTo(layer, pWidth, pHeight) { if (isMinNS4) { layer.height = pHeight; layer.width = pWidth; } if (isIENS6) { layer.style.width = pWidth; layer.style.height = pHeight; } return; } //----------------------------------------------------------------------------- // Move Layer //----------------------------------------------------------------------------- function moveLayerTo(layer, x, y) { if (isNullLayer(layer,"moveto")) return; if (isMinNS4) layer.moveTo(parseInt(x), parseInt(y)); if (isMinIE4) { layer.style.pixelLeft = x; layer.style.pixelTop = y; } if (isMinNS6) { layer.style.left = x+"px"; layer.style.top = y+"px"; } return; } function setLayerTop(layer,y) { if (isNullLayer(layer,"moveto")) return; if (isMinNS4) layer.moveTo(getLeft(layer), parseInt(y)); if (isMinIE4) { layer.style.pixelTop = y; } if (isMinNS6) { layer.style.top = y+"px"; } return; } function setLayerLeft(layer,x) { if (isNullLayer(layer,"moveto")) return; if (isMinNS4) layer.moveTo(parseInt(x), getTop(layer)); if (isMinIE4) { layer.style.pixelLeft = x; } if (isMinNS6) { layer.style.left = x+"px"; } return; } function moveLayerBy(layer, dx, dy) { if (isNullLayer(layer,"moveby")) return; if (isMinNS4) layer.moveBy(dx, dy); if (isMinIE4) { layer.style.pixelLeft += dx; layer.style.pixelTop += dy; } if (isMinNS6) { layer.style.left += dx+"px"; layer.style.top += dy+"px"; } return; } // Bouge le layer en le laissant dans l'ecran function moveLayerToInScreen(layer, x, y) { if (x+getWidth(layer)+20 > getWindowWidth()+ getPageScrollX()) ix = getWindowWidth() - getWidth(layer) - 15 + getPageScrollX(); else ix = x+20; if (x > ix && x < ix+getWidth(layer)) ix = x - getWidth(layer); if (ix < 0) ix = 0; if (y+getHeight(layer)+20 > getWindowHeight()+getPageScrollY()) iy = getWindowHeight() - 2*getHeight(layer) - 15 + getPageScrollY(); else iy = y+10; if (iy < 0) iy = 0; moveLayerTo(layer, ix, iy); } function moveLayerToLayer(layer, ilayer) { layer = getLayer(layer); ilayer = getLayer(ilayer); if (isNullLayer(layer,"movelayertolayer : layer") || isNullLayer(ilayer,"movelayertolayer:ilayer")) return; moveLayerTo(layer, getPageLeft(ilayer), getPageTop(ilayer)); return; } function moveLayerToLayerMv(player,pilayer,distx,disty) { layer = getLayer(player); ilayer = getLayer(pilayer); if (isNullLayer(layer,"movelayertolayer : layer") || isNullLayer(ilayer,"movelayertolayer:ilayer")) return; if (!distx && !disty) { distx = getPageLeft(ilayer) - getPageLeft(layer); disty = getPageTop(ilayer) - getPageTop(layer); } if (distx == 0) signex = 1; else signex = parseInt(Math.abs(distx)/distx); if (disty == 0) signey = 1; else signey = parseInt(Math.abs(disty)/disty); jx=parseInt(signex*Math.abs(distx)/50); jy=parseInt(signey*Math.abs(disty)/50); while (Math.abs(getPageLeft(layer) - getPageLeft(ilayer)) > Math.abs(jx) || Math.abs(getPageTop(layer)- getPageTop(ilayer)) > Math.abs(jy)) { if (Math.abs(getPageLeft(layer) - getPageLeft(ilayer)) < Math.abs(jx)) jx = 0; if (Math.abs(getPageTop(layer) - getPageTop(ilayer)) < Math.abs(jy)) jy = 0; moveLayerBy(layer, jx, jy); setTimeout("moveLayerToLayerMv(\""+player+"\",\""+pilayer+"\","+distx+","+disty+")",1); return; } moveLayerToLayer(player,pilayer); return; } function centerLayerW(layer) { if (isNullLayer(layer,"centerw")) return; var x = (getPageWidth()-getWidth(layer)) / 2; moveLayerTo(layer,x,0); return; } function centerLayerH(layer) { if (isNullLayer(layer,"centerh")) return; var y = (getPageHeight()-getHeight(layer)) / 2; moveLayerTo(layer,0,y); return; } function centerLayer(layer) { if (isNullLayer(layer,"center")) return; var x = (getPageWidth()-getWidth(layer)) / 2; var y = (getPageHeight()-getHeight(layer)) / 2; moveLayerTo(layer,x,y); return; } //----------------------------------------------------------------------------- // Z-Index //----------------------------------------------------------------------------- function getzIndex(layer) { if (isNullLayer(layer,"z-index")) return; if (isMinNS4) return layer.zIndex; if (isMinIE4 || isMinNS6) return layer.style.zIndex; return; } function setzIndex(layer, z) { if (isNullLayer(layer,"z-index")) return; if (isMinNS4) layer.zIndex = z; if (isIENS6) layer.style.zIndex = z; return; } function moveAbove(layer,win) { var max=0; if (!win) win =window; tab = win.document.all.tags("DIV"); for (i=0;i max) max = getzIndex(tab[i]); setzIndex(layer, max+1) return; } function moveBelow(layer,win) { var min=0; if (!win) win =window; tab = win.document.all.tags("DIV"); for (i=0;i getWidth(layer)) dx = getWidth(layer) - cr; if (ct + dy < 0) dy = -ct; else if (cb + dy > getHeight(layer)) dy = getHeight(layer) - cb; } if (getClipHeight(layer) >= layer.document.height) dy = 0; if (getClipWidth(layer) >= layer.document.width) dx = 0; clipLayer(layer, cl + dx, ct + dy, cr + dx, cb + dy); moveLayerBy(layer, -dx, -dy); return; } //----------------------------------------------------------------------------- // Layer background. //----------------------------------------------------------------------------- function getBgColor(layer) { if (isNullLayer(layer,"bgcolor")) return; if (isMinNS4) return layer.bgColor; if (isIENS6) return layer.style.backgroundColor; } function getForeColor(layer) { if (isNullLayer(layer,"color")) return; if (isMinNS4) return layer.color; if (isIENS6) return layer.style.color; } function getBorderColor(layer) { if (isNullLayer(layer,"bordercolor")) return; if (isMinNS4) return layer.bordercolor; if (isIENS6) return layer.style.borderColor; } function setBgColor(layer, color) { if (isNullLayer(layer,"bgcolor")) return; if (isMinNS4) layer.bgColor = color; if (isIENS6) layer.style.backgroundColor = color; return; } function setForeColor(layer, color) { if (isNullLayer(layer,"color")) return; if (isMinNS4) layer.color = color; if (isIENS6) layer.style.color = color; return; } function setBorderColor(layer,color) { if (isNullLayer(layer,"bordercolor")) return; if (isMinNS4) layer.bordercolor = color; if (isIENS6) layer.style.borderColor = color; return; } function setBgImage(layer, src) { if (isNullLayer(layer,"bgimage")) return; if (isMinNS4) layer.background.src = src; if (isIENS6) layer.style.backgroundImage = "url(" + src + ")"; } //----------------------------------------------------------------------------- // Layer creation. //----------------------------------------------------------------------------- // Compatible IE & NS function createLayer(p_name,p_style,p_action,p_src) { if (!p_style) p_style=""; if (!p_action) p_action=""; if (!p_src) p_src="#"; if (isMinNS4 || isMinNS6) { if (p_style) p_style = styleToNS(p_style); document.write(""+p_src+""); } if (isMinIE4) document.write("
"+p_src+"
"); l_lay = getLayer(p_name); if (isMinNS4) l_lay.innerHTML = p_src; return l_lay; } function styleToNS(p_style) { aTab=p_style.split(";"); for (i=0;i"); } if (isMinIE4){ document.write(""); } return; } //----------------------------------------------------------------------------- // Find Layer //----------------------------------------------------------------------------- function getFrame(p_name, win) { if (win == null) win = window; if (isMinNS4) return findLayer(p_name, win.document); if (isMinIE4) return win.document.frames(p_name); return; } function getLayer(p_name, win) { if (win == null) win = window; if (isMinNS4) return findLayer(p_name, win.document); if (isMinIE5 || isMinNS6) return (win.document.getElementById(p_name)); if (isMinIE4) return win.document.all(p_name); return; } function findLayer(p_name, doc) { var i, layer; for (i = 0; i < doc.layers.length; i++) { layer = doc.layers[i]; if (layer.name == p_name || layer.id == p_name) return layer; if (layer.document.layers.length > 0) if ((layer = findLayer(p_name, layer.document)) != null) return layer; } return null; } //----------------------------------------------------------------------------- // Page & Window properties. //----------------------------------------------------------------------------- function getWindowWidth(win) { if (!win) win=window; if (isMinNS4) return win.innerWidth; if (isMinIE4) return win.document.body.clientWidth; return -1; } function getWindowHeight(win) { if (!win) win=window; if (isMinNS4) return win.innerHeight; if (isMinIE4) return win.document.body.clientHeight; return -1; } function getPageWidth(win) { if (!win) win=window; if (isMinNS4) return win.document.width; if (isMinIE4 && !isMac) return win.document.body.scrollWidth; if (isNS6) return win.document.body.offsetWidth; if (isMac) return win.document.body.offsetWidth; return; } function getPageHeight(win) { if (!win) win=window; if (isMinNS4) return win.document.height; if (isMinIE4 && !isMac) return win.document.body.scrollHeight; if (isNS6) return win.document.body.offsetHeight; if (isMac) return win.document.body.offsetHeight; return; } function getPageScrollX(win) { if (!win) win=window; if (isNS) return win.pageXOffset; if (isMinIE4) return win.document.body.scrollLeft; return; } function getPageScrollY(win) { if (!win) win=window; if (isNS) return win.pageYOffset; if (isMinIE4) return win.document.body.scrollTop; return; } //----------------------------------------------------------------------------- // Event properties. //----------------------------------------------------------------------------- function getPageX(e,win) { if (isMinNS4 || isMinNS6) return e.pageX; if (isMinIE4) return e.clientX + getPageScrollX(win); return; } function getPageY(e,win) { if (isMinNS4 || isMinNS6) return e.pageY; if (isMinIE4) return e.clientY + getPageScrollY(win); return; } //----------------------------------------------------------------------------- // Tooltip //----------------------------------------------------------------------------- function TT_SetToolTip(sLayName, bOff, e) { pObj = getLayer(sLayName); if (!pObj) return; if (!bOff) { if (!e) return; iCx = getPageX(e); iCy = getPageY(e); if (isIE4) { iCx -= getPageScrollX(); iCy -= getPageScrollY(); } moveLayerToInScreen(pObj, iCx, iCy); showLayer(pObj); } else hideLayer(pObj); } //******************************************************************************* //------------------------------------------------------------------------------- // GFS.JS //------------------------------------------------------------------------------- //******************************************************************************* //************************************************ GESTION DES FRAME AVEC SOURCES ET SCROLL COMPATIBLE NETSCAPE 4.0 ******* // (c) 2001-2002-2003 V-Technologies - JlR/NG // V.2.01 23/09/01 //************************************************ ---------------------------------------------------------------- ******* //************************************************ Variables var Gfs_RessourceUrl = "http://admn.france-examen.com"; // debug var Gfs_DbgSet = false; var Gfs_DbgFormName = "F1"; var Gfs_DbgTextAreaName = "DBG"; // Interval var Gfs_Down; var Gfs_Up; var Gfs_Right; var Gfs_Left; // Ensemble de pointeurs sur les objets Accroche var Gfs_Tab = new Array(); //Tableau qui contient l'ensemble des FrameGfs var Gfs_iNum, Gfs_iTypeCurs; var Gfs_DateJour = new Date(); //************************************************ Utilitaires function Gfs_max(a,b) { return (a>b) ? a : b;} function Gfs_Debug ( strDbg ) { if (!Gfs_DbgSet) return; pZone = eval("document."+Gfs_DbgFormName+"."+Gfs_DbgTextAreaName); if (pZone) { strVal = pZone.value; pZone.value = Gfs_DateJour.getHours()+":"+Gfs_DateJour.getMinutes()+":"+Gfs_DateJour.getSeconds()+" "; pZone.value += strDbg + "\n" + strVal; } } // scroll Up & down function Gfs_StartMoveUp(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Up = setInterval("Gfs_Tab["+iNum+"].MoveUp();", 10); } function Gfs_StartMoveDown(iNum) {Gfs_Tab[iNum].bIsScrolling = true; Gfs_Down = setInterval("Gfs_Tab["+iNum+"].MoveDown();", 10); } function Gfs_StartMoveLeft(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Left = setInterval("Gfs_Tab["+iNum+"].MoveLeft();", 10); } function Gfs_StartMoveRight(iNum) { Gfs_Tab[iNum].bIsScrolling = true; Gfs_Right = setInterval("Gfs_Tab["+iNum+"].MoveRight();", 10); } function Gfs_EndMove(iNum) { if (Gfs_Tab[iNum].bIsToBeRedraw && Gfs_Tab[iNum].bIsScrolling ) { hideLayer(Gfs_Tab[iNum].pageLay); setTimeout('showLayer(Gfs_Tab['+iNum+'].pageLay)', 100); } Gfs_Tab[iNum].IsScrolling = false; } // end scroll function Gfs_EndMoveUp(iNum) { clearInterval(Gfs_Up); Gfs_EndMove(iNum) } function Gfs_EndMoveDown(iNum) { clearInterval(Gfs_Down); Gfs_EndMove(iNum) } function Gfs_EndMoveLeft(iNum) { clearInterval(Gfs_Left); Gfs_EndMove(iNum) } function Gfs_EndMoveRight(iNum) { clearInterval(Gfs_Right); Gfs_EndMove(iNum) } // scroll cursor by Click function Gfs_SetClickOn(event, iNum, iTypeCurs) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown = Gfs_SetClick; Gfs_iNum = iNum; Gfs_iTypeCurs = iTypeCurs; } function Gfs_SetClickOff(event, iNum, iTypeCurs) { document.releaseEvents(Event.MOUSEDOWN); document.onmousedown = null; Gfs_iNum = 0; Gfs_iTypeCurs = 0; } function Gfs_SetClick(e) { layCurs = (Gfs_iTypeCurs == 1) ? Gfs_Tab[Gfs_iNum].CursH.Id : Gfs_Tab[Gfs_iNum].CursV.Id; curX = getPageX(e); curY = getPageY(e); bIsIn = (Gfs_iTypeCurs == 1) ? ((curX > getPageLeft(layCurs)) && (curX < getPageRight(layCurs))) : ((curY > getPageTop(layCurs)) && (curY < getPageBottom(layCurs))); if (bIsIn) return Gfs_SetDragOn(e, Gfs_iNum, Gfs_iTypeCurs); Gfs_SetDrag(e, Gfs_iNum, Gfs_iTypeCurs, true); Gfs_SetDragOff(e, Gfs_iNum, Gfs_iTypeCurs); } // scroll cursor by Move function Gfs_SetDragOn(event, iNum, iTypeCurs) { pCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH : Gfs_Tab[iNum].CursV; if (pCurs.bDrag) return; pCurs.curX = getPageX(event); pCurs.curY = getPageY(event); pCurs.bDrag = true; document.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP); document.onmouseup = Gfs_SetDragOff; document.onmousemove = Gfs_SetDrag; document.onmousedown = Gfs_SetDragOff; Gfs_iNum = iNum; Gfs_iTypeCurs = iTypeCurs; } function Gfs_SetDragOff(event, iNum, iTypeCurs) { isDrag = false; if (iTypeCurs == null) { iNum = Gfs_iNum; iTypeCurs = Gfs_iTypeCurs; } if (iTypeCurs != null) { pCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH : Gfs_Tab[iNum].CursV; isDrag = pCurs.bDrag; } if (!isDrag) return; pCurs.bDrag = false; document.onmousedown = Gfs_SetClick; document.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP); document.onmouseup = null; document.onmousemove = null; if (Gfs_Tab[iNum].bIsToBeRedraw) { hideLayer(Gfs_Tab[iNum].mainLay); setTimeout('showLayer(Gfs_Tab['+iNum+'].mainLay)', 100); } } function Gfs_SetDrag(event, iNum, iTypeCurs, isClick) { if (event.type != "mousemove" && !isClick) return; if (iTypeCurs == null) { iNum = Gfs_iNum; iTypeCurs = Gfs_iTypeCurs; } isDrag = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH.bDrag : Gfs_Tab[iNum].CursV.bDrag; if (!isDrag && !isClick) return; layCurs = (iTypeCurs == 1) ? Gfs_Tab[iNum].CursH.Id : Gfs_Tab[iNum].CursV.Id; layScroll = (iTypeCurs == 1) ? Gfs_Tab[iNum].scrZHLay : Gfs_Tab[iNum].scrZVLay; if (iTypeCurs == 1) { if (Gfs_Tab[iNum].CursH.curX == getPageX(event)) return; iPosE = getPageX(event) - (Gfs_Tab[iNum].CursH.Img.width/2) ; if (iPosE < getPageLeft(layScroll)) iPosE = getPageLeft(layScroll) ; if (iPosE + getWidth(layCurs) <= getPageRight(layScroll)) moveLayerBy(layCurs, iPosE-getPageLeft(layCurs) ,0); } else { if (Gfs_Tab[iNum].CursV.curY == getPageY(event)) return; iPosE = getPageY(event) - (Gfs_Tab[iNum].CursV.Img.height/2) ; if (iPosE < getPageTop(layScroll)) iPosE = getPageTop(layScroll) ; if (iPosE + getHeight(layCurs) <= getPageBottom(layScroll)) moveLayerBy(layCurs, 0, iPosE-getPageTop(layCurs)); } Gfs_Tab[iNum].MoveLay(iTypeCurs); return false; } //************************************************ functions Objets function Gfs_ChangeSrc(pstrSrc, piNum, iScroll) { // iScroll = 0 -> nada, 1 to top, 2 to bottom var pObj = (piNum != null && piNum != -1) ? Gfs_Tab[piNum] : this ; pObj.pageLay = (isIENS6) ? getLayer(pObj.strId) : getLayer("LS"+pObj.strId); pObj.pageLay.src = pstrSrc; if (iScroll && (isMinNS4)) { switch (parseInt(iScroll)) { case 1 : setTimeout('Gfs_ScrollLayToTop('+pObj.Num+')', 800); break; case 2 : setTimeout('Gfs_ScrollLayToBottom('+pObj.Num+')', 800); break; } } this.strSrc = pstrSrc; } function Gfs_MoveLeft() { this.ScrollLay(-1,0); this.MoveCurs(1); } function Gfs_MoveRight(){ this.ScrollLay(1,0); this.MoveCurs(1); } function Gfs_MoveUp(){ this.ScrollLay(0,-1); this.MoveCurs(2); } function Gfs_MoveDown(){ this.ScrollLay(0,1); this.MoveCurs(2); } // synchro parent fils function Gfs_Move(paddX, paddY) { moveLayerBy(this.mainLay, paddX ,paddY); iX = (getPageLeft(this.mainLay))-(getPageLeft(this.IdParent.pageLay)+getClipLeft(this.IdParent.pageLay)); iY = (getPageTop(this.mainLay))-(getPageTop(this.IdParent.pageLay)+getClipTop(this.IdParent.pageLay)); if (iX < 0 || iY < 0) { iX = (iX < 0) ? -iX : getClipLeft(this.mainLay); iY = (iY < 0) ? -iY : getClipTop(this.mainLay); clipLayer(this.mainLay, iX, iY, getClipRight(this.mainLay), getClipBottom(this.mainLay)); } else { clipLayer(this.mainLay, 0, 0, getClipRight(this.mainLay), getClipBottom(this.mainLay)); } } // synchro lay - cursor function Gfs_MoveCurs(iTypeCurs) { var layCurs = (iTypeCurs == 1) ? this.CursH.Id : this.CursV.Id; var layScroll = (iTypeCurs == 1) ? this.scrZHLay : this.scrZVLay; var iX = (iTypeCurs == 1) ? Math.round((( (getWidth(layScroll)-this.CursH.Img.width) * getClipLeft(this.pageLay) ) / ( getWidth(this.pageLay) - this.iWidth))) : 0; var iY = (iTypeCurs == 1) ? 0 : Math.round((( (getHeight(layScroll)-this.CursV.Img.height) * getClipTop(this.pageLay) ) / ( getHeight(this.pageLay) - this.iHeight))); moveLayerTo(layCurs, iX ,iY); } function Gfs_MoveLay(iTypeCurs) { var layScroll = (iTypeCurs == 1) ? this.scrZHLay : this.scrZVLay; var layCurs = (iTypeCurs == 1) ? this.CursH.Id : this.CursV.Id; var iX = (iTypeCurs == 1) ? Math.round(( ((getWidth(this.pageLay) - this.iWidth) * (getLeft(layCurs))) / (getWidth(layScroll)-this.CursH.Img.width) )) - getClipLeft(this.pageLay): 0; var iY = (iTypeCurs == 1) ? 0 : Math.round((((getHeight(this.pageLay) - this.iHeight) * (getTop(layCurs))) / (getHeight(layScroll)-this.CursV.Img.height) )) - getClipTop(this.pageLay); this.ScrollLay(iX, iY); } // scrolling lay function Gfs_ScrollLay(paddX, paddY) { var iX = getLeft(this.pageLay); var iY = getTop(this.pageLay); // Clip plus grand que taille du doc if (getClipHeight(this.pageLay) > this.pageLay.document.height) paddY = 0; if (getClipWidth(this.pageLay) > this.pageLay.document.width) paddX = 0; scrollLayerBy(this.pageLay, paddX, paddY, true); if (iX != getLeft(this.pageLay) || iY != getTop(this.pageLay)) for (i=0; i"+iCx+" PosY="+this.iPosY+"->"+iCy); if (!iCy) iCy = 0; if (!iCx) iCx = 0; moveLayerTo(pObj.mainLay, iCx, iCy); // alert(this.mainLay+" PosX="+getPageLeft(this.mainLay)+" PosY="+getPageTop(this.mainLay)); if (pWidth && pWidth != 0 && pHeight && pHeight != 0) { resizeLayerTo(pObj.mainLay, pWidth, pHeight); clipLayer(pObj.mainLay, 0, 0, pWidth, pHeight); if (isMinNS4) { iWidth = (pObj.bScrollV) ? pWidth-pObj.iSizeZoneScrollV : pWidth; iHeight = (pObj.bScrollH) ? pHeight-pObj.iSizeZoneScrollH : pHeight; resizeLayerTo(pObj.pageLay, iWidth, iHeight); clipLayer(pObj.pageLay, 0, 0, iWidth, iHeight); } } // alert(this.mainLay+" W="+getWidth(this.mainLay)+" H="+getHeight(this.mainLay)); } function Gfs_SetFrameAdjust(piNum) { // uniquement si bAbsolute a ete sete a true var pObj = (piNum && piNum != -1) ? Gfs_Tab[piNum] : this ; // alert(this.mainLay+" W="+getWidth(this.mainLay)+" H="+this.mainLay.document.body.scrollHeight); // alert(pObj.mainLay+" X="+getContentWidth(pObj.mainLay)+" Y="+getContentHeight(pObj.mainLay)); resizeLayerTo(pObj.mainLay, getContentWidth(pObj.pageLay), getContentHeight(pObj.pageLay)); clipLayer(pObj.pageLay, 0, 0, pWidth, pHeight); // alert(this.mainLay+" W="+this.mainLay.height+" H="+this.mainLay.width); } function Gfs_SetFrame(IdParent, bDown) { // bDown aligne sur le bas this.IdParent = IdParent; this.posLay = getLayer(this.strId+"p"); this.iPosY = (isIENS6) ? getPageTop(this.posLay)+2 : getPageTop(this.posLay); this.iPosX = (isIENS6) ? getPageLeft(this.posLay)+2 : getPageLeft(this.posLay); if (isIENS6) { document.write(''); this.mainLay = getLayer(this.strId); moveLayerTo(this.mainLay, this.iPosX, this.iPosY); clipLayer(this.mainLay, 0, 0, this.iWidth, this.iHeight); this.pageLay = this.mainLay; showLayer(this.mainLay); } else { iWidth = (this.bScrollV) ? this.iWidth-this.iSizeZoneScrollV : this.iWidth; iHeight = (this.bScrollH) ? this.iHeight-this.iSizeZoneScrollH : this.iHeight; if (!this.bIsToBeReload) { document.write(''); document.write(''); } if (this.bScrollV) { document.write(''); document.write(""); document.write(""); document.write(""); document.write(""); this.CursV = new Gfs_Curseur(this, 2, this.strId+"CursV", this.imgCenterV); document.write(''); document.write(""); document.write(" "); document.write(""); document.write(''); } if (this.bScrollH) { document.write(''); document.write(""); document.write(""); document.write(""); document.write(""); this.CursH = new Gfs_Curseur(this, 1, this.strId+"CursH", this.imgCenterH); document.write(''); document.write(""); document.write(" "); document.write(""); document.write(''); } if (this.bIsToBeReload) { document.write(''); } else document.write(''); this.pageLay = getLayer("LS"+this.strId); if (this.bScrollV) { this.scrVLay = getLayer("SV"+this.strId); this.scrZVLay = getLayer("ZSV"+this.strId); } if (this.bScrollH) { this.scrHLay = getLayer("SH"+this.strId); this.scrZHLay = getLayer("ZSH"+this.strId); } if (this.IdParent && !this.bIsToBeReload) this.IdParent.Attach(this); if (this.bIsToBeReload) { this.mainLay = this.pageLay; this.pageLay.moveToAbsolute(this.iPosX, this.iPosY); if (this.bScrollV) { moveLayerTo(this.scrVLay, this.iPosX+getWidth(this.pageLay), this.iPosY); showLayer(this.scrVLay); } if (this.bScrollH) { moveLayerTo(this.scrHLay, this.iPosX, this.iPosY+getHeight(this.pageLay)); showLayer(this.scrHLay); } sAction = "Gfs_ChangeSrc('"+this.strSrc+"', "+this.Num+")"; setTimeout(sAction, 3000); showLayer(this.mainLay); } else { this.mainLay = getLayer(this.strId); moveLayerTo(this.mainLay, this.iPosX, this.iPosY); clipLayer(this.mainLay, 0, 0, this.iWidth, this.iHeight); if (this.bScrollV) showLayer(this.scrVLay); if (this.bScrollH) showLayer(this.scrHLay); showLayer(this.mainLay); } // alert (this.strId+" -> Num="+this.Num); if (bDown) setTimeout("Gfs_ScrollLayToBottom("+this.Num+")", 200); } } //************************************************ Objets function Gfs_Curseur(pIdFrame, iTypCurs, strId, pImg) { this.strId = strId; this.IdFrame = pIdFrame; // Frame pere this.Img = pImg; this.bDrag = false; this.curX = 0; this.curY = 0; document.write(""); document.write(""); document.write(""); this.Id = getLayer(this.strId); } function Gfs_Frame(pstrId, pstrSrc, pstrBg, pbBorder, piCx, piCy, piScrollV, piScrollH, pstrScroll) { //pstrId: nom de la GfsFrame //pstrSrc: source de ------- //pstrBg: couleur de fond //pbBorder: booleen : bordure visible ou non //piCx , PiCy taille de la barre de navigation //piScrollV, piScrollH quantité de déplacement dans la frame gfs en X,Y //pParam si il y a des parametres apres l'url (ex:TOTO=1) this.Num = Gfs_Tab.length + 1; //on ajoute cette frame a GfsTab Gfs_Tab[this.Num] = this; // Variables this.strId = pstrId; // name this.strBg = (pstrBg != "") ? pstrBg : "FFFFFF"; // background color arrayOfWords = pstrSrc.split("?"); this.strSrc = arrayOfWords[0]+"?BG="+this.strBg; // source de la frame if (arrayOfWords.length > 1) this.strSrc += "&"+arrayOfWords[1]; this.bBorder = pbBorder; this.iPosX = 0; this.iPosY = 0; this.iWidth = piCx; this.iHeight = piCy; this.IdParent = null; this.aIdFils = new Array(); // functions this.Attach = Gfs_Attach; this.SetFrame = Gfs_SetFrame; this.SetFramePos = Gfs_SetFramePos; this.SetFrameAdjust = Gfs_SetFrameAdjust; this.SetFrameHide = Gfs_SetFrameHide; this.SetFrameShow = Gfs_SetFrameShow; this.MoveLay = Gfs_MoveLay; this.ScrollLay = Gfs_ScrollLay; this.ScrollLayToBottom = Gfs_ScrollLayToBottom; this.ScrollLayToTop = Gfs_ScrollLayToTop; this.MoveCurs = Gfs_MoveCurs; this.Move = Gfs_Move; this.MoveLeft = Gfs_MoveLeft; this.MoveRight= Gfs_MoveRight; this.MoveUp = Gfs_MoveUp; this.MoveDown = Gfs_MoveDown; this.ChangeSrc = Gfs_ChangeSrc; // layers this.posLay = null; this.mainLay = null; this.pageLay = null; this.scrHLay = null; this.scrZHLay = null; this.scrVLay = null; this.scrZVLay = null; //scrolls this.bIsToBeReload = false; //Permet un reload de la frame Gfs //mettre bIsToBeReload à vrai pour activer les scrollings et les changeSrc this.bIsToBeRedraw = false; this.bIsScrolling = false; this.paddX=1; this.paddY=1; this.bScrollH = (piScrollH != 0 && piScrollH != null); this.iSizeZoneScrollH = piScrollH; this.CursH = null; this.bScrollV = (piScrollV != 0 && piScrollV != null); this.iSizeZoneScrollV = piScrollV; this.CursV = null; this.scroll = (pstrScroll) ? pstrScroll : "no"; if (isIENS6 && (this.bScrollH || this.bScrollV) ) { this.bScrollH=false; this.bScrollV=false; this.scroll="auto"; } // Images if (piScrollV || piScrollH) { this.imgUp = new Image(); this.imgUp.src = Gfs_RessourceUrl+"/images/im_scrollup0.gif"; this.imgDown = new Image(); this.imgDown.src = Gfs_RessourceUrl+"/images/im_scrolldown0.gif"; this.imgLeft = new Image(); this.imgLeft.src = Gfs_RessourceUrl+"/images/im_scrollleft0.gif"; this.imgRight = new Image(); this.imgRight.src = Gfs_RessourceUrl+"/images/im_scrollright0.gif"; this.imgCenterV = new Image(); this.imgCenterV.src = Gfs_RessourceUrl+"/images/im_scrollcurv.gif"; this.imgCenterH = new Image(); this.imgCenterH.src = Gfs_RessourceUrl+"/images/im_scrollcurh.gif"; } if (isIENS6){ document.write(""); } else { document.write(""); } } //******************************************************************************* //------------------------------------------------------------------------------- // IMG.JS //------------------------------------------------------------------------------- //******************************************************************************* //----------------------------------------------------------------------------- // Image utilities. //----------------------------------------------------------------------------- function getImage(name) { if (isMinNS4) { return findImage(name, document); } if (isMinIE4) return eval('document.all.' + name); return null; } function findImage(name, doc) { var i, img; if (doc == null) doc = window.document; for (i = 0; i < doc.images.length; i++) if (doc.images[i].name == name) return doc.images[i]; for (i = 0; i < doc.layers.length; i++) if ((img = findImage(name, doc.layers[i].document)) != null) { img.container = doc.layers[i]; return img; } return null; } function changeOneImage(pname, src1, src2, doc) { var i, img; if (doc == null) doc = window.document; for (i = 0; i < doc.images.length; i++) if (doc.images[i].name == pname) if (doc.images[i].src.indexOf(src1) != -1) doc.images[i].src = src2; else doc.images[i].src = src1; } function getImagePageLeft(img) { var x, obj; if (isMinNS4) { if (img.container != null) return img.container.pageX + img.x; else return img.x; } if (isMinIE4) { x = 0; obj = img; while (obj.offsetParent != null) { x += obj.offsetLeft; obj = obj.offsetParent; } x += obj.offsetLeft; return x; } return -1; } function getImagePageTop(img) { var y, obj; if (isMinNS4) { if (img.container != null) return img.container.pageY + img.y; else return img.y; } if (isMinIE4) { y = 0; obj = img; while (obj.offsetParent != null) { y += obj.offsetTop; obj = obj.offsetParent; } y += obj.offsetTop; return y; } return -1; } function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i < changeImages.arguments.length; i+=2) { document[changeImages.arguments[i]].src = changeImages.arguments[i+1]; } } } function MM_findObj(n, d) { //v3.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&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&&i < d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i < d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x; } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i < a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i < a.length; i++) if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; } } } //******************************************************************************* //------------------------------------------------------------------------------- // UTIL.JS //------------------------------------------------------------------------------- //******************************************************************************* // ********************************** PRINT + // The code by Captain // Mead & Company, http://www.meadroid.com/wpm/ // fake print() for IE4.x function printFrame(pframe, onfinish) { if ( !pframe ) pframe = window; // if ( frame.document.readyState != "complete" && // !confirm("Le document a imprimer n'est pas encore completement telecharge! Continuer l'impression?") ) // { // if ( onfinish ) onfinish(); // return; // } isMinIE4 = (document.all)?1:0; if (isMinIE4) Pop2ShowS(pframe.src,"POP",10,10) ; else { loc = pframe.src ; re = new RegExp("/NS(/res/.*?)(/res/.*)"); loc = loc.replace(re,"/NS$2/"); Pop2ShowS(loc,"POP",10,10) ; } setTimeout("P2S.print();P2S.close()",1000); return ; if (!isMinIE4) { pframe.print(); return; } if (printIsNativeSupport() ) { /* focus handling for this scope is IE5Beta workaround, should be gone with IE5 RTM. */ var focused = document.activeElement; pframe.focus(); pframe.self.print(); if ( onfinish ) onfinish(); if ( focused && !focused.disabled ) focused.focus(); return; } var eventScope = printGetEventScope(pframe); var focused = document.activeElement; window.printHelper = function() { execScript("on error resume next: printWB.ExecWB 6, 1", "VBScript"); printFireEvent(pframe, eventScope, "onafterprint"); printWB.outerHTML = ""; if ( onfinish ) onfinish(); if ( focused && !focused.disabled ) focused.focus(); window.printHelper = null; } document.body.insertAdjacentHTML("beforeEnd", ""); printFireEvent(pframe, eventScope, "onbeforeprint"); pframe.focus(); window.printHelper = printHelper; setTimeout("window.printHelper()", 0); } // helpers function printIsNativeSupport() { var agent = window.navigator.userAgent; var i = agent.indexOf("MSIE ")+5; return parseInt(agent.substr(i)) >= 5 && agent.indexOf("5.0b1") < 0; } function printFireEvent(pframe, obj, name) { var handler = obj[name]; switch ( typeof(handler) ) { case "string": pframe.execScript(handler); break; case "function": handler(); } } function printGetEventScope(pframe) { var pframeset = pframe.document.all.tags("FRAMESET"); if ( pframeset.length ) return pframeset[0]; return pframe.document.body; } // ********************************** PRINT - function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i < a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i < a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v3.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?")) > 0&&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&&i < d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i < d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function tableau() { this.length = tableau.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = tableau.arguments[i] } var tablJour = new tableau("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"); var tablMois = new tableau("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"); var DateJour = new Date(); function date() { document.write(tablJour[(DateJour.getDay()+1)]," ",DateJour.getDate()," "); document.write(tablMois[(DateJour.getMonth()+1)]," "); if (!document.all) { document.write((DateJour.getFullYear())); } else { document.write(DateJour.getFullYear()); } } function dateShort() { document.write(tablJour[(DateJour.getDay()+1)]," ",DateJour.getDate()," "); document.write(tablMois[(DateJour.getMonth()+1)]); } function time() { document.write(DateJour.getHours(),":",DateJour.getMinutes()); } function TestCpFrance(strCp, bShort) { var iDpt = 0; var iVil = 0; var iSiz = (bShort) ? 2 : 5; if (strCp.length < iSiz) return false; iDpt = parseInt(strCp.substr(0,2), 10); if (isNaN(iDpt)) return false; if (!bShort) { iVil = parseInt(strCp.substr(3,3), 10); if (isNaN(iVil)) return false; } if (iDpt < 1 || iDpt > 95) { if (iDpt != 97 && iDpt != 98) return false; } return true; } function TestTime(strTime) { // format testé 00:00:00 re = /^(\d{1,2}):(\d{1,2}):?(\d{1,2})?$/; MyArray = re.exec(strTime); if (!MyArray) return false; iHou = MyArray[1]; iMin = MyArray[2]; if (MyArray.length > 3) { iSec = MyArray[3]; if (iSec < 0 && iSec > 59) return false; } if (iHou < 0 || iHou > 23) return false; if (iMin < 0 && iMin > 59) return false; return true; } function checkDate(iDay, iMonth, iYear) { if (iMonth < 1 || iMonth > 12) return false; if (iMonth == 2 && iDay > 28) { if (iYear%4 != 0) return false; if (iDay > 29) return false; } else if ((iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11) && iDay > 30) { return false; } else if (iDay > 31) return false; return true; } function TestDate(strDate) { // format testé AAAA-MM-JJ HH:MM:SS re = /^(\d{4})-(\d{2})-(\d{2})\s?(\d{1,2}:\d{1,2}:\d{1,2})?$/; MyArray = re.exec(strDate); if (MyArray) { iDay = Number(MyArray[3]); iMonth = Number(MyArray[2]); iYear = Number(MyArray[1]); if (!checkDate(iDay, iMonth, iYear)) return false; if (MyArray[4]) if (!TestTime(MyArray[4])) return false; return true; } // format testé JJ/MM/AAAA re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/; MyArray = re1.exec(strDate); if (MyArray) { iDay = Number(MyArray[1]); iMonth = Number(MyArray[2]); iYear = Number(MyArray[3]); if (!checkDate(iDay, iMonth, iYear)) return false; return true; } return false; } function SetDateToSql(strDate) { if (!TestDate(strDate)) return false; sDate = strDate; re1 = /^(\d{1,2})[- \/](\d{1,2})[- \/](\d{2}|\d{4})$/; MyArray = re1.exec(strDate); if (MyArray) { iYear = Number(MyArray[3]); if (iYear < 100) iYear+=2000; iMonth = Number(MyArray[2]); sMonth = (iMonth < 10) ? "0"+iMonth : String(iMonth); iDay = Number(MyArray[1]); sDay = (iDay < 10) ? "0"+iDay : String(iDay); sDate = String(iYear)+"-"+sMonth+"-"+sDay; } return sDate; } function isValidMail(Email) { var strTmp = Email; re1 = /^www\./i; MyArray = re1.exec(strTmp); if (MyArray) return false; re1 = /^[a-zA-Z0-9][-_a-zA-Z0-9\.]+@[a-zA-Z0-9][-a-zA-Z0-9]+\./; MyArray = re1.exec(strTmp); if (!MyArray) return false; return true; } function isValidTelephone(strTel, bMobile, bFrance) { if (bFrance) re1 = (bMobile) ? /^\+?\(?(\+?33)?\)?[-\.\s]*06([-\.\s]*\d\d){4}/: /^\+?\(?(\+?33)?\)?[-\.\s]*([-\.\s]*\d\d){5}/; else re1 = /^[0-9][-\.0-9\s]+/; MyArray = re1.exec(strTel); if (!MyArray) return false; return true; } function GetRadioValue( pRadioButton ) { var checkedButton = ""; if (!pRadioButton.length) { if (pRadioButton.checked == true) { checkedButton = pRadioButton.value; } } else { for (i = 0; i < pRadioButton.length; i++) { if (pRadioButton[i].checked == true) { checkedButton = pRadioButton[i].value; } } } return checkedButton; } function Pop2Print(strUrl, strName, isizeX, isizeY) { var iPop2Print = null; iPop2Print = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=yes,left=15,top=15,resizable=yes,personalbar=no,locationbar=no'); if (iPop2Print) iPop2Print.focus(); if (!isMinIE4) iPop2Print.print(); } function Pop2Print2(strUrl, strName, isizeX, isizeY) { var iPop2Print = null; iPop2Print = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=yes,left=15,top=15,resizable=no,personalbar=no,locationbar=no'); if (iPop2Print) iPop2Print.focus(); iPop2Print.print(); iPop2Print.close(); } function Pop2Show(strUrl, strName, isizeX, isizeY) { var iPop2Show = null; iPop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left=15,top=15,resizable=yes,personalbar=no,locationbar=no'); if (iPop2Show) iPop2Show.focus(); } function PopWindow(strUrl, strName) { var iPopWindow = null; iPopWindow = window.open(strUrl, strName); if (iPopWindow) iPopWindow.focus(); } var P2S; function Pop2ShowS(strUrl, strName, isizeX, isizeY) { // avec scroll P2S = null; P2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no'); if (P2S) P2S.focus(); } function Pop2ShowC(strUrl, strName, isizeX, isizeY, bScroll) { cxx = (screen.width / 2) - (isizeX / 2); cyy = (screen.height / 2) - (isizeY / 2); var Pop2Show = null; if (bScroll) Pop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=yes,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no'); else Pop2Show = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=yes,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no'); if (Pop2Show) Pop2Show.focus(); } function Pop2ShowCNM(strUrl, strName, isizeX, isizeY, bScroll) { cxx = (screen.width / 2) - (isizeX / 2); cyy = (screen.height / 2) - (isizeY / 2); var Pop2S = null; if (bScroll) Pop2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no'); else Pop2S = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left='+cxx+',top='+cyy+',resizable=no,personalbar=no,locationbar=no'); if (Pop2S) Pop2S.focus(); } function PopPhot(fic) { var PopPhot=null; PopPhot = window.open('','PHOT','width=500,height=500,toolbar=no,scrollbars=no,statusbar=no,titlebar=no,menubar=yes,left=15,top=15,resizable=no,personalbar=no,locationbar=no');PopPhot.document.write('Annuaire-jeunes
Cliquez pour fermer la fenêtre
'); PopPhot.focus(); } function FullEcran(strUrl) { var Fen_imprim = null; Fenl=screen.width-50; FenL=screen.height-100; Fen_imprim = window.open(strUrl,'Pleinecran','width='+Fenl+',height='+FenL+',top=0,left=0,resizable=yes,toolbar=no,scrollbars=yes,menubar=no,statusbar=no'); Fen_imprim.focus(); } function animages(iCollection,iFreq) { var i = 0; var max = iCollection.length-1; for (i = 0 ; i < max ; i++) { if (i == iTemoin) { obj = iCollection[i]; obj.src = "images/" + iCollection[i+1]+".gif"; i = i + 2; if (i < max) continue; } if (i != iTemoin) { obj = iCollection[i]; obj.src = "images/" + iCollection[i+2]+".gif"; i = i + 2; if (i < max) continue; } } iTemoin = iTemoin + 3; if ( iTemoin> (max - 1) ) iTemoin = 0; strTimer=iCollection; timer=window.setTimeout("animages(strTimer,iFreq)",iFreq); } function createArray(n, init) { this.size = n; //This initialization is absolutely necessary for (i = 1 ; i <= n ; i++) { this[i] = init; //Initialize all of the left hand elements } return this; //Return the array object to the caller } function replace(str, c1, c2){ res = ""; for(i = 0;i < str.length;i++){ if (str.charAt(i) == c1) res += c2; else res += str.charAt(i); } return res; } function m_UGetElement(strNam, pForm) { var i0; for (i0 = 0; i0 < pForm.elements.length; i0++) if (pForm.elements[i0].name == strNam) return pForm.elements[i0]; return false; } function AddElement(s_select, s_value, s_text, selected) { if (document.all){ // explorer newOpt = document.createElement("OPTION") ; newOpt.text = s_text ; newOpt.value = s_value ; s_select.options.add(newOpt, s_select.length, false, selected) ; } else { // netscape var newOpt = new Option(s_text,s_value, false, selected); s_select.options[s_select.length] = newOpt ; } } function m_UGetSelect(strObj, pForm) { var pSel = m_UGetElement(strObj, pForm); if (!pSel) return 0; return (pSel.length > 0 && pSel.selectedIndex >= 0) ? parseInt(pSel.options[pSel.selectedIndex].value): 0; } function m_UcleanSelect(strObj, pForm) { var pSel = m_UGetElement(strObj, pForm); if (!pSel) return ; while (pSel.length > 0) pSel.options[0] = null; } function m_UAddSelect(strObj, strTxt, strVal, pForm) { var pSel = m_UGetElement(strObj, pForm); if (!pSel) return ; AddElement(pSel, strVal, strTxt, false); } function m_UAddAllSelectIE(strObj, aOption, pForm, selected) { if (isNS || isMac) { //if (!isMinIE5) { m_UcleanSelect(strObj, pForm) ; for (i in aOption) m_UAddSelect(strObj, aOption[i], i, pForm) ; if (selected) m_USetSelectByVal(strObj, selected, pForm); else m_USetSelect(strObj, 0, pForm); } else { var pSel = m_UGetElement(strObj, pForm); if (!pSel) return ; var aTab = pSel.outerHTML.match(/(]*>)/i); var strText = "" ; for (i in aOption) { if (i==selected) { strText += "" ; } else { strText += "" ; } } pSel.outerHTML = aTab[1] + strText + "" ; } } function m_USetSelectByVal(strObj, sVal, pForm) { var pSel = m_UGetElement(strObj, pForm); if (!pSel) return ; for (i=0; i