function Dimension(n){this.width=n.offsetWidth;this.height=n.offsetHeight}function GetPosition(n){for(var t=n.offsetLeft,i=n.offsetTop;(n=n.offsetParent)!=null;)t+=n.offsetLeft,i+=n.offsetTop;return{top:i,left:t}}function GetMousePosition(n){var i=event.y+window.document.body.scrollTop,r=event.x+window.document.body.scrollLeft,t;return n&&(t=GetPosition(n.frameElement),i+=t.top,r+=t.left),{top:i,left:r}}function Dimension(n){this.width=n.offsetWidth;this.height=n.offsetHeight}function Trank(n,t){return n.length>t?n.substring(0,t)+(t>3?"...":""):n}function InitFormValue(n,t){switch(n.type){case"file":break;case"select-one":for(var i=0;i<n.options.length;i++)if(n.options[i].value==t){n.options[i].selected=!0;break}break;case"checkbox":n.checked=t;break;case"radio":n.checked=t;break;default:n.value=value}}function defined(n){var t=typeof n=="undefined";return t==!0?!1:typeof n=="string"&&n==""?!1:n!=null}function isOk(n){return defined(n)}function GetViewWidth(n){return jQuery?n?Math.max(jQuery(document).width(),jQuery(window).width()):jQuery(window).width():null}function GetViewHeight(n){return jQuery?n?Math.max(jQuery(document).height(),jQuery(window).height()):jQuery(window).height():null}function addStyle(n,t){var i=document.createElement("style"),f,r,u;i.setAttribute("type","text/css");f="{0}{{1}}".Format(n,t);r=/msie/i.test(navigator.userAgent);r||i.appendChild(document.createTextNode(f));document.getElementsByTagName("head")[0].appendChild(i);r&&document.styleSheets&&document.styleSheets.length>0&&(u=document.styleSheets[document.styleSheets.length-1],typeof u.addRule=="object"&&u.addRule(n,t))}function _trace(n){var t,i;window.lw=window.lw?window.lw:{};t=window.lw;t.debContainer||(t.debContainer=$('<div style="z-index:999999999;padding:5px;box-shadow: -5px 5px 10px #888;background-color:#efefef;border:3px double black;border-radius:5px;width:200px;height:300px;overflow:auto;position:fixed;right:0;top:0"><\/div>'),$(document.body).append(t.debContainer));i=$("<div />");(typeof n=="string"||typeof n=="number")&&i.html(n);t.debContainer.prepend(i)}function inArray(n,t){return n.indexOf(t)!=-1}function compare(n,t,i){var f=">",e="<",o="=",r,u;switch(i.toLowerCase()){case"number":case"integer":case"decimal":case"float":case"int":return(r=parseFloat(n.toString()),u=parseFloat(t.toString()),r>u)?f:r<u?e:o;case"date":return(r=Date.parse(n.toString()),u=Date.parse(t.toString()),r>u)?f:r<u?e:o;case"string":return(r=n.toString(),u=t.toString(),r>u)?f:r<u?e:o;default:return(r=n.toString().length,u=t.toString().length,r>u)?f:r<u?e:o}}function preventDefault(n){n=n||window.event;n.preventDefault&&n.preventDefault();n.returnValue=!1}function keydown(n){for(var t=keys.length;t--;)if(n.keyCode===keys[t]){preventDefault(n);return}}function wheel(n){preventDefault(n)}function disable_scroll(){window.addEventListener&&window.addEventListener("DOMMouseScroll",wheel,!1);window.onmousewheel=document.onmousewheel=wheel;document.onkeydown=keydown}function enable_scroll(){window.removeEventListener&&window.removeEventListener("DOMMouseScroll",wheel,!1);window.onmousewheel=document.onmousewheel=document.onkeydown=null}var lwUtils,keys;String.prototype.TrimLeft=function(){return this.replace(/^(\s|\xA0|&nbsp;)*/,"")};String.prototype.TrimRight=function(){return this.replace(/(\s|\xA0|&nbsp;)*$/,"")};String.prototype.trim=String.prototype.Trim=function(){return this.TrimLeft().TrimRight()};String.prototype.toLower=function(){return this.toLowerCase()};String.prototype.Format=function(){var r=arguments[0],t=this,n,i;if(typeof r=="object")for(n in r)i=new RegExp("\\{"+n+"\\}","g"),t=t.replace(i,r[n]);else for(n=0;n<arguments.length;n++)i=new RegExp("\\{"+n+"\\}","g"),t=t.replace(i,arguments[n]);return t};lwUtils={version:"1.0.2.2",createDate:"May 30 2012",modifiedDate:"January 16 2013",_an:0,an:function(){return++lw.utils._an},dimension:Dimension,isOk:isOk,trace:_trace,compare:compare,inArray:inArray,initFormValue:InitFormValue,trankate:Trank,viewWith:GetViewWidth,viewHeight:GetViewHeight,passwordScorrer:function(n){var t=0,i=n.length;return i>=21?t=7:i>=16?t=6:i>=13?t=5:i>=10?t=4:i>=8?t=3:i>=5&&(t=2),passwd.match(/[a-z]/)&&(t+=1),passwd.match(/[A-Z]/)&&(t+=5),passwd.match(/\d+/)&&(t+=5),passwd.match(/(.*[0-9].*[0-9].*[0-9])/)&&(t+=5),passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)&&(t+=5),passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)&&(t+=5),passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(t+=2),passwd.match(/([a-zA-Z])/)&&passwd.match(/([0-9])/)&&(t+=2),passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)&&(t+=2),t},equals:function(n,t,i){return i?n.toLowerCase()===t.toLowerCase():n===t},fieldMask:function(n,t){isOk(n)&&(n.bind("focus",function(){n.val()==t&&(n.val(""),n.removeClass("empty"))}),n.bind("blur",function(){n.val()==""&&(n.val(t),n.addClass("empty"))}))},stripOutHtmlTags:function(n){if(n==null)return"";var t=new RegExp("<[^>]+>");return n.replace(t,"")},trankate:function(n,t,i){if(i="..."||i,n=lw.utils.stripOutHtmlTags(n),n.length>t){n=n.substring(0,t-3);var r=new RegExp("\\s([a-z_0-9.&;])*$","i");return lw.utils.sup(n.replace(r,i))}return n},sup:function(n){return n.replace(/<sup>&amp;reg;<\/sup>/ig,"®").replace(/<sup>®<\/sup>/ig,"®").replace(/\&amp;reg;/ig,"&reg;").replace(/\&reg;/ig,"<sup>&reg;<\/sup>").replace(/®/ig,"<sup>&reg;<\/sup>")},relative_time:function(n){n=typeof n=="string"?Date.parse(n):n;var i=arguments.length>1?arguments[1]:new Date,t=parseInt((i.getTime()-n)/1e3);return t<60?"less than a minute ago":t<120?"about a minute ago":t<3600?parseInt(t/60).toString()+" minutes ago":t<7200?"about an hour ago":t<86400?"about "+parseInt(t/3600).toString()+" hours ago":t<172800?"1 day ago":parseInt(t/86400).toString()+" days ago"},capitaliseFirstLetter:function(n){return n.charAt(0).toUpperCase()+n.slice(1)},toId:function(n,t){isOk(t)||(t="-");n=n.toLowerCase();n=n.replace("&reg;","");var u="àÀâÂäÄáÁéÉèÈêÊëËìÌîÎïÏòÒôÔöÖùÙûÛüÜçÇ’ñ/ó:",r=n;for(i=0;i<u.length;i++)r=r.replace(u.charAt(i),"aAaAaAaAeEeEeEeEiIiIiIoOoOoOuUuUuUcC-n-o ".charAt(i));return r=r.replace(/\W/ig," "),r=r.replace(/\s+/g," "),r.trim().replace(/ /g,t)},request:function(n){var i=lw.utils,f,u,r,t;if(!i.query){if(i.query={},t=location.href.split("?"),t.length==0)return null;for(f=t[1],u=f.split("&"),i.query={},r=0;r<u.length;r++)u[r].Trim()!=""&&(t=u[r].Trim().split("="),t.length==2&&(i.query[t[0].Trim()]=t[1].Trim()))}return i.query[n]},getTopZIndex:function(n){var i=lw.utils,t;return n="body"||n,t=1,$(n+" *").each(function(){var n=$(this);n.css("position")!="static"&&n.css("z-index")!="auto"&&(t=Math.max(t,parseInt(n.css("z-index"))))}),i.maxIndex=t+100,i.maxIndex},getFromJsonArray:function(n,t){for(var r,u=null,i=0;i<n.length;i++){r=!0;for(prop in t)if(typeof prop=="string"&&n[i][prop]!==t[prop]){r=!1;break}if(r){u=n[i];break}}return u},toURL:function(n,t){var u,r,e;isOk(t)||(t="-");n=n.toLowerCase();u=new RegExp("<[^>]+>","ig");n=n.replace(u,"");n=n.replace(/\&reg;/g,"");var o=new RegExp("\\W","ig"),s=new RegExp("\\s+","ig"),f="àÀâÂäÄáÁéÉèÈêÊëËìÌîÎïÏòÒôÔöÖùÙûÛüÜçÇ’ñ/ó:",i=n;for(r=0;r<f.Length;r++)i=i.replace(new RegExp(f[r],"ig"),"aAaAaAaAeEeEeEeEiIiIiIoOoOoOuUuUuUcC-n-o "[r].ToString());return i=i.replace(s," ").replace(o," ").trim(),i=i.replace(/ /g,t),e=new RegExp(t+"+","ig"),i.replace(e,t)}};this.lw=this.lw?this.lw:{};this.lw.utils=lwUtils;keys=[37,38,39,40];lw.utils.enableScroll=enable_scroll;lw.utils.disableScroll=disable_scroll;
/*
//# sourceMappingURL=lw-utils.min.js.map
*/