function getElement(id, obj) { if (typeof obj == 'undefined') obj = document; else obj = obj.document; if (obj.all) var element = obj.all[id]; else if (obj.layers) var element = obj.layers[id]; else if (obj.getElementById) var element = obj.getElementById(id); else return null; return element; } sprintfWrapper = { init : function () { if (typeof arguments == 'undefined') { return null; } if (arguments.length < 1) { return null; } if (typeof arguments[0] != 'string') { return null; } if (typeof RegExp == 'undefined') { return null; } var string = arguments[0]; var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); var matches = new Array(); var strings = new Array(); var convCount = 0; var stringPosStart = 0; var stringPosEnd = 0; var matchPosEnd = 0; var newString = ''; var match = null; while (match = exp.exec(string)) { if (match[9]) { convCount += 1; } stringPosStart = matchPosEnd; stringPosEnd = exp.lastIndex - match[0].length; strings[strings.length] = string.substring(stringPosStart, stringPosEnd); matchPosEnd = exp.lastIndex; matches[matches.length] = { match: match[0], left: match[3] ? true : false, sign: match[4] || '', pad: match[5] || ' ', min: match[6] || 0, precision: match[8], code: match[9] || '%', negative: parseInt(arguments[convCount]) < 0 ? true : false, argument: String(arguments[convCount]) }; } strings[strings.length] = string.substring(matchPosEnd); if (matches.length == 0) { return string; } if ((arguments.length - 1) < convCount) { return null; } var code = null; var match = null; var i = null; for (i=0; i= arguments.length) { alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\n' + 'for the number of substitution parameters in string (' + numSubstitutions + ' so far).'); } var param = arguments[numSubstitutions]; var pad = ''; if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1); else if (pPad) pad = pPad; var justifyRight = true; if (pJustify && pJustify === "-") justifyRight = false; var minLength = -1; if (pMinLength) minLength = parseInt(pMinLength); var precision = -1; if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1)); var subst = param; switch (pType) { case 'b': subst = parseInt(param).toString(2); break; case 'c': subst = String.fromCharCode(parseInt(param)); break; case 'd': subst = parseInt(param) ? parseInt(param) : 0; break; case 'u': subst = Math.abs(param); break; case 'f': subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision) : parseFloat(param); break; case 'o': subst = parseInt(param).toString(8); break; case 's': subst = param; break; case 'x': subst = ('' + parseInt(param).toString(16)).toLowerCase(); break; case 'X': subst = ('' + parseInt(param).toString(16)).toUpperCase(); break; } var padLeft = minLength - subst.toString().length; if (padLeft > 0) { var arrTmp = new Array(padLeft+1); var padding = arrTmp.join(pad?pad:" "); } else { var padding = ""; } } str = leftpart + padding + subst + rightPart; } return str; } function gotoURL(url, nowe) { if (typeof nowe == 'undefined' || !nowe) window.location.href = url; else window.open(url); } function modul(nazwa) { gotoURL('Modul=' + nazwa); } function pokazUkryj(id) { getElement(id).style.display = getElement(id).style.display == 'none' ? 'block' : 'none'; } function pobierzPole(f, p) { for (i = 0; i < f.elements.length; i++) if (f.elements[i].name == p) return f.elements[i]; return null; } function pobierzPoleRadioWybrane(f, p) { for (i = 0; i < f.elements.length; i++) if (f.elements[i].name == p && f.elements[i].checked) return f.elements[i]; return null; } function usunZdarzenia(e) { if (e && e.stopPropagation) e.stopPropagation(); else event.cancelBubble = true; } /* walidacje */ function sprawdzGodzine(czas) { return czas.match(/^[0-9]{1,2}:[0-9]{2}$/) && parseInt(czas.substring(0, 2)) >= 0 && parseInt(czas.substring(0, 2)) < 24; } function sprawdzDate(data) { return data.match(/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/) || data.match(/^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/); } function sprawdzWiek(dataUrodzenia) { var dzis = Math.floor(new Date().getTime() / 1000 / 60 / 60 / 24); if (dataUrodzenia.match(/^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/)) { var elementy = dataUrodzenia.split('-'); var data = new Date(elementy[0], elementy[1] - 1, elementy[2]); data = Math.floor(data.getTime() / 1000 / 60 / 60 / 24); } else if (dataUrodzenia.match(/^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/)) { var elementy = dataUrodzenia.split('.'); var data = new Date(elementy[2], elementy[1] - 1, elementy[1]); data = Math.floor(data.getTime() / 1000 / 60 / 60 / 24); } else var data = dzis; return (dzis - data) / 365.25; } function sprawdzPESEL(numer) { var i; var suma = 0; var wagi = [1,3,7,9,1,3,7,9,1,3]; if (numer.search(/^[0-9]{11}$/) != -1) { numer = numer.replace(/[^0-9]/g, ''); for (i = 0; i < wagi.length; i++) suma += wagi[i] * parseInt(numer.substr(i, 1)); return parseInt(numer.substr(wagi.length, 1)) == (10 - suma % 10) % 10; } else return false; } function sprawdzNIP(numer) { var i; var suma = 0; var wagi = [6,5,7,2,3,4,5,6,7]; if ( numer.search(/^[0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}$/) != -1 || numer.search(/^[0-9]{3}-[0-9]{2}-[0-9]{2}-[0-9]{3}$/) != -1 || numer.search(/^[a-zA-Z]{2} [0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}$/) != -1 || numer.search(/^[a-zA-Z]{2} [0-9]{3}-[0-9]{2}-[0-9]{2}-[0-9]{3}$/) != -1 || numer.search(/^[a-zA-Z]{2}[0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}$/) != -1 || numer.search(/^[a-zA-Z]{2}[0-9]{3}-[0-9]{2}-[0-9]{2}-[0-9]{3}$/) != -1 || numer.search(/^[0-9]{10}$/) != -1 || numer.search(/^[a-zA-Z]{2} [0-9]{10}$/) != -1 || numer.search(/^[a-zA-Z]{2}[0-9]{10}$/) != -1 ) { numer = numer.replace(/[^0-9]/g, ''); for (i = 0; i < wagi.length; i++) suma += wagi[i] * parseInt(numer.substr(i, 1)); return parseInt(numer.substr(wagi.length, 1)) == suma % 11 % 10; } else return false; } function sprawdzREGON(numer) { var i; var suma = 0; var wagi = []; wagi[7] = [2,3,4,5,6,7]; wagi[9] = [8,9,2,3,4,5,6,7] wagi[14] = [2,4,8,5,0,9,7,3,6,1,2,4,8]; if ( numer.search(/^[0-9]{7}$/) != -1 || numer.search(/^[0-9]{9}$/) != -1 || numer.search(/^[0-9]{14}$/) != -1 ) { numer = numer.replace(/[^0-9]/g, ''); for (i = 0; i < wagi[numer.length].length; i++) suma += wagi[numer.length][i] * parseInt(numer.substr(i, 1)); return parseInt(numer.substr(wagi[numer.length].length, 1)) == suma % 11 % 10; } else return false; } function sprawdzEmail(email) { return email.match(/^[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,}$/); } function sprawdzIdentyfikator(ident) { ident = trim(ident); return ident.match(/^[a-zA-Z0-9\ \.\-_ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]+$/); } function sprawdzKod(numer) { return numer.match(/^[0-9]{2}\-[0-9]{3}$/); } function sprawdzTelefon(numer) { return sprawdzTelefonStacjonarny(numer) || sprawdzTelefonKomorkowy(numer); } function sprawdzTelefonStacjonarny(numer) { return numer.match(/^[0-9]{2}\-[0-9]{7}$/); } function sprawdzTelefonKomorkowy(numer) { return numer.match(/^[0-9]{3}\-[0-9]{6}$/); } function trim(str, chars) { return ltrim(rtrim(str, chars), chars); } function ltrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("^[" + chars + "]+", "g"), ""); } function rtrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("[" + chars + "]+$", "g"), ""); } /* siła hasła */ function silaHasla(haslo) { var len = haslo.length; var litery_male = 0; var litery_duze = 0; var cyfry = 0; var inne = 0; for (var i = 0; i < haslo.length; i++) { if (haslo.substr(i, 1).match(/[a-z]/)) litery_male++; if (haslo.substr(i, 1).match(/[A-Z]/)) litery_duze++; if (haslo.substr(i, 1).match(/[0-9]/)) cyfry++; if (haslo.substr(i, 1).match(/[^a-zA-Z0-9\ ]/)) inne++; } var zestawy = 0; var punkty = 0; var mozliwePunkty = 4 + 1 + 3 + 3 + 5 + 16; if (litery_male > 0) { zestawy++; punkty += 1; } if (litery_duze > 0) { zestawy++; punkty += 3; } if (cyfry > 0) { zestawy++; punkty += 3; } if (inne > 0) { zestawy++; punkty += 5; } punkty += zestawy; punkty += len > 16 ? 16 : len; return Math.floor(100 * punkty / mozliwePunkty); } function ustalSile(haslo, miernik) { var sila = silaHasla(haslo); var kolory = []; kolory[10] = '#00FF00'; kolory[9] = '#22FF00'; kolory[8] = '#44FF00'; kolory[7] = '#88FF00'; kolory[6] = '#CCFF00'; kolory[5] = '#FFFF00'; kolory[4] = '#FFCC00'; kolory[3] = '#FF8800'; kolory[2] = '#FF4400'; kolory[1] = '#FF2200'; kolory[0] = '#FF0000'; getElement(miernik).style.width = sila + '%'; getElement(miernik).style.background = kolory[Math.floor(sila / 10)]; } function dodajDoUlubionych() { var title = 'Znany Prawnik'; var url = 'http://www.znanyprawnik.pl'; if (window.sidebar) { // Mozilla Firefox Bookmark window.sidebar.addPanel(title, url,""); } else if( window.external ) { // IE Favorite window.external.AddFavorite( url, title); } else if(window.opera && window.print) { // Opera Hotlist return true; } } function preloadMenu() { var imgs = ['btn_forum', 'btn_kontakt', 'btn_narzedzia', 'btn_o_nas', 'btn_oferta', 'btn_publikacje_prawne']; for (var i = 0; i < imgs.length; i++) { var img = new Image(); img.src = sprintf('/gfx/strona/%s_wybrany.jpg', imgs[i]); } } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt /*, from*/) { var len = this.length; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++) { if (from in this && this[from] === elt) return from; } return -1; }; } function formatujTelefon(telefon) { var stacjonarne = [12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 30, 32, 33, 34, 38, 39, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61, 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84, 85, 86, 87, 89, 91, 94, 95]; telefon = telefon.replace(/[^0-9]/g, ''); telefon = telefon.replace(/^0/g, ''); telefon = telefon.substr(0, 9); if (telefon.length != 9) return ''; if (stacjonarne.indexOf(parseInt(telefon.substring(0, 2))) == -1) telefon = sprintf('%s-%s%s', telefon.substr(0, 3), telefon.substr(3, 3), telefon.substr(6, 3)); else telefon = sprintf('%s-%s%s%s', telefon.substr(0, 2), telefon.substr(2, 3), telefon.substr(5, 2), telefon.substr(7, 2)); return telefon; } function urlEncodeCharacter (c) { return '%' + c.charCodeAt(0).toString(16); } function urlDecodeCharacter (str, c) { return String.fromCharCode(parseInt(c, 16)); } function urlEncode ( s ) { return encodeURIComponent( s ).replace( /\%20/g, '+' ).replace( /[!'()*~]/g, urlEncodeCharacter ); } function urlDecode ( s ) { return decodeURIComponent(s.replace( /\+/g, '%20' )).replace( /\%([0-9a-f]{2})/g, urlDecodeCharacter); } function usunZleZnakiIdentyfikatoraStrony(tekst) { tekst = tekst.toLowerCase(); tekst = tekst.replace('ą', 'a'); tekst = tekst.replace('ć', 'c'); tekst = tekst.replace('ę', 'e'); tekst = tekst.replace('ł', 'l'); tekst = tekst.replace('ń', 'n'); tekst = tekst.replace('ó', 'o'); tekst = tekst.replace('ś', 's'); tekst = tekst.replace('ź', 'z'); tekst = tekst.replace('ż', 'z'); tekst = tekst.replace(/[^a-z0-9\.\-]/g, ''); while (tekst.indexOf('..') != -1) tekst = tekst.replace('..', '.'); while (tekst.indexOf('--') != -1) tekst = tekst.replace('--', '-'); while (tekst.match(/^[-.]+/)) tekst = tekst.replace(/^[-.]+/, ''); while (tekst.match(/[-.]+$/)) tekst = tekst.replace(/[-.]+$/, ''); return tekst; } function usunZleZnakiIdentyfikatoraPoczty(tekst) { return usunZleZnakiIdentyfikatoraStrony(tekst); } function pobierzKod(kod, wojewodztwo, miasto, poczta) { advAJAX.get({ url: "/WebService/KodyPocztowe/" + urlEncode(kod.value), onSuccess : function(obj) { var dane = JSON.parse(obj.responseText); if (typeof wojewodztwo != 'undefined') wojewodztwo.value = dane.wojewodztwo; if (typeof miasto != 'undefined') miasto.value = dane.miasto; if (typeof poczta != 'undefined') poczta.value = dane.miasto; } }); } function pokazWszystkieMiasta() { getElement('divNajpopularniejszeMiasta').style.display = 'none'; getElement('divNajpopularniejszeMiastaWszystkie').style.display = 'block'; } function Kalkulatory() {} Kalkulatory.tylkoCyfry = function(e) { var keynum; var keychar; var numcheck; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } keychar = String.fromCharCode(keynum); if((48<=keynum && keynum<=57) || (96<=keynum && keynum<=105) || keynum==8 || keynum==46 ||keynum==9 || keynum==37 || keynum==38 || keynum==39 || keynum==40) { return true; } return false; } Kalkulatory.formatKwoty = function(e, obj) { var keynum; var keychar; var numcheck; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } keychar = String.fromCharCode(keynum); if((48<=keynum && keynum<=57) || (96<=keynum && keynum<=105) || keynum==8 || keynum==46 ||keynum==9 || keynum==190 || keynum==37 || keynum==38 || keynum==39 || keynum==40 || keynum==188) { /*sprawdz czy juz jest kropka, jezeli tak to */ /*if(obj.value.match(/^[0-9]*\.[0-9]{2}$/) && 48<=keynum && keynum<=57) { return false; } */ if(obj.value.match(/^[0-9]*[\.,][0-9]*$/) && (keynum==190 || keynum==188)) { return false; } return true; } return false; } Kalkulatory.formatNIP = function(e) { var keynum; var keychar; var numcheck; if(window.event) // IE { keynum = e.keyCode; } else if(e.which) // Netscape/Firefox/Opera { keynum = e.which; } keychar = String.fromCharCode(keynum); if((48<=keynum && keynum<=57) || (96<=keynum && keynum<=105) || keynum==8 || keynum==46 ||keynum==9 || keynum==109 || keynum==37 || keynum==38 || keynum==39 || keynum==40) { return true; } return false; } /* * AdvancedAJAX 1.1.2 * (c) 2005-2006 Lukasz Lach * mail: anakin@php5.pl * www: http://advajax.anakin.us/ * http://anakin.us/ * http://creativecommons.org/licenses/LGPL/2.1/ * */ function advAJAX() { var obj = new Object(); obj.url = window.location.href; obj.method = "GET"; obj.parameters = new Object(); obj.jsonParameters = new Object(); obj.headers = new Object(); obj.async = true; obj.mimeType = "text/xml"; obj.username = null; obj.password = null; obj.form = null; obj.disableForm = true; obj.unique = true; obj.uniqueParameter = "_uniqid"; obj.requestDone = false; obj.queryString = ""; obj.responseText = null; obj.responseXML = null; obj.status = null; obj.statusText = null; obj.aborted = false; obj.timeout = 0; obj.retryCount = 0; obj.retryDelay = 1000; obj.tag = null; obj.group = null; obj.progressTimerInterval = 50; obj.xmlHttpRequest = null; obj.onInitialization = null; obj.onFinalization = null; obj.onReadyStateChange = null; obj.onLoading = null; obj.onLoaded = null; obj.onInteractive = null; obj.onComplete = null; obj.onProgress = null; obj.onSuccess = null; obj.onFatalError = null; obj.onError = null; obj.onTimeout = null; obj.onRetryDelay = null; obj.onRetry = null; obj.onGroupEnter = null; obj.onGroupLeave = null; obj.createXmlHttpRequest = function() { if (typeof XMLHttpRequest != "undefined") return new XMLHttpRequest(); var xhrVersion = [ "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp","Microsoft.XMLHttp" ]; for (var i = 0; i < xhrVersion.length; i++) { try { var xhrObj = new ActiveXObject(xhrVersion[i]); return xhrObj; } catch (e) { } } obj.raiseEvent("FatalError"); return null; }; obj._oldResponseLength = null; obj._progressTimer = null; obj._progressStarted = navigator.userAgent.indexOf('Opera') == -1; obj._onProgress = function() { if (typeof obj.onProgress == "function" && typeof obj.xmlHttpRequest.getResponseHeader == "function") { var contentLength = obj.xmlHttpRequest.getResponseHeader("Content-length"); if (contentLength != null && contentLength != '') { var responseLength = obj.xmlHttpRequest.responseText.length; if (responseLength != obj._oldResponseLength) { obj.raiseEvent("Progress", obj, responseLength, contentLength); obj._oldResponseLength = obj.xmlHttpRequest.responseText.length; } } } if (obj._progressStarted) return; obj._progressStarted = true; var _obj = this; this.__onProgress = function() { obj._onProgress(); obj._progressTimer = window.setTimeout(_obj.__onProgress, obj.progressTimerInterval); } _obj.__onProgress(); } obj._onInitializationHandled = false; obj._initObject = function() { if (obj.xmlHttpRequest != null) { delete obj.xmlHttpRequest["onreadystatechange"]; obj.xmlHttpRequest = null; } if ((obj.xmlHttpRequest = obj.createXmlHttpRequest()) == null) return null; if (typeof obj.xmlHttpRequest.overrideMimeType != "undefined") obj.xmlHttpRequest.overrideMimeType(obj.mimeType); obj.xmlHttpRequest.onreadystatechange = function() { if (obj == null || obj.xmlHttpRequest == null) return; obj.raiseEvent("ReadyStateChange", obj, obj.xmlHttpRequest.readyState); obj._onProgress(); switch (obj.xmlHttpRequest.readyState) { case 1: obj._onLoading(); break; case 2: obj._onLoaded(); break; case 3: obj._onInteractive(); break; case 4: obj._onComplete(); break; } }; obj._onLoadingHandled = obj._onLoadedHandled = obj._onInteractiveHandled = obj._onCompleteHandled = false; }; obj._onLoading = function() { if (obj._onLoadingHandled) return; if (!obj._retry && obj.group != null) { if (typeof advAJAX._groupData[obj.group] == "undefined") advAJAX._groupData[obj.group] = 0; advAJAX._groupData[obj.group]++; if (typeof obj.onGroupEnter == "function" && advAJAX._groupData[obj.group] == 1) obj.onGroupEnter(obj); } obj.raiseEvent("Loading", obj); obj._onLoadingHandled = true; }; obj._onLoaded = function() { if (obj._onLoadedHandled) return; obj.raiseEvent("Loaded", obj); obj._onLoadedHandled = true; }; obj._onInteractive = function() { if (obj._onInteractiveHandled) return; obj.raiseEvent("Interactive", obj); obj._onInteractiveHandled = true; if (!obj._progressStarted) obj._onProgress(); }; obj._onComplete = function() { if (obj._onCompleteHandled || obj.aborted) return; if (obj._progressStarted) { window.clearInterval(obj._progressTimer); obj._progressStarted = false; } obj.requestDone = true; with (obj.xmlHttpRequest) { obj.responseText = responseText; obj.responseXML = responseXML; if (typeof status != "undefined") obj.status = status; if (typeof statusText != "undefined") obj.statusText = statusText; } obj.raiseEvent("Complete", obj); obj._onCompleteHandled = true; if (obj.status == 200) obj.raiseEvent("Success", obj); else obj.raiseEvent("Error", obj); delete obj.xmlHttpRequest['onreadystatechange']; obj.xmlHttpRequest = null; if (obj.disableForm) obj.switchForm(true); obj._groupLeave(); obj.raiseEvent("Finalization", obj); }; obj._groupLeave = function() { if (obj.group != null) { advAJAX._groupData[obj.group]--; if (advAJAX._groupData[obj.group] == 0) obj.raiseEvent("GroupLeave", obj); } }; obj._retry = false; obj._retryNo = 0; obj._onTimeout = function() { if (obj == null || obj.xmlHttpRequest == null || obj._onCompleteHandled) return; obj.aborted = true; obj.xmlHttpRequest.abort(); obj.raiseEvent("Timeout", obj); obj._retry = true; if (obj._retryNo != obj.retryCount) { obj._initObject(); if (obj.retryDelay > 0) { obj.raiseEvent("RetryDelay", obj); startTime = new Date().getTime(); while (new Date().getTime() - startTime < obj.retryDelay); } obj._retryNo++; obj.raiseEvent("Retry", obj, obj._retryNo); obj.run(); } else { delete obj.xmlHttpRequest["onreadystatechange"]; obj.xmlHttpRequest = null; if (obj.disableForm) obj.switchForm(true); obj._groupLeave(); obj.raiseEvent("Finalization", obj); } }; obj.run = function() { obj._initObject(); if (obj.xmlHttpRequest == null) return false; obj.aborted = false; if (!obj._onInitializationHandled) { obj.raiseEvent("Initialization", obj); obj._onInitializationHandled = true; } if (obj.method == "GET" && obj.unique) obj.parameters[encodeURIComponent(obj.uniqueParameter)] = new Date().getTime().toString().substr(5) + Math.floor(Math.random() * 100).toString(); if (!obj._retry) { for (var a in obj.parameters) { if (obj.queryString.length > 0) obj.queryString += "&"; if (typeof obj.parameters[a] != "object") obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a]); else { for (var i = 0; i < obj.parameters[a].length; i++) obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a][i]) + "&"; obj.queryString = obj.queryString.slice(0, -1); } } for (var a in obj.jsonParameters) { var useJson = typeof [].toJSONString == 'function'; if (obj.queryString.length > 0) obj.queryString += "&"; obj.queryString += encodeURIComponent(a) + "="; if (useJson) obj.queryString += encodeURIComponent(obj.jsonParameters[a].toJSONString()); else obj.queryString += encodeURIComponent(obj.jsonParameters[a]); } if (obj.method == "GET" && obj.queryString.length > 0) obj.url += (obj.url.indexOf("?") != -1 ? "&" : "?") + obj.queryString; } if (obj.disableForm) obj.switchForm(false); try { obj.xmlHttpRequest.open(obj.method, obj.url, obj.async, obj.username || '', obj.password || ''); } catch (e) { obj.raiseEvent("FatalError", obj, e); return; } if (obj.timeout > 0) setTimeout(obj._onTimeout, obj.timeout); if (typeof obj.xmlHttpRequest.setRequestHeader != "undefined") for (var a in obj.headers) obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a), encodeURIComponent(obj.headers[a])); if (obj.method == "POST" && typeof obj.xmlHttpRequest.setRequestHeader != "undefined") { obj.xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); obj.xmlHttpRequest.send(obj.queryString); } else if (obj.method == "GET") obj.xmlHttpRequest.send(''); }; obj.handleArguments = function(args) { if (typeof args.form == "object" && args.form != null) { obj.form = args.form; obj.appendForm(); } for (a in args) { if (typeof obj[a] == "undefined") obj.parameters[a] = args[a]; else { if (a != "parameters" && a != "headers") obj[a] = args[a]; else for (b in args[a]) obj[a][b] = args[a][b]; } } obj.method = obj.method.toUpperCase(); }; obj.switchForm = function(enable) { if (typeof obj.form != "object" || obj.form == null) return; with (obj.form) for (var nr = 0; nr < elements.length; nr++) if (!enable) { if (elements[nr]["disabled"]) elements[nr]["_disabled"] = true; else elements[nr]["disabled"] = "disabled"; } else if (typeof elements[nr]["_disabled"] == "undefined") elements[nr].removeAttribute("disabled"); }; obj.appendForm = function() { with (obj.form) { obj.method = getAttribute("method").toUpperCase(); obj.url = getAttribute("action"); for (var nr = 0; nr < elements.length; nr++) { var e = elements[nr]; if (e.disabled) continue; switch (e.type) { case "text": case "password": case "hidden": case "textarea": obj.addParameter(e.name, e.value); break; case "select-one": if (e.selectedIndex >= 0) obj.addParameter(e.name, e.options[e.selectedIndex].value); break; case "select-multiple": for (var nr2 = 0; nr2 < e.options.length; nr2++) if (e.options[nr2].selected) obj.addParameter(e.name, e.options[nr2].value); break; case "checkbox": case "radio": if (e.checked) obj.addParameter(e.name, e.value); break; } } } }; obj.addParameter = function(name, value) { if (typeof obj.parameters[name] == "undefined") obj.parameters[name] = value; else if (typeof obj.parameters[name] != "object") obj.parameters[name] = [ obj.parameters[name], value ]; else obj.parameters[name][obj.parameters[name].length] = value; }; obj.delParameter = function(name) { delete obj.parameters[name]; }; obj.raiseEvent = function(name) { var args = []; for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); if (typeof obj["on" + name] == "function") obj["on" + name].apply(null, args); if (name == "FatalError") obj.raiseEvent("Finalization", obj); } if (typeof advAJAX._defaultParameters != "undefined") obj.handleArguments(advAJAX._defaultParameters); return obj; } advAJAX.get = function(args) { return advAJAX.handleRequest("GET", args); }; advAJAX.post = function(args) { return advAJAX.handleRequest("POST", args); }; advAJAX.head = function(args) { return advAJAX.handleRequest("HEAD", args); }; advAJAX.submit = function(form, args) { if (typeof args == "undefined" || args == null) return -1; if (typeof form != "object" || form == null) return -2; var request = new advAJAX(); args["form"] = form; request.handleArguments(args); return request.run(); }; advAJAX.assign = function(form, args) { if (typeof args == "undefined" || args == null) return -1; if (typeof form != "object" || form == null) return -2; if (typeof form["onsubmit"] == "function") form["_onsubmit"] = form["onsubmit"]; form["advajax_args"] = args; form["onsubmit"] = function() { if (typeof this["_onsubmit"] != "undefined" && this["_onsubmit"]() === false) return false; if (advAJAX.submit(this, this["advajax_args"]) == false) return true; return false; } return true; }; advAJAX.download = function(targetObj, url) { if (typeof targetObj == "string") targetObj = document.getElementById(targetObj); if (!targetObj) return -1; advAJAX.get({ url: url, onSuccess : function(obj) { targetObj.innerHTML = obj.responseText; } }); }; advAJAX.scan = function() { var obj = document.getElementsByTagName("a"); for (var i = 0; i < obj.length;) { if (obj[i].getAttribute("rel") == "advancedajax" && obj[i].getAttribute("href") !== null) { var url = obj[i].getAttribute("href"); var div = document.createElement("div"); div.innerHTML = obj[i].innerHTML; div.className = obj[i].className; var parent = obj[i].parentNode; parent.insertBefore(div, obj[i]); parent.removeChild(obj[i]); advAJAX.download(div, url); } else i++; } }; advAJAX.handleRequest = function(requestType, args) { if (typeof args == "undefined" || args == null) return -1; var request = new advAJAX(); window.advajax_obj = request; request.method = requestType; request.handleArguments(args); return request.run(); }; advAJAX._defaultParameters = new Object(); advAJAX.setDefaultParameters = function(args) { advAJAX._defaultParameters = new Object(); for (a in args) advAJAX._defaultParameters[a] = args[a]; }; advAJAX._groupData = new Object();var TINY={};function T$(i){return document.getElementById(i)}TINY.box=function(){var p,m,b,fn,ic,iu,iw,ih,ia,f=0;return{show:function(c,u,w,h,a,t){if(!f){p=document.createElement('div');p.id='tinybox';m=document.createElement('div');m.id='tinymask';b=document.createElement('div');b.id='tinycontent';document.body.appendChild(m);document.body.appendChild(p);p.appendChild(b);m.onclick=TINY.box.hide;window.onresize=TINY.box.resize;f=1}if(!a&&!u){p.style.width=w?w+'px':'auto';p.style.height=h?h+'px':'auto';p.style.backgroundImage='none';b.innerHTML=c}else{b.style.display='none';p.style.width=p.style.height='100px'}this.mask();ic=c;iu=u;iw=w;ih=h;ia=a;this.alpha(m,1,80,3);if(t){setTimeout(function(){TINY.box.hide()},1000*t)}},fill:function(c,u,w,h,a){if(u){p.style.backgroundImage='';var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){TINY.box.psh(x.responseText,w,h,a)}};x.open('GET',c,1);x.send(null)}else{this.psh(c,w,h,a)}},psh:function(c,w,h,a){if(a){if(!w||!h){var x=p.style.width,y=p.style.height;b.innerHTML=c;p.style.width=w?w+'px':'';p.style.height=h?h+'px':'';b.style.display='';w=parseInt(b.offsetWidth);h=parseInt(b.offsetHeight);b.style.display='none';p.style.width=x;p.style.height=y}else{b.innerHTML=c}this.size(p,w,h)}else{p.style.backgroundImage='none'}},hide:function(){TINY.box.alpha(p,-1,0,3)},resize:function(){TINY.box.pos();TINY.box.mask()},mask:function(){m.style.height=TINY.page.total(1)+'px';m.style.width='';m.style.width=TINY.page.total(0)+'px'},pos:function(){var t=(TINY.page.height()/2)-(p.offsetHeight/2);t=t<10?10:t;p.style.top=(t+TINY.page.top())+'px';p.style.left=(TINY.page.width()/2)-(p.offsetWidth/2)+'px'},alpha:function(e,d,a){clearInterval(e.ai);if(d==1){e.style.opacity=0;e.style.filter='alpha(opacity=0)';e.style.display='block';this.pos()}e.ai=setInterval(function(){TINY.box.ta(e,a,d)},20)},ta:function(e,a,d){var o=Math.round(e.style.opacity*100);if(o==a){clearInterval(e.ai);if(d==-1){e.style.display='none';e==p?TINY.box.alpha(m,-1,0,2):b.innerHTML=p.style.backgroundImage=''}else{e==m?this.alpha(p,1,100):TINY.box.fill(ic,iu,iw,ih,ia)}}else{var n=Math.ceil((o+((a-o)*.5)));n=n==1?0:n;e.style.opacity=n/100;e.style.filter='alpha(opacity='+n+')'}},size:function(e,w,h){e=typeof e=='object'?e:T$(e);clearInterval(e.si);var ow=e.offsetWidth,oh=e.offsetHeight,wo=ow-parseInt(e.style.width),ho=oh-parseInt(e.style.height);var wd=ow-wo>w?0:1,hd=(oh-ho>h)?0:1;e.si=setInterval(function(){TINY.box.ts(e,w,wo,wd,h,ho,hd)},20)},ts:function(e,w,wo,wd,h,ho,hd){var ow=e.offsetWidth-wo,oh=e.offsetHeight-ho;if(ow==w&&oh==h){clearInterval(e.si);p.style.backgroundImage='none';b.style.display='block'}else{if(ow!=w){var n=ow+((w-ow)*.5);e.style.width=wd?Math.ceil(n)+'px':Math.floor(n)+'px'}if(oh!=h){var n=oh+((h-oh)*.5);e.style.height=hd?Math.ceil(n)+'px':Math.floor(n)+'px'}this.pos()}}}}();TINY.page=function(){return{top:function(){return document.documentElement.scrollTop||document.body.scrollTop},width:function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},height:function(){return self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},total:function(d){var b=document.body,e=document.documentElement;return d?Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight)):Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))}}}();/* SWFObject v2.1 Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis This software is released under the MIT License */ var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("