Make WordPress Core

Changeset 10326


Ignore:
Timestamp:
01/07/2009 05:02:40 AM (17 years ago)
Author:
azaozz
Message:

jQuery 1.3b2 and related changes (jquery.js is not minified to aid testing)

Location:
trunk
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/common.js

    r10291 r10326  
    1 var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(c){var a=this.get(c),b;if(a){this.each(a.split("&"),function(d){d=d.split("=");b=b||{};b[d[0]]=d[1]})}return b},setHash:function(i,a,f,c,h,b){var g="";this.each(a,function(e,d){g+=(!g?"":"&")+d+"="+e});this.set(i,g,f,c,h,b)},get:function(h){var g=document.cookie,f,d=h+"=",a;if(!g){return}a=g.indexOf("; "+d);if(a==-1){a=g.indexOf(d);if(a!=0){return null}}else{a+=2}f=g.indexOf(";",a);if(f==-1){f=g.length}return decodeURIComponent(g.substring(a+d.length,f))},set:function(h,a,f,c,g,b){document.cookie=h+"="+encodeURIComponent(a)+((f)?"; expires="+f.toGMTString():"")+((c)?"; path="+c:"")+((g)?"; domain="+g:"")+((b)?"; secure":"")},remove:function(c,a){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,a,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(a,i,k){var h="wp-settings-"+userSettings.uid,e=wpCookies.getHash(h)||{},g=new Date(),b,f=a.toString().replace(/[^A-Za-z0-9_]/,""),j=i.toString().replace(/[^A-Za-z0-9_]/,"");if(k){delete e[f]}else{e[f]=j}g.setTime(g.getTime()+31536000000);b=userSettings.url;wpCookies.setHash(h,e,g,b);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,g,b)}function deleteUserSetting(a){setUserSetting(a,"",1)}function getAllUserSettings(){return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}}jQuery(document).ready(function(d){var f=false,a,e,c,b;d(".fade").animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300).animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300);if(("undefined"!=typeof wpAjax)&&d.isFunction(wpAjax.validateForm)){d("form.validate").submit(function(){return wpAjax.validateForm(d(this))})}d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first");d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").addClass("invisible")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").removeClass("invisible");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").addClass("invisible")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").removeClass("invisible");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("table:visible tbody .check-column :checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents("form:first").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).parents("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead :checkbox, tfoot :checkbox").click(function(h){var i=d(this).attr("checked"),g=h.shiftKey||toggleWithKeyboard;if("undefined"==typeof toggleWithKeyboard){toggleWithKeyboard=false}d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked",function(){if(d(this).parents("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(i){return"checked"}}return""});d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked",function(){if(g){return""}else{if(i){return"checked"}}return""})})});var showNotice,adminMenu,columns;showNotice={warn:function(a){if(confirm(a)){return true}return false},note:function(a){alert(a)}};(function(a){adminMenu={init:function(){a("#adminmenu div.wp-menu-toggle").each(function(){if(a(this).siblings(".wp-submenu").length){a(this).click(function(){adminMenu.toggle(a(this).siblings(".wp-submenu"))})}else{a(this).hide()}});a("#adminmenu li.menu-top .wp-menu-image").click(function(){window.location=a(this).siblings("a.menu-top")[0].href});this.favorites();a(".wp-menu-separator").click(function(){if(a("#wpcontent").hasClass("folded")){adminMenu.fold(1);setUserSetting("mfold","o")}else{adminMenu.fold();setUserSetting("mfold","f")}});if("f"!=getUserSetting("mfold")){this.restoreMenuState()}else{this.fold()}},restoreMenuState:function(){a("#adminmenu li.wp-has-submenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open");a("#adminmenu li.wp-has-submenu").each(function(d,f){var c=a(f).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+d,c)});return false},fold:function(b){if(b){a("#wpcontent").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("#wpcontent").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(i){var c=a(this).find(".wp-submenu"),f=i.clientY,d=a(window).height(),g=c.height(),j;if((f+g+10)>d){j=(f+g+10)-d;c.css({marginTop:"-"+j+"px"})}else{if(c.css("marginTop")){c.css({marginTop:""})}}c.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)});a("#favorite-toggle, #favorite-inside").bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()})})(jQuery);(function(a){columns={init:function(b){a(".hide-column-tog").click(function(){var d=a(this).val(),c=a(this).attr("checked");if(c){a(".column-"+d).show()}else{a(".column-"+d).hide()}columns.save_manage_columns_state(b)})},save_manage_columns_state:function(c){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post("admin-ajax.php",{action:"hidden-columns",hidden:b,hiddencolumnsnonce:a("#hiddencolumnsnonce").val(),page:c})}}})(jQuery);jQuery(document).ready(function(b){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(c){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(a&&a.hasPermission){return}b(".turbo-nag").show()});
     1var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(c){var a=this.get(c),b;if(a){this.each(a.split("&"),function(d){d=d.split("=");b=b||{};b[d[0]]=d[1]})}return b},setHash:function(i,a,f,c,h,b){var g="";this.each(a,function(e,d){g+=(!g?"":"&")+d+"="+e});this.set(i,g,f,c,h,b)},get:function(h){var g=document.cookie,f,d=h+"=",a;if(!g){return}a=g.indexOf("; "+d);if(a==-1){a=g.indexOf(d);if(a!=0){return null}}else{a+=2}f=g.indexOf(";",a);if(f==-1){f=g.length}return decodeURIComponent(g.substring(a+d.length,f))},set:function(h,a,f,c,g,b){document.cookie=h+"="+encodeURIComponent(a)+((f)?"; expires="+f.toGMTString():"")+((c)?"; path="+c:"")+((g)?"; domain="+g:"")+((b)?"; secure":"")},remove:function(c,a){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,a,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(a,i,k){var h="wp-settings-"+userSettings.uid,e=wpCookies.getHash(h)||{},g=new Date(),b,f=a.toString().replace(/[^A-Za-z0-9_]/,""),j=i.toString().replace(/[^A-Za-z0-9_]/,"");if(k){delete e[f]}else{e[f]=j}g.setTime(g.getTime()+31536000000);b=userSettings.url;wpCookies.setHash(h,e,g,b);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,g,b)}function deleteUserSetting(a){setUserSetting(a,"",1)}function getAllUserSettings(){return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}}jQuery(document).ready(function(d){var f=false,a,e,c,b;d(".fade").animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300).animate({backgroundColor:"#ffffe0"},300).animate({backgroundColor:"#fffbcc"},300);if(("undefined"!=typeof wpAjax)&&d.isFunction(wpAjax.validateForm)){d("form.validate").submit(function(){return wpAjax.validateForm(d(this))})}d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first");d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").addClass("invisible")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").removeClass("invisible");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").addClass("invisible")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").removeClass("invisible");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("table:visible tbody .check-column :checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).parents("form:first").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).parents("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead :checkbox, tfoot :checkbox").click(function(h){if("undefined"==typeof toggleWithKeyboard){toggleWithKeyboard=false}var i=d(this).attr("checked"),g=h.shiftKey||toggleWithKeyboard;d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked",function(){if(d(this).parents("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(i){return"checked"}}return""});d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked",function(){if(g){return""}else{if(i){return"checked"}}return""})})});var showNotice,adminMenu,columns;showNotice={warn:function(a){if(confirm(a)){return true}return false},note:function(a){alert(a)}};(function(a){adminMenu={init:function(){a("#adminmenu div.wp-menu-toggle").each(function(){if(a(this).siblings(".wp-submenu").length){a(this).click(function(){adminMenu.toggle(a(this).siblings(".wp-submenu"))})}else{a(this).hide()}});a("#adminmenu li.menu-top .wp-menu-image").click(function(){window.location=a(this).siblings("a.menu-top")[0].href});this.favorites();a(".wp-menu-separator").click(function(){if(a("#wpcontent").hasClass("folded")){adminMenu.fold(1);setUserSetting("mfold","o")}else{adminMenu.fold();setUserSetting("mfold","f")}});if("f"!=getUserSetting("mfold")){this.restoreMenuState()}else{this.fold()}},restoreMenuState:function(){a("#adminmenu li.wp-has-submenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open");a("#adminmenu li.wp-has-submenu").each(function(d,f){var c=a(f).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+d,c)});return false},fold:function(b){if(b){a("#wpcontent").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("#wpcontent").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(i){var c=a(this).find(".wp-submenu"),f=i.clientY,d=a(window).height(),g=c.height(),j;if((f+g+10)>d){j=(f+g+10)-d;c.css({marginTop:"-"+j+"px"})}else{if(c.css("marginTop")){c.css({marginTop:""})}}c.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)});a("#favorite-toggle, #favorite-inside").bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()})})(jQuery);(function(a){columns={init:function(b){a(".hide-column-tog").click(function(){var d=a(this).val(),c=a(this).attr("checked");if(c){a(".column-"+d).show()}else{a(".column-"+d).hide()}columns.save_manage_columns_state(b)})},save_manage_columns_state:function(c){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post("admin-ajax.php",{action:"hidden-columns",hidden:b,hiddencolumnsnonce:a("#hiddencolumnsnonce").val(),page:c})}}})(jQuery);jQuery(document).ready(function(b){if("undefined"!=typeof google&&google.gears){return}var a=false;if("undefined"!=typeof GearsFactory){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(factory.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(c){if(("undefined"!=typeof navigator.mimeTypes)&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(a&&a.hasPermission){return}b(".turbo-nag").show()});
  • trunk/wp-admin/js/custom-fields.dev.js

    r10291 r10326  
    33   
    44    before = function() {
    5         var nonce = $('#newmeta [@name=_ajax_nonce]').val(), postId = $('#post_ID').val();
     5        var nonce = $('#newmeta [name=_ajax_nonce]').val(), postId = $('#post_ID').val();
    66        if ( !nonce || !postId ) { return false; }
    77        return [nonce,postId];
  • trunk/wp-admin/js/custom-fields.js

    r10291 r10326  
    1 jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d("#newmeta [@name=_ajax_nonce]").val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
     1jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d("#newmeta [name=_ajax_nonce]").val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
  • trunk/wp-admin/js/widgets.dev.js

    r10291 r10326  
    6060        if ( ( q.sidebar && q.sidebar == $('#sidebar').val() ) || q.add ) {
    6161            var w = q.edit || q.add;
    62             toggleWidget( $('#current-sidebar .widget-control-list input[@name^="widget-id"][@value=' + w + ']').parents('li:first'), false ).blur();
     62            toggleWidget( $('#current-sidebar .widget-control-list input[name^="widget-id"][value=' + w + ']').parents('li:first'), false ).blur();
    6363            return false;
    6464        } else if ( q.sidebar ) { // otherwise, redirect to correct page
     
    117117        // onclick for remove links
    118118        $('a.widget-control-remove', context).click( function() {
    119             var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val();
     119            var w = $(this).parents('li:first').find('input[name^="widget-id"]').val();
    120120            $(this).parents('li:first').remove();
    121121            var t = $('#widget-list ul#widget-control-info-' + w + ' textarea');
  • trunk/wp-admin/js/widgets.js

    r10291 r10326  
    1 jQuery(function(e){e(".noscript-action").remove();var a=false;var h=function(){if(a){return}window.onbeforeunload=function(){return widgetsL10n.lamerReminder};e("h2:first").after('<div class="updated"><p>'+widgetsL10n.lameReminder+"</p></div>");e("#current-widgets .submit input[name=save-widgets]").css("background-color","#ffffe0").click(function(){window.onbeforeunload=null});a=true};var j=1;var g=function(k,m){var l=k.find("input.widget-width").val();var n=e.browser.msie?function(){var o=e(this);if(o.is(":visible")){if(m){o.find(":input:enabled").not('[name="widget-id[]"], [name*="[submit]"]').attr("disabled","disabled")}k.css("marginLeft",0);o.siblings("div").children("h4").children("a").text(widgetsL10n.edit)}else{o.find(":disabled").attr("disabled","");if(l>250){k.css("marginLeft",(l-250)*-1)}o.siblings("div").children("h4").children("a").text(widgetsL10n.cancel)}o.toggle()}:function(){var o=e(this);if(o.is(":visible")){if(m){o.find(":input:enabled").not('[name="widget-id[]"], [name*="[submit]"]').attr("disabled","disabled")}if(l>250){k.animate({marginLeft:0})}o.siblings("div").children("h4").children("a").text(widgetsL10n.edit)}else{o.find(":disabled").attr("disabled","");if(l>250){k.animate({marginLeft:(l-250)*-1})}o.siblings("div").children("h4").children("a").text(widgetsL10n.cancel)}o.animate({height:"toggle"})};return k.children("div.widget-control").each(n).end()};var b=function(){var l=wpAjax.unserialize(this.href);if((l.sidebar&&l.sidebar==e("#sidebar").val())||l.add){var k=l.edit||l.add;g(e('#current-sidebar .widget-control-list input[@name^="widget-id"][@value='+k+"]").parents("li:first"),false).blur();return false}else{if(l.sidebar){return true}}g(e(this).parents("li:first"),true).blur();return false};var c=function(){var o=e(this).parents("li:first").find("ul.widget-control-info li");var l=o.clone();if(l.html().match(/%i%/)){var k=e("#generated-time").val()+j.toString();j++;l.html(l.html().replace(/%i%/g,k))}else{e(this).text(widgetsL10n.edit).unbind().click(b);o.html("<textarea>"+o.html()+"</textarea>")}f(l);i.append(l).SortableAddItem(l[0]);var m=parseInt(e("#widget-count").text(),10)+1;e("#widget-count").text(m.toString());h();return false};var f=function(k){if(!k){k=document}e("a.widget-control-edit",k).click(b);e("a.widget-control-save",k).click(function(){h();g(e(this).parents("li:first"),false).blur();return false});e("a.widget-control-remove",k).click(function(){var l=e(this).parents("li:first").find('input[@name^="widget-id"]').val();e(this).parents("li:first").remove();var m=e("#widget-list ul#widget-control-info-"+l+" textarea");m.parent().html(m.text()).parents("li.widget-list-item:first").children("h4").children("a.widget-action").show().text(widgetsL10n.add).unbind().click(c);var o=parseInt(e("#widget-count").text(),10)-1;e("#widget-count").text(o.toString());return false})};f();e("a.widget-control-add").click(c);var i;var d=function(){try{e("#current-sidebar .widget-control-list").SortableDestroy()}catch(k){}i=e("#current-sidebar .widget-control-list").Sortable({accept:"widget-sortable",helperclass:"sorthelper",handle:"h4.widget-title",onStop:d})};d()});
     1jQuery(function(e){e(".noscript-action").remove();var a=false;var h=function(){if(a){return}window.onbeforeunload=function(){return widgetsL10n.lamerReminder};e("h2:first").after('<div class="updated"><p>'+widgetsL10n.lameReminder+"</p></div>");e("#current-widgets .submit input[name=save-widgets]").css("background-color","#ffffe0").click(function(){window.onbeforeunload=null});a=true};var j=1;var g=function(k,m){var l=k.find("input.widget-width").val();var n=e.browser.msie?function(){var o=e(this);if(o.is(":visible")){if(m){o.find(":input:enabled").not('[name="widget-id[]"], [name*="[submit]"]').attr("disabled","disabled")}k.css("marginLeft",0);o.siblings("div").children("h4").children("a").text(widgetsL10n.edit)}else{o.find(":disabled").attr("disabled","");if(l>250){k.css("marginLeft",(l-250)*-1)}o.siblings("div").children("h4").children("a").text(widgetsL10n.cancel)}o.toggle()}:function(){var o=e(this);if(o.is(":visible")){if(m){o.find(":input:enabled").not('[name="widget-id[]"], [name*="[submit]"]').attr("disabled","disabled")}if(l>250){k.animate({marginLeft:0})}o.siblings("div").children("h4").children("a").text(widgetsL10n.edit)}else{o.find(":disabled").attr("disabled","");if(l>250){k.animate({marginLeft:(l-250)*-1})}o.siblings("div").children("h4").children("a").text(widgetsL10n.cancel)}o.animate({height:"toggle"})};return k.children("div.widget-control").each(n).end()};var b=function(){var l=wpAjax.unserialize(this.href);if((l.sidebar&&l.sidebar==e("#sidebar").val())||l.add){var k=l.edit||l.add;g(e('#current-sidebar .widget-control-list input[name^="widget-id"][value='+k+"]").parents("li:first"),false).blur();return false}else{if(l.sidebar){return true}}g(e(this).parents("li:first"),true).blur();return false};var c=function(){var o=e(this).parents("li:first").find("ul.widget-control-info li");var l=o.clone();if(l.html().match(/%i%/)){var k=e("#generated-time").val()+j.toString();j++;l.html(l.html().replace(/%i%/g,k))}else{e(this).text(widgetsL10n.edit).unbind().click(b);o.html("<textarea>"+o.html()+"</textarea>")}f(l);i.append(l).SortableAddItem(l[0]);var m=parseInt(e("#widget-count").text(),10)+1;e("#widget-count").text(m.toString());h();return false};var f=function(k){if(!k){k=document}e("a.widget-control-edit",k).click(b);e("a.widget-control-save",k).click(function(){h();g(e(this).parents("li:first"),false).blur();return false});e("a.widget-control-remove",k).click(function(){var l=e(this).parents("li:first").find('input[name^="widget-id"]').val();e(this).parents("li:first").remove();var m=e("#widget-list ul#widget-control-info-"+l+" textarea");m.parent().html(m.text()).parents("li.widget-list-item:first").children("h4").children("a.widget-action").show().text(widgetsL10n.add).unbind().click(c);var o=parseInt(e("#widget-count").text(),10)-1;e("#widget-count").text(o.toString());return false})};f();e("a.widget-control-add").click(c);var i;var d=function(){try{e("#current-sidebar .widget-control-list").SortableDestroy()}catch(k){}i=e("#current-sidebar .widget-control-list").Sortable({accept:"widget-sortable",helperclass:"sorthelper",handle:"h4.widget-title",onStop:d})};d()});
  • trunk/wp-includes/js/autosave.dev.js

    r10291 r10326  
    167167    autosaveLast = jQuery("#title").val()+jQuery("#content").val();
    168168    goodcats = ([]);
    169     jQuery("[@name='post_category[]']:checked").each( function(i) {
     169    jQuery("[name='post_category[]']:checked").each( function(i) {
    170170        goodcats.push(this.value);
    171171    } );
  • trunk/wp-includes/js/autosave.js

    r10291 r10326  
    1 var autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,autosaveFirst=true;jQuery(function(a){autosaveLast=a("#post #title").val()+a("#post #content").val();autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical)})});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,"autosave"),d="",a;if(c&&c.responses&&c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if("disable"==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(d){jQuery("#autosave").html(d)}else{if(autosaveOldMessage&&c){jQuery("#autosave").html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}autosaveFirst=false;if(autosaveDelayPreview){jQuery("#post-preview").click()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b);autosave_enable_buttons()});jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr("disabled","")}function autosave_disable_buttons(){jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}var autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c){b=tinyMCE.activeEditor;if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}autosave_disable_buttons();e=jQuery("#original_post_status").val();autosaveLast=jQuery("#title").val()+jQuery("#content").val();goodcats=([]);jQuery("[@name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(c&&tinyMCE.activeEditor.plugins.spellchecker&&tinyMCE.activeEditor.plugins.spellchecker.active){f=false}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}if(!f){d.autosave=0}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
     1var autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,autosaveFirst=true;jQuery(function(a){autosaveLast=a("#post #title").val()+a("#post #content").val();autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical)})});function autosave_parse_response(b){var c=wpAjax.parseAjaxResponse(b,"autosave"),d="",a;if(c&&c.responses&&c.responses.length){d=c.responses[0].data;if(c.responses[0].supplemental){if("disable"==c.responses[0].supplemental.disable_autosave){autosave=function(){};c={errors:true}}jQuery.each(c.responses[0].supplemental,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(d){jQuery("#autosave").html(d)}else{if(autosaveOldMessage&&c){jQuery("#autosave").html(autosaveOldMessage)}}return c}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}autosaveFirst=false;if(autosaveDelayPreview){jQuery("#post-preview").click()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b);autosave_enable_buttons()});jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if(jQuery.isFunction(make_slugedit_clickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(slugL10n.requestFile,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);make_slugedit_clickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(".submitbox :button:disabled, .submitbox :submit:disabled").attr("disabled","")}function autosave_disable_buttons(){jQuery(".submitbox :button:enabled, .submitbox :submit:enabled").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}var autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c){b=tinyMCE.activeEditor;if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}autosave_disable_buttons();e=jQuery("#original_post_status").val();autosaveLast=jQuery("#title").val()+jQuery("#content").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(c&&tinyMCE.activeEditor.plugins.spellchecker&&tinyMCE.activeEditor.plugins.spellchecker.active){f=false}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}if(!f){d.autosave=0}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})};
  • trunk/wp-includes/js/jquery/jquery.js

    r10291 r10326  
     1/*!
     2 * jQuery JavaScript Library v1.3b2
     3 * http://jquery.com/
     4 *
     5 * Copyright (c) 2009 John Resig
     6 * Dual licensed under the MIT and GPL licenses.
     7 * http://docs.jquery.com/License
     8 *
     9 * Date: 2009-01-05 18:33:56 -0500 (Mon, 05 Jan 2009)
     10 * Revision: 6056
     11 */
     12(function(){
     13
     14var
     15    // Will speed up references to window, and allows munging its name.
     16    window = this,
     17    // Will speed up references to undefined, and allows munging its name.
     18    undefined,
     19    // Map over jQuery in case of overwrite
     20    _jQuery = window.jQuery,
     21    // Map over the $ in case of overwrite
     22    _$ = window.$,
     23
     24    jQuery = window.jQuery = window.$ = function( selector, context ) {
     25        // The jQuery object is actually just the init constructor 'enhanced'
     26        return new jQuery.fn.init( selector, context );
     27    },
     28
     29    // A simple way to check for HTML strings or ID strings
     30    // (both of which we optimize for)
     31    quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
     32    // Is it a simple selector
     33    isSimple = /^.[^:#\[\.,]*$/;
     34
     35jQuery.fn = jQuery.prototype = {
     36    init: function( selector, context ) {
     37        // Make sure that a selection was provided
     38        selector = selector || document;
     39
     40        // Handle $(DOMElement)
     41        if ( selector.nodeType ) {
     42            this[0] = selector;
     43            this.length = 1;
     44            this.context = selector;
     45            return this;
     46        }
     47        // Handle HTML strings
     48        if ( typeof selector === "string" ) {
     49            // Are we dealing with HTML string or an ID?
     50            var match = quickExpr.exec( selector );
     51
     52            // Verify a match, and that no context was specified for #id
     53            if ( match && (match[1] || !context) ) {
     54
     55                // HANDLE: $(html) -> $(array)
     56                if ( match[1] )
     57                    selector = jQuery.clean( [ match[1] ], context );
     58
     59                // HANDLE: $("#id")
     60                else {
     61                    var elem = document.getElementById( match[3] );
     62
     63                    // Make sure an element was located
     64                    if ( elem ){
     65                        // Handle the case where IE and Opera return items
     66                        // by name instead of ID
     67                        if ( elem.id != match[3] )
     68                            return jQuery().find( selector );
     69
     70                        // Otherwise, we inject the element directly into the jQuery object
     71                        var ret = jQuery( elem );
     72                        ret.context = document;
     73                        ret.selector = selector;
     74                        return ret;
     75                    }
     76                    selector = [];
     77                }
     78
     79            // HANDLE: $(expr, [context])
     80            // (which is just equivalent to: $(content).find(expr)
     81            } else
     82                return jQuery( context ).find( selector );
     83
     84        // HANDLE: $(function)
     85        // Shortcut for document ready
     86        } else if ( jQuery.isFunction( selector ) )
     87            return jQuery( document ).ready( selector );
     88
     89        return this.setArray(jQuery.makeArray(selector));
     90    },
     91
     92    // Start with an empty selector
     93    selector: "",
     94
     95    // The current version of jQuery being used
     96    jquery: "1.3b2",
     97
     98    // The number of elements contained in the matched element set
     99    size: function() {
     100        return this.length;
     101    },
     102
     103    // Get the Nth element in the matched element set OR
     104    // Get the whole matched element set as a clean array
     105    get: function( num ) {
     106        return num === undefined ?
     107
     108            // Return a 'clean' array
     109            jQuery.makeArray( this ) :
     110
     111            // Return just the object
     112            this[ num ];
     113    },
     114
     115    // Take an array of elements and push it onto the stack
     116    // (returning the new matched element set)
     117    pushStack: function( elems, name, selector ) {
     118        // Build a new jQuery matched element set
     119        var ret = jQuery( elems );
     120
     121        // Add the old object onto the stack (as a reference)
     122        ret.prevObject = this;
     123
     124        ret.context = this.context;
     125
     126        if ( name === "find" )
     127            ret.selector = this.selector + (this.selector ? " " : "") + selector;
     128        else if ( name )
     129            ret.selector = this.selector + "." + name + "(" + selector + ")";
     130
     131        // Return the newly-formed element set
     132        return ret;
     133    },
     134
     135    // Force the current matched set of elements to become
     136    // the specified array of elements (destroying the stack in the process)
     137    // You should use pushStack() in order to do this, but maintain the stack
     138    setArray: function( elems ) {
     139        // Resetting the length to 0, then using the native Array push
     140        // is a super-fast way to populate an object with array-like properties
     141        this.length = 0;
     142        Array.prototype.push.apply( this, elems );
     143
     144        return this;
     145    },
     146
     147    // Execute a callback for every element in the matched set.
     148    // (You can seed the arguments with an array of args, but this is
     149    // only used internally.)
     150    each: function( callback, args ) {
     151        return jQuery.each( this, callback, args );
     152    },
     153
     154    // Determine the position of an element within
     155    // the matched set of elements
     156    index: function( elem ) {
     157        // Locate the position of the desired element
     158        return jQuery.inArray(
     159            // If it receives a jQuery object, the first element is used
     160            elem && elem.jquery ? elem[0] : elem
     161        , this );
     162    },
     163
     164    attr: function( name, value, type ) {
     165        var options = name;
     166
     167        // Look for the case where we're accessing a style value
     168        if ( typeof name === "string" )
     169            if ( value === undefined )
     170                return this[0] && jQuery[ type || "attr" ]( this[0], name );
     171
     172            else {
     173                options = {};
     174                options[ name ] = value;
     175            }
     176
     177        // Check to see if we're setting style values
     178        return this.each(function(i){
     179            // Set all the styles
     180            for ( name in options )
     181                jQuery.attr(
     182                    type ?
     183                        this.style :
     184                        this,
     185                    name, jQuery.prop( this, options[ name ], type, i, name )
     186                );
     187        });
     188    },
     189
     190    css: function( key, value ) {
     191        // ignore negative width and height values
     192        if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
     193            value = undefined;
     194        return this.attr( key, value, "curCSS" );
     195    },
     196
     197    text: function( text ) {
     198        if ( typeof text !== "object" && text != null )
     199            return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
     200
     201        var ret = "";
     202
     203        jQuery.each( text || this, function(){
     204            jQuery.each( this.childNodes, function(){
     205                if ( this.nodeType != 8 )
     206                    ret += this.nodeType != 1 ?
     207                        this.nodeValue :
     208                        jQuery.fn.text( [ this ] );
     209            });
     210        });
     211
     212        return ret;
     213    },
     214
     215    wrapAll: function( html ) {
     216        if ( this[0] )
     217            // The elements to wrap the target around
     218            jQuery( html, this[0].ownerDocument )
     219                .clone()
     220                .insertBefore( this[0] )
     221                .map(function(){
     222                    var elem = this;
     223
     224                    while ( elem.firstChild )
     225                        elem = elem.firstChild;
     226
     227                    return elem;
     228                })
     229                .append(this);
     230
     231        return this;
     232    },
     233
     234    wrapInner: function( html ) {
     235        return this.each(function(){
     236            jQuery( this ).contents().wrapAll( html );
     237        });
     238    },
     239
     240    wrap: function( html ) {
     241        return this.each(function(){
     242            jQuery( this ).wrapAll( html );
     243        });
     244    },
     245
     246    append: function() {
     247        return this.domManip(arguments, true, function(elem){
     248            if (this.nodeType == 1)
     249                this.appendChild( elem );
     250        });
     251    },
     252
     253    prepend: function() {
     254        return this.domManip(arguments, true, function(elem){
     255            if (this.nodeType == 1)
     256                this.insertBefore( elem, this.firstChild );
     257        });
     258    },
     259
     260    before: function() {
     261        return this.domManip(arguments, false, function(elem){
     262            this.parentNode.insertBefore( elem, this );
     263        });
     264    },
     265
     266    after: function() {
     267        return this.domManip(arguments, false, function(elem){
     268            this.parentNode.insertBefore( elem, this.nextSibling );
     269        });
     270    },
     271
     272    end: function() {
     273        return this.prevObject || jQuery( [] );
     274    },
     275
     276    find: function( selector ) {
     277        var elems = jQuery.map(this, function(elem){
     278            return jQuery.find( selector, elem );
     279        });
     280
     281        return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
     282            jQuery.unique( elems ) :
     283            elems, "find", selector );
     284    },
     285
     286    clone: function( events ) {
     287        // Do the clone
     288        var ret = this.map(function(){
     289            if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
     290                // IE copies events bound via attachEvent when
     291                // using cloneNode. Calling detachEvent on the
     292                // clone will also remove the events from the orignal
     293                // In order to get around this, we use innerHTML.
     294                // Unfortunately, this means some modifications to
     295                // attributes in IE that are actually only stored
     296                // as properties will not be copied (such as the
     297                // the name attribute on an input).
     298                var clone = this.cloneNode(true),
     299                    container = document.createElement("div");
     300                container.appendChild(clone);
     301                return jQuery.clean([container.innerHTML])[0];
     302            } else
     303                return this.cloneNode(true);
     304        });
     305
     306        // Need to set the expando to null on the cloned set if it exists
     307        // removeData doesn't work here, IE removes it from the original as well
     308        // this is primarily for IE but the data expando shouldn't be copied over in any browser
     309        var clone = ret.find("*").andSelf().each(function(){
     310            if ( this[ expando ] !== undefined )
     311                this[ expando ] = null;
     312        });
     313
     314        // Copy the events from the original to the clone
     315        if ( events === true )
     316            this.find("*").andSelf().each(function(i){
     317                if (this.nodeType == 3)
     318                    return;
     319                var events = jQuery.data( this, "events" );
     320
     321                for ( var type in events )
     322                    for ( var handler in events[ type ] )
     323                        jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
     324            });
     325
     326        // Return the cloned set
     327        return ret;
     328    },
     329
     330    filter: function( selector ) {
     331        return this.pushStack(
     332            jQuery.isFunction( selector ) &&
     333            jQuery.grep(this, function(elem, i){
     334                return selector.call( elem, i );
     335            }) ||
     336
     337            jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
     338                return elem.nodeType === 1;
     339            }) ), "filter", selector );
     340    },
     341
     342    closest: function( selector ) {
     343        return this.map(function(){
     344            var cur = this;
     345            while ( cur && cur.ownerDocument ) {
     346                if ( jQuery(cur).is(selector) )
     347                    return cur;
     348                cur = cur.parentNode;
     349            }
     350        });
     351    },
     352
     353    not: function( selector ) {
     354        if ( typeof selector === "string" )
     355            // test special case where just one selector is passed in
     356            if ( isSimple.test( selector ) )
     357                return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
     358            else
     359                selector = jQuery.multiFilter( selector, this );
     360
     361        var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
     362        return this.filter(function() {
     363            return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
     364        });
     365    },
     366
     367    add: function( selector ) {
     368        return this.pushStack( jQuery.unique( jQuery.merge(
     369            this.get(),
     370            typeof selector === "string" ?
     371                jQuery( selector ) :
     372                jQuery.makeArray( selector )
     373        )));
     374    },
     375
     376    is: function( selector ) {
     377        return !!selector && jQuery.multiFilter( selector, this ).length > 0;
     378    },
     379
     380    hasClass: function( selector ) {
     381        return !!selector && this.is( "." + selector );
     382    },
     383
     384    val: function( value ) {
     385        if ( value === undefined ) {           
     386            var elem = this[0];
     387
     388            if ( elem ) {
     389                if( jQuery.nodeName( elem, 'option' ) )
     390                    return (elem.attributes.value || {}).specified ? elem.value : elem.text;
     391               
     392                // We need to handle select boxes special
     393                if ( jQuery.nodeName( elem, "select" ) ) {
     394                    var index = elem.selectedIndex,
     395                        values = [],
     396                        options = elem.options,
     397                        one = elem.type == "select-one";
     398
     399                    // Nothing was selected
     400                    if ( index < 0 )
     401                        return null;
     402
     403                    // Loop through all the selected options
     404                    for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
     405                        var option = options[ i ];
     406
     407                        if ( option.selected ) {
     408                            // Get the specifc value for the option
     409                            value = jQuery(option).val();
     410
     411                            // We don't need an array for one selects
     412                            if ( one )
     413                                return value;
     414
     415                            // Multi-Selects return an array
     416                            values.push( value );
     417                        }
     418                    }
     419
     420                    return values;             
     421                }
     422
     423                // Everything else, we just grab the value
     424                return (elem.value || "").replace(/\r/g, "");
     425
     426            }
     427
     428            return undefined;
     429        }
     430
     431        if ( typeof value === "number" )
     432            value += '';
     433
     434        return this.each(function(){
     435            if ( this.nodeType != 1 )
     436                return;
     437
     438            if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
     439                this.checked = (jQuery.inArray(this.value, value) >= 0 ||
     440                    jQuery.inArray(this.name, value) >= 0);
     441
     442            else if ( jQuery.nodeName( this, "select" ) ) {
     443                var values = jQuery.makeArray(value);
     444
     445                jQuery( "option", this ).each(function(){
     446                    this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
     447                        jQuery.inArray( this.text, values ) >= 0);
     448                });
     449
     450                if ( !values.length )
     451                    this.selectedIndex = -1;
     452
     453            } else
     454                this.value = value;
     455        });
     456    },
     457
     458    html: function( value ) {
     459        return value === undefined ?
     460            (this[0] ?
     461                this[0].innerHTML :
     462                null) :
     463            this.empty().append( value );
     464    },
     465
     466    replaceWith: function( value ) {
     467        return this.after( value ).remove();
     468    },
     469
     470    eq: function( i ) {
     471        return this.slice( i, +i + 1 );
     472    },
     473
     474    slice: function() {
     475        return this.pushStack( Array.prototype.slice.apply( this, arguments ),
     476            "slice", Array.prototype.slice.call(arguments).join(",") );
     477    },
     478
     479    map: function( callback ) {
     480        return this.pushStack( jQuery.map(this, function(elem, i){
     481            return callback.call( elem, i, elem );
     482        }));
     483    },
     484
     485    andSelf: function() {
     486        return this.add( this.prevObject );
     487    },
     488
     489    domManip: function( args, table, callback ) {
     490        if ( this[0] ) {
     491            var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
     492                scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
     493                first = fragment.firstChild,
     494                extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
     495
     496            if ( first )
     497                for ( var i = 0, l = this.length; i < l; i++ )
     498                    callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
     499           
     500            if ( scripts )
     501                jQuery.each( scripts, evalScript );
     502        }
     503
     504        return this;
     505       
     506        function root( elem, cur ) {
     507            return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
     508                (elem.getElementsByTagName("tbody")[0] ||
     509                elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
     510                elem;
     511        }
     512    }
     513};
     514
     515// Give the init function the jQuery prototype for later instantiation
     516jQuery.fn.init.prototype = jQuery.fn;
     517
     518function evalScript( i, elem ) {
     519    if ( elem.src )
     520        jQuery.ajax({
     521            url: elem.src,
     522            async: false,
     523            dataType: "script"
     524        });
     525
     526    else
     527        jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
     528
     529    if ( elem.parentNode )
     530        elem.parentNode.removeChild( elem );
     531}
     532
     533function now(){
     534    return +new Date;
     535}
     536
     537jQuery.extend = jQuery.fn.extend = function() {
     538    // copy reference to target object
     539    var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
     540
     541    // Handle a deep copy situation
     542    if ( typeof target === "boolean" ) {
     543        deep = target;
     544        target = arguments[1] || {};
     545        // skip the boolean and the target
     546        i = 2;
     547    }
     548
     549    // Handle case when target is a string or something (possible in deep copy)
     550    if ( typeof target !== "object" && !jQuery.isFunction(target) )
     551        target = {};
     552
     553    // extend jQuery itself if only one argument is passed
     554    if ( length == i ) {
     555        target = this;
     556        --i;
     557    }
     558
     559    for ( ; i < length; i++ )
     560        // Only deal with non-null/undefined values
     561        if ( (options = arguments[ i ]) != null )
     562            // Extend the base object
     563            for ( var name in options ) {
     564                var src = target[ name ], copy = options[ name ];
     565
     566                // Prevent never-ending loop
     567                if ( target === copy )
     568                    continue;
     569
     570                // Recurse if we're merging object values
     571                if ( deep && copy && typeof copy === "object" && !copy.nodeType )
     572                    target[ name ] = jQuery.extend( deep,
     573                        // Never move original objects, clone them
     574                        src || ( copy.length != null ? [ ] : { } )
     575                    , copy );
     576
     577                // Don't bring in undefined values
     578                else if ( copy !== undefined )
     579                    target[ name ] = copy;
     580
     581            }
     582
     583    // Return the modified object
     584    return target;
     585};
     586
     587// exclude the following css properties to add px
     588var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
     589    // cache defaultView
     590    defaultView = document.defaultView || {},
     591    toString = Object.prototype.toString;
     592
     593jQuery.extend({
     594    noConflict: function( deep ) {
     595        window.$ = _$;
     596
     597        if ( deep )
     598            window.jQuery = _jQuery;
     599
     600        return jQuery;
     601    },
     602
     603    // See test/unit/core.js for details concerning isFunction.
     604    // Since version 1.3, DOM methods and functions like alert
     605    // aren't supported. They return false on IE (#2968).
     606    isFunction: function( obj ) {
     607        return toString.call(obj) === "[object Function]";
     608    },
     609
     610    isArray: function( obj ) {
     611        return toString.call(obj) === "[object Array]";
     612    },
     613
     614    // check if an element is in a (or is an) XML document
     615    isXMLDoc: function( elem ) {
     616        return elem.documentElement && !elem.body ||
     617            elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
     618    },
     619
     620    // Evalulates a script in a global context
     621    globalEval: function( data ) {
     622        data = jQuery.trim( data );
     623
     624        if ( data ) {
     625            // Inspired by code by Andrea Giammarchi
     626            // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
     627            var head = document.getElementsByTagName("head")[0] || document.documentElement,
     628                script = document.createElement("script");
     629
     630            script.type = "text/javascript";
     631            if ( jQuery.support.scriptEval )
     632                script.appendChild( document.createTextNode( data ) );
     633            else
     634                script.text = data;
     635
     636            // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
     637            // This arises when a base node is used (#2709).
     638            head.insertBefore( script, head.firstChild );
     639            head.removeChild( script );
     640        }
     641    },
     642
     643    nodeName: function( elem, name ) {
     644        return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
     645    },
     646
     647    // args is for internal usage only
     648    each: function( object, callback, args ) {
     649        var name, i = 0, length = object.length;
     650
     651        if ( args ) {
     652            if ( length === undefined ) {
     653                for ( name in object )
     654                    if ( callback.apply( object[ name ], args ) === false )
     655                        break;
     656            } else
     657                for ( ; i < length; )
     658                    if ( callback.apply( object[ i++ ], args ) === false )
     659                        break;
     660
     661        // A special, fast, case for the most common use of each
     662        } else {
     663            if ( length === undefined ) {
     664                for ( name in object )
     665                    if ( callback.call( object[ name ], name, object[ name ] ) === false )
     666                        break;
     667            } else
     668                for ( var value = object[0];
     669                    i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
     670        }
     671
     672        return object;
     673    },
     674
     675    prop: function( elem, value, type, i, name ) {
     676        // Handle executable functions
     677        if ( jQuery.isFunction( value ) )
     678            value = value.call( elem, i );
     679
     680        // Handle passing in a number to a CSS property
     681        return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
     682            value + "px" :
     683            value;
     684    },
     685
     686    className: {
     687        // internal only, use addClass("class")
     688        add: function( elem, classNames ) {
     689            jQuery.each((classNames || "").split(/\s+/), function(i, className){
     690                if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
     691                    elem.className += (elem.className ? " " : "") + className;
     692            });
     693        },
     694
     695        // internal only, use removeClass("class")
     696        remove: function( elem, classNames ) {
     697            if (elem.nodeType == 1)
     698                elem.className = classNames !== undefined ?
     699                    jQuery.grep(elem.className.split(/\s+/), function(className){
     700                        return !jQuery.className.has( classNames, className );
     701                    }).join(" ") :
     702                    "";
     703        },
     704
     705        // internal only, use hasClass("class")
     706        has: function( elem, className ) {
     707            return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
     708        }
     709    },
     710
     711    // A method for quickly swapping in/out CSS properties to get correct calculations
     712    swap: function( elem, options, callback ) {
     713        var old = {};
     714        // Remember the old values, and insert the new ones
     715        for ( var name in options ) {
     716            old[ name ] = elem.style[ name ];
     717            elem.style[ name ] = options[ name ];
     718        }
     719
     720        callback.call( elem );
     721
     722        // Revert the old values
     723        for ( var name in options )
     724            elem.style[ name ] = old[ name ];
     725    },
     726
     727    css: function( elem, name, force ) {
     728        if ( name == "width" || name == "height" ) {
     729            var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
     730
     731            function getWH() {
     732                val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
     733                var padding = 0, border = 0;
     734                jQuery.each( which, function() {
     735                    padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
     736                    border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
     737                });
     738                val -= Math.round(padding + border);
     739            }
     740
     741            if ( jQuery(elem).is(":visible") )
     742                getWH();
     743            else
     744                jQuery.swap( elem, props, getWH );
     745
     746            return Math.max(0, val);
     747        }
     748
     749        return jQuery.curCSS( elem, name, force );
     750    },
     751
     752    curCSS: function( elem, name, force ) {
     753        var ret, style = elem.style;
     754
     755        // We need to handle opacity special in IE
     756        if ( name == "opacity" && !jQuery.support.opacity ) {
     757            ret = jQuery.attr( style, "opacity" );
     758
     759            return ret == "" ?
     760                "1" :
     761                ret;
     762        }
     763
     764        // Make sure we're using the right name for getting the float value
     765        if ( name.match( /float/i ) )
     766            name = styleFloat;
     767
     768        if ( !force && style && style[ name ] )
     769            ret = style[ name ];
     770
     771        else if ( defaultView.getComputedStyle ) {
     772
     773            // Only "float" is needed here
     774            if ( name.match( /float/i ) )
     775                name = "float";
     776
     777            name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
     778
     779            var computedStyle = defaultView.getComputedStyle( elem, null );
     780
     781            if ( computedStyle )
     782                ret = computedStyle.getPropertyValue( name );
     783
     784            // We should always get a number back from opacity
     785            if ( name == "opacity" && ret == "" )
     786                ret = "1";
     787
     788        } else if ( elem.currentStyle ) {
     789            var camelCase = name.replace(/\-(\w)/g, function(all, letter){
     790                return letter.toUpperCase();
     791            });
     792
     793            ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
     794
     795            // From the awesome hack by Dean Edwards
     796            // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
     797
     798            // If we're not dealing with a regular pixel number
     799            // but a number that has a weird ending, we need to convert it to pixels
     800            if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
     801                // Remember the original values
     802                var left = style.left, rsLeft = elem.runtimeStyle.left;
     803
     804                // Put in the new values to get a computed value out
     805                elem.runtimeStyle.left = elem.currentStyle.left;
     806                style.left = ret || 0;
     807                ret = style.pixelLeft + "px";
     808
     809                // Revert the changed values
     810                style.left = left;
     811                elem.runtimeStyle.left = rsLeft;
     812            }
     813        }
     814
     815        return ret;
     816    },
     817
     818    clean: function( elems, context, fragment ) {
     819        context = context || document;
     820
     821        // !context.createElement fails in IE with an error but returns typeof 'object'
     822        if ( typeof context.createElement === "undefined" )
     823            context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
     824
     825        // If a single string is passed in and it's a single tag
     826        // just do a createElement and skip the rest
     827        if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
     828            var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
     829            if ( match )
     830                return [ context.createElement( match[1] ) ];
     831        }
     832
     833        var ret = [], scripts = [], div = context.createElement("div");
     834
     835        jQuery.each(elems, function(i, elem){
     836            if ( typeof elem === "number" )
     837                elem += '';
     838
     839            if ( !elem )
     840                return;
     841
     842            // Convert html string into DOM nodes
     843            if ( typeof elem === "string" ) {
     844                // Fix "XHTML"-style tags in all browsers
     845                elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
     846                    return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
     847                        all :
     848                        front + "></" + tag + ">";
     849                });
     850
     851                // Trim whitespace, otherwise indexOf won't work as expected
     852                var tags = jQuery.trim( elem ).toLowerCase();
     853
     854                var wrap =
     855                    // option or optgroup
     856                    !tags.indexOf("<opt") &&
     857                    [ 1, "<select multiple='multiple'>", "</select>" ] ||
     858
     859                    !tags.indexOf("<leg") &&
     860                    [ 1, "<fieldset>", "</fieldset>" ] ||
     861
     862                    tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
     863                    [ 1, "<table>", "</table>" ] ||
     864
     865                    !tags.indexOf("<tr") &&
     866                    [ 2, "<table><tbody>", "</tbody></table>" ] ||
     867
     868                    // <thead> matched above
     869                    (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
     870                    [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
     871
     872                    !tags.indexOf("<col") &&
     873                    [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
     874
     875                    // IE can't serialize <link> and <script> tags normally
     876                    !jQuery.support.htmlSerialize &&
     877                    [ 1, "div<div>", "</div>" ] ||
     878
     879                    [ 0, "", "" ];
     880
     881                // Go to html and back, then peel off extra wrappers
     882                div.innerHTML = wrap[1] + elem + wrap[2];
     883
     884                // Move to the right depth
     885                while ( wrap[0]-- )
     886                    div = div.lastChild;
     887
     888                // Remove IE's autoinserted <tbody> from table fragments
     889                if ( !jQuery.support.tbody ) {
     890
     891                    // String was a <table>, *may* have spurious <tbody>
     892                    var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
     893                        div.firstChild && div.firstChild.childNodes :
     894
     895                        // String was a bare <thead> or <tfoot>
     896                        wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
     897                            div.childNodes :
     898                            [];
     899
     900                    for ( var j = tbody.length - 1; j >= 0 ; --j )
     901                        if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
     902                            tbody[ j ].parentNode.removeChild( tbody[ j ] );
     903
     904                    }
     905
     906                // IE completely kills leading whitespace when innerHTML is used
     907                if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
     908                    div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
     909               
     910                elem = jQuery.makeArray( div.childNodes );
     911            }
     912
     913            if ( elem.nodeType )
     914                ret.push( elem );
     915            else
     916                ret = jQuery.merge( ret, elem );
     917
     918        });
     919
     920        if ( fragment ) {
     921            for ( var i = 0; ret[i]; i++ ) {
     922                if ( jQuery.nodeName( ret[i], "script" ) ) {
     923                    scripts.push( ret[i].parentNode.removeChild( ret[i] ) );
     924                } else {
     925                    if ( ret[i].nodeType === 1 )
     926                        ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
     927                    fragment.appendChild( ret[i] );
     928                }
     929            }
     930           
     931            return scripts;
     932        }
     933
     934        return ret;
     935    },
     936
     937    attr: function( elem, name, value ) {
     938        // don't set attributes on text and comment nodes
     939        if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
     940            return undefined;
     941
     942        var notxml = !jQuery.isXMLDoc( elem ),
     943            // Whether we are setting (or getting)
     944            set = value !== undefined;
     945
     946        // Try to normalize/fix the name
     947        name = notxml && jQuery.props[ name ] || name;
     948
     949        // Only do all the following if this is a node (faster for style)
     950        // IE elem.getAttribute passes even for style
     951        if ( elem.tagName ) {
     952
     953            // These attributes require special treatment
     954            var special = /href|src|style/.test( name );
     955
     956            // Safari mis-reports the default selected property of a hidden option
     957            // Accessing the parent's selectedIndex property fixes it
     958            if ( name == "selected" )
     959                elem.parentNode.selectedIndex;
     960
     961            // If applicable, access the attribute via the DOM 0 way
     962            if ( name in elem && notxml && !special ) {
     963                if ( set ){
     964                    // We can't allow the type property to be changed (since it causes problems in IE)
     965                    if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
     966                        throw "type property can't be changed";
     967
     968                    elem[ name ] = value;
     969                }
     970
     971                // browsers index elements by id/name on forms, give priority to attributes.
     972                if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
     973                    return elem.getAttributeNode( name ).nodeValue;
     974
     975                // elem.tabindex doesn't always return the correct value
     976                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
     977                if ( name == jQuery.props.tabindex ) {
     978                    var attributeNode = elem.getAttributeNode(jQuery.props.tabindex);
     979                    return attributeNode && attributeNode.specified && attributeNode.value || undefined;
     980                }
     981
     982                return elem[ name ];
     983            }
     984
     985            if ( !jQuery.support.style && notxml &&  name == "style" )
     986                return jQuery.attr( elem.style, "cssText", value );
     987
     988            if ( set )
     989                // convert the value to a string (all browsers do this but IE) see #1070
     990                elem.setAttribute( name, "" + value );
     991
     992            var attr = !jQuery.support.hrefNormalized && notxml && special
     993                    // Some attributes require a special call on IE
     994                    ? elem.getAttribute( name, 2 )
     995                    : elem.getAttribute( name );
     996
     997            // Non-existent attributes return null, we normalize to undefined
     998            return attr === null ? undefined : attr;
     999        }
     1000
     1001        // elem is actually elem.style ... set the style
     1002
     1003        // IE uses filters for opacity
     1004        if ( !jQuery.support.opacity && name == "opacity" ) {
     1005            if ( set ) {
     1006                // IE has trouble with opacity if it does not have layout
     1007                // Force it by setting the zoom level
     1008                elem.zoom = 1;
     1009
     1010                // Set the alpha filter to set the opacity
     1011                elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
     1012                    (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
     1013            }
     1014
     1015            return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
     1016                (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
     1017                "";
     1018        }
     1019
     1020        name = name.replace(/-([a-z])/ig, function(all, letter){
     1021            return letter.toUpperCase();
     1022        });
     1023
     1024        if ( set )
     1025            elem[ name ] = value;
     1026
     1027        return elem[ name ];
     1028    },
     1029
     1030    trim: function( text ) {
     1031        return (text || "").replace( /^\s+|\s+$/g, "" );
     1032    },
     1033
     1034    makeArray: function( array ) {
     1035        var ret = [];
     1036
     1037        if( array != null ){
     1038            var i = array.length;
     1039            // The window, strings (and functions) also have 'length'
     1040            if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
     1041                ret[0] = array;
     1042            else
     1043                while( i )
     1044                    ret[--i] = array[i];
     1045        }
     1046
     1047        return ret;
     1048    },
     1049
     1050    inArray: function( elem, array ) {
     1051        for ( var i = 0, length = array.length; i < length; i++ )
     1052        // Use === because on IE, window == document
     1053            if ( array[ i ] === elem )
     1054                return i;
     1055
     1056        return -1;
     1057    },
     1058
     1059    merge: function( first, second ) {
     1060        // We have to loop this way because IE & Opera overwrite the length
     1061        // expando of getElementsByTagName
     1062        var i = 0, elem, pos = first.length;
     1063        // Also, we need to make sure that the correct elements are being returned
     1064        // (IE returns comment nodes in a '*' query)
     1065        if ( !jQuery.support.getAll ) {
     1066            while ( (elem = second[ i++ ]) != null )
     1067                if ( elem.nodeType != 8 )
     1068                    first[ pos++ ] = elem;
     1069
     1070        } else
     1071            while ( (elem = second[ i++ ]) != null )
     1072                first[ pos++ ] = elem;
     1073
     1074        return first;
     1075    },
     1076
     1077    unique: function( array ) {
     1078        var ret = [], done = {};
     1079
     1080        try {
     1081
     1082            for ( var i = 0, length = array.length; i < length; i++ ) {
     1083                var id = jQuery.data( array[ i ] );
     1084
     1085                if ( !done[ id ] ) {
     1086                    done[ id ] = true;
     1087                    ret.push( array[ i ] );
     1088                }
     1089            }
     1090
     1091        } catch( e ) {
     1092            ret = array;
     1093        }
     1094
     1095        return ret;
     1096    },
     1097
     1098    grep: function( elems, callback, inv ) {
     1099        var ret = [];
     1100
     1101        // Go through the array, only saving the items
     1102        // that pass the validator function
     1103        for ( var i = 0, length = elems.length; i < length; i++ )
     1104            if ( !inv != !callback( elems[ i ], i ) )
     1105                ret.push( elems[ i ] );
     1106
     1107        return ret;
     1108    },
     1109
     1110    map: function( elems, callback ) {
     1111        var ret = [];
     1112
     1113        // Go through the array, translating each of the items to their
     1114        // new value (or values).
     1115        for ( var i = 0, length = elems.length; i < length; i++ ) {
     1116            var value = callback( elems[ i ], i );
     1117
     1118            if ( value != null )
     1119                ret[ ret.length ] = value;
     1120        }
     1121
     1122        return ret.concat.apply( [], ret );
     1123    }
     1124});
     1125
     1126// Use of jQuery.browser is deprecated.
     1127// It's included for backwards compatibility and plugins,
     1128// although they should work to migrate away.
     1129
     1130var userAgent = navigator.userAgent.toLowerCase();
     1131
     1132// Figure out what browser is being used
     1133jQuery.browser = {
     1134    version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
     1135    safari: /webkit/.test( userAgent ),
     1136    opera: /opera/.test( userAgent ),
     1137    msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
     1138    mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
     1139};
     1140
     1141// Check to see if the W3C box model is being used
     1142jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";
     1143
     1144jQuery.each({
     1145    parent: function(elem){return elem.parentNode;},
     1146    parents: function(elem){return jQuery.dir(elem,"parentNode");},
     1147    next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
     1148    prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
     1149    nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
     1150    prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
     1151    siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
     1152    children: function(elem){return jQuery.sibling(elem.firstChild);},
     1153    contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
     1154}, function(name, fn){
     1155    jQuery.fn[ name ] = function( selector ) {
     1156        var ret = jQuery.map( this, fn );
     1157
     1158        if ( selector && typeof selector == "string" )
     1159            ret = jQuery.multiFilter( selector, ret );
     1160
     1161        return this.pushStack( jQuery.unique( ret ), name, selector );
     1162    };
     1163});
     1164
     1165jQuery.each({
     1166    appendTo: "append",
     1167    prependTo: "prepend",
     1168    insertBefore: "before",
     1169    insertAfter: "after",
     1170    replaceAll: "replaceWith"
     1171}, function(name, original){
     1172    jQuery.fn[ name ] = function() {
     1173        var args = arguments;
     1174
     1175        return this.each(function(){
     1176            for ( var i = 0, length = args.length; i < length; i++ )
     1177                jQuery( args[ i ] )[ original ]( this );
     1178        });
     1179    };
     1180});
     1181
     1182jQuery.each({
     1183    removeAttr: function( name ) {
     1184        jQuery.attr( this, name, "" );
     1185        if (this.nodeType == 1)
     1186            this.removeAttribute( name );
     1187    },
     1188
     1189    addClass: function( classNames ) {
     1190        jQuery.className.add( this, classNames );
     1191    },
     1192
     1193    removeClass: function( classNames ) {
     1194        jQuery.className.remove( this, classNames );
     1195    },
     1196
     1197    toggleClass: function( classNames, state ) {
     1198        if( typeof state !== "boolean" )
     1199            state = !jQuery.className.has( this, classNames );
     1200        jQuery.className[ state ? "add" : "remove" ]( this, classNames );
     1201    },
     1202
     1203    remove: function( selector ) {
     1204        if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
     1205            // Prevent memory leaks
     1206            jQuery( "*", this ).add([this]).each(function(){
     1207                jQuery.event.remove(this);
     1208                jQuery.removeData(this);
     1209            });
     1210            if (this.parentNode)
     1211                this.parentNode.removeChild( this );
     1212        }
     1213    },
     1214
     1215    empty: function() {
     1216        // Remove element nodes and prevent memory leaks
     1217        jQuery( ">*", this ).remove();
     1218
     1219        // Remove any remaining nodes
     1220        while ( this.firstChild )
     1221            this.removeChild( this.firstChild );
     1222    }
     1223}, function(name, fn){
     1224    jQuery.fn[ name ] = function(){
     1225        return this.each( fn, arguments );
     1226    };
     1227});
     1228
     1229// Helper function used by the dimensions and offset modules
     1230function num(elem, prop) {
     1231    return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
     1232}
     1233var expando = "jQuery" + now(), uuid = 0, windowData = {};
     1234
     1235jQuery.extend({
     1236    cache: {},
     1237
     1238    data: function( elem, name, data ) {
     1239        elem = elem == window ?
     1240            windowData :
     1241            elem;
     1242
     1243        var id = elem[ expando ];
     1244
     1245        // Compute a unique ID for the element
     1246        if ( !id )
     1247            id = elem[ expando ] = ++uuid;
     1248
     1249        // Only generate the data cache if we're
     1250        // trying to access or manipulate it
     1251        if ( name && !jQuery.cache[ id ] )
     1252            jQuery.cache[ id ] = {};
     1253
     1254        // Prevent overriding the named cache with undefined values
     1255        if ( data !== undefined )
     1256            jQuery.cache[ id ][ name ] = data;
     1257
     1258        // Return the named cache data, or the ID for the element
     1259        return name ?
     1260            jQuery.cache[ id ][ name ] :
     1261            id;
     1262    },
     1263
     1264    removeData: function( elem, name ) {
     1265        elem = elem == window ?
     1266            windowData :
     1267            elem;
     1268
     1269        var id = elem[ expando ];
     1270
     1271        // If we want to remove a specific section of the element's data
     1272        if ( name ) {
     1273            if ( jQuery.cache[ id ] ) {
     1274                // Remove the section of cache data
     1275                delete jQuery.cache[ id ][ name ];
     1276
     1277                // If we've removed all the data, remove the element's cache
     1278                name = "";
     1279
     1280                for ( name in jQuery.cache[ id ] )
     1281                    break;
     1282
     1283                if ( !name )
     1284                    jQuery.removeData( elem );
     1285            }
     1286
     1287        // Otherwise, we want to remove all of the element's data
     1288        } else {
     1289            // Clean up the element expando
     1290            try {
     1291                delete elem[ expando ];
     1292            } catch(e){
     1293                // IE has trouble directly removing the expando
     1294                // but it's ok with using removeAttribute
     1295                if ( elem.removeAttribute )
     1296                    elem.removeAttribute( expando );
     1297            }
     1298
     1299            // Completely remove the data cache
     1300            delete jQuery.cache[ id ];
     1301        }
     1302    },
     1303    queue: function( elem, type, data ) {
     1304        if ( elem ){
     1305   
     1306            type = (type || "fx") + "queue";
     1307   
     1308            var q = jQuery.data( elem, type );
     1309   
     1310            if ( !q || jQuery.isArray(data) )
     1311                q = jQuery.data( elem, type, jQuery.makeArray(data) );
     1312            else if( data )
     1313                q.push( data );
     1314   
     1315        }
     1316        return q;
     1317    },
     1318
     1319    dequeue: function( elem, type ){
     1320        var queue = jQuery.queue( elem, type ),
     1321            fn = queue.shift();
     1322       
     1323        if( !type || type === "fx" )
     1324            fn = queue[0];
     1325           
     1326        if( fn !== undefined )
     1327            fn.call(elem);
     1328    }
     1329});
     1330
     1331jQuery.fn.extend({
     1332    data: function( key, value ){
     1333        var parts = key.split(".");
     1334        parts[1] = parts[1] ? "." + parts[1] : "";
     1335
     1336        if ( value === undefined ) {
     1337            var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
     1338
     1339            if ( data === undefined && this.length )
     1340                data = jQuery.data( this[0], key );
     1341
     1342            return data === undefined && parts[1] ?
     1343                this.data( parts[0] ) :
     1344                data;
     1345        } else
     1346            return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
     1347                jQuery.data( this, key, value );
     1348            });
     1349    },
     1350
     1351    removeData: function( key ){
     1352        return this.each(function(){
     1353            jQuery.removeData( this, key );
     1354        });
     1355    },
     1356    queue: function(type, data){
     1357        if ( typeof type !== "string" ) {
     1358            data = type;
     1359            type = "fx";
     1360        }
     1361
     1362        if ( data === undefined )
     1363            return jQuery.queue( this[0], type );
     1364
     1365        return this.each(function(){
     1366            var queue = jQuery.queue( this, type, data );
     1367           
     1368             if( type == "fx" && queue.length == 1 )
     1369                queue[0].call(this);
     1370        });
     1371    },
     1372    dequeue: function(type){
     1373        return this.each(function(){
     1374            jQuery.dequeue( this, type );
     1375        });
     1376    }
     1377});(function(){
     1378
     1379    jQuery.support = {};
     1380
     1381    var root = document.documentElement,
     1382        script = document.createElement("script"),
     1383        div = document.createElement("div"),
     1384        id = "script" + (new Date).getTime();
     1385
     1386    div.style.display = "none";
     1387    div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param></object>';
     1388
     1389    var all = div.getElementsByTagName("*"),
     1390        a = div.getElementsByTagName("a")[0];
     1391
     1392    // Can't get basic test support
     1393    if ( !all || !all.length || !a ) {
     1394        return;
     1395    }
     1396
     1397    jQuery.support = {
     1398        // IE strips leading whitespace when .innerHTML is used
     1399        leadingWhitespace: div.firstChild.nodeType == 3,
     1400       
     1401        // Make sure that tbody elements aren't automatically inserted
     1402        // IE will insert them into empty tables
     1403        tbody: !div.getElementsByTagName("tbody").length,
     1404       
     1405        // Make sure that you can get all elements in an <object> element
     1406        // IE 7 always returns no results
     1407        objectAll: !!div.getElementsByTagName("object")[0]
     1408            .getElementsByTagName("*").length,
     1409       
     1410        // Make sure that link elements get serialized correctly by innerHTML
     1411        // This requires a wrapper element in IE
     1412        htmlSerialize: !!div.getElementsByTagName("link").length,
     1413       
     1414        // Get the style information from getAttribute
     1415        // (IE uses .cssText insted)
     1416        style: /red/.test( a.getAttribute("style") ),
     1417       
     1418        // Make sure that URLs aren't manipulated
     1419        // (IE normalizes it by default)
     1420        hrefNormalized: a.getAttribute("href") === "/a",
     1421       
     1422        // Make sure that element opacity exists
     1423        // (IE uses filter instead)
     1424        opacity: a.style.opacity === "0.5",
     1425       
     1426        // Verify style float existence
     1427        // (IE uses styleFloat instead of cssFloat)
     1428        cssFloat: !!a.style.cssFloat,
     1429
     1430        // Verify tabindex attribute existence
     1431        // (IE uses tabIndex instead of tabindex)
     1432        tabindex: !a.getAttributeNode('tabindex'),
     1433
     1434        // Will be defined later
     1435        scriptEval: false,
     1436        noCloneEvent: true
     1437    };
     1438   
     1439    script.type = "text/javascript";
     1440    try {
     1441        script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
     1442    } catch(e){}
     1443
     1444    root.insertBefore( script, root.firstChild );
     1445   
     1446    // Make sure that the execution of code works by injecting a script
     1447    // tag with appendChild/createTextNode
     1448    // (IE doesn't support this, fails, and uses .text instead)
     1449    if ( window[ id ] ) {
     1450        jQuery.support.scriptEval = true;
     1451        delete window[ id ];
     1452    }
     1453
     1454    root.removeChild( script );
     1455
     1456    if ( div.attachEvent && div.fireEvent ) {
     1457        div.attachEvent("onclick", function(){
     1458            // Cloning a node shouldn't copy over any
     1459            // bound event handlers (IE does this)
     1460            jQuery.support.noCloneEvent = false;
     1461            div.detachEvent("onclick", arguments.callee);
     1462        });
     1463        div.cloneNode(true).fireEvent("onclick");
     1464    }
     1465
     1466})();
     1467
     1468var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
     1469
     1470jQuery.props = {
     1471    "for": "htmlFor",
     1472    "class": "className",
     1473    "float": styleFloat,
     1474    cssFloat: styleFloat,
     1475    styleFloat: styleFloat,
     1476    readonly: "readOnly",
     1477    maxlength: "maxLength",
     1478    cellspacing: "cellSpacing",
     1479    rowspan: "rowSpan",
     1480    tabindex: jQuery.support.tabindex ? "tabindex" : "tabIndex"
     1481};
    11482/*
    2  * jQuery 1.2.6 - New Wave Javascript
    3  *
    4  * Copyright (c) 2008 John Resig (jquery.com)
    5  * Dual licensed under the MIT (MIT-LICENSE.txt)
    6  * and GPL (GPL-LICENSE.txt) licenses.
    7  *
    8  * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
    9  * $Rev: 5685 $
     1483 * Sizzle CSS Selector Engine - v0.9
     1484 *  Copyright 2009, John Resig (http://ejohn.org/)
     1485 *  released under the MIT License
    101486 */
    11 (function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
    12 return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
    13 return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
    14 selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
    15 return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
    16 this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
    17 return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
    18 jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
    19 script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
    20 for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
    21 for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
    22 jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
    23 ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
    24 while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
    25 while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
    26 for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
    27 jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
    28 xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
    29 jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
    30 for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
    31 s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
    32 e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
     1487(function(){
     1488
     1489var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g;
     1490
     1491var done = 0;
     1492
     1493var Sizzle = function(selector, context, results, seed) {
     1494    var doCache = !results;
     1495    results = results || [];
     1496    context = context || document;
     1497
     1498    if ( context.nodeType !== 1 && context.nodeType !== 9 )
     1499        return [];
     1500   
     1501    if ( !selector || typeof selector !== "string" ) {
     1502        return results;
     1503    }
     1504
     1505    var parts = [], m, set, checkSet, check, mode, extra;
     1506   
     1507    // Reset the position of the chunker regexp (start from head)
     1508    chunker.lastIndex = 0;
     1509   
     1510    while ( (m = chunker.exec(selector)) !== null ) {
     1511        parts.push( m[1] );
     1512       
     1513        if ( m[2] ) {
     1514            extra = RegExp.rightContext;
     1515            break;
     1516        }
     1517    }
     1518
     1519    if ( parts.length > 1 && Expr.match.POS.exec( selector ) ) {
     1520        if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
     1521            var later = "", match;
     1522
     1523            // Position selectors must be done after the filter
     1524            while ( (match = Expr.match.POS.exec( selector )) ) {
     1525                later += match[0];
     1526                selector = selector.replace( Expr.match.POS, "" );
     1527            }
     1528
     1529            set = Sizzle.filter( later, Sizzle( selector, context ) );
     1530        } else {
     1531            set = Expr.relative[ parts[0] ] ?
     1532                [ context ] :
     1533                Sizzle( parts.shift(), context );
     1534
     1535            while ( parts.length ) {
     1536                var tmpSet = [];
     1537
     1538                selector = parts.shift();
     1539                if ( Expr.relative[ selector ] )
     1540                    selector += parts.shift();
     1541
     1542                for ( var i = 0, l = set.length; i < l; i++ ) {
     1543                    Sizzle( selector, set[i], tmpSet );
     1544                }
     1545
     1546                set = tmpSet;
     1547            }
     1548        }
     1549    } else {
     1550        var ret = seed ?
     1551            { expr: parts.pop(), set: makeArray(seed) } :
     1552            Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context );
     1553        set = Sizzle.filter( ret.expr, ret.set );
     1554
     1555        if ( parts.length > 0 ) {
     1556            checkSet = makeArray(set);
     1557        }
     1558
     1559        while ( parts.length ) {
     1560            var cur = parts.pop(), pop = cur;
     1561
     1562            if ( !Expr.relative[ cur ] ) {
     1563                cur = "";
     1564            } else {
     1565                pop = parts.pop();
     1566            }
     1567
     1568            if ( pop == null ) {
     1569                pop = context;
     1570            }
     1571
     1572            Expr.relative[ cur ]( checkSet, pop );
     1573        }
     1574    }
     1575
     1576    if ( !checkSet ) {
     1577        checkSet = set;
     1578    }
     1579
     1580    if ( !checkSet ) {
     1581        throw "Syntax error, unrecognized expression: " + (cur || selector);
     1582    }
     1583
     1584    if ( checkSet instanceof Array ) {
     1585        if ( context.nodeType === 1 ) {
     1586            for ( var i = 0; checkSet[i] != null; i++ ) {
     1587                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
     1588                    results.push( set[i] );
     1589                }
     1590            }
     1591        } else {
     1592            for ( var i = 0; checkSet[i] != null; i++ ) {
     1593                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
     1594                    results.push( set[i] );
     1595                }
     1596            }
     1597        }
     1598    } else {
     1599        makeArray( checkSet, results );
     1600    }
     1601
     1602    if ( extra ) {
     1603        Sizzle( extra, context, results, seed );
     1604    }
     1605
     1606    return results;
     1607};
     1608
     1609Sizzle.matches = function(expr, set){
     1610    return Sizzle(expr, null, null, set);
     1611};
     1612
     1613Sizzle.find = function(expr, context){
     1614    var set, match;
     1615
     1616    if ( !expr ) {
     1617        return [];
     1618    }
     1619
     1620    for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
     1621        var type = Expr.order[i], match;
     1622       
     1623        if ( (match = Expr.match[ type ].exec( expr )) ) {
     1624            var left = RegExp.leftContext;
     1625
     1626            if ( left.substr( left.length - 1 ) !== "\\" ) {
     1627                match[1] = (match[1] || "").replace(/\\/g, "");
     1628                set = Expr.find[ type ]( match, context );
     1629                if ( set != null ) {
     1630                    expr = expr.replace( Expr.match[ type ], "" );
     1631                    break;
     1632                }
     1633            }
     1634        }
     1635    }
     1636
     1637    if ( !set ) {
     1638        set = context.getElementsByTagName("*");
     1639    }
     1640
     1641    return {set: set, expr: expr};
     1642};
     1643
     1644Sizzle.filter = function(expr, set, inplace){
     1645    var old = expr, result = [], curLoop = set, match, anyFound;
     1646
     1647    while ( expr && set.length ) {
     1648        for ( var type in Expr.filter ) {
     1649            if ( (match = Expr.match[ type ].exec( expr )) != null ) {
     1650                var filter = Expr.filter[ type ], goodArray = null, goodPos = 0, found, item;
     1651                anyFound = false;
     1652
     1653                if ( curLoop == result ) {
     1654                    result = [];
     1655                }
     1656
     1657                if ( Expr.preFilter[ type ] ) {
     1658                    match = Expr.preFilter[ type ]( match, curLoop );
     1659
     1660                    if ( match[0] === true ) {
     1661                        goodArray = [];
     1662                        var last = null, elem;
     1663                        for ( var i = 0; (elem = curLoop[i]) !== undefined; i++ ) {
     1664                            if ( elem && last !== elem ) {
     1665                                goodArray.push( elem );
     1666                                last = elem;
     1667                            }
     1668                        }
     1669                    }
     1670                }
     1671
     1672                for ( var i = 0; (item = curLoop[i]) !== undefined; i++ ) {
     1673                    if ( item ) {
     1674                        if ( goodArray && item != goodArray[goodPos] ) {
     1675                            goodPos++;
     1676                        }
     1677
     1678                        found = filter( item, match, goodPos, goodArray );
     1679                        if ( inplace && found != null ) {
     1680                            curLoop[i] = found ? curLoop[i] : false;
     1681                            if ( found ) {
     1682                                anyFound = true;
     1683                            }
     1684                        } else if ( found ) {
     1685                            result.push( item );
     1686                            anyFound = true;
     1687                        }
     1688                    }
     1689                }
     1690
     1691                if ( found !== undefined ) {
     1692                    if ( !inplace ) {
     1693                        curLoop = result;
     1694                    }
     1695
     1696                    expr = expr.replace( Expr.match[ type ], "" );
     1697
     1698                    if ( !anyFound ) {
     1699                        return [];
     1700                    }
     1701
     1702                    break;
     1703                }
     1704            }
     1705        }
     1706
     1707        expr = expr.replace(/\s*,\s*/, "");
     1708
     1709        // Improper expression
     1710        if ( expr == old ) {
     1711            if ( anyFound == null ) {
     1712                throw "Syntax error, unrecognized expression: " + expr;
     1713            } else {
     1714                break;
     1715            }
     1716        }
     1717
     1718        old = expr;
     1719    }
     1720
     1721    return curLoop;
     1722};
     1723
     1724var Expr = Sizzle.selectors = {
     1725    order: [ "ID", "NAME", "TAG" ],
     1726    match: {
     1727        ID: /#((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
     1728        CLASS: /\.((?:[\w\u0128-\uFFFF_-]|\\.)+)/,
     1729        NAME: /\[name=['"]*((?:[\w\u0128-\uFFFF_-]|\\.)+)['"]*\]/,
     1730        ATTR: /\[((?:[\w\u0128-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\]/,
     1731        TAG: /^((?:[\w\u0128-\uFFFF\*_-]|\\.)+)/,
     1732        CHILD: /:(only|nth|last|first)-child\(?(even|odd|[\dn+-]*)\)?/,
     1733        POS: /:(nth|eq|gt|lt|first|last|even|odd)\(?(\d*)\)?(?:[^-]|$)/,
     1734        PSEUDO: /:((?:[\w\u0128-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
     1735    },
     1736    attrMap: {
     1737        "class": "className"
     1738    },
     1739    relative: {
     1740        "+": function(checkSet, part){
     1741            for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     1742                var elem = checkSet[i];
     1743                if ( elem ) {
     1744                    var cur = elem.previousSibling;
     1745                    while ( cur && cur.nodeType !== 1 ) {
     1746                        cur = cur.previousSibling;
     1747                    }
     1748                    checkSet[i] = typeof part === "string" ?
     1749                        cur || false :
     1750                        cur === part;
     1751                }
     1752            }
     1753
     1754            if ( typeof part === "string" ) {
     1755                Sizzle.filter( part, checkSet, true );
     1756            }
     1757        },
     1758        ">": function(checkSet, part){
     1759            if ( typeof part === "string" && !/\W/.test(part) ) {
     1760                part = part.toUpperCase();
     1761
     1762                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     1763                    var elem = checkSet[i];
     1764                    if ( elem ) {
     1765                        var parent = elem.parentNode;
     1766                        checkSet[i] = parent.nodeName === part ? parent : false;
     1767                    }
     1768                }
     1769            } else {
     1770                for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     1771                    var elem = checkSet[i];
     1772                    if ( elem ) {
     1773                        checkSet[i] = typeof part === "string" ?
     1774                            elem.parentNode :
     1775                            elem.parentNode === part;
     1776                    }
     1777                }
     1778
     1779                if ( typeof part === "string" ) {
     1780                    Sizzle.filter( part, checkSet, true );
     1781                }
     1782            }
     1783        },
     1784        "": function(checkSet, part){
     1785            var doneName = "done" + (done++), checkFn = dirCheck;
     1786
     1787            if ( !part.match(/\W/) ) {
     1788                var nodeCheck = part = part.toUpperCase();
     1789                checkFn = dirNodeCheck;
     1790            }
     1791
     1792            checkFn("parentNode", part, doneName, checkSet, nodeCheck);
     1793        },
     1794        "~": function(checkSet, part){
     1795            var doneName = "done" + (done++), checkFn = dirCheck;
     1796
     1797            if ( typeof part === "string" && !part.match(/\W/) ) {
     1798                var nodeCheck = part = part.toUpperCase();
     1799                checkFn = dirNodeCheck;
     1800            }
     1801
     1802            checkFn("previousSibling", part, doneName, checkSet, nodeCheck);
     1803        }
     1804    },
     1805    find: {
     1806        ID: function(match, context){
     1807            if ( context.getElementById ) {
     1808                var m = context.getElementById(match[1]);
     1809                return m ? [m] : [];
     1810            }
     1811        },
     1812        NAME: function(match, context){
     1813            return context.getElementsByName ? context.getElementsByName(match[1]) : null;
     1814        },
     1815        TAG: function(match, context){
     1816            return context.getElementsByTagName(match[1]);
     1817        }
     1818    },
     1819    preFilter: {
     1820        CLASS: function(match){
     1821            return new RegExp( "(?:^|\\s)" + match[1] + "(?:\\s|$)" );
     1822        },
     1823        ID: function(match){
     1824            return match[1];
     1825        },
     1826        TAG: function(match){
     1827            return match[1].toUpperCase();
     1828        },
     1829        CHILD: function(match){
     1830            if ( match[1] == "nth" ) {
     1831                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
     1832                var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
     1833                    match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
     1834                    !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
     1835
     1836                // calculate the numbers (first)n+(last) including if they are negative
     1837                match[2] = (test[1] + (test[2] || 1)) - 0;
     1838                match[3] = test[3] - 0;
     1839            }
     1840
     1841            // TODO: Move to normal caching system
     1842            match[0] = "done" + (done++);
     1843
     1844            return match;
     1845        },
     1846        ATTR: function(match){
     1847            var name = match[1];
     1848           
     1849            if ( Expr.attrMap[name] ) {
     1850                match[1] = Expr.attrMap[name];
     1851            }
     1852
     1853            if ( match[2] === "~=" ) {
     1854                match[4] = " " + match[4] + " ";
     1855            }
     1856
     1857            return match;
     1858        },
     1859        PSEUDO: function(match, curLoop){
     1860            if ( match[1] === "not" ) {
     1861                // If we're dealing with a complex expression, or a simple one
     1862                match[3] = match[3].match(chunker).length > 1 ?
     1863                    Sizzle(match[3], null, null, curLoop) :
     1864                    Sizzle.filter(match[3], curLoop);
     1865            }
     1866           
     1867            return match;
     1868        },
     1869        POS: function(match){
     1870            match.unshift( true );
     1871            return match;
     1872        }
     1873    },
     1874    filters: {
     1875        enabled: function(elem){
     1876            return elem.disabled === false && elem.type !== "hidden";
     1877        },
     1878        disabled: function(elem){
     1879            return elem.disabled === true;
     1880        },
     1881        checked: function(elem){
     1882            return elem.checked === true;
     1883        },
     1884        selected: function(elem){
     1885            // Accessing this property makes selected-by-default
     1886            // options in Safari work properly
     1887            elem.parentNode.selectedIndex;
     1888            return elem.selected === true;
     1889        },
     1890        parent: function(elem){
     1891            return !!elem.firstChild;
     1892        },
     1893        empty: function(elem){
     1894            return !elem.firstChild;
     1895        },
     1896        has: function(elem, i, match){
     1897            return !!Sizzle( match[3], elem ).length;
     1898        },
     1899        header: function(elem){
     1900            return /h\d/i.test( elem.nodeName );
     1901        },
     1902        text: function(elem){
     1903            return "text" === elem.type;
     1904        },
     1905        radio: function(elem){
     1906            return "radio" === elem.type;
     1907        },
     1908        checkbox: function(elem){
     1909            return "checkbox" === elem.type;
     1910        },
     1911        file: function(elem){
     1912            return "file" === elem.type;
     1913        },
     1914        password: function(elem){
     1915            return "password" === elem.type;
     1916        },
     1917        submit: function(elem){
     1918            return "submit" === elem.type;
     1919        },
     1920        image: function(elem){
     1921            return "image" === elem.type;
     1922        },
     1923        reset: function(elem){
     1924            return "reset" === elem.type;
     1925        },
     1926        button: function(elem){
     1927            return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
     1928        },
     1929        input: function(elem){
     1930            return /input|select|textarea|button/i.test(elem.nodeName);
     1931        }
     1932    },
     1933    setFilters: {
     1934        first: function(elem, i){
     1935            return i === 0;
     1936        },
     1937        last: function(elem, i, match, array){
     1938            return i === array.length - 1;
     1939        },
     1940        even: function(elem, i){
     1941            return i % 2 === 0;
     1942        },
     1943        odd: function(elem, i){
     1944            return i % 2 === 1;
     1945        },
     1946        lt: function(elem, i, match){
     1947            return i < match[3] - 0;
     1948        },
     1949        gt: function(elem, i, match){
     1950            return i > match[3] - 0;
     1951        },
     1952        nth: function(elem, i, match){
     1953            return match[3] - 0 == i;
     1954        },
     1955        eq: function(elem, i, match){
     1956            return match[3] - 0 == i;
     1957        }
     1958    },
     1959    filter: {
     1960        CHILD: function(elem, match){
     1961            var type = match[1], parent = elem.parentNode;
     1962
     1963            var doneName = match[0];
     1964           
     1965            if ( parent && !parent[ doneName ] ) {
     1966                var count = 1;
     1967
     1968                for ( var node = parent.firstChild; node; node = node.nextSibling ) {
     1969                    if ( node.nodeType == 1 ) {
     1970                        node.nodeIndex = count++;
     1971                    }
     1972                }
     1973
     1974                parent[ doneName ] = count - 1;
     1975            }
     1976
     1977            if ( type == "first" ) {
     1978                return elem.nodeIndex == 1;
     1979            } else if ( type == "last" ) {
     1980                return elem.nodeIndex == parent[ doneName ];
     1981            } else if ( type == "only" ) {
     1982                return parent[ doneName ] == 1;
     1983            } else if ( type == "nth" ) {
     1984                var add = false, first = match[2], last = match[3];
     1985
     1986                if ( first == 1 && last == 0 ) {
     1987                    return true;
     1988                }
     1989
     1990                if ( first == 0 ) {
     1991                    if ( elem.nodeIndex == last ) {
     1992                        add = true;
     1993                    }
     1994                } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {
     1995                    add = true;
     1996                }
     1997
     1998                return add;
     1999            }
     2000        },
     2001        PSEUDO: function(elem, match, i, array){
     2002            var name = match[1], filter = Expr.filters[ name ];
     2003
     2004            if ( filter ) {
     2005                return filter( elem, i, match, array );
     2006            } else if ( name === "contains" ) {
     2007                return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
     2008            } else if ( name === "not" ) {
     2009                var not = match[3];
     2010
     2011                for ( var i = 0, l = not.length; i < l; i++ ) {
     2012                    if ( not[i] === elem ) {
     2013                        return false;
     2014                    }
     2015                }
     2016
     2017                return true;
     2018            }
     2019        },
     2020        ID: function(elem, match){
     2021            return elem.nodeType === 1 && elem.getAttribute("id") === match;
     2022        },
     2023        TAG: function(elem, match){
     2024            return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
     2025        },
     2026        CLASS: function(elem, match){
     2027            return match.test( elem.className );
     2028        },
     2029        ATTR: function(elem, match){
     2030            var result = elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];
     2031            return result == null ?
     2032                false :
     2033                type === "=" ?
     2034                value === check :
     2035                type === "*=" ?
     2036                value.indexOf(check) >= 0 :
     2037                type === "~=" ?
     2038                (" " + value + " ").indexOf(check) >= 0 :
     2039                !match[4] ?
     2040                result :
     2041                type === "!=" ?
     2042                value != check :
     2043                type === "^=" ?
     2044                value.indexOf(check) === 0 :
     2045                type === "$=" ?
     2046                value.substr(value.length - check.length) === check :
     2047                type === "|=" ?
     2048                value === check || value.substr(0, check.length + 1) === check + "-" :
     2049                false;
     2050        },
     2051        POS: function(elem, match, i, array){
     2052            var name = match[2], filter = Expr.setFilters[ name ];
     2053
     2054            if ( filter ) {
     2055                return filter( elem, i, match, array );
     2056            }
     2057        }
     2058    }
     2059};
     2060
     2061for ( var type in Expr.match ) {
     2062    Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
     2063}
     2064
     2065var makeArray = function(array, results) {
     2066    array = Array.prototype.slice.call( array );
     2067
     2068    if ( results ) {
     2069        results.push.apply( results, array );
     2070        return results;
     2071    }
     2072   
     2073    return array;
     2074};
     2075
     2076// Perform a simple check to determine if the browser is capable of
     2077// converting a NodeList to an array using builtin methods.
     2078try {
     2079    Array.prototype.slice.call( document.documentElement.childNodes );
     2080
     2081// Provide a fallback method if it does not work
     2082} catch(e){
     2083    makeArray = function(array, results) {
     2084        var ret = results || [];
     2085
     2086        if ( array instanceof Array ) {
     2087            Array.prototype.push.apply( ret, array );
     2088        } else {
     2089            if ( typeof array.length === "number" ) {
     2090                for ( var i = 0, l = array.length; i < l; i++ ) {
     2091                    ret.push( array[i] );
     2092                }
     2093            } else {
     2094                for ( var i = 0; array[i]; i++ ) {
     2095                    ret.push( array[i] );
     2096                }
     2097            }
     2098        }
     2099
     2100        return ret;
     2101    };
     2102}
     2103
     2104// Check to see if the browser returns elements by name when
     2105// querying by getElementById (and provide a workaround)
     2106(function(){
     2107    // We're going to inject a fake input element with a specified name
     2108    var form = document.createElement("form"),
     2109        id = "script" + (new Date).getTime();
     2110    form.innerHTML = "<input name='" + id + "'/>";
     2111
     2112    // Inject it into the root element, check its status, and remove it quickly
     2113    var root = document.documentElement;
     2114    root.insertBefore( form, root.firstChild );
     2115
     2116    // The workaround has to do additional checks after a getElementById
     2117    // Which slows things down for other browsers (hence the branching)
     2118    if ( !!document.getElementById( id ) ) {
     2119        Expr.find.ID = function(match, context){
     2120            if ( context.getElementById ) {
     2121                var m = context.getElementById(match[1]);
     2122                return m ? m.id === match[1] || m.getAttributeNode && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
     2123            }
     2124        };
     2125
     2126        Expr.filter.ID = function(elem, match){
     2127            var node = elem.getAttributeNode && elem.getAttributeNode("id");
     2128            return elem.nodeType === 1 && node && node.nodeValue === match;
     2129        };
     2130    }
     2131
     2132    root.removeChild( form );
     2133})();
     2134
     2135// Check to see if the browser returns only elements
     2136// when doing getElementsByTagName("*")
     2137(function(){
     2138    // Create a fake element
     2139    var div = document.createElement("div");
     2140    div.appendChild( document.createComment("") );
     2141
     2142    // Make sure no comments are found
     2143    if ( div.getElementsByTagName("*").length > 0 ) {
     2144        Expr.find.TAG = function(match, context){
     2145            var results = context.getElementsByTagName(match[1]);
     2146
     2147            // Filter out possible comments
     2148            if ( match[1] === "*" ) {
     2149                var tmp = [];
     2150
     2151                for ( var i = 0; results[i]; i++ ) {
     2152                    if ( results[i].nodeType === 1 ) {
     2153                        tmp.push( results[i] );
     2154                    }
     2155                }
     2156
     2157                results = tmp;
     2158            }
     2159
     2160            return results;
     2161        };
     2162    }
     2163})();
     2164
     2165if ( document.querySelectorAll ) (function(){
     2166    var oldSizzle = Sizzle;
     2167   
     2168    Sizzle = function(query, context, extra, seed){
     2169        context = context || document;
     2170
     2171        if ( !seed && context.nodeType === 9 ) {
     2172            try {
     2173                return makeArray( context.querySelectorAll(query) );
     2174            } catch(e){}
     2175        }
     2176       
     2177        return oldSizzle(query, context, extra, seed);
     2178    };
     2179
     2180    Sizzle.find = oldSizzle.find;
     2181    Sizzle.filter = oldSizzle.filter;
     2182    Sizzle.selectors = oldSizzle.selectors;
     2183    Sizzle.matches = oldSizzle.matches;
     2184})();
     2185
     2186if ( document.documentElement.getElementsByClassName ) {
     2187    Expr.order.splice(1, 0, "CLASS");
     2188    Expr.find.CLASS = function(match, context) {
     2189        return context.getElementsByClassName(match[1]);
     2190    };
     2191}
     2192
     2193function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck ) {
     2194    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     2195        var elem = checkSet[i];
     2196        if ( elem ) {
     2197            elem = elem[dir];
     2198            var match = false;
     2199
     2200            while ( elem && elem.nodeType ) {
     2201                var done = elem[doneName];
     2202                if ( done ) {
     2203                    match = checkSet[ done ];
     2204                    break;
     2205                }
     2206
     2207                if ( elem.nodeType === 1 )
     2208                    elem[doneName] = i;
     2209
     2210                if ( elem.nodeName === cur ) {
     2211                    match = elem;
     2212                    break;
     2213                }
     2214
     2215                elem = elem[dir];
     2216            }
     2217
     2218            checkSet[i] = match;
     2219        }
     2220    }
     2221}
     2222
     2223function dirCheck( dir, cur, doneName, checkSet, nodeCheck ) {
     2224    for ( var i = 0, l = checkSet.length; i < l; i++ ) {
     2225        var elem = checkSet[i];
     2226        if ( elem ) {
     2227            elem = elem[dir];
     2228            var match = false;
     2229
     2230            while ( elem && elem.nodeType ) {
     2231                if ( elem[doneName] ) {
     2232                    match = checkSet[ elem[doneName] ];
     2233                    break;
     2234                }
     2235
     2236                if ( elem.nodeType === 1 ) {
     2237                    elem[doneName] = i;
     2238
     2239                    if ( typeof cur !== "string" ) {
     2240                        if ( elem === cur ) {
     2241                            match = true;
     2242                            break;
     2243                        }
     2244
     2245                    } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
     2246                        match = elem;
     2247                        break;
     2248                    }
     2249                }
     2250
     2251                elem = elem[dir];
     2252            }
     2253
     2254            checkSet[i] = match;
     2255        }
     2256    }
     2257}
     2258
     2259var contains = document.compareDocumentPosition ?  function(a, b){
     2260    return a.compareDocumentPosition(b) & 16;
     2261} : function(a, b){
     2262    return a !== b && (a.contains ? a.contains(b) : true);
     2263};
     2264
     2265// EXPOSE
     2266jQuery.find = Sizzle;
     2267jQuery.filter = Sizzle.filter;
     2268jQuery.expr = Sizzle.selectors;
     2269jQuery.expr[":"] = jQuery.expr.filters;
     2270
     2271Sizzle.selectors.filters.hidden = function(elem){
     2272    return "hidden" === elem.type ||
     2273        jQuery.css(elem, "display") === "none" ||
     2274        jQuery.css(elem, "visibility") === "hidden";
     2275};
     2276
     2277Sizzle.selectors.filters.visible = function(elem){
     2278    return "hidden" !== elem.type &&
     2279        jQuery.css(elem, "display") !== "none" &&
     2280        jQuery.css(elem, "visibility") !== "hidden";
     2281};
     2282
     2283Sizzle.selectors.filters.animated = function(elem){
     2284    return jQuery.grep(jQuery.timers, function(fn){
     2285        return elem === fn.elem;
     2286    }).length;
     2287};
     2288
     2289jQuery.multiFilter = function( expr, elems, not ) {
     2290    if ( not ) {
     2291        expr = ":not(" + expr + ")";
     2292    }
     2293
     2294    return Sizzle.matches(expr, elems);
     2295};
     2296
     2297jQuery.dir = function( elem, dir ){
     2298    var matched = [], cur = elem[dir];
     2299    while ( cur && cur != document ) {
     2300        if ( cur.nodeType == 1 )
     2301            matched.push( cur );
     2302        cur = cur[dir];
     2303    }
     2304    return matched;
     2305};
     2306
     2307jQuery.nth = function(cur, result, dir, elem){
     2308    result = result || 1;
     2309    var num = 0;
     2310
     2311    for ( ; cur; cur = cur[dir] )
     2312        if ( cur.nodeType == 1 && ++num == result )
     2313            break;
     2314
     2315    return cur;
     2316};
     2317
     2318jQuery.sibling = function(n, elem){
     2319    var r = [];
     2320
     2321    for ( ; n; n = n.nextSibling ) {
     2322        if ( n.nodeType == 1 && n != elem )
     2323            r.push( n );
     2324    }
     2325
     2326    return r;
     2327};
     2328
     2329return;
     2330
     2331window.Sizzle = Sizzle;
     2332
     2333})();
     2334/*
     2335 * A number of helper functions used for managing events.
     2336 * Many of the ideas behind this code originated from
     2337 * Dean Edwards' addEvent library.
     2338 */
     2339jQuery.event = {
     2340
     2341    // Bind an event to an element
     2342    // Original by Dean Edwards
     2343    add: function(elem, types, handler, data) {
     2344        if ( elem.nodeType == 3 || elem.nodeType == 8 )
     2345            return;
     2346
     2347        // For whatever reason, IE has trouble passing the window object
     2348        // around, causing it to be cloned in the process
     2349        if ( elem.setInterval && elem != window )
     2350            elem = window;
     2351
     2352        // Make sure that the function being executed has a unique ID
     2353        if ( !handler.guid )
     2354            handler.guid = this.guid++;
     2355
     2356        // if data is passed, bind to handler
     2357        if ( data !== undefined ) {
     2358            // Create temporary function pointer to original handler
     2359            var fn = handler;
     2360
     2361            // Create unique handler function, wrapped around original handler
     2362            handler = this.proxy( fn, function() {
     2363                // Pass arguments and context to original handler
     2364                return fn.apply(this, arguments);
     2365            });
     2366
     2367            // Store data in unique handler
     2368            handler.data = data;
     2369        }
     2370
     2371        // Init the element's event structure
     2372        var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
     2373            handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
     2374                // Handle the second event of a trigger and when
     2375                // an event is called after a page has unloaded
     2376                return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
     2377                    jQuery.event.handle.apply(arguments.callee.elem, arguments) :
     2378                    undefined;
     2379            });
     2380        // Add elem as a property of the handle function
     2381        // This is to prevent a memory leak with non-native
     2382        // event in IE.
     2383        handle.elem = elem;
     2384
     2385        // Handle multiple events separated by a space
     2386        // jQuery(...).bind("mouseover mouseout", fn);
     2387        jQuery.each(types.split(/\s+/), function(index, type) {
     2388            // Namespaced event handlers
     2389            var namespaces = type.split(".");
     2390            type = namespaces.shift();
     2391            handler.type = namespaces.slice().sort().join(".");
     2392
     2393            // Get the current list of functions bound to this event
     2394            var handlers = events[type];
     2395           
     2396            if ( jQuery.event.specialAll[type] )
     2397                jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
     2398
     2399            // Init the event handler queue
     2400            if (!handlers) {
     2401                handlers = events[type] = {};
     2402
     2403                // Check for a special event handler
     2404                // Only use addEventListener/attachEvent if the special
     2405                // events handler returns false
     2406                if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
     2407                    // Bind the global event handler to the element
     2408                    if (elem.addEventListener)
     2409                        elem.addEventListener(type, handle, false);
     2410                    else if (elem.attachEvent)
     2411                        elem.attachEvent("on" + type, handle);
     2412                }
     2413            }
     2414
     2415            // Add the function to the element's handler list
     2416            handlers[handler.guid] = handler;
     2417
     2418            // Keep track of which events have been used, for global triggering
     2419            jQuery.event.global[type] = true;
     2420        });
     2421
     2422        // Nullify elem to prevent memory leaks in IE
     2423        elem = null;
     2424    },
     2425
     2426    guid: 1,
     2427    global: {},
     2428
     2429    // Detach an event or set of events from an element
     2430    remove: function(elem, types, handler) {
     2431        // don't do events on text and comment nodes
     2432        if ( elem.nodeType == 3 || elem.nodeType == 8 )
     2433            return;
     2434
     2435        var events = jQuery.data(elem, "events"), ret, index;
     2436
     2437        if ( events ) {
     2438            // Unbind all events for the element
     2439            if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
     2440                for ( var type in events )
     2441                    this.remove( elem, type + (types || "") );
     2442            else {
     2443                // types is actually an event object here
     2444                if ( types.type ) {
     2445                    handler = types.handler;
     2446                    types = types.type;
     2447                }
     2448
     2449                // Handle multiple events seperated by a space
     2450                // jQuery(...).unbind("mouseover mouseout", fn);
     2451                jQuery.each(types.split(/\s+/), function(index, type){
     2452                    // Namespaced event handlers
     2453                    var namespaces = type.split(".");
     2454                    type = namespaces.shift();
     2455                    var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
     2456
     2457                    if ( events[type] ) {
     2458                        // remove the given handler for the given type
     2459                        if ( handler )
     2460                            delete events[type][handler.guid];
     2461
     2462                        // remove all handlers for the given type
     2463                        else
     2464                            for ( handler in events[type] )
     2465                                // Handle the removal of namespaced events
     2466                                if ( namespace.test(events[type][handler].type) )
     2467
     2468                                    delete events[type][handler];
     2469                                   
     2470                        if ( jQuery.event.specialAll[type] )
     2471                            jQuery.event.specialAll[type].teardown.call(elem, namespaces);
     2472
     2473                        // remove generic event handler if no more handlers exist
     2474                        for ( ret in events[type] ) break;
     2475                        if ( !ret ) {
     2476                            if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
     2477                                if (elem.removeEventListener)
     2478                                    elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
     2479                                else if (elem.detachEvent)
     2480                                    elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
     2481                            }
     2482                            ret = null;
     2483                            delete events[type];
     2484                        }
     2485                    }
     2486                });
     2487            }
     2488
     2489            // Remove the expando if it's no longer used
     2490            for ( ret in events ) break;
     2491            if ( !ret ) {
     2492                var handle = jQuery.data( elem, "handle" );
     2493                if ( handle ) handle.elem = null;
     2494                jQuery.removeData( elem, "events" );
     2495                jQuery.removeData( elem, "handle" );
     2496            }
     2497        }
     2498    },
     2499
     2500    // bubbling is internal
     2501    trigger: function( event, data, elem, bubbling ) {
     2502        // Event object or event type
     2503        var type = event.type || event;
     2504
     2505        if( !bubbling ){
     2506            event = typeof event === "object" ?
     2507                // jQuery.Event object
     2508                event[expando] ? event :
     2509                // Object literal
     2510                jQuery.extend( jQuery.Event(type), event ) :
     2511                // Just the event type (string)
     2512                jQuery.Event(type);
     2513
     2514            if ( type.indexOf("!") >= 0 ) {
     2515                event.type = type = type.slice(0, -1);
     2516                event.exclusive = true;
     2517            }
     2518
     2519            // Handle a global trigger
     2520            if ( !elem ) {
     2521                // Don't bubble custom events when global (to avoid too much overhead)
     2522                event.stopPropagation();
     2523                // Only trigger if we've ever bound an event for it
     2524                if ( this.global[type] )
     2525                    jQuery.each( jQuery.cache, function(){
     2526                        if ( this.events && this.events[type] )
     2527                            jQuery.event.trigger( event, data, this.handle.elem );
     2528                    });
     2529            }
     2530
     2531            // Handle triggering a single element
     2532
     2533            // don't do events on text and comment nodes
     2534            if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
     2535                return undefined;
     2536           
     2537            // Clean up in case it is reused
     2538            event.result = undefined;
     2539            event.target = elem;
     2540           
     2541            // Clone the incoming data, if any
     2542            data = jQuery.makeArray(data);
     2543            data.unshift( event );
     2544        }
     2545
     2546        event.currentTarget = elem;
     2547
     2548        // Trigger the event, it is assumed that "handle" is a function
     2549        var handle = jQuery.data(elem, "handle");
     2550        if ( handle )
     2551            handle.apply( elem, data );
     2552
     2553        // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
     2554        if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
     2555            event.result = false;
     2556
     2557        // Trigger the native events (except for clicks on links)
     2558        if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
     2559            this.triggered = true;
     2560            try {
     2561                elem[ type ]();
     2562            // prevent IE from throwing an error for some hidden elements
     2563            } catch (e) {}
     2564        }
     2565
     2566        this.triggered = false;
     2567
     2568        if ( !event.isPropagationStopped() ) {
     2569            var parent = elem.parentNode || elem.ownerDocument;
     2570            if ( parent )
     2571                jQuery.event.trigger(event, data, parent, true);
     2572        }
     2573    },
     2574
     2575    handle: function(event) {
     2576        // returned undefined or false
     2577        var all, handlers;
     2578
     2579        event = arguments[0] = jQuery.event.fix( event || window.event );
     2580
     2581        // Namespaced event handlers
     2582        var namespaces = event.type.split(".");
     2583        event.type = namespaces.shift();
     2584
     2585        // Cache this now, all = true means, any handler
     2586        all = !namespaces.length && !event.exclusive;
     2587       
     2588        var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
     2589
     2590        handlers = ( jQuery.data(this, "events") || {} )[event.type];
     2591
     2592        for ( var j in handlers ) {
     2593            var handler = handlers[j];
     2594
     2595            // Filter the functions by class
     2596            if ( all || namespace.test(handler.type) ) {
     2597                // Pass in a reference to the handler function itself
     2598                // So that we can later remove it
     2599                event.handler = handler;
     2600                event.data = handler.data;
     2601
     2602                var ret = handler.apply(this, arguments);
     2603
     2604                if( ret !== undefined ){
     2605                    event.result = ret;
     2606                    if ( ret === false ) {
     2607                        event.preventDefault();
     2608                        event.stopPropagation();
     2609                    }
     2610                }
     2611
     2612                if( event.isImmediatePropagationStopped() )
     2613                    break;
     2614
     2615            }
     2616        }
     2617    },
     2618
     2619    props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
     2620
     2621    fix: function(event) {
     2622        if ( event[expando] )
     2623            return event;
     2624
     2625        // store a copy of the original event object
     2626        // and "clone" to set read-only properties
     2627        var originalEvent = event;
     2628        event = jQuery.Event( originalEvent );
     2629
     2630        for ( var i = this.props.length, prop; i; ){
     2631            prop = this.props[ --i ];
     2632            event[ prop ] = originalEvent[ prop ];
     2633        }
     2634
     2635        // Fix target property, if necessary
     2636        if ( !event.target )
     2637            event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
     2638
     2639        // check if target is a textnode (safari)
     2640        if ( event.target.nodeType == 3 )
     2641            event.target = event.target.parentNode;
     2642
     2643        // Add relatedTarget, if necessary
     2644        if ( !event.relatedTarget && event.fromElement )
     2645            event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
     2646
     2647        // Calculate pageX/Y if missing and clientX/Y available
     2648        if ( event.pageX == null && event.clientX != null ) {
     2649            var doc = document.documentElement, body = document.body;
     2650            event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
     2651            event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
     2652        }
     2653
     2654        // Add which for key events
     2655        if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
     2656            event.which = event.charCode || event.keyCode;
     2657
     2658        // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
     2659        if ( !event.metaKey && event.ctrlKey )
     2660            event.metaKey = event.ctrlKey;
     2661
     2662        // Add which for click: 1 == left; 2 == middle; 3 == right
     2663        // Note: button is not normalized, so don't use it
     2664        if ( !event.which && event.button )
     2665            event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
     2666
     2667        return event;
     2668    },
     2669
     2670    proxy: function( fn, proxy ){
     2671        // Set the guid of unique handler to the same of original handler, so it can be removed
     2672        proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
     2673        // So proxy can be declared as an argument
     2674        return proxy;
     2675    },
     2676
     2677    special: {
     2678        ready: {
     2679            // Make sure the ready event is setup
     2680            setup: bindReady,
     2681            teardown: function() {}
     2682        }
     2683    },
     2684   
     2685    specialAll: {
     2686        live: {
     2687            setup: function( selector, namespaces ){
     2688                jQuery.event.add( this, namespaces[0], liveHandler );
     2689            },
     2690            teardown:  function( namespaces ){
     2691                if ( namespaces.length ) {
     2692                    var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
     2693                   
     2694                    jQuery.each( (jQuery.data(this, "events").live || {}), function(){
     2695                        if ( name.test(this.type) )
     2696                            remove++;
     2697                    });
     2698                   
     2699                    if ( remove <= 1 )
     2700                        jQuery.event.remove( this, namespaces[0], liveHandler );
     2701                }
     2702            }
     2703        }
     2704    }
     2705};
     2706
     2707jQuery.Event = function( src ){
     2708    // Allow instantiation without the 'new' keyword
     2709    if( !this.preventDefault )
     2710        return new jQuery.Event(src);
     2711   
     2712    // Event object
     2713    if( src && src.type ){
     2714        this.originalEvent = src;
     2715        this.type = src.type;
     2716        this.timeStamp = src.timeStamp;
     2717    // Event type
     2718    }else
     2719        this.type = src;
     2720
     2721    if( !this.timeStamp )
     2722        this.timeStamp = now();
     2723   
     2724    // Mark it as fixed
     2725    this[expando] = true;
     2726};
     2727
     2728function returnFalse(){
     2729    return false;
     2730}
     2731function returnTrue(){
     2732    return true;
     2733}
     2734
     2735// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
     2736// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
     2737jQuery.Event.prototype = {
     2738    preventDefault: function() {
     2739        this.isDefaultPrevented = returnTrue;
     2740
     2741        var e = this.originalEvent;
     2742        if( !e )
     2743            return;
     2744        // if preventDefault exists run it on the original event
     2745        if (e.preventDefault)
     2746            e.preventDefault();
     2747        // otherwise set the returnValue property of the original event to false (IE)
     2748        e.returnValue = false;
     2749    },
     2750    stopPropagation: function() {
     2751        this.isPropagationStopped = returnTrue;
     2752
     2753        var e = this.originalEvent;
     2754        if( !e )
     2755            return;
     2756        // if stopPropagation exists run it on the original event
     2757        if (e.stopPropagation)
     2758            e.stopPropagation();
     2759        // otherwise set the cancelBubble property of the original event to true (IE)
     2760        e.cancelBubble = true;
     2761    },
     2762    stopImmediatePropagation:function(){
     2763        this.isImmediatePropagationStopped = returnTrue;
     2764        this.stopPropagation();
     2765    },
     2766    isDefaultPrevented: returnFalse,
     2767    isPropagationStopped: returnFalse,
     2768    isImmediatePropagationStopped: returnFalse
     2769};
     2770// Checks if an event happened on an element within another element
     2771// Used in jQuery.event.special.mouseenter and mouseleave handlers
     2772var withinElement = function(event) {
     2773    // Check if mouse(over|out) are still within the same parent element
     2774    var parent = event.relatedTarget;
     2775    // Traverse up the tree
     2776    while ( parent && parent != this )
     2777        try { parent = parent.parentNode; }
     2778        catch(e) { parent = this; }
     2779   
     2780    if( parent != this ){
     2781        // set the correct event type
     2782        event.type = event.data;
     2783        // handle event if we actually just moused on to a non sub-element
     2784        jQuery.event.handle.apply( this, arguments );
     2785    }
     2786};
     2787   
     2788jQuery.each({
     2789    mouseover: 'mouseenter',
     2790    mouseout: 'mouseleave'
     2791}, function( orig, fix ){
     2792    jQuery.event.special[ fix ] = {
     2793        setup: function(){
     2794            jQuery.event.add( this, orig, withinElement, fix );
     2795        },
     2796        teardown: function(){
     2797            jQuery.event.remove( this, orig, withinElement );
     2798        }
     2799    };             
     2800});
     2801
     2802jQuery.fn.extend({
     2803    bind: function( type, data, fn ) {
     2804        return type == "unload" ? this.one(type, data, fn) : this.each(function(){
     2805            jQuery.event.add( this, type, fn || data, fn && data );
     2806        });
     2807    },
     2808
     2809    one: function( type, data, fn ) {
     2810        var one = jQuery.event.proxy( fn || data, function(event) {
     2811            jQuery(this).unbind(event, one);
     2812            return (fn || data).apply( this, arguments );
     2813        });
     2814        return this.each(function(){
     2815            jQuery.event.add( this, type, one, fn && data);
     2816        });
     2817    },
     2818
     2819    unbind: function( type, fn ) {
     2820        return this.each(function(){
     2821            jQuery.event.remove( this, type, fn );
     2822        });
     2823    },
     2824
     2825    trigger: function( type, data ) {
     2826        return this.each(function(){
     2827            jQuery.event.trigger( type, data, this );
     2828        });
     2829    },
     2830
     2831    triggerHandler: function( type, data ) {
     2832        if( this[0] ){
     2833            var event = jQuery.Event(type);
     2834            event.preventDefault();
     2835            event.stopPropagation();
     2836            jQuery.event.trigger( event, data, this[0] );
     2837            return event.result;
     2838        }       
     2839    },
     2840
     2841    toggle: function( fn ) {
     2842        // Save reference to arguments for access in closure
     2843        var args = arguments, i = 1;
     2844
     2845        // link all the functions, so any of them can unbind this click handler
     2846        while( i < args.length )
     2847            jQuery.event.proxy( fn, args[i++] );
     2848
     2849        return this.click( jQuery.event.proxy( fn, function(event) {
     2850            // Figure out which function to execute
     2851            this.lastToggle = ( this.lastToggle || 0 ) % i;
     2852
     2853            // Make sure that clicks stop
     2854            event.preventDefault();
     2855
     2856            // and execute the function
     2857            return args[ this.lastToggle++ ].apply( this, arguments ) || false;
     2858        }));
     2859    },
     2860
     2861    hover: function(fnOver, fnOut) {
     2862        return this.mouseenter(fnOver).mouseleave(fnOut);
     2863    },
     2864
     2865    ready: function(fn) {
     2866        // Attach the listeners
     2867        bindReady();
     2868
     2869        // If the DOM is already ready
     2870        if ( jQuery.isReady )
     2871            // Execute the function immediately
     2872            fn.call( document, jQuery );
     2873
     2874        // Otherwise, remember the function for later
     2875        else
     2876            // Add the function to the wait list
     2877            jQuery.readyList.push( fn );
     2878
     2879        return this;
     2880    },
     2881   
     2882    live: function( type, fn ){
     2883        jQuery(document).bind( liveConvert(type, this.selector), this.selector, fn );
     2884        return this;
     2885    },
     2886   
     2887    die: function( type, fn ){
     2888        jQuery(document).unbind( liveConvert(type, this.selector), fn );
     2889        return this;
     2890    }
     2891});
     2892
     2893function liveHandler( event ){
     2894    var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
     2895        stop = true;
     2896
     2897    jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
     2898        if ( !event.isImmediatePropagationStopped() && check.test(fn.type) ) {
     2899            var elem = jQuery(event.target).closest(fn.data)[0];
     2900            if ( elem && fn.call(elem, event, fn.data) === false )
     2901                stop = false;
     2902        }
     2903    });
     2904    return stop;
     2905}
     2906
     2907function liveConvert(type, selector){
     2908    return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
     2909}
     2910
     2911jQuery.extend({
     2912    isReady: false,
     2913    readyList: [],
     2914    // Handle when the DOM is ready
     2915    ready: function() {
     2916        // Make sure that the DOM is not already loaded
     2917        if ( !jQuery.isReady ) {
     2918            // Remember that the DOM is ready
     2919            jQuery.isReady = true;
     2920
     2921            // If there are functions bound, to execute
     2922            if ( jQuery.readyList ) {
     2923                // Execute all of them
     2924                jQuery.each( jQuery.readyList, function(){
     2925                    this.call( document, jQuery );
     2926                });
     2927
     2928                // Reset the list of functions
     2929                jQuery.readyList = null;
     2930            }
     2931
     2932            // Trigger any bound ready events
     2933            jQuery(document).triggerHandler("ready");
     2934        }
     2935    }
     2936});
     2937
     2938var readyBound = false;
     2939
     2940function bindReady(){
     2941    if ( readyBound ) return;
     2942    readyBound = true;
     2943
     2944    // Mozilla, Opera and webkit nightlies currently support this event
     2945    if ( document.addEventListener ) {
     2946        // Use the handy event callback
     2947        document.addEventListener( "DOMContentLoaded", function(){
     2948            document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
     2949            jQuery.ready();
     2950        }, false );
     2951
     2952    // If IE event model is used
     2953    } else if ( document.attachEvent ) {
     2954        // ensure firing before onload,
     2955        // maybe late but safe also for iframes
     2956        document.attachEvent("onreadystatechange", function(){
     2957            if ( document.readyState === "complete" ) {
     2958                document.detachEvent( "onreadystatechange", arguments.callee );
     2959                jQuery.ready();
     2960            }
     2961        });
     2962
     2963        // If IE and not an iframe
     2964        // continually check to see if the document is ready
     2965        if ( document.documentElement.doScroll && !window.frameElement ) (function(){
     2966            if ( jQuery.isReady ) return;
     2967
     2968            try {
     2969                // If IE is used, use the trick by Diego Perini
     2970                // http://javascript.nwbox.com/IEContentLoaded/
     2971                document.documentElement.doScroll("left");
     2972            } catch( error ) {
     2973                setTimeout( arguments.callee, 0 );
     2974                return;
     2975            }
     2976
     2977            // and execute any waiting functions
     2978            jQuery.ready();
     2979        })();
     2980    }
     2981
     2982    // A fallback to window.onload, that will always work
     2983    jQuery.event.add( window, "load", jQuery.ready );
     2984}
     2985
     2986jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
     2987    "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
     2988    "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
     2989
     2990    // Handle event binding
     2991    jQuery.fn[name] = function(fn){
     2992        return fn ? this.bind(name, fn) : this.trigger(name);
     2993    };
     2994});
     2995
     2996// Prevent memory leaks in IE
     2997// And prevent errors on refresh with events like mouseover in other browsers
     2998// Window isn't included so as not to unbind existing unload events
     2999jQuery( window ).bind( 'unload', function(){
     3000    for ( var id in jQuery.cache )
     3001        // Skip the window
     3002        if ( id != 1 && jQuery.cache[ id ].handle )
     3003            jQuery.event.remove( jQuery.cache[ id ].handle.elem );
     3004});
     3005jQuery.fn.extend({
     3006    // Keep a copy of the old load
     3007    _load: jQuery.fn.load,
     3008
     3009    load: function( url, params, callback ) {
     3010        if ( typeof url !== "string" )
     3011            return this._load( url );
     3012
     3013        var off = url.indexOf(" ");
     3014        if ( off >= 0 ) {
     3015            var selector = url.slice(off, url.length);
     3016            url = url.slice(0, off);
     3017        }
     3018
     3019        // Default to a GET request
     3020        var type = "GET";
     3021
     3022        // If the second parameter was provided
     3023        if ( params )
     3024            // If it's a function
     3025            if ( jQuery.isFunction( params ) ) {
     3026                // We assume that it's the callback
     3027                callback = params;
     3028                params = null;
     3029
     3030            // Otherwise, build a param string
     3031            } else if( typeof params === "object" ) {
     3032                params = jQuery.param( params );
     3033                type = "POST";
     3034            }
     3035
     3036        var self = this;
     3037
     3038        // Request the remote document
     3039        jQuery.ajax({
     3040            url: url,
     3041            type: type,
     3042            dataType: "html",
     3043            data: params,
     3044            complete: function(res, status){
     3045                // If successful, inject the HTML into all the matched elements
     3046                if ( status == "success" || status == "notmodified" )
     3047                    // See if a selector was specified
     3048                    self.html( selector ?
     3049                        // Create a dummy div to hold the results
     3050                        jQuery("<div/>")
     3051                            // inject the contents of the document in, removing the scripts
     3052                            // to avoid any 'Permission Denied' errors in IE
     3053                            .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
     3054
     3055                            // Locate the specified elements
     3056                            .find(selector) :
     3057
     3058                        // If not, just inject the full result
     3059                        res.responseText );
     3060
     3061                if( callback )
     3062                    self.each( callback, [res.responseText, status, res] );
     3063            }
     3064        });
     3065        return this;
     3066    },
     3067
     3068    serialize: function() {
     3069        return jQuery.param(this.serializeArray());
     3070    },
     3071    serializeArray: function() {
     3072        return this.map(function(){
     3073            return this.elements ? jQuery.makeArray(this.elements) : this;
     3074        })
     3075        .filter(function(){
     3076            return this.name && !this.disabled &&
     3077                (this.checked || /select|textarea/i.test(this.nodeName) ||
     3078                    /text|hidden|password/i.test(this.type));
     3079        })
     3080        .map(function(i, elem){
     3081            var val = jQuery(this).val();
     3082            return val == null ? null :
     3083                jQuery.isArray(val) ?
     3084                    jQuery.map( val, function(val, i){
     3085                        return {name: elem.name, value: val};
     3086                    }) :
     3087                    {name: elem.name, value: val};
     3088        }).get();
     3089    }
     3090});
     3091
     3092// Attach a bunch of functions for handling common AJAX events
     3093jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
     3094    jQuery.fn[o] = function(f){
     3095        return this.bind(o, f);
     3096    };
     3097});
     3098
     3099var jsc = now();
     3100
     3101jQuery.extend({
     3102 
     3103    get: function( url, data, callback, type ) {
     3104        // shift arguments if data argument was ommited
     3105        if ( jQuery.isFunction( data ) ) {
     3106            callback = data;
     3107            data = null;
     3108        }
     3109
     3110        return jQuery.ajax({
     3111            type: "GET",
     3112            url: url,
     3113            data: data,
     3114            success: callback,
     3115            dataType: type
     3116        });
     3117    },
     3118
     3119    getScript: function( url, callback ) {
     3120        return jQuery.get(url, null, callback, "script");
     3121    },
     3122
     3123    getJSON: function( url, data, callback ) {
     3124        return jQuery.get(url, data, callback, "json");
     3125    },
     3126
     3127    post: function( url, data, callback, type ) {
     3128        if ( jQuery.isFunction( data ) ) {
     3129            callback = data;
     3130            data = {};
     3131        }
     3132
     3133        return jQuery.ajax({
     3134            type: "POST",
     3135            url: url,
     3136            data: data,
     3137            success: callback,
     3138            dataType: type
     3139        });
     3140    },
     3141
     3142    ajaxSetup: function( settings ) {
     3143        jQuery.extend( jQuery.ajaxSettings, settings );
     3144    },
     3145
     3146    ajaxSettings: {
     3147        url: location.href,
     3148        global: true,
     3149        type: "GET",
     3150        contentType: "application/x-www-form-urlencoded",
     3151        processData: true,
     3152        async: true,
     3153        /*
     3154        timeout: 0,
     3155        data: null,
     3156        username: null,
     3157        password: null,
     3158        */
     3159        // Create the request object; Microsoft failed to properly
     3160        // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
     3161        // This function can be overriden by calling jQuery.ajaxSetup
     3162        xhr:function(){
     3163            return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
     3164        },
     3165        accepts: {
     3166            xml: "application/xml, text/xml",
     3167            html: "text/html",
     3168            script: "text/javascript, application/javascript",
     3169            json: "application/json, text/javascript",
     3170            text: "text/plain",
     3171            _default: "*/*"
     3172        }
     3173    },
     3174
     3175    // Last-Modified header cache for next request
     3176    lastModified: {},
     3177
     3178    ajax: function( s ) {
     3179        // Extend the settings, but re-extend 's' so that it can be
     3180        // checked again later (in the test suite, specifically)
     3181        s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
     3182
     3183        var jsonp, jsre = /=\?(&|$)/g, status, data,
     3184            type = s.type.toUpperCase();
     3185
     3186        // convert data if not already a string
     3187        if ( s.data && s.processData && typeof s.data !== "string" )
     3188            s.data = jQuery.param(s.data);
     3189
     3190        // Handle JSONP Parameter Callbacks
     3191        if ( s.dataType == "jsonp" ) {
     3192            if ( type == "GET" ) {
     3193                if ( !s.url.match(jsre) )
     3194                    s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
     3195            } else if ( !s.data || !s.data.match(jsre) )
     3196                s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
     3197            s.dataType = "json";
     3198        }
     3199
     3200        // Build temporary JSONP function
     3201        if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
     3202            jsonp = "jsonp" + jsc++;
     3203
     3204            // Replace the =? sequence both in the query string and the data
     3205            if ( s.data )
     3206                s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
     3207            s.url = s.url.replace(jsre, "=" + jsonp + "$1");
     3208
     3209            // We need to make sure
     3210            // that a JSONP style response is executed properly
     3211            s.dataType = "script";
     3212
     3213            // Handle JSONP-style loading
     3214            window[ jsonp ] = function(tmp){
     3215                data = tmp;
     3216                success();
     3217                complete();
     3218                // Garbage collect
     3219                window[ jsonp ] = undefined;
     3220                try{ delete window[ jsonp ]; } catch(e){}
     3221                if ( head )
     3222                    head.removeChild( script );
     3223            };
     3224        }
     3225
     3226        if ( s.dataType == "script" && s.cache == null )
     3227            s.cache = false;
     3228
     3229        if ( s.cache === false && type == "GET" ) {
     3230            var ts = now();
     3231            // try replacing _= if it is there
     3232            var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
     3233            // if nothing was replaced, add timestamp to the end
     3234            s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
     3235        }
     3236
     3237        // If data is available, append data to url for get requests
     3238        if ( s.data && type == "GET" ) {
     3239            s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
     3240
     3241            // IE likes to send both get and post data, prevent this
     3242            s.data = null;
     3243        }
     3244
     3245        // Watch for a new set of requests
     3246        if ( s.global && ! jQuery.active++ )
     3247            jQuery.event.trigger( "ajaxStart" );
     3248
     3249        // Matches an absolute URL, and saves the domain
     3250        var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
     3251
     3252        // If we're requesting a remote document
     3253        // and trying to load JSON or Script with a GET
     3254        if ( s.dataType == "script" && type == "GET" && parts
     3255            && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
     3256
     3257            var head = document.getElementsByTagName("head")[0];
     3258            var script = document.createElement("script");
     3259            script.src = s.url;
     3260            if (s.scriptCharset)
     3261                script.charset = s.scriptCharset;
     3262
     3263            // Handle Script loading
     3264            if ( !jsonp ) {
     3265                var done = false;
     3266
     3267                // Attach handlers for all browsers
     3268                script.onload = script.onreadystatechange = function(){
     3269                    if ( !done && (!this.readyState ||
     3270                            this.readyState == "loaded" || this.readyState == "complete") ) {
     3271                        done = true;
     3272                        success();
     3273                        complete();
     3274                        head.removeChild( script );
     3275                    }
     3276                };
     3277            }
     3278
     3279            head.appendChild(script);
     3280
     3281            // We handle everything using the script element injection
     3282            return undefined;
     3283        }
     3284
     3285        var requestDone = false;
     3286
     3287        // Create the request object
     3288        var xhr = s.xhr();
     3289
     3290        // Open the socket
     3291        // Passing null username, generates a login popup on Opera (#2865)
     3292        if( s.username )
     3293            xhr.open(type, s.url, s.async, s.username, s.password);
     3294        else
     3295            xhr.open(type, s.url, s.async);
     3296
     3297        // Need an extra try/catch for cross domain requests in Firefox 3
     3298        try {
     3299            // Set the correct header, if data is being sent
     3300            if ( s.data )
     3301                xhr.setRequestHeader("Content-Type", s.contentType);
     3302
     3303            // Set the If-Modified-Since header, if ifModified mode.
     3304            if ( s.ifModified )
     3305                xhr.setRequestHeader("If-Modified-Since",
     3306                    jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
     3307
     3308            // Set header so the called script knows that it's an XMLHttpRequest
     3309            xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
     3310
     3311            // Set the Accepts header for the server, depending on the dataType
     3312            xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
     3313                s.accepts[ s.dataType ] + ", */*" :
     3314                s.accepts._default );
     3315        } catch(e){}
     3316
     3317        // Allow custom headers/mimetypes and early abort
     3318        if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
     3319            // Handle the global AJAX counter
     3320            if ( s.global && ! --jQuery.active )
     3321                jQuery.event.trigger( "ajaxStop" );
     3322            // close opended socket
     3323            xhr.abort();
     3324            return false;
     3325        }
     3326
     3327        if ( s.global )
     3328            jQuery.event.trigger("ajaxSend", [xhr, s]);
     3329
     3330        // Wait for a response to come back
     3331        var onreadystatechange = function(isTimeout){
     3332            // The request was aborted, clear the interval and decrement jQuery.active
     3333            if (xhr.readyState == 0) {
     3334                if (ival) {
     3335                    // clear poll interval
     3336                    clearInterval(ival);
     3337                    ival = null;
     3338                    // Handle the global AJAX counter
     3339                    if ( s.global && ! --jQuery.active )
     3340                        jQuery.event.trigger( "ajaxStop" );
     3341                }
     3342            // The transfer is complete and the data is available, or the request timed out
     3343            } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
     3344                requestDone = true;
     3345
     3346                // clear poll interval
     3347                if (ival) {
     3348                    clearInterval(ival);
     3349                    ival = null;
     3350                }
     3351
     3352                status = isTimeout == "timeout" ? "timeout" :
     3353                    !jQuery.httpSuccess( xhr ) ? "error" :
     3354                    s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
     3355                    "success";
     3356
     3357                if ( status == "success" ) {
     3358                    // Watch for, and catch, XML document parse errors
     3359                    try {
     3360                        // process the data (runs the xml through httpData regardless of callback)
     3361                        data = jQuery.httpData( xhr, s.dataType, s );
     3362                    } catch(e) {
     3363                        status = "parsererror";
     3364                    }
     3365                }
     3366
     3367                // Make sure that the request was successful or notmodified
     3368                if ( status == "success" ) {
     3369                    // Cache Last-Modified header, if ifModified mode.
     3370                    var modRes;
     3371                    try {
     3372                        modRes = xhr.getResponseHeader("Last-Modified");
     3373                    } catch(e) {} // swallow exception thrown by FF if header is not available
     3374
     3375                    if ( s.ifModified && modRes )
     3376                        jQuery.lastModified[s.url] = modRes;
     3377
     3378                    // JSONP handles its own success callback
     3379                    if ( !jsonp )
     3380                        success();
     3381                } else
     3382                    jQuery.handleError(s, xhr, status);
     3383
     3384                // Fire the complete handlers
     3385                complete();
     3386
     3387                // Stop memory leaks
     3388                if ( s.async )
     3389                    xhr = null;
     3390            }
     3391        };
     3392
     3393        if ( s.async ) {
     3394            // don't attach the handler to the request, just poll it instead
     3395            var ival = setInterval(onreadystatechange, 13);
     3396
     3397            // Timeout checker
     3398            if ( s.timeout > 0 )
     3399                setTimeout(function(){
     3400                    // Check to see if the request is still happening
     3401                    if ( xhr ) {
     3402                        if( !requestDone )
     3403                            onreadystatechange( "timeout" );
     3404
     3405                        // Cancel the request
     3406                        if ( xhr )
     3407                            xhr.abort();
     3408                    }
     3409                }, s.timeout);
     3410        }
     3411
     3412        // Send the data
     3413        try {
     3414            xhr.send(s.data);
     3415        } catch(e) {
     3416            jQuery.handleError(s, xhr, null, e);
     3417        }
     3418
     3419        // firefox 1.5 doesn't fire statechange for sync requests
     3420        if ( !s.async )
     3421            onreadystatechange();
     3422
     3423        function success(){
     3424            // If a local callback was specified, fire it and pass it the data
     3425            if ( s.success )
     3426                s.success( data, status );
     3427
     3428            // Fire the global callback
     3429            if ( s.global )
     3430                jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
     3431        }
     3432
     3433        function complete(){
     3434            // Process result
     3435            if ( s.complete )
     3436                s.complete(xhr, status);
     3437
     3438            // The request was completed
     3439            if ( s.global )
     3440                jQuery.event.trigger( "ajaxComplete", [xhr, s] );
     3441
     3442            // Handle the global AJAX counter
     3443            if ( s.global && ! --jQuery.active )
     3444                jQuery.event.trigger( "ajaxStop" );
     3445        }
     3446
     3447        // return XMLHttpRequest to allow aborting the request etc.
     3448        return xhr;
     3449    },
     3450
     3451    handleError: function( s, xhr, status, e ) {
     3452        // If a local callback was specified, fire it
     3453        if ( s.error ) s.error( xhr, status, e );
     3454
     3455        // Fire the global callback
     3456        if ( s.global )
     3457            jQuery.event.trigger( "ajaxError", [xhr, s, e] );
     3458    },
     3459
     3460    // Counter for holding the number of active queries
     3461    active: 0,
     3462
     3463    // Determines if an XMLHttpRequest was successful or not
     3464    httpSuccess: function( xhr ) {
     3465        try {
     3466            // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
     3467            return !xhr.status && location.protocol == "file:" ||
     3468                ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
     3469        } catch(e){}
     3470        return false;
     3471    },
     3472
     3473    // Determines if an XMLHttpRequest returns NotModified
     3474    httpNotModified: function( xhr, url ) {
     3475        try {
     3476            var xhrRes = xhr.getResponseHeader("Last-Modified");
     3477
     3478            // Firefox always returns 200. check Last-Modified date
     3479            return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
     3480        } catch(e){}
     3481        return false;
     3482    },
     3483
     3484    httpData: function( xhr, type, s ) {
     3485        var ct = xhr.getResponseHeader("content-type"),
     3486            xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
     3487            data = xml ? xhr.responseXML : xhr.responseText;
     3488
     3489        if ( xml && data.documentElement.tagName == "parsererror" )
     3490            throw "parsererror";
     3491           
     3492        // Allow a pre-filtering function to sanitize the response
     3493        // s != null is checked to keep backwards compatibility
     3494        if( s && s.dataFilter )
     3495            data = s.dataFilter( data, type );
     3496
     3497        // The filter can actually parse the response
     3498        if( typeof data === "string" ){
     3499
     3500            // If the type is "script", eval it in global context
     3501            if ( type == "script" )
     3502                jQuery.globalEval( data );
     3503
     3504            // Get the JavaScript object, if JSON is used.
     3505            if ( type == "json" )
     3506                data = window["eval"]("(" + data + ")");
     3507        }
     3508       
     3509        return data;
     3510    },
     3511
     3512    // Serialize an array of form elements or a set of
     3513    // key/values into a query string
     3514    param: function( a ) {
     3515        var s = [ ];
     3516
     3517        function add( key, value ){
     3518            s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
     3519        };
     3520
     3521        // If an array was passed in, assume that it is an array
     3522        // of form elements
     3523        if ( jQuery.isArray(a) || a.jquery )
     3524            // Serialize the form elements
     3525            jQuery.each( a, function(){
     3526                add( this.name, this.value );
     3527            });
     3528
     3529        // Otherwise, assume that it's an object of key/value pairs
     3530        else
     3531            // Serialize the key/values
     3532            for ( var j in a )
     3533                // If the value is an array then the key names need to be repeated
     3534                if ( jQuery.isArray(a[j]) )
     3535                    jQuery.each( a[j], function(){
     3536                        add( j, this );
     3537                    });
     3538                else
     3539                    add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
     3540
     3541        // Return the resulting serialization
     3542        return s.join("&").replace(/%20/g, "+");
     3543    }
     3544
     3545});
     3546var elemdisplay = {},
     3547    fxAttrs = [
     3548        // height animations
     3549        [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
     3550        // width animations
     3551        [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
     3552        // opacity animations
     3553        [ "opacity" ]
     3554    ];
     3555
     3556function genFx( type, num ){
     3557    var obj = {};
     3558    jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
     3559        obj[ this ] = type;
     3560    });
     3561    return obj;
     3562}
     3563
     3564jQuery.fn.extend({
     3565    show: function(speed,callback){
     3566        if ( speed ) {
     3567            return this.animate( genFx("show", 3), speed, callback);
     3568        } else {
     3569            for ( var i = 0, l = this.length; i < l; i++ ){
     3570                var old = jQuery.data(this[i], "olddisplay");
     3571               
     3572                this[i].style.display = old || "";
     3573               
     3574                if ( jQuery.css(this[i], "display") === "none" ) {
     3575                    var tagName = this[i].tagName, display;
     3576                   
     3577                    if ( elemdisplay[ tagName ] ) {
     3578                        display = elemdisplay[ tagName ];
     3579                    } else {
     3580                        var elem = jQuery("<" + tagName + " />").appendTo("body");
     3581                       
     3582                        display = elem.css("display");
     3583                        if ( display === "none" )
     3584                            display = "block";
     3585                       
     3586                        elem.remove();
     3587                       
     3588                        elemdisplay[ tagName ] = display;
     3589                    }
     3590                   
     3591                    this[i].style.display = jQuery.data(this[i], "olddisplay", display);
     3592                }
     3593            }
     3594           
     3595            return this;
     3596        }
     3597    },
     3598
     3599    hide: function(speed,callback){
     3600        if ( speed ) {
     3601            return this.animate( genFx("hide", 3), speed, callback);
     3602        } else {
     3603            for ( var i = 0, l = this.length; i < l; i++ ){
     3604                var old = jQuery.data(this[i], "olddisplay");
     3605                if ( !old && old !== "none" )
     3606                    jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
     3607                this[i].style.display = "none";
     3608            }
     3609            return this;
     3610        }
     3611    },
     3612
     3613    // Save the old toggle function
     3614    _toggle: jQuery.fn.toggle,
     3615
     3616    toggle: function( fn, fn2 ){
     3617        var bool = typeof fn === "boolean";
     3618
     3619        return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
     3620            this._toggle.apply( this, arguments ) :
     3621            fn == null || bool ?
     3622                this.each(function(){
     3623                    var state = bool ? fn : jQuery(this).is(":hidden");
     3624                    jQuery(this)[ state ? "show" : "hide" ]();
     3625                }) :
     3626                this.animate(genFx("toggle", 3), fn, fn2);
     3627    },
     3628
     3629    fadeTo: function(speed,to,callback){
     3630        return this.animate({opacity: to}, speed, callback);
     3631    },
     3632
     3633    animate: function( prop, speed, easing, callback ) {
     3634        var optall = jQuery.speed(speed, easing, callback);
     3635
     3636        return this[ optall.queue === false ? "each" : "queue" ](function(){
     3637       
     3638            var opt = jQuery.extend({}, optall), p,
     3639                hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
     3640                self = this;
     3641   
     3642            for ( p in prop ) {
     3643                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
     3644                    return opt.complete.call(this);
     3645
     3646                if ( ( p == "height" || p == "width" ) && this.style ) {
     3647                    // Store display property
     3648                    opt.display = jQuery.css(this, "display");
     3649
     3650                    // Make sure that nothing sneaks out
     3651                    opt.overflow = this.style.overflow;
     3652                }
     3653            }
     3654
     3655            if ( opt.overflow != null )
     3656                this.style.overflow = "hidden";
     3657
     3658            opt.curAnim = jQuery.extend({}, prop);
     3659
     3660            jQuery.each( prop, function(name, val){
     3661                var e = new jQuery.fx( self, opt, name );
     3662
     3663                if ( /toggle|show|hide/.test(val) )
     3664                    e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
     3665                else {
     3666                    var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
     3667                        start = e.cur(true) || 0;
     3668
     3669                    if ( parts ) {
     3670                        var end = parseFloat(parts[2]),
     3671                            unit = parts[3] || "px";
     3672
     3673                        // We need to compute starting value
     3674                        if ( unit != "px" ) {
     3675                            self.style[ name ] = (end || 1) + unit;
     3676                            start = ((end || 1) / e.cur(true)) * start;
     3677                            self.style[ name ] = start + unit;
     3678                        }
     3679
     3680                        // If a +=/-= token was provided, we're doing a relative animation
     3681                        if ( parts[1] )
     3682                            end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
     3683
     3684                        e.custom( start, end, unit );
     3685                    } else
     3686                        e.custom( start, val, "" );
     3687                }
     3688            });
     3689
     3690            // For JS strict compliance
     3691            return true;
     3692        });
     3693    },
     3694
     3695    stop: function(clearQueue, gotoEnd){
     3696        var timers = jQuery.timers;
     3697
     3698        if (clearQueue)
     3699            this.queue([]);
     3700
     3701        this.each(function(){
     3702            // go in reverse order so anything added to the queue during the loop is ignored
     3703            for ( var i = timers.length - 1; i >= 0; i-- )
     3704                if ( timers[i].elem == this ) {
     3705                    if (gotoEnd)
     3706                        // force the next step to be the last
     3707                        timers[i](true);
     3708                    timers.splice(i, 1);
     3709                }
     3710        });
     3711
     3712        // start the next in the queue if the last step wasn't forced
     3713        if (!gotoEnd)
     3714            this.dequeue();
     3715
     3716        return this;
     3717    }
     3718
     3719});
     3720
     3721// Generate shortcuts for custom animations
     3722jQuery.each({
     3723    slideDown: genFx("show", 1),
     3724    slideUp: genFx("hide", 1),
     3725    slideToggle: genFx("toggle", 1),
     3726    fadeIn: { opacity: "show" },
     3727    fadeOut: { opacity: "hide" }
     3728}, function( name, props ){
     3729    jQuery.fn[ name ] = function( speed, callback ){
     3730        return this.animate( props, speed, callback );
     3731    };
     3732});
     3733
     3734jQuery.extend({
     3735
     3736    speed: function(speed, easing, fn) {
     3737        var opt = typeof speed === "object" ? speed : {
     3738            complete: fn || !fn && easing ||
     3739                jQuery.isFunction( speed ) && speed,
     3740            duration: speed,
     3741            easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
     3742        };
     3743
     3744        opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
     3745            jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
     3746
     3747        // Queueing
     3748        opt.old = opt.complete;
     3749        opt.complete = function(){
     3750            if ( opt.queue !== false )
     3751                jQuery(this).dequeue();
     3752            if ( jQuery.isFunction( opt.old ) )
     3753                opt.old.call( this );
     3754        };
     3755
     3756        return opt;
     3757    },
     3758
     3759    easing: {
     3760        linear: function( p, n, firstNum, diff ) {
     3761            return firstNum + diff * p;
     3762        },
     3763        swing: function( p, n, firstNum, diff ) {
     3764            return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
     3765        }
     3766    },
     3767
     3768    timers: [],
     3769    timerId: null,
     3770
     3771    fx: function( elem, options, prop ){
     3772        this.options = options;
     3773        this.elem = elem;
     3774        this.prop = prop;
     3775
     3776        if ( !options.orig )
     3777            options.orig = {};
     3778    }
     3779
     3780});
     3781
     3782jQuery.fx.prototype = {
     3783
     3784    // Simple function for setting a style value
     3785    update: function(){
     3786        if ( this.options.step )
     3787            this.options.step.call( this.elem, this.now, this );
     3788
     3789        (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
     3790
     3791        // Set display property to block for height/width animations
     3792        if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
     3793            this.elem.style.display = "block";
     3794    },
     3795
     3796    // Get the current size
     3797    cur: function(force){
     3798        if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
     3799            return this.elem[ this.prop ];
     3800
     3801        var r = parseFloat(jQuery.css(this.elem, this.prop, force));
     3802        return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
     3803    },
     3804
     3805    // Start an animation from one number to another
     3806    custom: function(from, to, unit){
     3807        this.startTime = now();
     3808        this.start = from;
     3809        this.end = to;
     3810        this.unit = unit || this.unit || "px";
     3811        this.now = this.start;
     3812        this.pos = this.state = 0;
     3813
     3814        var self = this;
     3815        function t(gotoEnd){
     3816            return self.step(gotoEnd);
     3817        }
     3818
     3819        t.elem = this.elem;
     3820
     3821        jQuery.timers.push(t);
     3822
     3823        if ( t() && jQuery.timerId == null ) {
     3824            jQuery.timerId = setInterval(function(){
     3825                var timers = jQuery.timers;
     3826
     3827                for ( var i = 0; i < timers.length; i++ )
     3828                    if ( !timers[i]() )
     3829                        timers.splice(i--, 1);
     3830
     3831                if ( !timers.length ) {
     3832                    clearInterval( jQuery.timerId );
     3833                    jQuery.timerId = null;
     3834                }
     3835            }, 13);
     3836        }
     3837    },
     3838
     3839    // Simple 'show' function
     3840    show: function(){
     3841        // Remember where we started, so that we can go back to it later
     3842        this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
     3843        this.options.show = true;
     3844
     3845        // Begin the animation
     3846        // Make sure that we start at a small width/height to avoid any
     3847        // flash of content
     3848        this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
     3849
     3850        // Start by showing the element
     3851        jQuery(this.elem).show();
     3852    },
     3853
     3854    // Simple 'hide' function
     3855    hide: function(){
     3856        // Remember where we started, so that we can go back to it later
     3857        this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
     3858        this.options.hide = true;
     3859
     3860        // Begin the animation
     3861        this.custom(this.cur(), 0);
     3862    },
     3863
     3864    // Each step of an animation
     3865    step: function(gotoEnd){
     3866        var t = now();
     3867
     3868        if ( gotoEnd || t >= this.options.duration + this.startTime ) {
     3869            this.now = this.end;
     3870            this.pos = this.state = 1;
     3871            this.update();
     3872
     3873            this.options.curAnim[ this.prop ] = true;
     3874
     3875            var done = true;
     3876            for ( var i in this.options.curAnim )
     3877                if ( this.options.curAnim[i] !== true )
     3878                    done = false;
     3879
     3880            if ( done ) {
     3881                if ( this.options.display != null ) {
     3882                    // Reset the overflow
     3883                    this.elem.style.overflow = this.options.overflow;
     3884
     3885                    // Reset the display
     3886                    this.elem.style.display = this.options.display;
     3887                    if ( jQuery.css(this.elem, "display") == "none" )
     3888                        this.elem.style.display = "block";
     3889                }
     3890
     3891                // Hide the element if the "hide" operation was done
     3892                if ( this.options.hide )
     3893                    jQuery(this.elem).hide();
     3894
     3895                // Reset the properties, if the item has been hidden or shown
     3896                if ( this.options.hide || this.options.show )
     3897                    for ( var p in this.options.curAnim )
     3898                        jQuery.attr(this.elem.style, p, this.options.orig[p]);
     3899            }
     3900
     3901            if ( done )
     3902                // Execute the complete function
     3903                this.options.complete.call( this.elem );
     3904
     3905            return false;
     3906        } else {
     3907            var n = t - this.startTime;
     3908            this.state = n / this.options.duration;
     3909
     3910            // Perform the easing function, defaults to swing
     3911            this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
     3912            this.now = this.start + ((this.end - this.start) * this.pos);
     3913
     3914            // Perform the next step of the animation
     3915            this.update();
     3916        }
     3917
     3918        return true;
     3919    }
     3920
     3921};
     3922
     3923jQuery.extend( jQuery.fx, {
     3924    speeds:{
     3925        slow: 600,
     3926        fast: 200,
     3927        // Default speed
     3928        _default: 400
     3929    },
     3930    step: {
     3931
     3932        opacity: function(fx){
     3933            jQuery.attr(fx.elem.style, "opacity", fx.now);
     3934        },
     3935
     3936        _default: function(fx){
     3937            if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
     3938                fx.elem.style[ fx.prop ] = fx.now + fx.unit;
     3939            else
     3940                fx.elem[ fx.prop ] = fx.now;
     3941        }
     3942    }
     3943});
     3944if ( document.documentElement["getBoundingClientRect"] )
     3945    jQuery.fn.offset = function() {
     3946        if ( !this[0] ) return { top: 0, left: 0 };
     3947        if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
     3948        var box  = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
     3949            clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
     3950            top  = box.top  + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
     3951            left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
     3952        return { top: top, left: left };
     3953    };
     3954else
     3955    jQuery.fn.offset = function() {
     3956        if ( !this[0] ) return { top: 0, left: 0 };
     3957        if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
     3958        jQuery.offset.initialized || jQuery.offset.initialize();
     3959
     3960        var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
     3961            doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
     3962            body = doc.body, defaultView = doc.defaultView,
     3963            prevComputedStyle = defaultView.getComputedStyle(elem, null),
     3964            top = elem.offsetTop, left = elem.offsetLeft;
     3965
     3966        while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
     3967            computedStyle = defaultView.getComputedStyle(elem, null);
     3968            top -= elem.scrollTop, left -= elem.scrollLeft;
     3969            if ( elem === offsetParent ) {
     3970                top += elem.offsetTop, left += elem.offsetLeft;
     3971                if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
     3972                    top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
     3973                    left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
     3974                prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
     3975            }
     3976            if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
     3977                top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
     3978                left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
     3979            prevComputedStyle = computedStyle;
     3980        }
     3981
     3982        if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
     3983            top  += body.offsetTop,
     3984            left += body.offsetLeft;
     3985
     3986        if ( prevComputedStyle.position === "fixed" )
     3987            top  += Math.max(docElem.scrollTop, body.scrollTop),
     3988            left += Math.max(docElem.scrollLeft, body.scrollLeft);
     3989
     3990        return { top: top, left: left };
     3991    };
     3992
     3993jQuery.offset = {
     3994    initialize: function() {
     3995        if ( this.initialized ) return;
     3996        var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
     3997            html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';
     3998
     3999        rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
     4000        for ( prop in rules ) container.style[prop] = rules[prop];
     4001
     4002        container.innerHTML = html;
     4003        body.insertBefore(container, body.firstChild);
     4004        innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
     4005
     4006        this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
     4007        this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
     4008
     4009        innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
     4010        this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
     4011
     4012        body.style.marginTop = '1px';
     4013        this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
     4014        body.style.marginTop = bodyMarginTop;
     4015
     4016        body.removeChild(container);
     4017        this.initialized = true;
     4018    },
     4019
     4020    bodyOffset: function(body) {
     4021        jQuery.offset.initialized || jQuery.offset.initialize();
     4022        var top = body.offsetTop, left = body.offsetLeft;
     4023        if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
     4024            top  += parseInt( jQuery.curCSS(body, 'marginTop',  true), 10 ) || 0,
     4025            left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
     4026        return { top: top, left: left };
     4027    }
     4028};
     4029
     4030
     4031jQuery.fn.extend({
     4032    position: function() {
     4033        var left = 0, top = 0, results;
     4034
     4035        if ( this[0] ) {
     4036            // Get *real* offsetParent
     4037            var offsetParent = this.offsetParent(),
     4038
     4039            // Get correct offsets
     4040            offset       = this.offset(),
     4041            parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
     4042
     4043            // Subtract element margins
     4044            // note: when an element has margin: auto the offsetLeft and marginLeft
     4045            // are the same in Safari causing offset.left to incorrectly be 0
     4046            offset.top  -= num( this, 'marginTop'  );
     4047            offset.left -= num( this, 'marginLeft' );
     4048
     4049            // Add offsetParent borders
     4050            parentOffset.top  += num( offsetParent, 'borderTopWidth'  );
     4051            parentOffset.left += num( offsetParent, 'borderLeftWidth' );
     4052
     4053            // Subtract the two offsets
     4054            results = {
     4055                top:  offset.top  - parentOffset.top,
     4056                left: offset.left - parentOffset.left
     4057            };
     4058        }
     4059
     4060        return results;
     4061    },
     4062
     4063    offsetParent: function() {
     4064        var offsetParent = this[0].offsetParent || document.body;
     4065        while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
     4066            offsetParent = offsetParent.offsetParent;
     4067        return jQuery(offsetParent);
     4068    }
     4069});
     4070
     4071
     4072// Create scrollLeft and scrollTop methods
     4073jQuery.each( ['Left', 'Top'], function(i, name) {
     4074    var method = 'scroll' + name;
     4075   
     4076    jQuery.fn[ method ] = function(val) {
     4077        if (!this[0]) return null;
     4078
     4079        return val !== undefined ?
     4080
     4081            // Set the scroll offset
     4082            this.each(function() {
     4083                this == window || this == document ?
     4084                    window.scrollTo(
     4085                        !i ? val : jQuery(window).scrollLeft(),
     4086                         i ? val : jQuery(window).scrollTop()
     4087                    ) :
     4088                    this[ method ] = val;
     4089            }) :
     4090
     4091            // Return the scroll offset
     4092            this[0] == window || this[0] == document ?
     4093                self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
     4094                    jQuery.boxModel && document.documentElement[ method ] ||
     4095                    document.body[ method ] :
     4096                this[0][ method ];
     4097    };
     4098});
     4099// Create innerHeight, innerWidth, outerHeight and outerWidth methods
     4100jQuery.each([ "Height", "Width" ], function(i, name){
     4101
     4102    var tl = i ? "Left"  : "Top",  // top or left
     4103        br = i ? "Right" : "Bottom"; // bottom or right
     4104
     4105    // innerHeight and innerWidth
     4106    jQuery.fn["inner" + name] = function(){
     4107        return this[ name.toLowerCase() ]() +
     4108            num(this, "padding" + tl) +
     4109            num(this, "padding" + br);
     4110    };
     4111
     4112    // outerHeight and outerWidth
     4113    jQuery.fn["outer" + name] = function(margin) {
     4114        return this["inner" + name]() +
     4115            num(this, "border" + tl + "Width") +
     4116            num(this, "border" + br + "Width") +
     4117            (margin ?
     4118                num(this, "margin" + tl) + num(this, "margin" + br) : 0);
     4119    };
     4120   
     4121    var type = name.toLowerCase();
     4122
     4123    jQuery.fn[ type ] = function( size ) {
     4124        // Get window width or height
     4125        return this[0] == window ?
     4126            // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
     4127            document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
     4128            document.body[ "client" + name ] :
     4129
     4130            // Get document width or height
     4131            this[0] == document ?
     4132                // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
     4133                Math.max(
     4134                    document.documentElement["client" + name],
     4135                    document.body["scroll" + name], document.documentElement["scroll" + name],
     4136                    document.body["offset" + name], document.documentElement["offset" + name]
     4137                ) :
     4138
     4139                // Get or set width or height on the element
     4140                size === undefined ?
     4141                    // Get width or height on the element
     4142                    (this.length ? jQuery.css( this[0], type ) : null) :
     4143
     4144                    // Set the width or height on the element (default to pixels if value is unitless)
     4145                    this.css( type, typeof size === "string" ? size : size + "px" );
     4146    };
     4147
     4148});})();
     4149
     4150jQuery.noConflict();
  • trunk/wp-includes/js/thickbox/thickbox.js

    r10291 r10326  
    1 var tb_pathToImage="../wp-includes/js/thickbox/loadingAnimation.gif",tb_closeImage="../wp-includes/js/thickbox/tb-close.png";jQuery(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image();imgLoader.src=tb_pathToImage});function tb_init(a){jQuery(a).click(function(){var c=this.title||this.name||null,b=this.href||this.alt,d=this.rel||false;tb_show(c,b,d);this.blur();return false})}function tb_show(o,b,i){try{var c,f=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/,p=c.toLowerCase().match(f),g,h,n,m,l,j,a,d;if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click(tb_remove)}}else{if(document.getElementById("TB_overlay")===null){jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click(tb_remove)}}if(tb_detectMacXFF()){jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{jQuery("#TB_overlay").addClass("TB_overlayBG")}if(o===null){o=""}jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");jQuery("#TB_load").show();if(b.indexOf("?")!==-1){c=b.substr(0,b.indexOf("?"))}else{c=b}if(p==".jpg"||p==".jpeg"||p==".png"||p==".gif"||p==".bmp"){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(i){TB_TempArray=jQuery("a[@rel="+i+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){g=TB_TempArray[TB_Counter].href.toLowerCase().match(f);if(!(TB_TempArray[TB_Counter].href==b)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;h=tb_getPageSize();n=h[0]-150;m=h[1]-150;l=imgPreloader.width;j=imgPreloader.height;if(l>n){j=j*(n/l);l=n;if(j>m){l=l*(m/j);j=m}}else{if(j>m){l=l*(m/j);j=m;if(l>n){j=j*(n/l);l=n}}}TB_WIDTH=l+30;TB_HEIGHT=j+60;jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+b+"' width='"+l+"' height='"+j+"' alt='"+o+"'/></a><div id='TB_caption'>"+o+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='"+tb_closeImage+"' /></a></div>");jQuery("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function q(){if(jQuery(document).unbind("click",q)){jQuery(document).unbind("click",q)}jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,i);return false}jQuery("#TB_prev").click(q)}if(!(TB_NextHTML==="")){function e(){jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,i);return false}jQuery("#TB_next").click(e)}document.onkeydown=function(r){if(r==null){keycode=event.keyCode}else{keycode=r.which}if(keycode==27){tb_remove()}else{if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";e()}}else{if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";q()}}}}};tb_position();jQuery("#TB_load").remove();jQuery("#TB_ImageOff").click(tb_remove);jQuery("#TB_window").css({display:"block"})};imgPreloader.src=b}else{a=b.replace(/^[^\?]+\??/,"");d=tb_parseQuery(a);TB_WIDTH=(d.width*1)+30||630;TB_HEIGHT=(d.height*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(b.indexOf("TB_iframe")!=-1){urlNoQuery=b.split("TB_");jQuery("#TB_iframeContent").remove();if(d.modal!="true"){jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+o+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='"+tb_closeImage+"' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>")}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>")}}else{if(jQuery("#TB_window").css("display")!="block"){if(d.modal!="true"){jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+o+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='"+tb_closeImage+"' /></a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")}else{jQuery("#TB_overlay").unbind();jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>")}}else{jQuery("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";jQuery("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";jQuery("#TB_ajaxContent")[0].scrollTop=0;jQuery("#TB_ajaxWindowTitle").html(o)}}jQuery("#TB_closeWindowButton").click(tb_remove);if(b.indexOf("TB_inline")!=-1){jQuery("#TB_ajaxContent").append(jQuery("#"+d.inlineId).children());jQuery("#TB_window").unload(function(){jQuery("#"+d.inlineId).append(jQuery("#TB_ajaxContent").children())});tb_position();jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"})}else{if(b.indexOf("TB_iframe")!=-1){tb_position();if(jQuery.browser.safari){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"})}}else{jQuery("#TB_ajaxContent").load(b+="&random="+(new Date().getTime()),function(){tb_position();jQuery("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");jQuery("#TB_window").css({display:"block"})})}}}if(!d.modal){document.onkeyup=function(q){if(q==null){keycode=event.keyCode}else{keycode=q.which}if(keycode==27){tb_remove()}}}}catch(k){}}function tb_showIframe(){jQuery("#TB_load").remove();jQuery("#TB_window").css({display:"block"})}function tb_remove(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");jQuery("#TB_window").fadeOut("fast",function(){jQuery("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()});jQuery("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){jQuery("body","html").css({height:"auto",width:"auto"});jQuery("html").css("overflow","")}document.onkeydown="";document.onkeyup="";return false}function tb_position(){jQuery("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){jQuery("#TB_window").css({marginTop:"-"+parseInt((TB_HEIGHT/2),10)+"px"})}}function tb_parseQuery(d){var e={},a,c,g,b,f;if(!d){return e}a=d.split(/[;&]/);for(c=0;c<a.length;c++){g=a[c].split("=");if(!g||g.length!=2){continue}b=unescape(g[0]);f=unescape(g[1]);f=f.replace(/\+/g," ");e[b]=f}return e}function tb_getPageSize(){var c=document.documentElement,a,b;a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=[a,b];return arrayPageSize}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("mac")!=-1&&a.indexOf("firefox")!=-1){return true}};
     1/*
     2 * Thickbox 3.1 - One Box To Rule Them All.
     3 * By Cody Lindley (http://www.codylindley.com)
     4 * Copyright (c) 2007 cody lindley
     5 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
     6*/
     7         
     8var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
     9var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";
     10
     11/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
     12
     13//on page load call tb_init
     14jQuery(document).ready(function(){   
     15    tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
     16    imgLoader = new Image();// preload image
     17    imgLoader.src = tb_pathToImage;
     18});
     19
     20//add thickbox to href & area elements that have a class of .thickbox
     21function tb_init(domChunk){
     22    jQuery(domChunk).click(function(){
     23    var t = this.title || this.name || null;
     24    var a = this.href || this.alt;
     25    var g = this.rel || false;
     26    tb_show(t,a,g);
     27    this.blur();
     28    return false;
     29    });
     30}
     31
     32function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
     33
     34    try {
     35        if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
     36            jQuery("body","html").css({height: "100%", width: "100%"});
     37            jQuery("html").css("overflow","hidden");
     38            if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
     39                jQuery("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
     40                jQuery("#TB_overlay").click(tb_remove);
     41            }
     42        }else{//all others
     43            if(document.getElementById("TB_overlay") === null){
     44                jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
     45                jQuery("#TB_overlay").click(tb_remove);
     46            }
     47        }
     48       
     49        if(tb_detectMacXFF()){
     50            jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
     51        }else{
     52            jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
     53        }
     54       
     55        if(caption===null){caption="";}
     56        jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
     57        jQuery('#TB_load').show();//show loader
     58       
     59        var baseURL;
     60       if(url.indexOf("?")!==-1){ //ff there is a query string involved
     61            baseURL = url.substr(0, url.indexOf("?"));
     62       }else{
     63            baseURL = url;
     64       }
     65       
     66       var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
     67       var urlType = baseURL.toLowerCase().match(urlString);
     68
     69        if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
     70               
     71            TB_PrevCaption = "";
     72            TB_PrevURL = "";
     73            TB_PrevHTML = "";
     74            TB_NextCaption = "";
     75            TB_NextURL = "";
     76            TB_NextHTML = "";
     77            TB_imageCount = "";
     78            TB_FoundURL = false;
     79            if(imageGroup){
     80                TB_TempArray = jQuery("a[rel="+imageGroup+"]").get();
     81                for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
     82                    var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
     83                        if (!(TB_TempArray[TB_Counter].href == url)) {                     
     84                            if (TB_FoundURL) {
     85                                TB_NextCaption = TB_TempArray[TB_Counter].title;
     86                                TB_NextURL = TB_TempArray[TB_Counter].href;
     87                                TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
     88                            } else {
     89                                TB_PrevCaption = TB_TempArray[TB_Counter].title;
     90                                TB_PrevURL = TB_TempArray[TB_Counter].href;
     91                                TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
     92                            }
     93                        } else {
     94                            TB_FoundURL = true;
     95                            TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);                                         
     96                        }
     97                }
     98            }
     99
     100            imgPreloader = new Image();
     101            imgPreloader.onload = function(){       
     102            imgPreloader.onload = null;
     103               
     104            // Resizing large images - orginal by Christian Montoya edited by me.
     105            var pagesize = tb_getPageSize();
     106            var x = pagesize[0] - 150;
     107            var y = pagesize[1] - 150;
     108            var imageWidth = imgPreloader.width;
     109            var imageHeight = imgPreloader.height;
     110            if (imageWidth > x) {
     111                imageHeight = imageHeight * (x / imageWidth);
     112                imageWidth = x;
     113                if (imageHeight > y) {
     114                    imageWidth = imageWidth * (y / imageHeight);
     115                    imageHeight = y;
     116                }
     117            } else if (imageHeight > y) {
     118                imageWidth = imageWidth * (y / imageHeight);
     119                imageHeight = y;
     120                if (imageWidth > x) {
     121                    imageHeight = imageHeight * (x / imageWidth);
     122                    imageWidth = x;
     123                }
     124            }
     125            // End Resizing
     126           
     127            TB_WIDTH = imageWidth + 30;
     128            TB_HEIGHT = imageHeight + 60;
     129            jQuery("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='" + tb_closeImage + "' /></a></div>");     
     130           
     131            jQuery("#TB_closeWindowButton").click(tb_remove);
     132           
     133            if (!(TB_PrevHTML === "")) {
     134                function goPrev(){
     135                    if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);}
     136                    jQuery("#TB_window").remove();
     137                    jQuery("body").append("<div id='TB_window'></div>");
     138                    tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
     139                    return false;   
     140                }
     141                jQuery("#TB_prev").click(goPrev);
     142            }
     143           
     144            if (!(TB_NextHTML === "")) {       
     145                function goNext(){
     146                    jQuery("#TB_window").remove();
     147                    jQuery("body").append("<div id='TB_window'></div>");
     148                    tb_show(TB_NextCaption, TB_NextURL, imageGroup);               
     149                    return false;   
     150                }
     151                jQuery("#TB_next").click(goNext);
     152               
     153            }
     154
     155            document.onkeydown = function(e){   
     156                if (e == null) { // ie
     157                    keycode = event.keyCode;
     158                } else { // mozilla
     159                    keycode = e.which;
     160                }
     161                if(keycode == 27){ // close
     162                    tb_remove();
     163                } else if(keycode == 190){ // display previous image
     164                    if(!(TB_NextHTML == "")){
     165                        document.onkeydown = "";
     166                        goNext();
     167                    }
     168                } else if(keycode == 188){ // display next image
     169                    if(!(TB_PrevHTML == "")){
     170                        document.onkeydown = "";
     171                        goPrev();
     172                    }
     173                }   
     174            };
     175           
     176            tb_position();
     177            jQuery("#TB_load").remove();
     178            jQuery("#TB_ImageOff").click(tb_remove);
     179            jQuery("#TB_window").css({display:"block"}); //for safari using css instead of show
     180            };
     181           
     182            imgPreloader.src = url;
     183        }else{//code to show html
     184           
     185            var queryString = url.replace(/^[^\?]+\??/,'');
     186            var params = tb_parseQuery( queryString );
     187
     188            TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
     189            TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
     190            ajaxContentW = TB_WIDTH - 30;
     191            ajaxContentH = TB_HEIGHT - 45;
     192           
     193            if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window     
     194                    urlNoQuery = url.split('TB_');
     195                    jQuery("#TB_iframeContent").remove();
     196                    if(params['modal'] != "true"){//iframe no modal
     197                        jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='" + tb_closeImage + "' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
     198                    }else{//iframe modal
     199                    jQuery("#TB_overlay").unbind();
     200                        jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
     201                    }
     202            }else{// not an iframe, ajax
     203                    if(jQuery("#TB_window").css("display") != "block"){
     204                        if(params['modal'] != "true"){//ajax no modal
     205                        jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='" + tb_closeImage + "' /></a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
     206                        }else{//ajax modal
     207                        jQuery("#TB_overlay").unbind();
     208                        jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");   
     209                        }
     210                    }else{//this means the window is already up, we are just loading new content via ajax
     211                        jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
     212                        jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
     213                        jQuery("#TB_ajaxContent")[0].scrollTop = 0;
     214                        jQuery("#TB_ajaxWindowTitle").html(caption);
     215                    }
     216            }
     217                   
     218            jQuery("#TB_closeWindowButton").click(tb_remove);
     219           
     220                if(url.indexOf('TB_inline') != -1){
     221                    jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children());
     222                    jQuery("#TB_window").unload(function () {
     223                        jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished
     224                    });
     225                    tb_position();
     226                    jQuery("#TB_load").remove();
     227                    jQuery("#TB_window").css({display:"block"});
     228                }else if(url.indexOf('TB_iframe') != -1){
     229                    tb_position();
     230                    if($.browser.safari){//safari needs help because it will not fire iframe onload
     231                        jQuery("#TB_load").remove();
     232                        jQuery("#TB_window").css({display:"block"});
     233                    }
     234                }else{
     235                    jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
     236                        tb_position();
     237                        jQuery("#TB_load").remove();
     238                        tb_init("#TB_ajaxContent a.thickbox");
     239                        jQuery("#TB_window").css({display:"block"});
     240                    });
     241                }
     242           
     243        }
     244
     245        if(!params['modal']){
     246            document.onkeyup = function(e){     
     247                if (e == null) { // ie
     248                    keycode = event.keyCode;
     249                } else { // mozilla
     250                    keycode = e.which;
     251                }
     252                if(keycode == 27){ // close
     253                    tb_remove();
     254                }   
     255            };
     256        }
     257       
     258    } catch(e) {
     259        //nothing here
     260    }
     261}
     262
     263//helper functions below
     264function tb_showIframe(){
     265    jQuery("#TB_load").remove();
     266    jQuery("#TB_window").css({display:"block"});
     267}
     268
     269function tb_remove() {
     270    jQuery("#TB_imageOff").unbind("click");
     271    jQuery("#TB_closeWindowButton").unbind("click");
     272    jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
     273    jQuery("#TB_load").remove();
     274    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
     275        jQuery("body","html").css({height: "auto", width: "auto"});
     276        jQuery("html").css("overflow","");
     277    }
     278    document.onkeydown = "";
     279    document.onkeyup = "";
     280    return false;
     281}
     282
     283function tb_position() {
     284jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
     285    if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
     286        jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
     287    }
     288}
     289
     290function tb_parseQuery ( query ) {
     291   var Params = {};
     292   if ( ! query ) {return Params;}// return empty object
     293   var Pairs = query.split(/[;&]/);
     294   for ( var i = 0; i < Pairs.length; i++ ) {
     295      var KeyVal = Pairs[i].split('=');
     296      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
     297      var key = unescape( KeyVal[0] );
     298      var val = unescape( KeyVal[1] );
     299      val = val.replace(/\+/g, ' ');
     300      Params[key] = val;
     301   }
     302   return Params;
     303}
     304
     305function tb_getPageSize(){
     306    var de = document.documentElement;
     307    var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
     308    var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
     309    arrayPageSize = [w,h];
     310    return arrayPageSize;
     311}
     312
     313function tb_detectMacXFF() {
     314  var userAgent = navigator.userAgent.toLowerCase();
     315  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
     316    return true;
     317  }
     318}
     319
     320
  • trunk/wp-includes/script-loader.php

    r10291 r10326  
    4343    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
    4444
    45     $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent'), '20090102' );
     45    $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent'), '20090106' );
    4646
    4747    $scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", false, '1.6.1' );
     
    8080    ) );
    8181
    82     $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090102' );
     82    $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090106' );
    8383
    8484    $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20090102' );
     
    9898    $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
    9999
    100     $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.2.6');
     100    $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.3b2');
    101101    $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.02m');
    102102    $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color$suffix.js", array('jquery'), '2.0-4561m');
     
    106106    $scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m' );
    107107    $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' );
    108     $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox$suffix.js", array('jquery'), '3.1-20080430m');
     108    $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20080430m');
    109109
    110110    if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) {
     
    185185        $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('wp-lists'), '20090102' );
    186186
    187         $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090102' );
     187        $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
    188188
    189189        $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20090102' );
     
    282282        $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20090102' );
    283283
    284         $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'interface' ), '20090102' );
     284        $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'interface' ), '20090106' );
    285285        $scripts->localize( 'admin-widgets', 'widgetsL10n', array(
    286286            'add' => __('Add'),
Note: See TracChangeset for help on using the changeset viewer.