(function(a){a.extend({getDoc:function(){var b=document.compatMode==="CSS1Compat",c=a.browser.msie&&!b;return c&&document.body||document.documentElement;},getViewportWidth:function(){return a.browser.msie&&this.getDoc().clientWidth||self.innerWidth;},getViewportHeight:function(){return a.browser.msie&&this.getDoc().clientHeight||self.innerHeight;},getRandomId:function(b){var f="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var g=parseInt(b,10)||8;var e="";for(var d=0;d<g;d++){var c=Math.floor(Math.random()*f.length);e+=f.substring(c,c+1);}return e;},onlyNum:function(f,e){var g="";var d="1234567890";var b;var h;for(b=0;b<e.value.length;b++){h=e.value.charAt(b);if(d.indexOf(h)!=-1){g=g+h;}}e.value=g;},getBackgroundPositionX:function(){var b;try{b=a(this).css("background-positionX");if(!b){b=a(this).css("background-position").split(" ")[0];}}catch(c){}return b;},getBackgroundPositionY:function(){var c;try{c=a(this).css("background-positionY");if(!c){c=a(this).css("background-position").split(" ")[1];}}catch(b){}return c;},isEmail:function(b){var c=/^[a-zA-Z0-9]+([\._-][a-zA-Z0-9]+)*@(([a-zA-Z0-9]+([\.-][a-zA-Z0-9]+)?)+\.)+[a-zA-Z]+$/;return c.test(b);},getCookie:function(b){return a.cookie(cookie);},setCookie:function(c,d,b){a.cookie(c,d,{expires:5000});},deleteCookie:function(b){a.cookie(b,"",{expires:-1});},addStyleSheet:function(b){var d=b.split(",");for(var c=0;c<d.length;c++){a('<link href="'+d[c]+'" rel="stylesheet" type="text/css" />').appendTo("head");}},addJsSource:function(b,d){var e=b.split(",");for(var c=0;c<e.length;c++){a.getScript(e[c],d);}},getPage:function(){},ajaxPage:function(){}});a.fn.extend({setCheck:function(b){$status=a(this).attr("checked");return b.each(function(){this.checked=$status;});},checkAll:function(){return this.each(function(){this.checked=true;});},unCheck:function(){return this.each(function(){this.checked=false;});},negateCheck:function(){return this.each(function(){this.checked=this.checked?false:true;});},isHasChecked:function(){$flag=false;a(this).each(function(){if(a(this).attr("checked")){$flag=true;}});return $flag;},checkedItemsById:function(){var b="";a(this).each(function(c){if(this.checked){b+=a(this).attr("id")+",";}});return b.substring(0,b.length-1);}});})(jQuery);
