// Original JavaScript code by Duncan Crombie: dcrombie@chirp.com.au // Please acknowledge use of this code by including this header. // CONSTANTS var separator = ","; // use comma as 000's separator var decpoint = "."; // use period as decimal point var percent = "%"; var currency = "$"; // use dollar sign for currency function strip(input, chars) { // strip all characters in 'chars' from input var output = ""; // initialise output string for (var i=0; i < input.length; i++) if (chars.indexOf(input.charAt(i)) == -1) output += input.charAt(i); return output; } function separate(input, separator) { // format input using 'separator' to mark 000's input = "" + input; var output = ""; // initialise output string for (var i=0; i < input.length; i++) { if (i != 0 && (input.length - i) % 3 == 0) output += separator; output += input.charAt(i); } return output; } // Stop hiding --> var isNav4, isNav6, isIE4; openCal = false; openTime = false; openThumb = false; var hD="0123456789ABCDEF"; function dechex(d) { var h = hD.substr(d&15, 1); while(d > 15) { d >>= 4; h = hD.substr(d&15,1) + h; } return h; } function hexdec(h) { return parseInt(h,16); } function cancelEvent() { event.returnValue = false; } function replace(inString,oldText,newText) { return (inString.split(oldText).join(newText)); } function ToggleID(id) { button_text = ''; if (document.getElementById(id).style.visibility == "visible") { HideID(id); button_text = 'SHOW'; } else { ShowID(id); button_text = 'HIDE'; } if (arguments.length == 2) { document } } function ShowID(id) { document.getElementById(id).style.visibility = "visible"; document.getElementById(id).style.position = "relative"; document.getElementById(id).style.display = "inline"; } function HideID(id) { document.getElementById(id).style.visibility = "hidden"; document.getElementById(id).style.position = "absolute"; document.getElementById(id).style.display = "none"; } function HiLite(imgDocID, imgStatus) { tmp = eval(imgDocID + "_" + imgStatus + ".src"); document.images[imgDocID].src = tmp; } function SetBrowser() { if (navigator.appVersion.charAt(0) == "4") { if (navigator.appName.indexOf("Explorer") >= 0) { isIE4 = true; } else { isNav4 = true; } } else if (navigator.appVersion.charAt(0) > "4") { isNav6 = true; } } SetBrowser(); function ReturnDiv(divarea,txt) { if (isNav4) { var lyr = document.layers[divarea].document; lyr.open() lyr.write(txt); lyr.close(); } else if (isIE4) { divRoot = document; divRoot.all[divarea].innerHTML = txt; } } function ID_checkIn(div_ID) { var theObj,ss,sr,i,j,WM_layers=new Array(); if (document.all || document.getElementById) { if(false && (document.getElementById(div_ID).style.position != 'absolute') && (document.getElementById(div_ID).style.position != 'relative')){ for (ss = 0 ; ss < document.styleSheets.length; ss++) { for (sr = 0 ; sr < document.styleSheets(ss).rules.length; sr++) { if (document.styleSheets(ss).rules(sr).selectorText == '#' + div_ID) { theObj = document.styleSheets(ss).rules(sr).style; break; } } } } else { theObj = document.getElementById(div_ID).style; } } else if(document.layers) { WM_layers = new Array(); with (document) { for (i = 0; i= 0; i--) { ruleList = sheetList[i].cssRules; for (j = 0; j -1 && value.indexOf("url(") == -1) { value = "url(\'" + value + "\')"; } if (isNav6) { var styleObject = document.getElementById(id); if (styleObject != null) { styleObject = styleObject.style; styleObject[property] = value; } } else if (isNav4) { //alert(id+"&"+property); document[id][property] = value; } else if (isIE4) { eval("div_OBJ."+property+"= value;"); } } function GetJSID(PK_prod, PK_var) { id_str = "selection_" + PK_prod; if (PK_var != "uniques") { id_str += "_" + PK_var; } id_str = "document.getElementById('" + id_str + "')"; if (parent) { id_str = "parent." + id_str; } return id_str; } function ChangeSelection(action, PK_prod, PK_var, selection) { req_str = "div_id|selection_" + PK_prod + "`PK_prod|" + PK_prod + "`PK_var|" + PK_var; tmp_date = new Date(); tmp_timestamp = tmp_date.getFullYear() + tmp_date.getDate() + tmp_date.getMinutes() + tmp_date.getMilliseconds(); if (action == "add") { req_str += "`selection|" + selection + "`i_action|add`timestamp|" + tmp_timestamp; } else if (action == "load") { req_str += "`timestamp|" + tmp_timestamp; } else if (action == "del") { req_str += "`PK_item|" + selection + "`i_action|del`timestamp|" + tmp_timestamp; } SendReq('get`item_selection', req_str); return; } function GetJSSrc(PK_prod, PK_var) { src_str = GetJSID(PK_prod, PK_var); eval("src_str = " + src_str + ".src;"); src_str = src_str.substring(0, src_str.indexOf(".php") + 4); return src_str; } cursor_pos = -1; function MarkSelection(txtObj) { if (txtObj.createTextRange) { cursor_pos = document.selection.createRange().duplicate(); isSelected = true; } } function InsertText(txtForm, txtName, txtBefore, txtAfter) { var txtObj = eval("document." + txtForm + "[\"" + txtName + "\"]"); if (window.isSelected == null) { txtObj.focus(); MarkSelection(txtObj); } if (isSelected) { if (txtObj.createTextRange && cursor_pos != -1) { if (cursor_pos.text == "" && txtAfter != "" && confirm("You have selected a tag that normally goes around something else.\nDo you want to specify this something else?\n(possibly text if this is a formatting, ie, bold, italic, etc, tag?")) { val = prompt("Enter the text you want to go between the selected tags.", ""); tag_text = val; } else { tag_text = cursor_pos.text; } var caretPos = cursor_pos; caretPos.text = ((txtAfter != "") ? (txtBefore + tag_text + txtAfter) : (txtBefore + tag_text)); if (cursor_pos.text == '') { isSelected = false; txtObj.focus(); } MarkSelection(txtObj); } } else { // placeholder for loss of focus handler } } function AnimEllipsis(PK_prod, PK_var) { is_loaded = false; if (PK_var != "uniques") { eval("is_loaded = item_" + PK_prod + "_" + PK_var + "_loaded;"); eval("ellipsis_id = 'id_selection_" + PK_prod + "_" + PK_var + "';"); } else { eval("is_loaded = item_" + PK_prod + "_loaded;"); eval("ellipsis_id = 'id_selection_" + PK_prod + "';"); } if (is_loaded == false) { str = document.getElementById(ellipsis_id).innerHTML; switch (str) { case "Loading...": { str = "Loading..."; break; } case "Loading...": { str = "Loading..."; break; } case "Loading...": { str = "Loading..."; break; } case "Loading...": { str = "Loading..."; break; } } document.getElementById(ellipsis_id).innerHTML = str; setTimeout("AnimEllipsis('" + PK_prod + "', '" + PK_var + "');", 100); } } function handleTAB(e, field) { e = ((window.event) ? (event) : (e)) && ((e.keyCode) ? (e) : (null)); if (e && e.keyCode == 9 && 1 == 0) { InsertText(field.form.name, field.name, "\t", ""); return false; } return true; } function CopyFormField(textareaID, label) { tempval = document.getElementById(textareaID); tempval.focus(); tempval.select(); ItemCode = tempval.createTextRange(); ItemCode.execCommand("Copy"); tempval.value = tempval.value; tmpStr = "The " + label + " has been copied to your clipboard."; alert(tmpStr); } function InsertTag(inserted_field, tag_open, tag_close) { if (arguments.length > 3) { args = ''; params = arguments[3].split(','); for (param in params) { param = params[param].split('`'); val = prompt(param[1], ''); args += ' ' + param[0] + '=\'' + val + '\''; } tag_open = tag_open.substring(0, tag_open.lastIndexOf('>')) + args + '>'; } InsertText('vizform', inserted_field, tag_open, tag_close); } function AlertElementProperties(element) { group_len = 15; items = 0; for (v in element) { ++items; } groups = 0; while (groups < items) { tmp = ''; for (i = groups; i < (groups + group_len); ++i) { t = 0; for (v in element) { if (t == i) { tmp += v + ' = ' + element[v] + '\\\n'; } ++t; } } alert(tmp); groups += group_len; } } function MoveItem(element, from_select, to_select) { var elmtname = element.name; var sel_f = element.form[from_select]; var sel_t = element.form[to_select]; var tmpNumOptions = sel_t.options.length; var tmpOptions = sel_t.options; var tmpIndex = sel_t.selectedIndex; if (typeof use_indents == "undefined") { use_indents = false; } if (elmtname == "addbutton") { var tmpFrom = sel_f.options; var optSize = tmpFrom.length; var obLng = tmpOptions.length; for (i=0; i < optSize; i++) { if (tmpFrom[i].selected) { in_to = false; for (j = 0; j < sel_t.options.length; ++j) { if (sel_t.options[j].text == tmpFrom[i].text) { in_to = true; } } if (!in_to) { var selText = tmpFrom[i].text; var selVal = tmpFrom[i].value; var newOpt = new Option(selText,selVal); tmpOptions[obLng++] = newOpt; } } } } else if ((elmtname == "moveleft" || elmtname == "moveright") && (tmpIndex > 0)) { use_indents = true; tmpOptionTextPrev = tmpOptions[tmpIndex - 1].text; tmpOptionValue = tmpOptions[tmpIndex].value; tmpOptionText = tmpOptions[tmpIndex].text; var space_count = CountLeadingSpaces(tmpOptionText); var prev_space_count = CountLeadingSpaces(tmpOptionTextPrev); tmpOptionText = tmpOptionText.substring(space_count); tmpOptionTextPrev = tmpOptionTextPrev.substring(prev_space_count); if (elmtname == "moveleft" && space_count >= 2) { space_count -= 2; } if (elmtname == "moveright" && prev_space_count >= space_count) { space_count += 2; } tmpOptionValue = tmpOptionValue.split("`"); tmpOptionValue = tmpOptionValue[0] + "`" + (space_count / 2); tmpOptionText = StringRepeat("_", space_count) + tmpOptionText; tmpOptions[tmpIndex].value = tmpOptionValue; tmpOptions[tmpIndex].text = tmpOptionText; tmpOptions[tmpIndex].selected = true; } else if (((elmtname == "moveup") && (tmpIndex > 0)) || ((elmtname == "movedown") && (tmpIndex < (tmpNumOptions - 1)))) { moveDir = (elmtname == "moveup") ? (-1) : (1); tmpOptionValue = tmpOptions[tmpIndex + moveDir].value; tmpOptionText = tmpOptions[tmpIndex + moveDir].text; tmpOptions[tmpIndex + moveDir].value = tmpOptions[tmpIndex].value; tmpOptions[tmpIndex + moveDir].text = tmpOptions[tmpIndex].text; tmpOptions[tmpIndex].value = tmpOptionValue; tmpOptions[tmpIndex].text = tmpOptionText; tmpOptions[tmpIndex + moveDir].selected = true; } else if (elmtname == "remove") { if (sel_t.selectedIndex >= 0) { tmpOptions[tmpIndex] = null; } sel_t.selectedIndex = ((sel_t.options.length - 1) < tmpIndex) ? (tmpIndex - 1) : (tmpIndex); } UpdateSelectVals(element.form, to_select, use_indents); } function StringRepeat(str, count) { var tmp_str = ""; for (var i = 0; i < count; ++i) { tmp_str += str; } return tmp_str; } function CountLeadingSpaces(tmpString) { var space_count = 0; for (var i = 0; i < tmpString.length; ++i) { if (tmpString.substr(i, 1) == "_") { ++space_count; } } return space_count; } function resizeIframe() { // Must launched on the body onload event handler for IE // Use document.documentElement if you are in Compat mode if (parent && window.name) { i = parent.document.getElementById(window.name); iHeight = document.body.scrollHeight; i.style.height = iHeight + "px"; iWidth = document.body.scrollWidth; i.style.width = iWidth + "px"; } } function clickHandler(evt) { cancelClick = true; elementType = 'unknown'; if (document.layers) { alert(evt.target); } else if (evt.stopPropagation || window.event) { focussedElement = (evt.target) ? (evt.target) : (event.srcElement); if (focussedElement.form && focussedElement.type == 'submit') { // submit button elementType = 'submit'; focussedElement.disabled = 'disabled'; focussedElement.value = submitWaitText; } if (focussedElement.href || (focussedElement.nodeValue && focussedElement.baseURI)) { // link elementType = 'link'; if (focussedElement.nodeValue) { focussedElement.nodeValue = linkWaitText; } else if (focussedElement.innerHTML) { focussedElement.innerHTML = linkWaitText; } focussedElement.href = focussedElement.href + '#' } } if (cancelClick) { if (evt.stopPropagation) { evt.stopPropagation(); evt.preventDefault(); } return false; } else { if (elementType == 'submit') { focussedElement.form.submit(); } return true; } } function initClickHandler() { if (document.layers) { window.captureEvents(Event.CLICK); window.onclick = clickHandler; } else if (document.all && !document.getElementById) { document.onclick = clickHandler; } else if (document.all) { document.attachEvent('onclick', clickHandler); } else if (document.addEventListener) { document.addEventListener('click', clickHandler, true); } } //initClickHandler(); function clickElement (element) { if (element.click) element.click(); else if (element.dispatchEvent) { var evt = document.createEvent('MouseEvents'); evt.initMouseEvent( 'click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null ); element.dispatchEvent(evt); } } function Pause(Amount) { d = new Date() //today's date while (1) { mill = new Date() // Date Now diff = mill - d //difference in milliseconds if (diff > Amount) { break; } } } function PopWin(url, width, height) { window.open(url, "popup", "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1"); } function SetScroll(X, Y) { alert(X); if ((X > 0) || (Y > 0)) { if ((top.opera) && (typeof window.pageYOffset != 'undefined')) { window.pageYOffset = Y; window.pageXOffset = X; } else if ((window.document.compatMode) && (window.document.compatMode != 'BackCompat')) { window.document.documentElement.scrollLeft = X; window.document.documentElement.scrollTop = Y; } else if ((window.document.body) && (typeof window.document.body.scrollTop != 'undefined')) { window.document.body.scrollLeft = X; window.document.body.scrollTop = Y; } else { window.scrollTo(X, Y); } } } function ReturnMatches(text, regex) { var re = new RegExp(regex, "gim"); var m = re.exec(text); var matches = new Array(); if (m == null) { return ""; } else { var s = "Match at position " + m.index + ":\n"; for (i = 0; i < m.length; i++) { matches[matches.length] = m[i]; s += "\n" + m[i]; } //alert(s); } return matches; } var isOpera = navigator.userAgent.indexOf("Opera") > -1; var isIE = navigator.userAgent.indexOf("MSIE") > 1 && !isOpera; var isMoz = navigator.userAgent.indexOf("Mozilla/5.") == 0 && !isOpera; function New_Image_Load(index) { tmp_str = "Image Preview:"; if (arguments.length > 1) { tmp_str = arguments[1] + tmp_str; } img = document.getElementById("image_" + index); img_width = img.width; if (img.width > 1) { img_height = img.height; img_size = img.fileSize; tmp_str += "  "; tmp_str += img_width + " x " + img_height + " pixels"; tmp_str += "  "; tmp_str += img_size + "bytes"; new_height = 50; new_width = Math.floor((new_height * img_width) / img_height); if (new_width < img_width) { img.width = new_width; img.height = new_height; } document.getElementById("img_dims_" + index).innerHTML = tmp_str; img.style.visibility = "visible"; img.style.position = "relative"; } } function Existing_Image_Load(index) { tmp_str = "Current "; if (arguments.length > 2) { tmp_str += arguments[2]; } else { tmp_str += "Image"; } tmp_str += ":"; tmp_str += "  "; if (arguments.length > 1) { tmp_str = '' + arguments[1] + ':
' + tmp_str; is_thumb = true; } else { is_thumb = false; } eval("current_image_src = document.images.current_image_" + index + ".src;"); if (current_image_src.indexOf('spacer.gif') != -1) { tmp_str += "This image doesn't exist on the server yet."; } else { eval("tmp_str += document.images.current_image_" + index + ".width + \" x \" + document.images.current_image_" + index + ".height + \" pixels\";"); tmp_str += "  "; eval("tmp_str += document.images.current_image_" + index + ".fileSize + \" bytes\";"); last_slash = current_image_src.lastIndexOf("/"); next_last_slash = current_image_src.lastIndexOf("/", last_slash - 1); if (current_image_src.indexOf("/thumbs/") != -1) { next_next_last_slash = current_image_src.lastIndexOf("/", next_last_slash - 1); current_image_filename = current_image_src.substring(next_next_last_slash + 1); } else { current_image_filename = current_image_src.substring(next_last_slash + 1); } eval("tmp_str += \"     Delete Image.\";"); } document.getElementById("current_img_dims_" + index).innerHTML = tmp_str; } function Preview_Image(tmp_index, tmp_path) { if (tmp_path != '') { tmp_path = tmp_path.replace(/\\/g, "/"); document.getElementById(tmp_index).src = "file://" + tmp_path; //alert(document.getElementById(tmp_index).src); setTimeout('New_Image_Load(\'' + tmp_index.replace(/image_/, '') + '\');', 500); } else { document.getElementById(tmp_index).src = 'http://www.vizions.com/images/common/spacer.gif'; document.getElementById("img_dims_" + tmp_index).innerHTML = ""; } } /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ /* * Configurable variables. You may need to tweak these to be compatible with * the server-side, but the defaults work in most cases. */ var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ /* * These are the functions you'll usually want to call * They take string arguments and return either hex or base-64 encoded strings */ function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } /* * Perform a simple self-test to see if the VM is working */ function md5_vm_test() { return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; } /* * Calculate the MD5 of an array of little-endian words, and a bit length */ function core_md5(x, len) { /* append padding */ x[len >> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); c = md5_ff(c, d, a, b, x[i+10], 17, -42063); b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); } /* * These functions implement the four basic operations the algorithm uses. */ function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); } function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); } function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); } function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); } function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); } /* * Calculate the HMAC-MD5, of a key and some data */ function core_hmac_md5(key, data) { var bkey = str2binl(key); if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); } /* * Add integers, wrapping at 2^32. This uses 16-bit operations internally * to work around bugs in some JS interpreters. */ function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xFFFF); } /* * Bitwise rotate a 32-bit number to the left. */ function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); } /* * Convert a string to an array of little-endian words * If chrsz is ASCII, characters >255 have their hi-byte silently ignored. */ function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for(var i = 0; i < str.length * chrsz; i += chrsz) bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); return bin; } /* * Convert an array of little-endian words to a string */ function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; } /* * Convert an array of little-endian words to a hex string. */ function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for(var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); } return str; } /* * Convert an array of little-endian words to a base-64 string */ function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); for(var j = 0; j < 4; j++) { if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); } } return str; } // This function defeats the undesirable border caused by the Eolas/MS dispute function decode(input) { return input.replace(/</g, "<").replace(/>/g, ">"); } function LoadFlash() { isStd = (navigator.appName == "Netscape") ? true : false; var flash_obj = document.getElementById("flash_swf"); var makeitwork = document.getElementById("flash_div"); // Firefox must use decode() to convert '<' and '>' to '<' and '>' respectively // MSIE does not copy the inner 'param' tag as part of innerHTML, but it is not needed by IE anyhow if (isStd) { makeitwork.innerHTML = decode(flash_obj.innerHTML); } else { makeitwork.innerHTML = flash_obj.innerHTML; } //flash_obj.parentNode.insertBefore(makeitwork, flash_obj); } function ReturnFalse() { return false; } function PressEnter() { return (event.which && event.which == 13) || (event.keyCode && event.keyCode == 13); } old_border_color = ''; function DarkenBorder(e) { old_border_color = e.style.borderColor; e.style.borderColor = '#000000'; } function RestoreBorder(e) { e.style.borderColor = old_border_color; } function ClipboardCopy(text2copy) { if (window.clipboardData) { window.clipboardData.setData("Text",text2copy); } else { var flashcopier = 'flashcopier'; if (!document.getElementById(flashcopier)) { var divholder = document.createElement('div'); divholder.id = flashcopier; document.body.appendChild(divholder); } document.getElementById(flashcopier).innerHTML = ''; var divinfo = ''; document.getElementById(flashcopier).innerHTML = divinfo; } }