// Script code Copyright MyRo 1999-2010 var GetObjectByRef = null; var GetElementsByTagName = null; function errorHandler(message, url, line) { window.alert ("Een fout gebeurde: " + message + "\n op de lijn:" + line + "\n in: " + url); // stop the event from bubbling up to the default window.onerror handler return true; } // install the global error-handler window.onerror = errorHandler; OS_UNKNOWN = 0; OS_LINUX = 1; OS_UBUNTU = 2; OS_MAC = 3; OS_WINDOWS = 4; BROWSER_UNKNOWN = 0; BROWSER_IE = 1; BROWSER_NS = 2; BROWSER_KONQUEROR = 3; BROWSER_OPERA = 4; BROWSER_FF = 5; BROWSER_SAFARI = 6; BROWSER_CHROME = 7; function BV_checkBrowser (key, browser) { var pos; pos = this.agent.indexOf (key); if (pos >= 0) { this.version = Math.floor (parseFloat (this.agent.substr (pos + key.length)) * 100); this.browser = browser; return true; } return false; } function BV_checkVersion (key) { var pos; pos = this.agent.indexOf (key); if (pos >= 0) { return Math.floor (parseFloat (this.agent.substr (pos + key.length)) * 100); } return -1; } function BV_checkOS (key, os) { var pos; pos = this.agent.indexOf (key); if (pos >= 0) { this.os = os; return true; } return false; } function BV_checkProperty (key) { return this.agent.indexOf (key) >= 0; } function BV_getVersion (browser) { if (this.browser == browser) return this.version; return -1; } function GetJavascriptStylename (n) { switch (n) { case 'background-image': return 'backgroundImage'; default: return n; } } function CBrowserVersion() { this.checkBrowser = BV_checkBrowser; this.checkVersion = BV_checkVersion; this.checkOS = BV_checkOS; this.checkProperty = BV_checkProperty; this.getVersion = BV_getVersion; this.ver = navigator.appVersion; this.agent = navigator.userAgent.toLowerCase(); if (!(this.checkOS ('ubuntu', OS_UBUNTU) || this.checkOS ('mac', OS_MAC) || this.checkOS ('linux', OS_LINUX) || this.checkOS ('windows', OS_WINDOWS))) this.os = OS_UNKNOWN; if (!(this.checkBrowser ('opera/', BROWSER_OPERA) || this.checkBrowser ('msie ', BROWSER_IE) || this.checkBrowser ('navigator/', BROWSER_NS) || this.checkBrowser ('netscape/', BROWSER_NS) || this.checkBrowser ('firefox/', BROWSER_FF) || this.checkBrowser ('konqueror', BROWSER_KONQUEROR) || this.checkBrowser ('safari', BROWSER_SAFARI) || this.checkBrowser ('chrome/', BROWSER_CHROME) || this.checkBrowser ('mozilla/', BROWSER_NS) )) this.browser = BROWSER_UNKNOWN; this.mozilla = this.checkVersion ('mozilla/'); this.gecko = this.checkProperty ('gecko'); this.webkit = this.checkVersion ('applewebkit/'); this.dom = document.getElementById?1:0; this.usedom = this.getVersion (BROWSER_NS) >= 600; this.reuse = this.getVersion (BROWSER_IE) >= 400 || this.usedom;//Reuse layers this.useDhtml = (this.getVersion (BROWSER_IE) > 300) || (this.getVersion (BROWSER_NS) > 600) || this.mozilla >= 500 || (BROWSER_KONQUEROR <= this.browser && this.browser <= BROWSER_CHROME) || this.webkit > 0; this.useLayer = this.getVersion (BROWSER_NS) == 400; this.supportError = this.getVersion (BROWSER_IE) >= 500 || this.getVersion (BROWSER_NS) >= 600; if (document.getElementById) GetObjectByRef = function (nm) {return document.getElementById (nm);}; else if (document.all) GetObjectByRef = function (nm) {return window.document.all [nm];}; else if (document.layers) GetObjectByRef = function (nm) {return document.layers [nm];}; else GetObjectByRef = null; if (document.getElementsByName) GetElementsByName = function (nm) {return document.getElementsByName (nm);}; else GetElementsByName = NULL; if (document.getElementsByTagName) GetElementsByTagName = function (nm) {return document.getElementsByTagName (nm);}; else GetElementsByTagName = NULL; if (this.browser == BROWSER_IE && (this.version < 500 && this.version >= 400)) GetParentNode = function(obj) {return obj ? obj.parentElement : NULL;}; else GetParentNode = function (obj) {return obj ? obj.parentNode : NULL;}; if (this.browser == BROWSER_IE) HasAttribute = function (obj, attr) {return attr in obj;}; else HasAttribute = function (obj, attr) {return obj.hasAttribute (attr);}; if (this.browser == BROWSER_IE) GetAttribute = function (obj, attr) {return obj [attr];}; else GetAttribute = function (obj, attr) {return obj.getAttribute (attr);}; if (this.browser == BROWSER_IE) SetAttribute = function (obj, attr, value) {obj [attr] = value;}; else SetAttribute = function (obj, attr, value) {obj.setAttribute (attr, value);}; if (this.browser == BROWSER_IE) SetEvent = function (obj, attr, value) {obj [attr] = new Function (value);}; else SetEvent = function (obj, attr, value) {obj.setAttribute (attr, value);}; RemoveAttribute = function (obj, attr) {obj.removeAttribute (attr);}; if (this.browser == BROWSER_IE) GetClassName = function (obj) {return GetAttribute (obj, "className");}; else GetClassName = function (obj) {return GetAttribute (obj, "class");}; if (this.browser == BROWSER_IE) SetClassName = function (obj, value) {return SetAttribute (obj, "className", value);}; else SetClassName = function (obj, value) {return SetAttribute (obj, "class", value);}; if (this.browser == BROWSER_IE) HasClassName = function (obj) {return HasAttribute (obj, "className");}; else HasClassName = function (obj) {return HasAttribute (obj, "class");}; if (this.browser == BROWSER_IE && this.version < 500) GetChildNodes = function (obj) {return obj.all;}; else GetChildNodes = function (obj) {return obj.childNodes;}; // http://www.ruzee.com/blog/2006/07/retrieving-css-styles-via-javascript/ if (document.defaultView && document.defaultView.getComputedStyle) GetComputedStyle = function (obj, styleElem) {return document.defaultView.getComputedStyle(obj, null).getPropertyValue(styleElem);} else // IE-way GetComputedStyle = function (obj, styleElem) {return obj.currentStyle[GetJavascriptStylename (styleElem)];} //window.alert ("agent=" + this.agent + " ver=" + this.ver + " os=" + this.os + " version=" + this.version + " browser=" + this.browser); return this; } var browserVersion=new CBrowserVersion(); // http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html function _filterResults(n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; } function GetClientWidth () {return _filterResults (window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0);} function GetClientHeight() {return _filterResults (window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0);} function GetScrollLeft() {return _filterResults (window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0);} function GetScrollTop() {return _filterResults (window.pageYOffset ? window.pageYOffset : 0, document.documentElement ? document.documentElement.scrollTop : 0, document.body ? document.body.scrollTop : 0);} function GetImageWidth (img) {return IEVersion () > 0 ? parseInt (img.offsetWidth) : img.width;} function GetImageHeight (img) {return IEVersion () > 0 ? parseInt (img.offsetHeight) : img.height;} function GetEventTarget (event) { if (event) if (event.target) return event.target; else if (event.srcElement) return event.srcElement; if (window.event && window.event.srcElement) return window.event.srcElement; return null; } function SupportDHTML () { if (browserVersion == null) return false; return browserVersion.useDhtml; } function GetBrowserVersion (browser) { if (browserVersion == null || browserVersion.browser != browser) return 0; return browserVersion.version; } function IEVersion () { return GetBrowserVersion (BROWSER_IE); } function NSVersion () { return GetBrowserVersion (BROWSER_NS); } function FireFoxVersion () { return GetBrowserVersion (BROWSER_FF); } function OperaVersion () { return GetBrowserVersion (BROWSER_OPERA); } function KonquerorVersion () { return GetBrowserVersion (BROWSER_KONQUEROR); } function SafariVersion () { return GetBrowserVersion (BROWSER_SAFARI); } function SupportLayers () { if (browserVersion == null) return false; return browserVersion.useLayer; } function SupportAnimation () { if (browserVersion == null) return false; return browserVersion.ie >= 550; } function Check() { if (!SupportDHTML ()) return; var obj; for (var i=0; i < Data.elements.length; i++) { obj=Data.elements[i]; if (obj.type=="text" && Data.elements[i].value.length > 0) { doSubmit.style.visibility="visible"; return 1; } } doSubmit.style.visibility="hidden"; } function InitSheet() { if (SupportDHTML ()) doSubmit.style.visibility="hidden"; } function GetStyleSheet (location) { if (typeof (location) != "string") location = ""; if (IEVersion () >= 0) { if (IEVersion () < 400) return ''; if (IEVersion () < 500) return ''; } if (KonquerorVersion () >= 0) return ''; if (NSVersion () >= 0) { if (NSVersion () < 500) return ''; } return ''; } function ShowAnswer (id, hide) { if (SupportDHTML ()) if (hide) id.style.display="none"; else id.style.display=""; } function ToggleAnswer (id) { if (SupportDHTML ()) { if (id.style.display=="none") id.style.display=""; else id.style.display="none"; } } function ToggleAnswerS (oItems) { var obj = GetObjectByRef (oItems); if (obj) { if (obj.style.display == "none") { obj.style.display = "inline"; } else { obj.style.display = "none"; } } } function SelectMenu (id) { if (SupportDHTML ()) { if (id.className == "RMenu") id.className = "RMenuPush"; id.style.color = "Red"; } } function UnselectMenu (id) { if (SupportDHTML ()) { if (id.className == "RMenuPush") id.className = "RMenu"; id.style.color = "Black"; } } function ToggleDisplay(oItems) { var obj = GetObjectByRef (oItems); if (obj) if ((obj.style.display == "") || (obj.style.display == "none")) { obj.style.display = "block"; //oButton.src = "/msdn-online/start/images/minus.gif"; } else { obj.style.display = "none"; //oButton.src = "/msdn-online/start/images/plus.gif"; } } var menuCount; function InitDownMenu1 (sTitle) { menuCount = 0; document.write (''); } function EndDownMenu1 () { document.write ("
"); } function MakeDownMenu1 (sName, sBookmark, sInfo, picture) { if (menuCount == 5) { document.write (''); menuCount = 1; } else menuCount++; var index; thisPage = location.href; index = thisPage.lastIndexOf ("/"); if (index < 0) index = thisPage.lastIndexOf ("\\"); if (index > 0) thisPage = thisPage.substr (index + 1); if (sName == null || thisPage == sName || thisPage == "_" + sName) { if (picture == null) document.write ('' + sInfo + '\n'); else document.write ('' + picture + sInfo + '\n'); return true; } else { var ref; if (sBookmark == "") ref = sName; else ref = sName + "#" + sBookmark; if (picture == null) document.write ('' + sInfo + '\n'); else document.write ('' + picture + sInfo + '\n'); return false; } } function DumpProperties (obj) { var s = typeof (obj) + "\n"; for (var p in obj) { s += p + "="; try { s += typeof (obj [p]) + " "; s += obj [p]; } catch (e) { var d = e.description; if (d.charCodeAt (d.length - 1) == 10) d = d.substr (0, d.length - 2); s += "[Error: " + e.number + "=" + d + "]"; } s += "\n"; } return s; } function FindObjectPos(obj) { var curtop = 0; var curleft = 0; if (obj && "offsetParent" in obj) { for (;;) { curleft += obj.offsetLeft; curleft += obj.clientLeft; curtop += obj.offsetTop; curtop += obj.clientTop; if ("offsetParent" in obj) { obj = obj.offsetParent; if (obj == null) break; } else break; } // for } return [curleft, curtop]; } function SetObjectPos (obj, co) { obj.style.top = co[1] + 'px'; obj.style.left = co[0] + 'px'; } function CUrlArgs () { this.items = new Object; this.add = urlargs_add; this.remove = urlargs_remove; this.addArg = urlargs_addArg; this.addUrl = urlargs_addUrl; this.toString = urlargs_toString; } function urlargs_add (arg, value) { this.items [arg] = value; } function urlargs_remove (arg) { this.items [arg] = null; } function urlargs_addArg (n) { var pos = n.indexOf ("="); if (pos > 0) this.add (n.substr (0, pos), n.substr (pos + 1)); } function urlargs_addUrl (url) { var params = url.split ("&"), param; for (param in params) this.addArg (params [param]); } function urlargs_toString () { var result = "", index; for (index in this.items) { if (result != "") result = result + "&"; result = result + index + "=" + this.items [index]; } return result; } function AddGetParam (url, getParam, doReplace) { var pos, urlEnd, urlBase; pos = url.indexOf ("#"); if (pos > 0) { urlEnd = url.substr (pos); url = url.substr (0, pos); } else urlEnd = ""; pos = url.indexOf ("?"); if (pos > 0) { urlBase = url.substr (0, pos); url = url.substr (pos + 1); } else urlBase = url; if (typeof (doReplace) == "undefined") doReplace = true; if (doReplace) { var args; args = new CUrlArgs (); args.addUrl (url); args.addUrl (getParam); getParam = args.toString (); } // if if (url.indexOf ("?") < 0) return urlBase + "?" + getParam + urlEnd; else return urlBase + "&" + getParam + urlEnd; } CAjax2 = function() { myself = this; if (window.XMLHttpRequest) this.request = new XMLHttpRequest(); else this.request = new ActiveXObject("Microsoft.XMLHTTP"); } function CAjax2_process (request) { if (request.request.readyState == 4) { if (request.request.status != 200) { if (typeof (request.onError) == 'function') request.onError (); } else if (typeof (request.onSuccess) == 'function') request.onSuccess(); } } CAjax2.prototype.get = function(url, onSuccess, onError) { this.request.open('GET', url, true); this.request.onreadystatechange = function() {CAjax2_process (myself);} this.onSuccess = onSuccess; this.onError = onError; this.request.send(null); } // http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html function addEvent( obj, type, fn ) { if (obj.addEventListener) obj.addEventListener( type, fn, false ); else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent( "on"+type, obj[type+fn] ); } } function removeEvent( obj, type, fn ) { if (obj.removeEventListener) obj.removeEventListener( type, fn, false ); else if (obj.detachEvent) { obj.detachEvent( "on"+type, obj[type+fn] ); obj[type+fn] = null; obj["e"+type+fn] = null; } } function getHiddenImageFrame (name) { var h = GetObjectByRef (name); if (h == null) { var c = document.createElement ('div'); c.id = name; c.style.display="none"; var b = GetElementsByTagName ("Body") [0]; b.appendChild (c); h = GetObjectByRef (name); } // if return h; }