var html5Forms = new function () { var me = this; var scriptNode = null, scriptDir = null, isScriptCompressed = false, // WebKit less than 534 doesn't show validation UI - we need to check for this (from http://stackoverflow.com/questions/6030522/html5-form-validation-modernizr-safari) hasNativeBubbles = navigator.userAgent.indexOf('WebKit') < 0 || parseInt(navigator.userAgent.match(/AppleWebKit\/([^ ]*)/)[1].split('.')[0]) > 534, hasBadValidationImplementation = !hasNativeBubbles; // making another var for this in case we have more criteria in the future. var globalEvent = document.addEventListener?document.createEvent("HTMLEvents"):null; function getBrowserLanguage() { var r = navigator.language; if (!r) { r = navigator.browserLanguage; } return r; } me.start = function () { var split = navigator.userAgent.split('Firefox/'); //Firefox 3.6 gives a wierd error when using the Twitter API //unless you do this onload. if (split.length>=1 && parseFloat(split[1]) <= 3.6) { EventHelpers.addEvent(window, 'load', me.init); } else { me.init(); } } me.init = function () { var scriptNodes = document.getElementsByTagName('script'); for (var i=0; i= 0) { isScriptCompressed = true; } break; } } if (scriptNode) { if (window.yepnope) { var inputSupport = Modernizr.inputtypes; /* let's load the supporting scripts according to what is in data-webforms2-support */ var supportArray = scriptNode.getAttribute('data-webforms2-support'); me.forceJSValidation = (scriptNode.getAttribute('data-webforms2-force-js-validation') == 'true'); me.turnOffValidation = (scriptNode.getAttribute('data-webforms2-turn-off-validation') == 'true'); me.forceJSDatePicker = (scriptNode.getAttribute('data-webforms2-force-js-date-picker') == 'true'); if (!supportArray) { return; } else if (trim(supportArray) == 'all') { supportArray="validation,number,color,date,ouput,range,placeholder"; } supportArray = supportArray.split(','); var toLoad = []; var toRunAfterLoad = []; var loadHTML5Widgets = false; for (var i=0; i<\/script>'); var script = document.getElementById("__ie_onload"); me.addEvent(script, 'readystatechange', me.runPageLoadEvents); /*@end @*/ } if (!window.html5Forms) { init(); } } html5Forms.start();