(function($){
$.extend($.browser,{
client:function(){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,bodyWidth:document.body.clientWidth,bodyHeight:document.body.clientHeight};},
scroll:function(){return{width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight,bodyWidth:document.body.scrollWidth,bodyHeight:document.body.scrollHeight,left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop};},
screen:function(){return{width:window.screen.width,height:window.screen.height};},
isIE6:$.browser.msie&&$.browser.version==6,
isMinW:function(val){return Math.min($.browser.client().bodyWidth,$.browser.client().width)<=val;},
isMinH:function(val){return $.browser.client().height<=val;}});
$.widthForIE6=function(option){
var s=$.extend({max:null,min:null,padding:0},option||{});
var init=function(){
var w=$(document.body);
if($.browser.client().width>=s.max+s.padding){w.width(s.max+"px");}
else if($.browser.client().width<=s.min+s.padding){w.width(s.min+"px");}
else{w.width("auto");}}
init();$(window).resize(init);}
$.fn.hoverForIE6=function(option){
var s=$.extend({
current:"hover"},option||{});
var obj=this;
$.each(this,function(){
$(this).bind("mouseover",function(){
$(this).addClass(s.current);}).bind("mouseleave",function(){
$(this).removeClass(s.current);})})}
$.fn.jdSonny=function(option,callback){
var s=$.extend({current:"curr",delay:100,timer:null,index:null},option||{});
var obj=this;
$.each(this,function(n){
$(this).bind("mouseover",function(){
if(s.timer!=null)clearTimeout(s.timer);
s.index=(s.index==null)?0:s.index;
s.timer=setTimeout(function(){obj.eq(s.index).removeClass(s.current);s.index=n;obj.eq(s.index).addClass(s.current);},s.delay);})})}
$.fn.jdTab=function(option,callback){
$.each(this,function(){
var s=$.extend({event:"mouseover",delay:100,current:"curr",dom:"ul > li > a".split(" > "),attr:"href",timer:null,index:null},option||{});
var child1=$(this).find(s.dom[1]),child2=$(this).find(s.dom[2]),content=[];
child2.each(function(){
content.push($($(this).attr(s.attr)));});
child2.each(function(n){
if(s.action!="click"){$(this).click(function(){return false;})}
$(this).bind(s.event,function(){
clearTimeout(s.timer);
s.index=(s.index==null)?0:s.index;
s.timer=setTimeout(function(){child1.eq(s.index).removeClass(s.current);content[s.index].hide();s.index=n;child1.eq(s.index).addClass(s.current);content[s.index].show();},s.delay);})})})}})(jQuery);
(function($) {
    $.extend({
        _jsonp: {
            scripts: {},
            //charset: 'utf-8',
            counter: 1,
            head: document.getElementsByTagName("head")[0],
            name: function(callback) {
                var name = '_jsonp_' + (new Date).getTime() + '_' + this.counter;
                this.counter++;
                var cb = function(json) {
                    eval('delete ' + name);
                    callback(json);
                    $._jsonp.head.removeChild($._jsonp.scripts[name]);
                    delete $._jsonp.scripts[name];
                };
                eval(name + ' = cb');
                return name;
            },
            load: function(url, name) {
                var script = document.createElement('script');
                script.type = 'text/javascript';
                script.charset = this.charset;
                script.src = url;
                this.head.appendChild(script);
                this.scripts[name] = script;
            }
        },

        getJSONP: function(url, callback) {
            var name = $._jsonp.name(callback);
            var url = url.replace(/{callback}/, name);
            $._jsonp.load(url, name);
            return this;
        }
    });
})(jQuery);