function common_scroll_to_bottom() { var c = document.getElementById("content"); c.scrollTop = c.scrollHeight; } function common_scroll_to_right() { var c = document.getElementById("content"); c.scrollLeft = c.scrollWidth; } function alertSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } window.alert( 'Width = ' + myWidth ); window.alert( 'Height = ' + myHeight ); } function getScrollXY() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; } /* function common_resize() { c = document.getElementById("content_groei"); c.style.height = ""+(common_get_clientHeight()-100)+"px"; c.scrollTop = c.scrollHeight; } */ /*function common_get_clientHeight() { windowH = window.innerHeight ? window.innerHeight : 0; documentH = document.documentElement ? document.documentElement.clientHeight : 0; bodyH = document.body ? document.body.clientHeight : 0; // return biggest if (windowH>documentH && windowH>bodyH) {return windowH;} if (documentH>windowH && documentH>bodyH) {return documentH;} if (bodyH>windowH && bodyH>documentH) {return bodyH;} }*/ function common_get_clientHeight() { return common_filterResults ( window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0 ); } function common_get_clientWidth() { return common_filterResults ( window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0 ); } function common_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 common_getPreviousByClass(node, classname, alert_if_not_found, strict) { //common_alert_node(node, "common_getPreviousByClass. classname="+classname) if (typeof(alert_if_not_found)=== 'undefined') { alert_if_not_found = true; } if (typeof(strict)=== 'undefined') { strict = true; } n = node; while (true) { n = n.previousSibling; if (n===null) { // stop when there's no previous node. break; } else if (typeof(n.className)!= 'undefined') { // skip text nodes if (n.className.indexOf(classname) != -1) { return n; } else if (strict) { // stop if we find another class break; } } } if (alert_if_not_found) { common_alert_node(node, "common_getPreviousByClass not found. classname="+classname) } return null; } function common_alert_node(node, text) { //atts="";for (a=0; a node.attributes has no properties if (typeof(text)!='undefined') { s = text+"\n\n"; } else { s = ""; } s+="<"+node.nodeName+" class=\""+node.className+"\" id=\""+node.id+"\">\n\n"; if (typeof(node.innerHTML)=='undefined') { s+="(no innerHTML)\n"; } else if (node.innerHTML.length<1000) { s+="innerHTML:\n"+node.innerHTML+"\n\n"; } else { s+="innerHTML:\n"+node.innerHTML.substring(0,1000)+"[...]\n\n"; } if (typeof(node.childNodes)!='undefined') { s+="childNodes.length="+node.childNodes.length+"\n"; } if (typeof(node.nodeValue)!='undefined') { s+="value="+node.nodeValue+"\n"; } t=node.nodeType; if (t==1) {s+="nodeType=ELEMENT_NODE\n";} if (t==2) {s+="nodeType=ATTRIBUTE_NODE\n";} if (t==3) {s+="nodeType=TEXT_NODE\n";} if (t==4) {s+="nodeType=CDATA_SECTION_NODE\n";} if (t==5) {s+="nodeType=ENTITY_REFERENCE_NODE\n";} if (t==6) {s+="nodeType=ENTITY_NODE\n";} if (t==7) {s+="nodeType=PROCESSING_INSTRUCTION_NODE\n";} if (t==8) {s+="nodeType=COMMENT_NODE\n";} if (t==9) {s+="nodeType=DOCUMENT_NODE\n";} if (t==10) {s+="nodeType=DOCUMENT_TYPE_NODE\n";} if (t==11) {s+="nodeType=DOCUMENT_FRAGMENT_NODE\n";} if (t==12) {s+="nodeType=NOTATION_NODE\n";} //if (node.nodeType==3) { // text //} alert(s); } // http://www.webtoolkit.info/javascript-url-decode-encode.html function common_URLencode(string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return escape(utftext); } function common_URLdecode(string) { string = unescape(string); var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } function common_hide(node) { var c = node.className; if (node.className.indexOf("hidden")==-1) { // checking "hidden" instead of " hidden" because FF removes leading spaces. node.className = node.className + " hidden"; // " hidden" --> space is needed to keep other css rules working. } } function common_show(node) { node.className = node.className.replace(" hidden", ""); node.className = node.className.replace("hidden", ""); // FF removes leading space: