BN.namespace("productDetails");var mycarousel_itemList=[];var number_of_offers=0;this.clickedOnce=false;$(document).ready(function(){BN.productDetails.init();BN.productDetails.getNumberOfOffers();BN.productDetails.mycarousel_loadItems();$("#mycarousel").jcarousel({size:mycarousel_itemList.length,itemLoadCallback:BN.productDetails.mycarousel_itemLoadCallback});$(".all-feedback").css("display","none")});$("#show-all").live("click",function(){var A=$(this).attr("data-oid");BN.productDetails.updateData(A);BN.productDetails.alreadyClicked=true;return false});$("#hide-all").live("click",function(){$("#CustomerFeedback").html("Customer Feedback");$("#feedback-summary, #show-all").show();$("#feedback-list, #hide-all").hide();return false});$("#show-details").live("click",function(){$("#feedback-summary, #show-all").hide();$("#CustomerFeedback").html("All Customer Feedback");$("#feedback-list, #hide-all").show();return false});$(".return_to_details").live("click",function(){$("#CustomerFeedback").html("Customer Feedback");$("#feedback-summary, #show-all").show();$("#feedback-list, #hide-all").hide();return false});BN.productDetails={init:function(){BN.shippingCountdown.init()},alreadyClicked:false,updateData:function(B){var A=this;if(!A.alreadyClicked){var C="/ws/productdetails/feedback?oid="+B;$.get(C,function(D){$("#feedback-list").append(D);$("#feedback-summary, #show-all").hide();$("#CustomerFeedback").html("All Customer Feedback");$("#feedback-list, #hide-all").show()},"html")}else{$("#feedback-summary, #show-all").hide();$("#CustomerFeedback").html("All Customer Feedback");$("#feedback-list, #hide-all").show()}},mycarousel_itemLoadCallback:function(C,B){for(var A=C.first;A<=C.last;A++){if(C.has(A)){continue}if(A>mycarousel_itemList.length){break}C.add(A,BN.productDetails.mycarousel_getItemHTML(mycarousel_itemList[A-1]))}},mycarousel_getItemHTML:function(A){return'<div><a href="'+A.url+'"><div><img src="'+A.image+'" alt="'+A.name+'" title="'+A.name+'"/></div><div><center><p>'+A.size+"</p></div><div><p>"+A.price+"</p></center></div></a></div>"},getNumberOfOffers:function(){$("#pick-one div").each(function(A,B){if($(B).hasClass("hide")){number_of_offers++}})},mycarousel_loadItems:function(){for(var D=0;D<number_of_offers;D++){var B=$("#url_"+D);var F=$("#image_"+D);var A=$("#name_"+D);var C=$("#size_"+D);var E=$("#price_"+D);mycarousel_itemList[D]={url:B.html(),image:F.html(),name:A.html(),size:C.html(),price:E.html()}}},addToWishList:function(){if($("#product_form").length>0){$("INPUT[name='sAction']").val("favorite");$("#product_form")[0].submit()}return false}};jQuery.fn.crossfade=function(B,A){jQuery.fn.crossfade(B,A,null,null)};jQuery.fn.crossfade=function(D,B,C,A){return this.each(function(){var F=$(this);if(F.parent().attr("class")!="cross_fade_spanner"){var E=F.attr("height");var G=F.attr("width");F.wrap('<span class="cross_fade_spanner" style="position: relative; display:none"></span>').parent().append("<img>").find(":last-child").attr("src",D).attr("data-index",(B===null)?"":B).css("display","inline").attr("height",E).attr("width",G);F.css({position:"absolute",left:0,background:"",top:this.offsetTop});$(".cross_fade_spanner").css("display","block")}var H=F.parent().find(":last-child");if(B!=null){$("#s7_main_image").attr("data-index",B)}if(F.css("opacity")==0){if(H.attr("src")==D){return }F.attr("src",D);if((C!==null)&&(A!==null)){F.attr("width",C);F.attr("height",A)}F.stop().animate({opacity:1},500);H.stop().animate({opacity:0},500)}else{if(F.attr("src")==D){return }H.attr("src",D);if((C!==null)&&(A!==null)){H.attr("width",C);H.attr("height",A)}F.stop().animate({opacity:0},500);H.stop().animate({opacity:1},500)}})};(function(A){A.fn.hoverIntent=function(I,H){var J={sensitivity:7,interval:100,timeout:0};J=A.extend(J,H?{over:I,out:H}:I);var L,K,F,D;var E=function(M){L=M.pageX;K=M.pageY};var C=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);if((Math.abs(F-L)+Math.abs(D-K))<J.sensitivity){A(M).unbind("mousemove",E);M.hoverIntent_s=1;return J.over.apply(M,[N])}else{F=L;D=K;M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}};var G=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);M.hoverIntent_s=0;return J.out.apply(M,[N])};var B=function(P){var O=(P.type=="mouseover"?P.fromElement:P.toElement)||P.relatedTarget;while(O&&O!=this){try{O=O.parentNode}catch(P){O=this}}if(O==this){return false}var N=jQuery.extend({},P);var M=this;if(M.hoverIntent_t){M.hoverIntent_t=clearTimeout(M.hoverIntent_t)}if(P.type=="mouseover"){F=N.pageX;D=N.pageY;A(M).bind("mousemove",E);if(M.hoverIntent_s!=1){M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}}else{A(M).unbind("mousemove",E);if(M.hoverIntent_s==1){M.hoverIntent_t=setTimeout(function(){G(N,M)},J.timeout)}}};return this.mouseover(B).mouseout(B)}})(jQuery);BN.namespace("imageViewer");function ImageViewerManager(){this.sViewShape="";this.oViewTypeThumbnail="";this.sImageIndex=0;this.getIndex=function(){return $(this.oViewTypeThumbnail).attr("data-index")};this.getImage=function(){var A="";if($(this.oViewTypeThumbnail).attr(ImageViewer.getDataAttribute(this.sViewShape))!=null){A=$(this.oViewTypeThumbnail).attr(ImageViewer.getDataAttribute(this.sViewShape))}else{A=$(this.oViewTypeThumbnail).attr(ImageViewer.getDataAttribute(null))}return A}}var oImage=new ImageViewerManager();var shapeOverlayTimeout=null;if(typeof jQuery!="undefined"){$(document).ready(function(){BN.imageViewer.init()})}BN.imageViewer={viewWithDiamond:function(A){oImage.sViewShape=A;$("#s7_fade_image").crossfade(oImage.getImage(false),oImage.getIndex());$(".picture-small").each(function(){var B=$(this).attr(ImageViewer.getDataAttribute(oImage.sViewShape));preloadImg(B);log("preloading shape: "+B)});return false},init:function(){$("#zoom_link_container").show();$("#change_diamond").show();if(!$("#s7_main_image").length){return }$(".picture-small").each(function(){preloadImg($(this).attr("data-imageurl"))});$(".selected").each(function(){oImage.oViewTypeThumbnail=$(this)});var A=($("#s7_main_image").attr("data-useZoom")+"").toLowerCase();if(A=="true"){$("#s7_fade_image_div").append('<div id="s7_zoom_overlay"></div>');$("#s7_main_image").hover(function(){$("#s7_zoom_overlay").css("left",function(){return $("#s7_main_image").width()/2-$(this).width()/2});$("#s7_zoom_overlay").css("top",function(){return $("#s7_main_image").height()/2-$(this).height()/2});$("#s7_main_image").css("cursor","pointer");$("#s7_zoom_overlay").css("opacity",0.8).fadeIn(100)},function(){$("#s7_main_image").css("cursor","auto");$("#s7_zoom_overlay").fadeOut(100)});if(BN.detailsLightbox!==undefined){$("#s7_fade_image_div, #zoom_link").unbind("click");$("#s7_fade_image_div, #zoom_link").bind("click",function(){var B=$("a.picture-small.selected").attr("data-lightboxid");BN.detailsLightbox.showLightbox($("#"+B),null);return false});$("#adv_rper_link").unbind("click");$("#adv_rper_link").bind("click",function(){BN.detailsLightbox.showLightbox(null,"recently_purchased");return false})}}$(".picture-small").click(function(){oImage.oViewTypeThumbnail=$(this);$(".picture-small").removeClass("selected");$(this).addClass("selected");$("#s7_fade_image").crossfade(oImage.getImage(false),oImage.getIndex());return false});$("#change_diamond").unbind().hover(function(){if(shapeOverlayTimeout!==undefined){clearTimeout(shapeOverlayTimeout)}BN.imageViewer.showShapeOverlay()},function(){BN.imageViewer.hideShapeOverlay()});$("#change_diamond").click(function(){return false});$("#shape_overlay").unbind("mouseenter").unbind("mouseleave").hover(function(){if(shapeOverlayTimeout!==undefined){clearTimeout(shapeOverlayTimeout)}},function(){BN.imageViewer.hideShapeOverlay()});$("#shape_overlay_content div").unbind("click").click(function(){var B=$(this).attr("data-shapeCode");$("#change_diamond").attr("data-shapeCode",B);BN.imageViewer.updateShapeIcons($(this).children("img.shape_icon"));return BN.imageViewer.viewWithDiamond(B)})},updateShapeIcons:function(A){var B=$("#shape_overlay_content img.selected_shape");if(B.length!==0){B.attr("src",B.attr("src").replace("_on","")).removeClass("selected_shape")}if(A.length!==0){A.addClass("selected_shape");A.attr("src",A.attr("src").replace(".gif","_on.gif"))}},showShapeOverlay:function(){var B=$("#change_diamond_container");var A=Math.round(B.position().top-10);var C=Math.round(B.position().left+B.width()+13);$("#shape_overlay").css({top:A,left:C,display:"block"})},hideShapeOverlay:function(){shapeOverlayTimeout=setTimeout(function(){$("#shape_overlay").hide()},500)}};function preloadImg(A){var B=document.createElement("img");B.src=A}function log(A){}var ImageViewer={getDataAttribute:function(B){var A="";if(B==null||B==""){A="data-imageurl"}else{A="data-imageurl-shape-"+B}return A}};jQuery.ui||(function(G){var A=G.fn.remove,F=G.browser.mozilla&&(parseFloat(G.browser.version)<1.9);G.ui={version:"1.7.2",plugin:{add:function(L,K,N){var J=G.ui[L].prototype;for(var M in N){J.plugins[M]=J.plugins[M]||[];J.plugins[M].push([K,N[M]])}},call:function(M,K,L){var N=M.plugins[K];if(!N||!M.element[0].parentNode){return }for(var J=0;J<N.length;J++){if(M.options[N[J][0]]){N[J][1].apply(M.element,L)}}}},contains:function(J,K){return document.compareDocumentPosition?J.compareDocumentPosition(K)&16:J!==K&&J.contains(K)},hasScroll:function(J,L){if(G(J).css("overflow")=="hidden"){return false}var M=(L&&L=="left")?"scrollLeft":"scrollTop",K=false;if(J[M]>0){return true}J[M]=1;K=(J[M]>0);J[M]=0;return K},isOverAxis:function(K,L,J){return(K>L)&&(K<(L+J))},isOver:function(N,L,O,J,M,K){return G.ui.isOverAxis(N,O,M)&&G.ui.isOverAxis(L,J,K)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(F){var D=G.attr,E=G.fn.removeAttr,B="http://www.w3.org/2005/07/aaa",I=/^aria-/,H=/^wairole:/;G.attr=function(L,M,K){var J=K!==undefined;return(M=="role"?(J?D.call(this,L,M,"wairole:"+K):(D.apply(this,arguments)||"").replace(H,"")):(I.test(M)?(J?L.setAttributeNS(B,M.replace(I,"aaa:"),K):D.call(this,L,M.replace(I,"aaa:"))):D.apply(this,arguments)))};G.fn.removeAttr=function(J){return(I.test(J)?this.each(function(){this.removeAttributeNS(B,J.replace(I,""))}):E.call(this,J))}}G.fn.extend({remove:function(){G("*",this).add(this).each(function(){G(this).triggerHandler("remove")});return A.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var J;if((G.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(G.curCSS(this,"position",1))&&(/(auto|scroll)/).test(G.curCSS(this,"overflow",1)+G.curCSS(this,"overflow-y",1)+G.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(G.curCSS(this,"overflow",1)+G.curCSS(this,"overflow-y",1)+G.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?G(document):J}});G.extend(G.expr[":"],{data:function(J,K,L){return !!G.data(J,L[3])},focusable:function(K){var J=K.nodeName.toLowerCase(),L=G.attr(K,"tabindex");return(/input|select|textarea|button|object/.test(J)?!K.disabled:"a"==J||"area"==J?K.href||!isNaN(L):!isNaN(L))&&!G(K)["area"==J?"parents":"closest"](":hidden").length},tabbable:function(J){var K=G.attr(J,"tabindex");return(isNaN(K)||K>=0)&&G(J).is(":focusable")}});function C(J,O,N,K){function L(P){var Q=G[J][O][P]||[];return(typeof Q=="string"?Q.split(/,?\s+/):Q)}var M=L("getter");if(K.length==1&&typeof K[0]=="string"){M=M.concat(L("getterSetter"))}return(G.inArray(N,M)!=-1)}G.widget=function(K,L){var J=K.split(".")[0];K=K.split(".")[1];G.fn[K]=function(N){var P=(typeof N=="string"),O=Array.prototype.slice.call(arguments,1);if(P&&N.substring(0,1)=="_"){return this}if(P&&C(J,K,N,O)){var M=G.data(this[0],K);return(M?M[N].apply(M,O):undefined)}return this.each(function(){var Q=G.data(this,K);(!Q&&!P&&G.data(this,K,new G[J][K](this,N))._init());(Q&&P&&G.isFunction(Q[N])&&Q[N].apply(Q,O))})};G[J]=G[J]||{};G[J][K]=function(N,O){var M=this;this.namespace=J;this.widgetName=K;this.widgetEventPrefix=G[J][K].eventPrefix||K;this.widgetBaseClass=J+"-"+K;this.options=G.extend({},G.widget.defaults,G[J][K].defaults,G.metadata&&G.metadata.get(N)[K],O);this.element=G(N).bind("setData."+K,function(Q,R,P){if(Q.target==N){return M._setData(R,P)}}).bind("getData."+K,function(P,Q){if(P.target==N){return M._getData(Q)}}).bind("remove",function(){return M.destroy()})};G[J][K].prototype=G.extend({},G.widget.prototype,L);G[J][K].getterSetter="option"};G.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(K,J){var L=K,M=this;if(typeof K=="string"){if(J===undefined){return this._getData(K)}L={};L[K]=J}G.each(L,function(O,N){M._setData(O,N)})},_getData:function(J){return this.options[J]},_setData:function(K,J){this.options[K]=J;if(K=="disabled"){this.element[J?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",J)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(K,J,P){var N=this.options[K],M=(K==this.widgetEventPrefix?K:this.widgetEventPrefix+K);J=G.Event(J);J.type=M;if(J.originalEvent){for(var L=G.event.props.length,O;L;){O=G.event.props[--L];J[O]=J.originalEvent[O]}}this.element.trigger(J,P);return !(G.isFunction(N)&&N.call(this.element[0],J,P)===false||J.isDefaultPrevented())}};G.widget.defaults={disabled:false};G.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;K.stopImmediatePropagation();return false}});if(G.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(G.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(K){K.originalEvent=K.originalEvent||{};if(K.originalEvent.mouseHandled){return }(this._mouseStarted&&this._mouseUp(K));this._mouseDownEvent=K;var L=this,J=(K.which==1),M=(typeof this.options.cancel=="string"?G(K.target).parents().add(K.target).filter(this.options.cancel).length:false);if(!J||M||!this._mouseCapture(K)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){L.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(K)&&this._mouseDelayMet(K)){this._mouseStarted=(this._mouseStart(K)!==false);if(!this._mouseStarted){K.preventDefault();return true}}this._mouseMoveDelegate=function(N){return L._mouseMove(N)};this._mouseUpDelegate=function(N){return L._mouseUp(N)};G(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(G.browser.safari||K.preventDefault());K.originalEvent.mouseHandled=true;return true},_mouseMove:function(J){if(G.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){G(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(J.target==this._mouseDownEvent.target);this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};G.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(B);this.originalPageX=B.pageX;this.originalPageY=B.pageY;if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}if(C.containment){this._setContainment()}this._trigger("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,C){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!C){var D=this._uiHash();this._trigger("drag",B,D);this.position=D.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(D){var C=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){C=A.ui.ddmanager.drop(this,D)}if(this.dropped){C=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!C)||(this.options.revert=="valid"&&C)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,C))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._trigger("stop",D);B._clear()})}else{this._trigger("stop",D);this._clear()}return false},_getHandle:function(B){var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==B.target){C=true}});return C},_createHelper:function(D){var C=this.options;var B=A.isFunction(C.helper)?A(C.helper.apply(this.element[0],[D])):(C.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((C.appendTo=="parent"?this.element[0].parentNode:C.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var C=this.options;if(C.containment=="parent"){C.containment=this.helper[0].parentNode}if(C.containment=="document"||C.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(C.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(C.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(C.containment)&&C.containment.constructor!=Array){var E=A(C.containment)[0];if(!E){return }var D=A(C.containment).offset();var B=(A(E).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(E).css("borderLeftWidth"),10)||0)+(parseInt(A(E).css("paddingLeft"),10)||0)-this.margins.left,D.top+(parseInt(A(E).css("borderTopWidth"),10)||0)+(parseInt(A(E).css("paddingTop"),10)||0)-this.margins.top,D.left+(B?Math.max(E.scrollWidth,E.offsetWidth):E.offsetWidth)-(parseInt(A(E).css("borderLeftWidth"),10)||0)-(parseInt(A(E).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(E.scrollHeight,E.offsetHeight):E.offsetHeight)-(parseInt(A(E).css("borderTopWidth"),10)||0)-(parseInt(A(E).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(C.containment.constructor==Array){this.containment=C.containment}}},_convertPositionTo:function(E,C){if(!C){C=this.position}var G=E=="absolute"?1:-1;var F=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,D=(/(html|body)/i).test(B[0].tagName);return{top:(C.top+this.offset.relative.top*G+this.offset.parent.top*G-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(D?0:B.scrollTop()))*G)),left:(C.left+this.offset.relative.left*G+this.offset.parent.left*G-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():D?0:B.scrollLeft())*G))}},_generatePosition:function(G){var D=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,C=(/(html|body)/i).test(B[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var H=G.pageX;var I=G.pageY;if(this.originalPosition){if(this.containment){if(G.pageX-this.offset.click.left<this.containment[0]){H=this.containment[0]+this.offset.click.left}if(G.pageY-this.offset.click.top<this.containment[1]){I=this.containment[1]+this.offset.click.top}if(G.pageX-this.offset.click.left>this.containment[2]){H=this.containment[2]+this.offset.click.left}if(G.pageY-this.offset.click.top>this.containment[3]){I=this.containment[3]+this.offset.click.top}}if(D.grid){var E=this.originalPageY+Math.round((I-this.originalPageY)/D.grid[1])*D.grid[1];I=this.containment?(!(E-this.offset.click.top<this.containment[1]||E-this.offset.click.top>this.containment[3])?E:(!(E-this.offset.click.top<this.containment[1])?E-D.grid[1]:E+D.grid[1])):E;var F=this.originalPageX+Math.round((H-this.originalPageX)/D.grid[0])*D.grid[0];H=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-D.grid[0]:F+D.grid[0])):F}}return{top:(I-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(C?0:B.scrollTop())))),left:(H-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():C?0:B.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(B,D,C){C=C||this._uiHash();A.ui.plugin.call(this,B,[D,C]);if(B=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return A.widget.prototype._trigger.call(this,B,D,C)},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));A.extend(A.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});A.ui.plugin.add("draggable","connectToSortable",{start:function(F,D){var E=A(this).data("draggable"),C=E.options,B=A.extend({},D,{item:E.element});E.sortables=[];A(C.connectToSortable).each(function(){var G=A.data(this,"sortable");if(G&&!G.options.disabled){E.sortables.push({instance:G,shouldRevert:G.options.revert});G._refreshItems();G._trigger("activate",F,B)}})},stop:function(E,C){var D=A(this).data("draggable"),B=A.extend({},C,{item:D.element});A.each(D.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;D.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(E);this.instance.options.helper=this.instance.options._helper;if(D.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",E,B)}})},drag:function(F,C){var D=A(this).data("draggable"),B=this;var E=function(M){var H=this.offset.click.top,I=this.offset.click.left;var O=this.positionAbs.top,K=this.positionAbs.left;var L=M.height,J=M.width;var G=M.top,N=M.left;return A.ui.isOver(O+H,K+I,G,N,L,J)};A.each(D.sortables,function(G){this.instance.positionAbs=D.positionAbs;this.instance.helperProportions=D.helperProportions;this.instance.offset.click=D.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return C.helper[0]};F.target=this.instance.currentItem[0];this.instance._mouseCapture(F,true);this.instance._mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D._trigger("toSortable",F);D.dropped=this.instance.element;D.currentItem=D.element;this.instance.fromOutside=D}if(this.instance.currentItem){this.instance._mouseDrag(F)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",F,this.instance._uiHash(this.instance));this.instance._mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}D._trigger("fromSortable",F);D.dropped=false}}})}});A.ui.plugin.add("draggable","cursor",{start:function(E,D){var B=A("body"),C=A(this).data("draggable").options;if(B.css("cursor")){C._cursor=B.css("cursor")}B.css("cursor",C.cursor)},stop:function(B,D){var C=A(this).data("draggable").options;if(C._cursor){A("body").css("cursor",C._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,D){var C=A(this).data("draggable").options;A(C.iframeFix===true?"iframe":C.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(E,D){var B=A(D.helper),C=A(this).data("draggable").options;if(B.css("opacity")){C._opacity=B.css("opacity")}B.css("opacity",C.opacity)},stop:function(B,D){var C=A(this).data("draggable").options;if(C._opacity){A(D.helper).css("opacity",C._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(E,D){var F=A(this).data("draggable"),C=F.options,B=false;if(F.scrollParent[0]!=document&&F.scrollParent[0].tagName!="HTML"){if(!C.axis||C.axis!="x"){if((F.overflowOffset.top+F.scrollParent[0].offsetHeight)-E.pageY<C.scrollSensitivity){F.scrollParent[0].scrollTop=B=F.scrollParent[0].scrollTop+C.scrollSpeed}else{if(E.pageY-F.overflowOffset.top<C.scrollSensitivity){F.scrollParent[0].scrollTop=B=F.scrollParent[0].scrollTop-C.scrollSpeed}}}if(!C.axis||C.axis!="y"){if((F.overflowOffset.left+F.scrollParent[0].offsetWidth)-E.pageX<C.scrollSensitivity){F.scrollParent[0].scrollLeft=B=F.scrollParent[0].scrollLeft+C.scrollSpeed}else{if(E.pageX-F.overflowOffset.left<C.scrollSensitivity){F.scrollParent[0].scrollLeft=B=F.scrollParent[0].scrollLeft-C.scrollSpeed}}}}else{if(!C.axis||C.axis!="x"){if(E.pageY-A(document).scrollTop()<C.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-C.scrollSpeed)}else{if(A(window).height()-(E.pageY-A(document).scrollTop())<C.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+C.scrollSpeed)}}}if(!C.axis||C.axis!="y"){if(E.pageX-A(document).scrollLeft()<C.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-C.scrollSpeed)}else{if(A(window).width()-(E.pageX-A(document).scrollLeft())<C.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+C.scrollSpeed)}}}}if(B!==false&&A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(F,E)}}});A.ui.plugin.add("draggable","snap",{start:function(E,D){var B=A(this).data("draggable"),C=B.options;B.snapElements=[];A(C.snap.constructor!=String?(C.snap.items||":data(draggable)"):C.snap).each(function(){var F=A(this);var G=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:G.top,left:G.left})}})},drag:function(G,K){var Q=A(this).data("draggable"),I=Q.options;var C=I.snapTolerance;var D=K.offset.left,E=D+Q.helperProportions.width,R=K.offset.top,S=R+Q.helperProportions.height;for(var F=Q.snapElements.length-1;F>=0;F--){var H=Q.snapElements[F].left,L=H+Q.snapElements[F].width,M=Q.snapElements[F].top,J=M+Q.snapElements[F].height;if(!((H-C<D&&D<L+C&&M-C<R&&R<J+C)||(H-C<D&&D<L+C&&M-C<S&&S<J+C)||(H-C<E&&E<L+C&&M-C<R&&R<J+C)||(H-C<E&&E<L+C&&M-C<S&&S<J+C))){if(Q.snapElements[F].snapping){(Q.options.snap.release&&Q.options.snap.release.call(Q.element,G,A.extend(Q._uiHash(),{snapItem:Q.snapElements[F].item})))}Q.snapElements[F].snapping=false;continue}if(I.snapMode!="inner"){var T=Math.abs(M-S)<=C;var B=Math.abs(J-R)<=C;var O=Math.abs(H-E)<=C;var N=Math.abs(L-D)<=C;if(T){K.position.top=Q._convertPositionTo("relative",{top:M-Q.helperProportions.height,left:0}).top-Q.margins.top}if(B){K.position.top=Q._convertPositionTo("relative",{top:J,left:0}).top-Q.margins.top}if(O){K.position.left=Q._convertPositionTo("relative",{top:0,left:H-Q.helperProportions.width}).left-Q.margins.left}if(N){K.position.left=Q._convertPositionTo("relative",{top:0,left:L}).left-Q.margins.left}}var P=(T||B||O||N);if(I.snapMode!="outer"){var T=Math.abs(M-R)<=C;var B=Math.abs(J-S)<=C;var O=Math.abs(H-D)<=C;var N=Math.abs(L-E)<=C;if(T){K.position.top=Q._convertPositionTo("relative",{top:M,left:0}).top-Q.margins.top}if(B){K.position.top=Q._convertPositionTo("relative",{top:J-Q.helperProportions.height,left:0}).top-Q.margins.top}if(O){K.position.left=Q._convertPositionTo("relative",{top:0,left:H}).left-Q.margins.left}if(N){K.position.left=Q._convertPositionTo("relative",{top:0,left:L-Q.helperProportions.width}).left-Q.margins.left}}if(!Q.snapElements[F].snapping&&(T||B||O||N||P)){(Q.options.snap.snap&&Q.options.snap.snap.call(Q.element,G,A.extend(Q._uiHash(),{snapItem:Q.snapElements[F].item})))}Q.snapElements[F].snapping=(T||B||O||N||P)}}});A.ui.plugin.add("draggable","stack",{start:function(B,E){var C=A(this).data("draggable").options;var D=A.makeArray(A(C.stack.group)).sort(function(F,G){return(parseInt(A(F).css("zIndex"),10)||C.stack.min)-(parseInt(A(G).css("zIndex"),10)||C.stack.min)});A(D).each(function(F){this.style.zIndex=C.stack.min+F});this[0].style.zIndex=C.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(E,D){var B=A(D.helper),C=A(this).data("draggable").options;if(B.css("zIndex")){C._zIndex=B.css("zIndex")}B.css("zIndex",C.zIndex)},stop:function(B,D){var C=A(this).data("draggable").options;if(C._zIndex){A(D.helper).css("zIndex",C._zIndex)}}})})(jQuery);(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(C)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(C){var B=A.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(B&&this._trigger("activate",C,this.ui(B)))},_deactivate:function(C){var B=A.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(B&&this._trigger("deactivate",C,this.ui(B)))},_over:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",C,this.ui(B))}},_out:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",C,this.ui(B))}},_drop:function(E,D){var B=D||A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return false}var C=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(B,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){C=true;return false}});if(C){return false}if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",E,this.ui(B));return this.element}return false},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,offset:B.positionAbs}}});A.extend(A.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(B,H,D){if(!H.offset){return false}var M=(B.positionAbs||B.position.absolute).left,N=M+B.helperProportions.width,E=(B.positionAbs||B.position.absolute).top,F=E+B.helperProportions.height;var K=H.offset.left,O=K+H.proportions.width,C=H.offset.top,G=C+H.proportions.height;switch(D){case"fit":return(K<M&&N<O&&C<E&&F<G);break;case"intersect":return(K<M+(B.helperProportions.width/2)&&N-(B.helperProportions.width/2)<O&&C<E+(B.helperProportions.height/2)&&F-(B.helperProportions.height/2)<G);break;case"pointer":var J=((B.positionAbs||B.position.absolute).left+(B.clickOffset||B.offset.click).left),I=((B.positionAbs||B.position.absolute).top+(B.clickOffset||B.offset.click).top),L=A.ui.isOver(I,J,C,K,H.proportions.height,H.proportions.width);return L;break;case"touch":return((E>=C&&E<=G)||(F>=C&&F<=G)||(E<C&&F>G))&&((M>=K&&M<=O)||(N>=K&&N<=O)||(M<K&&N>O));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(F,D){var B=A.ui.ddmanager.droppables[F.options.scope];var E=D?D.type:null;var C=(F.currentItem||F.element).find(":data(droppable)").andSelf();droppablesLoop:for(var G=0;G<B.length;G++){if(B[G].options.disabled||(F&&!B[G].options.accept.call(B[G].element[0],(F.currentItem||F.element)))){continue}for(var H=0;H<C.length;H++){if(C[H]==B[G].element[0]){B[G].proportions.height=0;continue droppablesLoop}}B[G].visible=B[G].element.css("display")!="none";if(!B[G].visible){continue}B[G].offset=B[G].element.offset();B[G].proportions={width:B[G].element[0].offsetWidth,height:B[G].element[0].offsetHeight};if(E=="mousedown"){B[G]._activate.call(B[G],D)}}},drop:function(B,D){var C=false;A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(B,this,this.options.tolerance)){C=this._drop.call(this,D)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(B.currentItem||B.element))){this.isout=1;this.isover=0;this._deactivate.call(this,D)}});return C},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets(B,C)}A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var F=A.ui.intersect(B,this,this.options.tolerance);var D=!F&&this.isover==1?"isout":(F&&this.isover==0?"isover":null);if(!D){return }var E;if(this.options.greedy){var G=this.element.parents(":data(droppable):eq(0)");if(G.length){E=A.data(G[0],"droppable");E.greedyChild=(D=="isover"?1:0)}}if(E&&D=="isover"){E.isover=0;E.isout=1;E._out.call(E,C)}this[D]=1;this[D=="isout"?"isover":"isout"]=0;this[D=="isover"?"_over":"_out"].call(this,C);if(E&&D=="isout"){E.isout=0;E.isover=1;E._over.call(E,C)}})}}})(jQuery);(function(C){C.widget("ui.resizable",C.extend({},C.ui.mouse,{_init:function(){var I=this,E=this.options;this.element.addClass("ui-resizable");C.extend(this,{_aspectRatio:!!(E.aspectRatio),aspectRatio:E.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:E.helper||E.ghost||E.animate?E.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&C.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(C('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=E.handles||(!C(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var D=this.handles.split(",");this.handles={};for(var H=0;H<D.length;H++){var F=C.trim(D[H]),J="ui-resizable-"+F;var G=C('<div class="ui-resizable-handle '+J+'"></div>');if(/sw|se|ne|nw/.test(F)){G.css({zIndex:++E.zIndex})}if("se"==F){G.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[F]=".ui-resizable-"+F;this.element.append(G)}}this._renderAxis=function(M){M=M||this.element;for(var K in this.handles){if(this.handles[K].constructor==String){this.handles[K]=C(this.handles[K],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var O=C(this.handles[K],this.element),N=0;N=/sw|ne|nw|se|n|s/.test(K)?O.outerHeight():O.outerWidth();var L=["padding",/ne|nw|n/.test(K)?"Top":/se|sw|s/.test(K)?"Bottom":/^e$/.test(K)?"Right":"Left"].join("");M.css(L,N);this._proportionallyResize()}if(!C(this.handles[K]).length){continue}}};this._renderAxis(this.element);this._handles=C(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!I.resizing){if(this.className){var K=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}I.axis=K&&K[1]?K[1]:"se"}});if(E.autoHide){this._handles.hide();C(this.element).addClass("ui-resizable-autohide").hover(function(){C(this).removeClass("ui-resizable-autohide");I._handles.show()},function(){if(!I.resizing){C(this).addClass("ui-resizable-autohide");I._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var E=function(F){C(F).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){E(this.element);var D=this.element;D.parent().append(this.originalElement.css({position:D.css("position"),width:D.outerWidth(),height:D.outerHeight(),top:D.css("top"),left:D.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);E(this.originalElement)},_mouseCapture:function(E){var D=false;for(var F in this.handles){if(C(this.handles[F])[0]==E.target){D=true}}return this.options.disabled||!!D},_mouseStart:function(H){var E=this.options,I=this.element.position(),J=this.element;this.resizing=true;this.documentScroll={top:C(document).scrollTop(),left:C(document).scrollLeft()};if(J.is(".ui-draggable")||(/absolute/).test(J.css("position"))){J.css({position:"absolute",top:I.top,left:I.left})}if(C.browser.opera&&(/relative/).test(J.css("position"))){J.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var D=A(this.helper.css("left")),G=A(this.helper.css("top"));if(E.containment){D+=C(E.containment).scrollLeft()||0;G+=C(E.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:D,top:G};this.size=this._helper?{width:J.outerWidth(),height:J.outerHeight()}:{width:J.width(),height:J.height()};this.originalSize=this._helper?{width:J.outerWidth(),height:J.outerHeight()}:{width:J.width(),height:J.height()};this.originalPosition={left:D,top:G};this.sizeDiff={width:J.outerWidth()-J.width(),height:J.outerHeight()-J.height()};this.originalMousePosition={left:H.pageX,top:H.pageY};this.aspectRatio=(typeof E.aspectRatio=="number")?E.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var F=C(".ui-resizable-"+this.axis).css("cursor");C("body").css("cursor",F=="auto"?this.axis+"-resize":F);J.addClass("ui-resizable-resizing");this._propagate("start",H);return true},_mouseDrag:function(P){var M=this.helper,N=this.options,H={},E=this,K=this.originalMousePosition,G=this.axis;var D=(P.pageX-K.left)||0,F=(P.pageY-K.top)||0;var L=this._change[G];if(!L){return false}var I=L.apply(this,[P,D,F]),J=C.browser.msie&&C.browser.version<7,O=this.sizeDiff;if(this._aspectRatio||P.shiftKey){I=this._updateRatio(I,P)}I=this._respectSize(I,P);this._propagate("resize",P);M.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(I);this._trigger("resize",P,this.ui());return false},_mouseStop:function(J){this.resizing=false;var I=this.options,E=this;if(this._helper){var K=this._proportionallyResizeElements,M=K.length&&(/textarea/i).test(K[0].nodeName),L=M&&C.ui.hasScroll(K[0],"left")?0:E.sizeDiff.height,G=M?0:E.sizeDiff.width;var D={width:(E.size.width-G),height:(E.size.height-L)},H=(parseInt(E.element.css("left"),10)+(E.position.left-E.originalPosition.left))||null,F=(parseInt(E.element.css("top"),10)+(E.position.top-E.originalPosition.top))||null;if(!I.animate){this.element.css(C.extend(D,{top:F,left:H}))}E.helper.height(E.size.height);E.helper.width(E.size.width);if(this._helper&&!I.animate){this._proportionallyResize()}}C("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",J);if(this._helper){this.helper.remove()}return false},_updateCache:function(E){var D=this.options;this.offset=this.helper.offset();if(B(E.left)){this.position.left=E.left}if(B(E.top)){this.position.top=E.top}if(B(E.height)){this.size.height=E.height}if(B(E.width)){this.size.width=E.width}},_updateRatio:function(F,G){var E=this.options,D=this.position,H=this.size,I=this.axis;if(F.height){F.width=(H.height*this.aspectRatio)}else{if(F.width){F.height=(H.width/this.aspectRatio)}}if(I=="sw"){F.left=D.left+(H.width-F.width);F.top=null}if(I=="nw"){F.top=D.top+(H.height-F.height);F.left=D.left+(H.width-F.width)}return F},_respectSize:function(J,O){var L=this.helper,M=this.options,E=this._aspectRatio||O.shiftKey,F=this.axis,R=B(J.width)&&M.maxWidth&&(M.maxWidth<J.width),I=B(J.height)&&M.maxHeight&&(M.maxHeight<J.height),N=B(J.width)&&M.minWidth&&(M.minWidth>J.width),D=B(J.height)&&M.minHeight&&(M.minHeight>J.height);if(N){J.width=M.minWidth}if(D){J.height=M.minHeight}if(R){J.width=M.maxWidth}if(I){J.height=M.maxHeight}var P=this.originalPosition.left+this.originalSize.width,G=this.position.top+this.size.height;var K=/sw|nw|w/.test(F),Q=/nw|ne|n/.test(F);if(N&&K){J.left=P-M.minWidth}if(R&&K){J.left=P-M.maxWidth}if(D&&Q){J.top=G-M.minHeight}if(I&&Q){J.top=G-M.maxHeight}var H=!J.width&&!J.height;if(H&&!J.left&&J.top){J.top=null}else{if(H&&!J.top&&J.left){J.left=null}}return J},_proportionallyResize:function(){var D=this.options;if(!this._proportionallyResizeElements.length){return }var G=this.helper||this.element;for(var H=0;H<this._proportionallyResizeElements.length;H++){var F=this._proportionallyResizeElements[H];if(!this.borderDif){var I=[F.css("borderTopWidth"),F.css("borderRightWidth"),F.css("borderBottomWidth"),F.css("borderLeftWidth")],E=[F.css("paddingTop"),F.css("paddingRight"),F.css("paddingBottom"),F.css("paddingLeft")];this.borderDif=C.map(I,function(L,J){var K=parseInt(L,10)||0,M=parseInt(E[J],10)||0;return K+M})}if(C.browser.msie&&!(!(C(G).is(":hidden")||C(G).parents(":hidden").length))){continue}F.css({height:(G.height()-this.borderDif[0]-this.borderDif[2])||0,width:(G.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var G=this.element,D=this.options;this.elementOffset=G.offset();if(this._helper){this.helper=this.helper||C('<div style="overflow:hidden;"></div>');var H=C.browser.msie&&C.browser.version<7,F=(H?1:0),E=(H?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+E,height:this.element.outerHeight()+E,position:"absolute",left:this.elementOffset.left-F+"px",top:this.elementOffset.top-F+"px",zIndex:++D.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(D,E,F){return{width:this.originalSize.width+E}},w:function(F,H,I){var D=this.options,G=this.originalSize,E=this.originalPosition;return{left:E.left+H,width:G.width-H}},n:function(F,H,I){var D=this.options,G=this.originalSize,E=this.originalPosition;return{top:E.top+I,height:G.height-I}},s:function(D,E,F){return{height:this.originalSize.height+F}},se:function(D,E,F){return C.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[D,E,F]))},sw:function(D,E,F){return C.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[D,E,F]))},ne:function(D,E,F){return C.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[D,E,F]))},nw:function(D,E,F){return C.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[D,E,F]))}},_propagate:function(D,E){C.ui.plugin.call(this,D,[E,this.ui()]);(D!="resize"&&this._trigger(D,E,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));C.extend(C.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});C.ui.plugin.add("resizable","alsoResize",{start:function(F,E){var G=C(this).data("resizable"),D=G.options;_store=function(H){C(H).each(function(){C(this).data("resizable-alsoresize",{width:parseInt(C(this).width(),10),height:parseInt(C(this).height(),10),left:parseInt(C(this).css("left"),10),top:parseInt(C(this).css("top"),10)})})};if(typeof (D.alsoResize)=="object"&&!D.alsoResize.parentNode){if(D.alsoResize.length){D.alsoResize=D.alsoResize[0];_store(D.alsoResize)}else{C.each(D.alsoResize,function(I,H){_store(I)})}}else{_store(D.alsoResize)}},resize:function(I,G){var J=C(this).data("resizable"),F=J.options,H=J.originalSize,D=J.originalPosition;var E={height:(J.size.height-H.height)||0,width:(J.size.width-H.width)||0,top:(J.position.top-D.top)||0,left:(J.position.left-D.left)||0},K=function(M,L){C(M).each(function(){var O=C(this),N=C(this).data("resizable-alsoresize"),P={},Q=L&&L.length?L:["width","height","top","left"];C.each(Q||["width","height","top","left"],function(T,R){var S=(N[R]||0)+(E[R]||0);if(S&&S>=0){P[R]=S||null}});if(/relative/.test(O.css("position"))&&C.browser.opera){J._revertToRelativePosition=true;O.css({position:"absolute",top:"auto",left:"auto"})}O.css(P)})};if(typeof (F.alsoResize)=="object"&&!F.alsoResize.nodeType){C.each(F.alsoResize,function(M,L){K(M,L)})}else{K(F.alsoResize)}},stop:function(E,D){var F=C(this).data("resizable");if(F._revertToRelativePosition&&C.browser.opera){F._revertToRelativePosition=false;el.css({position:"relative"})}C(this).removeData("resizable-alsoresize-start")}});C.ui.plugin.add("resizable","animate",{stop:function(J,E){var D=C(this).data("resizable"),I=D.options;var K=D._proportionallyResizeElements,N=K.length&&(/textarea/i).test(K[0].nodeName),M=N&&C.ui.hasScroll(K[0],"left")?0:D.sizeDiff.height,G=N?0:D.sizeDiff.width;var L={width:(D.size.width-G),height:(D.size.height-M)},H=(parseInt(D.element.css("left"),10)+(D.position.left-D.originalPosition.left))||null,F=(parseInt(D.element.css("top"),10)+(D.position.top-D.originalPosition.top))||null;D.element.animate(C.extend(L,F&&H?{top:F,left:H}:{}),{duration:I.animateDuration,easing:I.animateEasing,step:function(){var O={width:parseInt(D.element.css("width"),10),height:parseInt(D.element.css("height"),10),top:parseInt(D.element.css("top"),10),left:parseInt(D.element.css("left"),10)};if(K&&K.length){C(K[0]).css({width:O.width,height:O.height})}D._updateCache(O);D._propagate("resize",J)}})}});C.ui.plugin.add("resizable","containment",{start:function(O,E){var Q=C(this).data("resizable"),K=Q.options,I=Q.element;var N=K.containment,J=(N instanceof C)?N.get(0):(/parent/.test(N))?I.parent().get(0):N;if(!J){return }Q.containerElement=C(J);if(/document/.test(N)||N==document){Q.containerOffset={left:0,top:0};Q.containerPosition={left:0,top:0};Q.parentData={element:C(document),left:0,top:0,width:C(document).width(),height:C(document).height()||document.body.parentNode.scrollHeight}}else{var G=C(J),L=[];C(["Top","Right","Left","Bottom"]).each(function(R,S){L[R]=A(G.css("padding"+S))});Q.containerOffset=G.offset();Q.containerPosition=G.position();Q.containerSize={height:(G.innerHeight()-L[3]),width:(G.innerWidth()-L[1])};var F=Q.containerOffset,P=Q.containerSize.height,H=Q.containerSize.width,M=(C.ui.hasScroll(J,"left")?J.scrollWidth:H),D=(C.ui.hasScroll(J)?J.scrollHeight:P);Q.parentData={element:J,left:F.left,top:F.top,width:M,height:D}}},resize:function(O,F){var R=C(this).data("resizable"),M=R.options,P=R.containerSize,G=R.containerOffset,I=R.size,H=R.position,E=R._aspectRatio||O.shiftKey,Q={top:0,left:0},N=R.containerElement;if(N[0]!=document&&(/static/).test(N.css("position"))){Q=G}if(H.left<(R._helper?G.left:0)){R.size.width=R.size.width+(R._helper?(R.position.left-G.left):(R.position.left-Q.left));if(E){R.size.height=R.size.width/M.aspectRatio}R.position.left=M.helper?G.left:0}if(H.top<(R._helper?G.top:0)){R.size.height=R.size.height+(R._helper?(R.position.top-G.top):R.position.top);if(E){R.size.width=R.size.height*M.aspectRatio}R.position.top=R._helper?G.top:0}R.offset.left=R.parentData.left+R.position.left;R.offset.top=R.parentData.top+R.position.top;var J=Math.abs((R._helper?R.offset.left-Q.left:(R.offset.left-Q.left))+R.sizeDiff.width),D=Math.abs((R._helper?R.offset.top-Q.top:(R.offset.top-G.top))+R.sizeDiff.height);var K=R.containerElement.get(0)==R.element.parent().get(0),L=/relative|absolute/.test(R.containerElement.css("position"));if(K&&L){J-=R.parentData.left}if(J+R.size.width>=R.parentData.width){R.size.width=R.parentData.width-J;if(E){R.size.height=R.size.width/R.aspectRatio}}if(D+R.size.height>=R.parentData.height){R.size.height=R.parentData.height-D;if(E){R.size.width=R.size.height*R.aspectRatio}}},stop:function(N,G){var E=C(this).data("resizable"),M=E.options,I=E.position,H=E.containerOffset,O=E.containerPosition,L=E.containerElement;var K=C(E.helper),D=K.offset(),F=K.outerWidth()-E.sizeDiff.width,J=K.outerHeight()-E.sizeDiff.height;if(E._helper&&!M.animate&&(/relative/).test(L.css("position"))){C(this).css({left:D.left-O.left-H.left,width:F,height:J})}if(E._helper&&!M.animate&&(/static/).test(L.css("position"))){C(this).css({left:D.left-O.left-H.left,width:F,height:J})}}});C.ui.plugin.add("resizable","ghost",{start:function(F,E){var H=C(this).data("resizable"),D=H.options,G=H.size;H.ghost=H.originalElement.clone();H.ghost.css({opacity:0.25,display:"block",position:"relative",height:G.height,width:G.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof D.ghost=="string"?D.ghost:"");H.ghost.appendTo(H.helper)},resize:function(F,E){var G=C(this).data("resizable"),D=G.options;if(G.ghost){G.ghost.css({position:"relative",height:G.size.height,width:G.size.width})}},stop:function(F,E){var G=C(this).data("resizable"),D=G.options;if(G.ghost&&G.helper){G.helper.get(0).removeChild(G.ghost.get(0))}}});C.ui.plugin.add("resizable","grid",{resize:function(N,F){var D=C(this).data("resizable"),K=D.options,H=D.size,J=D.originalSize,I=D.originalPosition,E=D.axis,G=K._aspectRatio||N.shiftKey;K.grid=typeof K.grid=="number"?[K.grid,K.grid]:K.grid;var L=Math.round((H.width-J.width)/(K.grid[0]||1))*(K.grid[0]||1),M=Math.round((H.height-J.height)/(K.grid[1]||1))*(K.grid[1]||1);if(/^(se|s|e)$/.test(E)){D.size.width=J.width+L;D.size.height=J.height+M}else{if(/^(ne)$/.test(E)){D.size.width=J.width+L;D.size.height=J.height+M;D.position.top=I.top-M}else{if(/^(sw)$/.test(E)){D.size.width=J.width+L;D.size.height=J.height+M;D.position.left=I.left-L}else{D.size.width=J.width+L;D.size.height=J.height+M;D.position.top=I.top-M;D.position.left=I.left-L}}}}});var A=function(D){return parseInt(D,10)||0};var B=function(D){return !isNaN(parseInt(D,10))}})(jQuery);(function(A){A.widget("ui.selectable",A.extend({},A.ui.mouse,{_init:function(){var B=this;this.element.addClass("ui-selectable");this.dragged=false;var C;this.refresh=function(){C=A(B.options.filter,B.element[0]);C.each(function(){var E=A(this);var D=E.offset();A.data(this,"selectable-item",{element:this,$element:E,left:D.left,top:D.top,right:D.left+E.outerWidth(),bottom:D.top+E.outerHeight(),startselected:false,selected:E.hasClass("ui-selected"),selecting:E.hasClass("ui-selecting"),unselecting:E.hasClass("ui-unselecting")})})};this.refresh();this.selectees=C.addClass("ui-selectee");this._mouseInit();this.helper=A(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(C){var B=this;this.opos=[C.pageX,C.pageY];if(this.options.disabled){return }var D=this.options;this.selectees=A(D.filter,this.element[0]);this._trigger("start",C);A(D.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:C.clientX,top:C.clientY,width:0,height:0});if(D.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var E=A.data(this,"selectable-item");E.startselected=true;if(!C.metaKey){E.$element.removeClass("ui-selected");E.selected=false;E.$element.addClass("ui-unselecting");E.unselecting=true;B._trigger("unselecting",C,{unselecting:E.element})}});A(C.target).parents().andSelf().each(function(){var E=A.data(this,"selectable-item");if(E){E.$element.removeClass("ui-unselecting").addClass("ui-selecting");E.unselecting=false;E.selecting=true;E.selected=true;B._trigger("selecting",C,{selecting:E.element});return false}})},_mouseDrag:function(C){var I=this;this.dragged=true;if(this.options.disabled){return }var G=this.options;var H=this.opos[0],D=this.opos[1],B=C.pageX,E=C.pageY;if(H>B){var F=B;B=H;H=F}if(D>E){var F=E;E=D;D=F}this.helper.css({left:H,top:D,width:B-H,height:E-D});this.selectees.each(function(){var K=A.data(this,"selectable-item");if(!K||K.element==I.element[0]){return }var J=false;if(G.tolerance=="touch"){J=(!(K.left>B||K.right<H||K.top>E||K.bottom<D))}else{if(G.tolerance=="fit"){J=(K.left>H&&K.right<B&&K.top>D&&K.bottom<E)}}if(J){if(K.selected){K.$element.removeClass("ui-selected");K.selected=false}if(K.unselecting){K.$element.removeClass("ui-unselecting");K.unselecting=false}if(!K.selecting){K.$element.addClass("ui-selecting");K.selecting=true;I._trigger("selecting",C,{selecting:K.element})}}else{if(K.selecting){if(C.metaKey&&K.startselected){K.$element.removeClass("ui-selecting");K.selecting=false;K.$element.addClass("ui-selected");K.selected=true}else{K.$element.removeClass("ui-selecting");K.selecting=false;if(K.startselected){K.$element.addClass("ui-unselecting");K.unselecting=true}I._trigger("unselecting",C,{unselecting:K.element})}}if(K.selected){if(!C.metaKey&&!K.startselected){K.$element.removeClass("ui-selected");K.selected=false;K.$element.addClass("ui-unselecting");K.unselecting=true;I._trigger("unselecting",C,{unselecting:K.element})}}}});return false},_mouseStop:function(C){var B=this;this.dragged=false;var D=this.options;A(".ui-unselecting",this.element[0]).each(function(){var E=A.data(this,"selectable-item");E.$element.removeClass("ui-unselecting");E.unselecting=false;E.startselected=false;B._trigger("unselected",C,{unselected:E.element})});A(".ui-selecting",this.element[0]).each(function(){var E=A.data(this,"selectable-item");E.$element.removeClass("ui-selecting").addClass("ui-selected");E.selecting=false;E.selected=true;E.startselected=true;B._trigger("selected",C,{selected:E.element})});this._trigger("stop",C);this.helper.remove();return false}}));A.extend(A.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);(function(A){A.widget("ui.sortable",A.extend({},A.ui.mouse,{_init:function(){var B=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("sortable-item")}},_mouseCapture:function(E,D){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(E);var F=null,G=this,B=A(E.target).parents().each(function(){if(A.data(this,"sortable-item")==G){F=A(this);return false}});if(A.data(E.target,"sortable-item")==G){F=A(E.target)}if(!F){return false}if(this.options.handle&&!D){var C=false;A(this.options.handle,F).find("*").andSelf().each(function(){if(this==E.target){C=true}});if(!C){return false}}this.currentItem=F;this._removeCurrentsFromItems();return true},_mouseStart:function(E,D,B){var C=this.options,G=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(E);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");A.extend(this.offset,{click:{left:E.pageX-this.offset.left,top:E.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(E);this.originalPageX=E.pageX;this.originalPageY=E.pageY;if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(C.containment){this._setContainment()}if(C.cursor){if(A("body").css("cursor")){this._storedCursor=A("body").css("cursor")}A("body").css("cursor",C.cursor)}if(C.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",C.opacity)}if(C.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",C.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",E,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!B){for(var F=this.containers.length-1;F>=0;F--){this.containers[F]._trigger("activate",E,G._uiHash(this))}}if(A.ui.ddmanager){A.ui.ddmanager.current=this}if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(E);return true},_mouseDrag:function(E){this.position=this._generatePosition(E);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var D=this.options,B=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-E.pageY<D.scrollSensitivity){this.scrollParent[0].scrollTop=B=this.scrollParent[0].scrollTop+D.scrollSpeed}else{if(E.pageY-this.overflowOffset.top<D.scrollSensitivity){this.scrollParent[0].scrollTop=B=this.scrollParent[0].scrollTop-D.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-E.pageX<D.scrollSensitivity){this.scrollParent[0].scrollLeft=B=this.scrollParent[0].scrollLeft+D.scrollSpeed}else{if(E.pageX-this.overflowOffset.left<D.scrollSensitivity){this.scrollParent[0].scrollLeft=B=this.scrollParent[0].scrollLeft-D.scrollSpeed}}}else{if(E.pageY-A(document).scrollTop()<D.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-D.scrollSpeed)}else{if(A(window).height()-(E.pageY-A(document).scrollTop())<D.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+D.scrollSpeed)}}if(E.pageX-A(document).scrollLeft()<D.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-D.scrollSpeed)}else{if(A(window).width()-(E.pageX-A(document).scrollLeft())<D.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+D.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!D.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var G=this.items.length-1;G>=0;G--){var F=this.items[G],H=F.item[0],C=this._intersectsWithPointer(F);if(!C){continue}if(H!=this.currentItem[0]&&this.placeholder[C==1?"next":"prev"]()[0]!=H&&!A.ui.contains(this.placeholder[0],H)&&(this.options.type=="semi-dynamic"?!A.ui.contains(this.element[0],H):true)){this.direction=C==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(F)){this._rearrange(E,F)}else{break}this._trigger("change",E,this._uiHash());break}}this._contactContainers(E);if(A.ui.ddmanager){A.ui.ddmanager.drag(this,E)}this._trigger("sort",E,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(E,D){if(!E){return }if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,E)}if(this.options.revert){var B=this;var C=B.placeholder.offset();B.reverting=true;A(this.helper).animate({left:C.left-this.offset.parent.left-B.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:C.top-this.offset.parent.top-B.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){B._clear(E)})}else{this._clear(E,D)}return false},cancel:function(){var B=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var C=this.containers.length-1;C>=0;C--){this.containers[C]._trigger("deactivate",null,B._uiHash(this));if(this.containers[C].containerCache.over){this.containers[C]._trigger("out",null,B._uiHash(this));this.containers[C].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}A.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){A(this.domPosition.prev).after(this.currentItem)}else{A(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(C){var B=this._getItemsAsjQuery(C&&C.connected);var D=[];C=C||{};A(B).each(function(){var E=(A(C.item||this).attr(C.attribute||"id")||"").match(C.expression||(/(.+)[-=_](.+)/));if(E){D.push((C.key||E[1]+"[]")+"="+(C.key&&C.expression?E[1]:E[2]))}});return D.join("&")},toArray:function(C){var B=this._getItemsAsjQuery(C&&C.connected);var D=[];C=C||{};B.each(function(){D.push(A(C.item||this).attr(C.attribute||"id")||"")});return D},_intersectsWith:function(D){var K=this.positionAbs.left,L=K+this.helperProportions.width,E=this.positionAbs.top,F=E+this.helperProportions.height;var J=D.left,M=J+D.width,C=D.top,G=C+D.height;var B=this.offset.click.top,H=this.offset.click.left;var I=(E+B)>C&&(E+B)<G&&(K+H)>J&&(K+H)<M;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>D[this.floating?"width":"height"])){return I}else{return(J<K+(this.helperProportions.width/2)&&L-(this.helperProportions.width/2)<M&&C<E+(this.helperProportions.height/2)&&F-(this.helperProportions.height/2)<G)}},_intersectsWithPointer:function(F){var E=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,F.top,F.height),G=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,F.left,F.width),C=E&&G,B=this._getDragVerticalDirection(),D=this._getDragHorizontalDirection();if(!C){return false}return this.floating?(((D&&D=="right")||B=="down")?2:1):(B&&(B=="down"?2:1))},_intersectsWithSides:function(D){var F=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,D.top+(D.height/2),D.height),E=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,D.left+(D.width/2),D.width),B=this._getDragVerticalDirection(),C=this._getDragHorizontalDirection();if(this.floating&&C){return((C=="right"&&E)||(C=="left"&&!E))}else{return B&&((B=="down"&&F)||(B=="up"&&!F))}},_getDragVerticalDirection:function(){var B=this.positionAbs.top-this.lastPositionAbs.top;return B!=0&&(B>0?"down":"up")},_getDragHorizontalDirection:function(){var B=this.positionAbs.left-this.lastPositionAbs.left;return B!=0&&(B>0?"right":"left")},refresh:function(B){this._refreshItems(B);this.refreshPositions()},_connectWith:function(){var B=this.options;return B.connectWith.constructor==String?[B.connectWith]:B.connectWith},_getItemsAsjQuery:function(J){var B=this;var E=[];var G=[];var D=this._connectWith();if(D&&J){for(var H=D.length-1;H>=0;H--){var C=A(D[H]);for(var I=C.length-1;I>=0;I--){var F=A.data(C[I],"sortable");if(F&&F!=this&&!F.options.disabled){G.push([A.isFunction(F.options.items)?F.options.items.call(F.element):A(F.options.items,F.element).not(".ui-sortable-helper"),F])}}}}G.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var H=G.length-1;H>=0;H--){G[H][0].each(function(){E.push(this)})}return A(E)},_removeCurrentsFromItems:function(){var C=this.currentItem.find(":data(sortable-item)");for(var D=0;D<this.items.length;D++){for(var B=0;B<C.length;B++){if(C[B]==this.items[D].item[0]){this.items.splice(D,1)}}}},_refreshItems:function(N){this.items=[];this.containers=[this];var H=this.items;var B=this;var J=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],N,{item:this.currentItem}):A(this.options.items,this.element),this]];var F=this._connectWith();if(F){for(var K=F.length-1;K>=0;K--){var E=A(F[K]);for(var L=E.length-1;L>=0;L--){var I=A.data(E[L],"sortable");if(I&&I!=this&&!I.options.disabled){J.push([A.isFunction(I.options.items)?I.options.items.call(I.element[0],N,{item:this.currentItem}):A(I.options.items,I.element),I]);this.containers.push(I)}}}}for(var K=J.length-1;K>=0;K--){var G=J[K][1];var M=J[K][0];for(var L=0,D=M.length;L<D;L++){var C=A(M[L]);C.data("sortable-item",G);H.push({item:C,instance:G,width:0,height:0,left:0,top:0})}}},refreshPositions:function(B){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var E=this.items.length-1;E>=0;E--){var D=this.items[E];if(D.instance!=this.currentContainer&&this.currentContainer&&D.item[0]!=this.currentItem[0]){continue}var F=this.options.toleranceElement?A(this.options.toleranceElement,D.item):D.item;if(!B){D.width=F.outerWidth();D.height=F.outerHeight()}var C=F.offset();D.left=C.left;D.top=C.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var E=this.containers.length-1;E>=0;E--){var C=this.containers[E].element.offset();this.containers[E].containerCache.left=C.left;this.containers[E].containerCache.top=C.top;this.containers[E].containerCache.width=this.containers[E].element.outerWidth();this.containers[E].containerCache.height=this.containers[E].element.outerHeight()}}},_createPlaceholder:function(D){var B=D||this,C=B.options;if(!C.placeholder||C.placeholder.constructor==String){var E=C.placeholder;C.placeholder={element:function(){var F=A(document.createElement(B.currentItem[0].nodeName)).addClass(E||B.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!E){F.style.visibility="hidden"}return F},update:function(G,F){if(E&&!C.forcePlaceholderSize){return }if(!F.height()){F.height(B.currentItem.innerHeight()-parseInt(B.currentItem.css("paddingTop")||0,10)-parseInt(B.currentItem.css("paddingBottom")||0,10))}if(!F.width()){F.width(B.currentItem.innerWidth()-parseInt(B.currentItem.css("paddingLeft")||0,10)-parseInt(B.currentItem.css("paddingRight")||0,10))}}}}B.placeholder=A(C.placeholder.element.call(B.element,B.currentItem));B.currentItem.after(B.placeholder);C.placeholder.update(B,B.placeholder)},_contactContainers:function(G){for(var H=this.containers.length-1;H>=0;H--){if(this._intersectsWith(this.containers[H].containerCache)){if(!this.containers[H].containerCache.over){if(this.currentContainer!=this.containers[H]){var C=10000;var D=null;var F=this.positionAbs[this.containers[H].floating?"left":"top"];for(var B=this.items.length-1;B>=0;B--){if(!A.ui.contains(this.containers[H].element[0],this.items[B].item[0])){continue}var E=this.items[B][this.containers[H].floating?"left":"top"];if(Math.abs(E-F)<C){C=Math.abs(E-F);D=this.items[B]}}if(!D&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[H];D?this._rearrange(G,D,null,true):this._rearrange(G,null,this.containers[H].element,true);this._trigger("change",G,this._uiHash());this.containers[H]._trigger("change",G,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[H]._trigger("over",G,this._uiHash(this));this.containers[H].containerCache.over=1}}else{if(this.containers[H].containerCache.over){this.containers[H]._trigger("out",G,this._uiHash(this));this.containers[H].containerCache.over=0}}}},_createHelper:function(D){var C=this.options;var B=A.isFunction(C.helper)?A(C.helper.apply(this.element[0],[D,this.currentItem])):(C.helper=="clone"?this.currentItem.clone():this.currentItem);if(!B.parents("body").length){A(C.appendTo!="parent"?C.appendTo:this.currentItem[0].parentNode)[0].appendChild(B[0])}if(B[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(B[0].style.width==""||C.forceHelperSize){B.width(this.currentItem.width())}if(B[0].style.height==""||C.forceHelperSize){B.height(this.currentItem.height())}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.currentItem.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var C=this.options;if(C.containment=="parent"){C.containment=this.helper[0].parentNode}if(C.containment=="document"||C.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(C.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(C.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(C.containment)){var E=A(C.containment)[0];var D=A(C.containment).offset();var B=(A(E).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(E).css("borderLeftWidth"),10)||0)+(parseInt(A(E).css("paddingLeft"),10)||0)-this.margins.left,D.top+(parseInt(A(E).css("borderTopWidth"),10)||0)+(parseInt(A(E).css("paddingTop"),10)||0)-this.margins.top,D.left+(B?Math.max(E.scrollWidth,E.offsetWidth):E.offsetWidth)-(parseInt(A(E).css("borderLeftWidth"),10)||0)-(parseInt(A(E).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(E.scrollHeight,E.offsetHeight):E.offsetHeight)-(parseInt(A(E).css("borderTopWidth"),10)||0)-(parseInt(A(E).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,C){if(!C){C=this.position}var G=E=="absolute"?1:-1;var F=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,D=(/(html|body)/i).test(B[0].tagName);return{top:(C.top+this.offset.relative.top*G+this.offset.parent.top*G-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(D?0:B.scrollTop()))*G)),left:(C.left+this.offset.relative.left*G+this.offset.parent.left*G-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():D?0:B.scrollLeft())*G))}},_generatePosition:function(G){var D=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,C=(/(html|body)/i).test(B[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var H=G.pageX;var I=G.pageY;if(this.originalPosition){if(this.containment){if(G.pageX-this.offset.click.left<this.containment[0]){H=this.containment[0]+this.offset.click.left}if(G.pageY-this.offset.click.top<this.containment[1]){I=this.containment[1]+this.offset.click.top}if(G.pageX-this.offset.click.left>this.containment[2]){H=this.containment[2]+this.offset.click.left}if(G.pageY-this.offset.click.top>this.containment[3]){I=this.containment[3]+this.offset.click.top}}if(D.grid){var E=this.originalPageY+Math.round((I-this.originalPageY)/D.grid[1])*D.grid[1];I=this.containment?(!(E-this.offset.click.top<this.containment[1]||E-this.offset.click.top>this.containment[3])?E:(!(E-this.offset.click.top<this.containment[1])?E-D.grid[1]:E+D.grid[1])):E;var F=this.originalPageX+Math.round((H-this.originalPageX)/D.grid[0])*D.grid[0];H=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-D.grid[0]:F+D.grid[0])):F}}return{top:(I-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(C?0:B.scrollTop())))),left:(H-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():C?0:B.scrollLeft())))}},_rearrange:function(C,D,G,E){G?G[0].appendChild(this.placeholder[0]):D.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?D.item[0]:D.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var F=this,B=this.counter;window.setTimeout(function(){if(B==F.counter){F.refreshPositions(!E)}},0)},_clear:function(E,D){this.reverting=false;var C=[],B=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var F in this._storedCSS){if(this._storedCSS[F]=="auto"||this._storedCSS[F]=="static"){this._storedCSS[F]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!D){C.push(function(G){this._trigger("receive",G,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!D){C.push(function(G){this._trigger("update",G,this._uiHash())})}if(!A.ui.contains(this.element[0],this.currentItem[0])){if(!D){C.push(function(G){this._trigger("remove",G,this._uiHash())})}for(var F=this.containers.length-1;F>=0;F--){if(A.ui.contains(this.containers[F].element[0],this.currentItem[0])&&!D){C.push((function(G){return function(H){G._trigger("receive",H,this._uiHash(this))}}).call(this,this.containers[F]));C.push((function(G){return function(H){G._trigger("update",H,this._uiHash(this))}}).call(this,this.containers[F]))}}}for(var F=this.containers.length-1;F>=0;F--){if(!D){C.push((function(G){return function(H){G._trigger("deactivate",H,this._uiHash(this))}}).call(this,this.containers[F]))}if(this.containers[F].containerCache.over){C.push((function(G){return function(H){G._trigger("out",H,this._uiHash(this))}}).call(this,this.containers[F]));this.containers[F].containerCache.over=0}}if(this._storedCursor){A("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!D){this._trigger("beforeStop",E,this._uiHash());for(var F=0;F<C.length;F++){C[F].call(this,E)}this._trigger("stop",E,this._uiHash())}return false}if(!D){this._trigger("beforeStop",E,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!D){for(var F=0;F<C.length;F++){C[F].call(this,E)}this._trigger("stop",E,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(A.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(C){var B=C||this;return{helper:B.helper,placeholder:B.placeholder||A([]),position:B.position,absolutePosition:B.positionAbs,offset:B.positionAbs,item:B.currentItem,sender:C?C.element:null}}}));A.extend(A.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);(function(C){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},B="ui-dialog ui-widget ui-widget-content ui-corner-all ";C.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var E=this,D=this.options,G=D.title||this.originalTitle||"&nbsp;",L=C.ui.dialog.getTitleId(this.element),F=(this.uiDialog=C("<div/>")).appendTo(document.body).hide().addClass(B+D.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:D.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(N){(D.closeOnEscape&&N.keyCode&&N.keyCode==C.ui.keyCode.ESCAPE&&E.close(N))}).attr({role:"dialog","aria-labelledby":L}).mousedown(function(N){E.moveToTop(false,N)}),J=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(F),K=(this.uiDialogTitlebar=C("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(F),H=C('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){H.addClass("ui-state-hover")},function(){H.removeClass("ui-state-hover")}).focus(function(){H.addClass("ui-state-focus")}).blur(function(){H.removeClass("ui-state-focus")}).mousedown(function(N){N.stopPropagation()}).click(function(N){E.close(N);return false}).appendTo(K),I=(this.uiDialogTitlebarCloseText=C("<span/>")).addClass("ui-icon ui-icon-closethick").text(D.closeText).appendTo(H),M=C("<span/>").addClass("ui-dialog-title").attr("id",L).html(G).prependTo(K);K.find("*").add(K).disableSelection();(D.draggable&&C.fn.draggable&&this._makeDraggable());(D.resizable&&C.fn.resizable&&this._makeResizable());this._createButtons(D.buttons);this._isOpen=false;(D.bgiframe&&C.fn.bgiframe&&F.bgiframe());(D.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(D){var F=this;if(false===F._trigger("beforeclose",D)){return }(F.overlay&&F.overlay.destroy());F.uiDialog.unbind("keypress.ui-dialog");(F.options.hide?F.uiDialog.hide(F.options.hide,function(){F._trigger("close",D)}):F.uiDialog.hide()&&F._trigger("close",D));C.ui.dialog.overlay.resize();F._isOpen=false;if(F.options.modal){var E=0;C(".ui-dialog").each(function(){if(this!=F.uiDialog[0]){E=Math.max(E,C(this).css("z-index"))}});C.ui.dialog.maxZ=E}},isOpen:function(){return this._isOpen},moveToTop:function(D,E){if((this.options.modal&&!D)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",E)}if(this.options.zIndex>C.ui.dialog.maxZ){C.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",C.ui.dialog.overlay.maxZ=++C.ui.dialog.maxZ));var F={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++C.ui.dialog.maxZ);this.element.attr(F);this._trigger("focus",E)},open:function(){if(this._isOpen){return }var D=this.options,E=this.uiDialog;this.overlay=D.modal?new C.ui.dialog.overlay(this):null;(E.next().length&&E.appendTo("body"));this._size();this._position(D.position);E.show(D.show);this.moveToTop(true);(D.modal&&E.bind("keypress.ui-dialog",function(G){if(G.keyCode!=C.ui.keyCode.TAB){return }var H=C(":tabbable",this),F=H.filter(":first")[0],I=H.filter(":last")[0];if(G.target==I&&!G.shiftKey){setTimeout(function(){F.focus()},1)}else{if(G.target==F&&G.shiftKey){setTimeout(function(){I.focus()},1)}}}));C([]).add(E.find(".ui-dialog-content :tabbable:first")).add(E.find(".ui-dialog-buttonpane :tabbable:first")).add(E).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(D){var E=this,G=false,F=C("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof D=="object"&&D!==null&&C.each(D,function(){return !(G=true)}));if(G){C.each(D,function(I,H){C('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(I).click(function(){H.apply(E.element[0],arguments)}).hover(function(){C(this).addClass("ui-state-hover")},function(){C(this).removeClass("ui-state-hover")}).focus(function(){C(this).addClass("ui-state-focus")}).blur(function(){C(this).removeClass("ui-state-focus")}).appendTo(F)});F.appendTo(this.uiDialog)}},_makeDraggable:function(){var F=this,D=this.options,E;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){E=D.height;C(this).height(C(this).height()).addClass("ui-dialog-dragging");(D.dragStart&&D.dragStart.apply(F.element[0],arguments))},drag:function(){(D.drag&&D.drag.apply(F.element[0],arguments))},stop:function(){C(this).removeClass("ui-dialog-dragging").height(E);(D.dragStop&&D.dragStop.apply(F.element[0],arguments));C.ui.dialog.overlay.resize()}})},_makeResizable:function(D){D=(D===undefined?this.options.resizable:D);var G=this,E=this.options,F=typeof D=="string"?D:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:E.maxWidth,maxHeight:E.maxHeight,minWidth:E.minWidth,minHeight:E.minHeight,start:function(){C(this).addClass("ui-dialog-resizing");(E.resizeStart&&E.resizeStart.apply(G.element[0],arguments))},resize:function(){(E.resize&&E.resize.apply(G.element[0],arguments))},handles:F,stop:function(){C(this).removeClass("ui-dialog-resizing");E.height=C(this).height();E.width=C(this).width();(E.resizeStop&&E.resizeStop.apply(G.element[0],arguments));C.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(D){var H=C(window),G=C(document),F=G.scrollTop(),I=G.scrollLeft(),E=F;if(C.inArray(D,["center","top","right","bottom","left"])>=0){D=[D=="right"||D=="left"?D:"center",D=="top"||D=="bottom"?D:"middle"]}if(D.constructor!=Array){D=["center","middle"]}if(D[0].constructor==Number){I+=D[0]}else{switch(D[0]){case"left":I+=0;break;case"right":I+=H.width()-this.uiDialog.outerWidth();break;default:case"center":I+=(H.width()-this.uiDialog.outerWidth())/2}}if(D[1].constructor==Number){F+=D[1]}else{switch(D[1]){case"top":F+=0;break;case"bottom":F+=H.height()-this.uiDialog.outerHeight();break;default:case"middle":F+=(H.height()-this.uiDialog.outerHeight())/2}}F=Math.max(F,E);this.uiDialog.css({top:F,left:I})},_setData:function(F,E){(A[F]&&this.uiDialog.data(A[F],E));switch(F){case"buttons":this._createButtons(E);break;case"closeText":this.uiDialogTitlebarCloseText.text(E);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(B+E);break;case"draggable":(E?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(E);break;case"position":this._position(E);break;case"resizable":var G=this.uiDialog,D=this.uiDialog.is(":data(resizable)");(D&&!E&&G.resizable("destroy"));(D&&typeof E=="string"&&G.resizable("option","handles",E));(D||this._makeResizable(E));break;case"title":C(".ui-dialog-title",this.uiDialogTitlebar).html(E||"&nbsp;");break;case"width":this.uiDialog.width(E);break}C.widget.prototype._setData.apply(this,arguments)},_size:function(){var D=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var E=this.uiDialog.css({height:"auto",width:D.width}).height();this.element.css({minHeight:Math.max(D.minHeight-E,0),height:D.height=="auto"?"auto":Math.max(D.height-E,0)})}});C.extend(C.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(D){return"ui-dialog-title-"+(D.attr("id")||++this.uuid)},overlay:function(D){this.$el=C.ui.dialog.overlay.create(D)}});C.extend(C.ui.dialog.overlay,{instances:[],maxZ:0,events:C.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(D){return D+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){if(C.ui.dialog.overlay.instances.length){C(document).bind(C.ui.dialog.overlay.events,function(G){var F=C(G.target).parents(".ui-dialog").css("zIndex")||0;return(F>C.ui.dialog.overlay.maxZ)})}},1);C(document).bind("keydown.dialog-overlay",function(F){(D.options.closeOnEscape&&F.keyCode&&F.keyCode==C.ui.keyCode.ESCAPE&&D.close(F))});C(window).bind("resize.dialog-overlay",C.ui.dialog.overlay.resize)}var E=C("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(D.options.bgiframe&&C.fn.bgiframe&&E.bgiframe());this.instances.push(E);return E},destroy:function(E){this.instances.splice(C.inArray(this.instances,E),1);if(this.instances.length===0){C([document,window]).unbind(".dialog-overlay")}E.remove();var D=0;C.each(this.instances,function(){D=Math.max(D,this.css("z-index"))});this.maxZ=D},height:function(){if(C.browser.msie&&C.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var E=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<E){return C(window).height()+"px"}else{return D+"px"}}else{return C(document).height()+"px"}},width:function(){if(C.browser.msie&&C.browser.version<7){var E=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(E<D){return C(window).width()+"px"}else{return E+"px"}}else{return C(document).width()+"px"}},resize:function(){var D=C([]);C.each(C.ui.dialog.overlay.instances,function(){D=D.add(this)});D.css({width:0,height:0}).css({width:C.ui.dialog.overlay.width(),height:C.ui.dialog.overlay.height()})}});C.extend(C.ui.dialog.overlay.prototype,{destroy:function(){C.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(A){A.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(B,C){if(B=="selected"){if(this.options.collapsible&&C==this.options.selected){return }this.select(C)}else{this.options[B]=C;if(B=="deselectable"){this.options.collapsible=C}this._tabify()}},_tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},_sanitizeSelector:function(B){return B.replace(/:/g,"\\:")},_cookie:function(){var B=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+A.data(this.list[0]));return A.cookie.apply(null,[B].concat(A.makeArray(arguments)))},_ui:function(C,B){return{tab:C,panel:B,index:this.anchors.index(C)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var B=A(this);B.html(B.data("label.tabs")).removeData("label.tabs")})},_tabify:function(C){this.list=this.element.children("ul:first");this.lis=A("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return A("a",this)[0]});this.panels=A([]);var B=this,L=this.options;var M=/^#.+/;this.anchors.each(function(S,U){var T=A(U).attr("href");var R=T.split("#")[0],Q;if(R&&(R===location.toString().split("#")[0]||(Q=A("base")[0])&&R===Q.href)){T=U.hash;U.href=T}if(M.test(T)){B.panels=B.panels.add(B._sanitizeSelector(T))}else{if(T!="#"){A.data(U,"href.tabs",T);A.data(U,"load.tabs",T.replace(/#.*$/,""));var O=B._tabId(U);U.href="#"+O;var P=A("#"+O);if(!P.length){P=A(L.panelTemplate).attr("id",O).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(B.panels[S-1]||B.list);P.data("destroy.tabs",true)}B.panels=B.panels.add(P)}else{L.disabled.push(S)}}});if(C){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(L.selected===undefined){if(location.hash){this.anchors.each(function(O,P){if(P.hash==location.hash){L.selected=O;return false}})}if(typeof L.selected!="number"&&L.cookie){L.selected=parseInt(B._cookie(),10)}if(typeof L.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){L.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}L.selected=L.selected||0}else{if(L.selected===null){L.selected=-1}}L.selected=((L.selected>=0&&this.anchors[L.selected])||L.selected<0)?L.selected:0;L.disabled=A.unique(L.disabled.concat(A.map(this.lis.filter(".ui-state-disabled"),function(O,P){return B.lis.index(O)}))).sort();if(A.inArray(L.selected,L.disabled)!=-1){L.disabled.splice(A.inArray(L.selected,L.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(L.selected>=0&&this.anchors.length){this.panels.eq(L.selected).removeClass("ui-tabs-hide");this.lis.eq(L.selected).addClass("ui-tabs-selected ui-state-active");B.element.queue("tabs",function(){B._trigger("show",null,B._ui(B.anchors[L.selected],B.panels[L.selected]))});this.load(L.selected)}A(window).bind("unload",function(){B.lis.add(B.anchors).unbind(".tabs");B.lis=B.anchors=B.panels=null})}else{L.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[L.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(L.cookie){this._cookie(L.selected,L.cookie)}for(var I=0,D;(D=this.lis[I]);I++){A(D)[A.inArray(I,L.disabled)!=-1&&!A(D).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(L.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(L.event!="mouseover"){var J=function(P,O){if(O.is(":not(.ui-state-disabled)")){O.addClass("ui-state-"+P)}};var G=function(P,O){O.removeClass("ui-state-"+P)};this.lis.bind("mouseover.tabs",function(){J("hover",A(this))});this.lis.bind("mouseout.tabs",function(){G("hover",A(this))});this.anchors.bind("focus.tabs",function(){J("focus",A(this).closest("li"))});this.anchors.bind("blur.tabs",function(){G("focus",A(this).closest("li"))})}var N,H;if(L.fx){if(A.isArray(L.fx)){N=L.fx[0];H=L.fx[1]}else{N=H=L.fx}}function K(O,P){O.css({display:""});if(A.browser.msie&&P.opacity){O[0].style.removeAttribute("filter")}}var F=H?function(O,P){A(O).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");P.hide().removeClass("ui-tabs-hide").animate(H,H.duration||"normal",function(){K(P,H);B._trigger("show",null,B._ui(O,P[0]))})}:function(O,P){A(O).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");P.removeClass("ui-tabs-hide");B._trigger("show",null,B._ui(O,P[0]))};var E=N?function(P,O){O.animate(N,N.duration||"normal",function(){B.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");O.addClass("ui-tabs-hide");K(O,N);B.element.dequeue("tabs")})}:function(Q,O,P){B.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");O.addClass("ui-tabs-hide");B.element.dequeue("tabs")};this.anchors.bind(L.event+".tabs",function(){var R=this,P=A(this).closest("li"),O=B.panels.filter(":not(.ui-tabs-hide)"),Q=A(B._sanitizeSelector(this.hash));if((P.hasClass("ui-tabs-selected")&&!L.collapsible)||P.hasClass("ui-state-disabled")||P.hasClass("ui-state-processing")||B._trigger("select",null,B._ui(this,Q[0]))===false){this.blur();return false}L.selected=B.anchors.index(this);B.abort();if(L.collapsible){if(P.hasClass("ui-tabs-selected")){L.selected=-1;if(L.cookie){B._cookie(L.selected,L.cookie)}B.element.queue("tabs",function(){E(R,O)}).dequeue("tabs");this.blur();return false}else{if(!O.length){if(L.cookie){B._cookie(L.selected,L.cookie)}B.element.queue("tabs",function(){F(R,Q)});B.load(B.anchors.index(this));this.blur();return false}}}if(L.cookie){B._cookie(L.selected,L.cookie)}if(Q.length){if(O.length){B.element.queue("tabs",function(){E(R,O)})}B.element.queue("tabs",function(){F(R,Q)});B.load(B.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var B=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var D=A.data(this,"href.tabs");if(D){this.href=D}var C=A(this).unbind(".tabs");A.each(["href","load","cache"],function(F,E){C.removeData(E+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(B.cookie){this._cookie(null,B.cookie)}},add:function(G,H,I){if(I===undefined){I=this.anchors.length}var B=this,E=this.options,C=A(E.tabTemplate.replace(/#\{href\}/g,G).replace(/#\{label\}/g,H)),D=!G.indexOf("#")?G.replace("#",""):this._tabId(A("a",C)[0]);C.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var F=A("#"+D);if(!F.length){F=A(E.panelTemplate).attr("id",D).data("destroy.tabs",true)}F.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(I>=this.lis.length){C.appendTo(this.list);F.appendTo(this.list[0].parentNode)}else{C.insertBefore(this.lis[I]);F.insertBefore(this.panels[I])}E.disabled=A.map(E.disabled,function(J,K){return J>=I?++J:J});this._tabify();if(this.anchors.length==1){C.addClass("ui-tabs-selected ui-state-active");F.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){B._trigger("show",null,B._ui(B.anchors[0],B.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[I],this.panels[I]))},remove:function(B){var D=this.options,C=this.lis.eq(B).remove(),E=this.panels.eq(B).remove();if(C.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(B+(B+1<this.anchors.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(F,G){return F!=B}),function(F,G){return F>=B?--F:F});this._tabify();this._trigger("remove",null,this._ui(C.find("a")[0],E[0]))},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }this.lis.eq(B).removeClass("ui-state-disabled");C.disabled=A.grep(C.disabled,function(D,E){return D!=B});this._trigger("enable",null,this._ui(this.anchors[B],this.panels[B]))},disable:function(D){var B=this,C=this.options;if(D!=C.selected){this.lis.eq(D).addClass("ui-state-disabled");C.disabled.push(D);C.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[D],this.panels[D]))}},select:function(B){if(typeof B=="string"){B=this.anchors.index(this.anchors.filter("[href$="+B+"]"))}else{if(B===null){B=-1}}if(B==-1&&this.options.collapsible){B=this.options.selected}this.anchors.eq(B).trigger(this.options.event+".tabs")},load:function(E){var G=this,C=this.options,B=this.anchors.eq(E)[0],F=A.data(B,"load.tabs");this.abort();if(!F||this.element.queue("tabs").length!==0&&A.data(B,"cache.tabs")){this.element.dequeue("tabs");return }this.lis.eq(E).addClass("ui-state-processing");if(C.spinner){var D=A("span",B);D.data("label.tabs",D.html()).html(C.spinner)}this.xhr=A.ajax(A.extend({},C.ajaxOptions,{url:F,success:function(I,J){A(G._sanitizeSelector(B.hash)).html(I);G._cleanup();if(C.cache){A.data(B,"cache.tabs",true)}G._trigger("load",null,G._ui(G.anchors[E],G.panels[E]));try{C.ajaxOptions.success(I,J)}catch(H){}G.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(C,B){this.anchors.eq(C).removeData("cache.tabs").data("load.tabs",B)},length:function(){return this.anchors.length}});A.extend(A.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(F,D){var B=this,C=this.options;var G=B._rotate||(B._rotate=function(H){clearTimeout(B.rotation);B.rotation=setTimeout(function(){var I=C.selected;B.select(++I<B.anchors.length?I:0)},F);if(H){H.stopPropagation()}});var E=B._unrotate||(B._unrotate=!D?function(H){if(H.clientX){B.rotate(null)}}:function(H){t=C.selected;G()});if(F){this.element.bind("tabsshow",G);this.anchors.bind(C.event+".tabs",E);G()}else{clearTimeout(B.rotation);this.element.unbind("tabsshow",G);this.anchors.unbind(C.event+".tabs",E);delete this._rotate;delete this._unrotate}}})})(jQuery);BN.namespace("detailsLightbox");var $page;var $detailsOverlay;var $lightboxMainImage;var $lightboxChangeDiamondContainer;var $lightboxShapeOverlay;var $paginationContainer;var diamondShape="";var lightboxShapeTimeout=null;var sectionId="";var defaultImagePath="http://img.bluenile.com/is/image/bluenile/pxlclear?wid=520&hei=440";var pageCount;var currentPage;var OVERLAY_WIDTH=938;if(typeof jQuery!="undefined"){$(document).ready(function(){BN.detailsLightbox.init()})}BN.detailsLightbox={init:function(){$page=$("div.content");$detailsOverlay=$("#details_lightbox");$lightboxMainImage=$("#lightbox_main_image");$lightboxChangeDiamondContainer=$("#lightbox_change_diamond_container");$lightboxShapeOverlay=$("#lightbox_shape_overlay")},getOverlayDimensions:function(){var B=$(window).width();var D=$(window).height();var E=$(window).scrollTop();var F=$(window).scrollLeft();var C=OVERLAY_WIDTH;var A=$page.position().top;var H=Math.round((D>700&&E<=100&&A>=0)?A:(D*0.1));if(D<400){H=0}var G=$page.position().left+(26);if(B<C){G=0}if($.browser.msie){if(document.documentElement){E+=document.documentElement.scrollTop;F+=document.documentElement.scrollLeft}H+=E;G+=F}return{top:H+"px",left:G+"px",width:C+"px",height:"auto",windowWidth:B,windowHeight:D}},positionOverlay:function(){var B=BN.detailsLightbox.getOverlayDimensions();var A=$detailsOverlay.parent();A.css("top",B.top);A.css("left",B.left)},showLightbox:function(E,D){diamondShape=$("#change_diamond").attr("data-shapeCode");BN.detailsLightbox.updateShapeIcons($("#lightbox_shape_icon_"+diamondShape));if(E!==null){BN.detailsLightbox.selectThumbnail(E)}var C=BN.detailsLightbox.getOverlayDimensions();var B=((C.windowWidth<OVERLAY_WIDTH)||(C.windowHeight<$detailsOverlay.height()))?"absolute":"fixed";$.blockUI({message:$detailsOverlay,fadeIn:($.browser.msie?0:200),centerX:true,baseZ:1000,focusInput:false,css:{top:C.top,left:C.left,width:C.width,height:C.height,cursor:"default",border:"1px solid #666",position:B},overlayCSS:{backgroundColor:"#024",opacity:"0.4",cursor:"default"}});$(window).unbind("resize").bind("resize",BN.detailsLightbox.positionOverlay);$("body > .blockOverlay").click(BN.detailsLightbox.hideLightbox);$("#lightbox_close_button").click(function(){BN.detailsLightbox.hideLightbox();return false});$("a.lightbox_thumbnail").unbind("click").bind("click",function(){BN.detailsLightbox.selectThumbnail($(this));return false});var A=$("#thumbnail_tabs").tabs({select:function(F,G){sectionId=$(G.tab).attr("data-sectionId");BN.detailsLightbox.loadThumbnailTab(1);BN.detailsLightbox.showFirstImage(1)}});if(E!==null){sectionId=E.attr("data-sectionId");A.tabs("select","#"+sectionId);BN.detailsLightbox.loadThumbnailTab(parseInt(E.attr("data-pageNumber"),10))}else{if(D!==null){sectionId=D;A.tabs("select","#"+sectionId);BN.detailsLightbox.loadThumbnailTab(1);BN.detailsLightbox.showFirstImage(1)}}$lightboxChangeDiamondContainer.unbind().hover(function(){if(lightboxShapeTimeout!==undefined){clearTimeout(lightboxShapeTimeout)}BN.detailsLightbox.showShapeOverlay()},function(){BN.detailsLightbox.hideShapeOverlay()});$lightboxChangeDiamondContainer.click(function(){return false});lightboxShapeTimeout=null;$("#lightbox_change_diamond").show();$lightboxShapeOverlay.unbind("mouseenter mouseleave").hover(function(){if(lightboxShapeTimeout!==undefined){clearTimeout(lightboxShapeTimeout)}},function(){BN.detailsLightbox.hideShapeOverlay()});$("#lightbox_shape_overlay_content div").unbind().click(function(){if($(this).attr("data-shapeCode")!==undefined){diamondShape=$(this).attr("data-shapeCode");$lightboxChangeDiamondContainer.attr("data-shapeCode",diamondShape);BN.detailsLightbox.updateShapeIcons($(this).children("img.shape_icon"));BN.detailsLightbox.updateImage($(".lightbox_thumbnail.highlight"));BN.detailsLightbox.preloadImages()}return false});BN.logger.info("DETAILS_LIGHTBOX","Lightbox opened")},hideLightbox:function(){$(window).unbind("resize",BN.detailsLightbox.positionOverlay);$.unblockUI({fadeOut:($.browser.msie?0:100)});$page.unblock();$("#lightbox_close_button").unbind("click");BN.detailsLightbox.updateImage(null);return false},updateShapeIcons:function(A){var B=$("#lightbox_shape_overlay_content img.selected_shape");if(B.length!==0){B.attr("src",B.attr("src").replace("_on","")).removeClass("selected_shape")}if(A.length!==0){A.addClass("selected_shape");A.attr("src",A.attr("src").replace(".gif","_on.gif"))}},showShapeOverlay:function(){var A=Math.round($lightboxChangeDiamondContainer.position().top-10);var B=Math.round($lightboxChangeDiamondContainer.position().left+$lightboxChangeDiamondContainer.width()+13);$lightboxShapeOverlay.css({top:A,left:B,display:"block"})},hideShapeOverlay:function(){lightboxShapeTimeout=setTimeout(function(){$lightboxShapeOverlay.hide()},500)},updateImage:function(D){var C="";var B=null;var A=null;if((D==undefined)||(D==null)){C=defaultImagePath;B=520;A=440}else{if(D.attr("data-multipleShapes")==="false"){$lightboxChangeDiamondContainer.hide()}else{$lightboxChangeDiamondContainer.show()}if((diamondShape!==undefined)&&(diamondShape!=="")&&(D.attr("data-imageurl-shape-"+diamondShape)!==undefined)){C=D.attr("data-imageurl-shape-"+diamondShape)}else{C=D.attr("data-imageurl")}B=D.attr("data-imageWidth");A=D.attr("data-imageHeight")}$lightboxMainImage.crossfade(C,null,B,A);return false},selectThumbnail:function(C){BN.detailsLightbox.updateImage(C);$(".lightbox_thumbnail").removeClass("highlight");C.addClass("highlight");var B=C.attr("data-descmodule");if(B!==""){var A=$("#"+B);if($("#"+B).length!==0){$("#main_image_caption").html($("#"+B).html())}}else{$("#main_image_caption").html("")}},showFirstImage:function(B){var A=$("#"+sectionId+"_page_"+B+" > a.lightbox_thumbnail:first");if((A.length!==0)&&(A!==undefined)){BN.detailsLightbox.selectThumbnail(A)}},loadThumbnailTab:function(A){$paginationContainer=$("#"+sectionId+"_pagination");if($paginationContainer.length!==0){pageCount=$paginationContainer.attr("data-pageCount");currentPage=parseInt($paginationContainer.attr("data-currentPage"),10);BN.detailsLightbox.switchPage(A);$(".thumbnail_pagination a").unbind("click").bind("click",function(){var B=1;if($(this).hasClass("next_page")&&((currentPage+1)<=pageCount)){B=currentPage+1}else{if($(this).hasClass("prev_page")&&((currentPage-1)>0)){B=currentPage-1}else{B=parseInt($(this).attr("data-pageNumber"),10)}}BN.detailsLightbox.switchPage(B);BN.detailsLightbox.preloadImages();BN.detailsLightbox.showFirstImage(B);return false})}else{pageCount=1;currentPage=1}BN.detailsLightbox.preloadImages()},switchPage:function(A){if(A!==currentPage){if(A>1){$("#"+sectionId+"_prev_page_label").hide();$("#"+sectionId+"_prev_page_link").show()}else{$("#"+sectionId+"_prev_page_label").show();$("#"+sectionId+"_prev_page_link").hide()}if(A<pageCount){$("#"+sectionId+"_next_page_label").hide();$("#"+sectionId+"_next_page_link").show()}else{$("#"+sectionId+"_next_page_label").show();$("#"+sectionId+"_next_page_link").hide()}$("#"+sectionId+"_page_"+currentPage+"_label").hide();$("#"+sectionId+"_page_"+currentPage+"_link").show();$("#"+sectionId+"_page_"+A+"_link").hide();$("#"+sectionId+"_page_"+A+"_label").show();$("#"+sectionId+"_page_"+currentPage).hide();$("#"+sectionId+"_page_"+A).show();currentPage=A;$paginationContainer.attr("data-currentPage",A)}},preloadImages:function(){$("#"+sectionId+"_page_"+currentPage+" > a.lightbox_thumbnail").each(function(){if((diamondShape!==undefined)&&(diamondShape!=="")&&($(this).attr("data-imageurl-shape-"+diamondShape)!==undefined)){preloadImg($(this).attr("data-imageurl-shape-"+diamondShape))}else{preloadImg($(this).attr("data-imageurl"))}})}};(function(B){B.fn.jcarousel=function(D){return this.each(function(){new A(this,D)})};var C={vertical:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null};B.jcarousel=function(G,E){this.options=B.extend({},C,E||{});this.locked=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?"left":"top";var K="",I=G.className.split(" ");for(var F=0;F<I.length;F++){if(I[F].indexOf("jcarousel-skin")!=-1){B(G).removeClass(I[F]);var K=I[F];break}}if(G.nodeName=="UL"||G.nodeName=="OL"){this.list=B(G);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container")){this.container=this.container.wrap("<div></div>")}this.container=this.container.parent()}else{if(!this.container.hasClass("jcarousel-container")){this.container=this.list.wrap("<div></div>").parent()}}}else{this.container=B(G);this.list=B(G).find(">ul,>ol,div>ul,div>ol")}if(K!=""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+K+'"></div>')}this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip")){this.clip=this.list.wrap("<div></div>").parent()}this.buttonPrev=B(".jcarousel-prev",this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null){this.buttonPrev=this.clip.before(this.options.buttonPrevHTML).prev()}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=B(".jcarousel-next",this.container);if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null){this.buttonNext=this.clip.before(this.options.buttonNextHTML).prev()}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip"));this.list.addClass(this.className("jcarousel-list"));this.container.addClass(this.className("jcarousel-container"));var H=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var J=this.list.children("li");var L=this;if(J.size()>0){var D=0,F=this.options.offset;J.each(function(){L.format(this,F++);D+=L.dimension(this,H)});this.list.css(this.wh,D+"px");if(!E||E.size===undefined){this.options.size=J.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){L.next()};this.funcPrev=function(){L.prev()};this.funcResize=function(){L.reload()};if(this.options.initCallback!=null){this.options.initCallback(this,"init")}if(B.browser.safari){this.buttons(false,false);B(window).bind("load",function(){L.setup()})}else{this.setup()}};var A=B.jcarousel;A.fn=A.prototype={jcarousel:"0.2.3"};A.fn.extend=A.extend=B.extend;A.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;if(this.locked){return }this.list.css(this.lt,this.pos(this.options.offset)+"px");var D=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(D,false);B(window).unbind("resize",this.funcResize).bind("resize",this.funcResize)},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!=null){this.options.initCallback(this,"reset")}this.setup()},reload:function(){if(this.tail!=null&&this.inTail){this.list.css(this.lt,A.intval(this.list.css(this.lt))+this.tail)}this.tail=null;this.inTail=false;if(this.options.reloadCallback!=null){this.options.reloadCallback(this)}if(this.options.visible!=null){var F=this;var G=Math.ceil(this.clipping()/this.options.visible),E=0,D=0;B("li",this.list).each(function(H){E+=F.dimension(this,G);if(H+1<F.first){D=E}});this.list.css(this.wh,E+"px");this.list.css(this.lt,-D+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(D){if(D!=undefined){this.options.size=D;if(!this.locked){this.buttons()}}return this.options.size},has:function(E,F){if(F==undefined||!F){F=E}if(this.options.size!==null&&F>this.options.size){F=this.options.size}for(var D=E;D<=F;D++){var G=this.get(D);if(!G.length||G.hasClass("jcarousel-item-placeholder")){return false}}return true},get:function(D){return B(".jcarousel-item-"+D,this.list)},add:function(G,L){var H=this.get(G),E=0,K=0;if(H.length==0){var J,H=this.create(G),F=A.intval(G);while(J=this.get(--F)){if(F<=0||J.length){F<=0?this.list.prepend(H):J.after(H);break}}}else{E=this.dimension(H)}H.removeClass(this.className("jcarousel-item-placeholder"));typeof L=="string"?H.html(L):H.empty().append(L);var I=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var D=this.dimension(H,I)-E;if(G>0&&G<this.first){this.list.css(this.lt,A.intval(this.list.css(this.lt))-D+"px")}this.list.css(this.wh,A.intval(this.list.css(this.wh))+D+"px");return H},remove:function(D){var E=this.get(D);if(!E.length||(D>=this.first&&D<=this.last)){return }var F=this.dimension(E);if(D<this.first){this.list.css(this.lt,A.intval(this.list.css(this.lt))+F+"px")}E.remove();this.list.css(this.wh,A.intval(this.list.css(this.wh))-F+"px")},next:function(){this.stopAuto();if(this.tail!=null&&!this.inTail){this.scrollTail(false)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!=null&&this.last==this.options.size)?1:this.first+this.options.scroll)}},prev:function(){this.stopAuto();if(this.tail!=null&&this.inTail){this.scrollTail(true)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!=null&&this.first==1)?this.options.size:this.first-this.options.scroll)}},scrollTail:function(D){if(this.locked||this.animating||!this.tail){return }var E=A.intval(this.list.css(this.lt));!D?E-=this.tail:E+=this.tail;this.inTail=!D;this.prevFirst=this.first;this.prevLast=this.last;this.animate(E)},scroll:function(E,D){if(this.locked||this.animating){return }this.animate(this.pos(E),D)},pos:function(Q){if(this.locked||this.animating){return }if(this.options.wrap!="circular"){Q=Q<1?1:(this.options.size&&Q>this.options.size?this.options.size:Q)}var N=this.first>Q;var E=A.intval(this.list.css(this.lt));var R=this.options.wrap!="circular"&&this.first<=1?1:this.first;var U=N?this.get(R):this.get(this.last);var P=N?R:R-1;var S=null,O=0,L=false,T=0;while(N?--P>=Q:++P<Q){S=this.get(P);L=!S.length;if(S.length==0){S=this.create(P).addClass(this.className("jcarousel-item-placeholder"));U[N?"before":"after"](S)}U=S;T=this.dimension(S);if(L){O+=T}if(this.first!=null&&(this.options.wrap=="circular"||(P>=1&&(this.options.size==null||P<=this.options.size)))){E=N?E+T:E-T}}var I=this.clipping();var K=[];var D=0,P=Q,J=0;var U=this.get(Q-1);while(++D){S=this.get(P);L=!S.length;if(S.length==0){S=this.create(P).addClass(this.className("jcarousel-item-placeholder"));U.length==0?this.list.prepend(S):U[N?"before":"after"](S)}U=S;var T=this.dimension(S);if(T==0){alert("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");return 0}if(this.options.wrap!="circular"&&this.options.size!==null&&P>this.options.size){K.push(S)}else{if(L){O+=T}}J+=T;if(J>=I){break}P++}for(var H=0;H<K.length;H++){K[H].remove()}if(O>0){this.list.css(this.wh,this.dimension(this.list)+O+"px");if(N){E-=O;this.list.css(this.lt,A.intval(this.list.css(this.lt))-O+"px")}}var G=Q+D-1;if(this.options.wrap!="circular"&&this.options.size&&G>this.options.size){G=this.options.size}if(P>G){D=0,P=G,J=0;while(++D){var S=this.get(P--);if(!S.length){break}J+=this.dimension(S);if(J>=I){break}}}var F=G-D+1;if(this.options.wrap!="circular"&&F<1){F=1}if(this.inTail&&N){E+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&G==this.options.size&&(G-D+1)>=1){var M=A.margin(this.get(G),!this.options.vertical?"marginRight":"marginBottom");if((J-M)>I){this.tail=J-I-M}}while(Q-->F){E+=this.dimension(this.get(Q))}this.prevFirst=this.first;this.prevLast=this.last;this.first=F;this.last=G;return E},animate:function(G,D){if(this.locked||this.animating){return }this.animating=true;var E=this;var F=function(){E.animating=false;if(G==0){E.list.css(E.lt,0)}if(E.options.wrap=="both"||E.options.wrap=="last"||E.options.size==null||E.last<E.options.size){E.startAuto()}E.buttons();E.notify("onAfterAnimation")};this.notify("onBeforeAnimation");if(!this.options.animation||D==false){this.list.css(this.lt,G+"px");F()}else{var H=!this.options.vertical?{left:G}:{top:G};this.list.animate(H,this.options.animation,this.options.easing,F)}},startAuto:function(E){if(E!=undefined){this.options.auto=E}if(this.options.auto==0){return this.stopAuto()}if(this.timer!=null){return }var D=this;this.timer=setTimeout(function(){D.next()},this.options.auto*1000)},stopAuto:function(){if(this.timer==null){return }clearTimeout(this.timer);this.timer=null},buttons:function(F,E){if(F==undefined||F==null){var F=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="first")||this.options.size==null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!=null&&this.last>=this.options.size){F=this.tail!=null&&!this.inTail}}if(E==undefined||E==null){var E=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="last")||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!=null&&this.first==1){E=this.tail!=null&&this.inTail}}var D=this;this.buttonNext[F?"bind":"unbind"](this.options.buttonNextEvent,this.funcNext)[F?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",F?false:true);this.buttonPrev[E?"bind":"unbind"](this.options.buttonPrevEvent,this.funcPrev)[E?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",E?false:true);if(this.buttonNext.length>0&&(this.buttonNext[0].jcarouselstate==undefined||this.buttonNext[0].jcarouselstate!=F)&&this.options.buttonNextCallback!=null){this.buttonNext.each(function(){D.options.buttonNextCallback(D,this,F)});this.buttonNext[0].jcarouselstate=F}if(this.buttonPrev.length>0&&(this.buttonPrev[0].jcarouselstate==undefined||this.buttonPrev[0].jcarouselstate!=E)&&this.options.buttonPrevCallback!=null){this.buttonPrev.each(function(){D.options.buttonPrevCallback(D,this,E)});this.buttonPrev[0].jcarouselstate=E}},notify:function(D){var E=this.prevFirst==null?"init":(this.prevFirst<this.first?"next":"prev");this.callback("itemLoadCallback",D,E);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",D,E,this.first);this.callback("itemFirstOutCallback",D,E,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",D,E,this.last);this.callback("itemLastOutCallback",D,E,this.prevLast)}this.callback("itemVisibleInCallback",D,E,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",D,E,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(H,K,D,I,G,F,E){if(this.options[H]==undefined||(typeof this.options[H]!="object"&&K!="onAfterAnimation")){return }var L=typeof this.options[H]=="object"?this.options[H][K]:this.options[H];if(!B.isFunction(L)){return }var M=this;if(I===undefined){L(M,D,K)}else{if(G===undefined){this.get(I).each(function(){L(M,this,I,D,K)})}else{for(var J=I;J<=G;J++){if(J!==null&&!(J>=F&&J<=E)){this.get(J).each(function(){L(M,this,J,D,K)})}}}}},create:function(D){return this.format("<li></li>",D)},format:function(F,E){var D=B(F).addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+E));D.attr("jcarouselindex",E);return D},className:function(D){return D+" "+D+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(G,H){var F=G.jquery!=undefined?G[0]:G;var E=!this.options.vertical?F.offsetWidth+A.margin(F,"marginLeft")+A.margin(F,"marginRight"):F.offsetHeight+A.margin(F,"marginTop")+A.margin(F,"marginBottom");if(H==undefined||E==H){return E}var D=!this.options.vertical?H-A.margin(F,"marginLeft")-A.margin(F,"marginRight"):H-A.margin(F,"marginTop")-A.margin(F,"marginBottom");B(F).css(this.wh,D+"px");return this.dimension(F)},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-A.intval(this.clip.css("borderLeftWidth"))-A.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-A.intval(this.clip.css("borderTopWidth"))-A.intval(this.clip.css("borderBottomWidth"))},index:function(D,E){if(E==undefined){E=this.options.size}return Math.round((((D-1)/E)-Math.floor((D-1)/E))*E)+1}});A.extend({defaults:function(D){return B.extend(C,D||{})},margin:function(H,G){if(!H){return 0}var F=H.jquery!=undefined?H[0]:H;if(G=="marginRight"&&B.browser.safari){var E={display:"block","float":"none",width:"auto"},D,I;B.swap(F,E,function(){D=F.offsetWidth});E.marginRight=0;B.swap(F,E,function(){I=F.offsetWidth});return I-D}return A.intval(B.css(F,G))},intval:function(D){D=parseInt(D);return isNaN(D)?0:D}})})(jQuery);eval(function(E,A,F,B,D,C){D=function(G){return(G<A?"":D(parseInt(G/A)))+((G=G%A)>35?String.fromCharCode(G+29):G.toString(36))};if(!"".replace(/^/,String)){while(F--){C[D(F)]=B[F]||D(F)}B=[function(G){return C[G]}];D=function(){return"\\w+"};F=1}while(F--){if(B[F]){E=E.replace(new RegExp("\\b"+D(F)+"\\b","g"),B[F])}}return E}("(9($){$.1v.C=9(o){z 4.1b(9(){3p r(4,o)})};8 q={Z:F,25:1,21:1,u:7,1c:3,15:7,1K:'2X',2c:'2Q',1q:0,B:7,1j:7,1G:7,2F:7,2B:7,2z:7,2x:7,2v:7,2s:7,2p:7,1S:'<P></P>',1Q:'<P></P>',2m:'2l',2k:'2l',1O:7,1L:7};$.C=9(e,o){4.5=$.16({},q,o||{});4.Q=F;4.D=7;4.H=7;4.t=7;4.U=7;4.R=7;4.N=!4.5.Z?'1H':'26';4.E=!4.5.Z?'24':'23';8 a='',1e=e.K.1e(' ');1r(8 i=0;i<1e.I;i++){6(1e[i].2y('C-2w')!=-1){$(e).1E(1e[i]);8 a=1e[i];1p}}6(e.2t=='3o'||e.2t=='3n'){4.t=$(e);4.D=4.t.19();6(4.D.1o('C-H')){6(!4.D.19().1o('C-D'))4.D=4.D.B('<P></P>');4.D=4.D.19()}10 6(!4.D.1o('C-D'))4.D=4.t.B('<P></P>').19()}10{4.D=$(e);4.t=$(e).3h('>2o,>2n,P>2o,P>2n')}6(a!=''&&4.D.19()[0].K.2y('C-2w')==-1)4.D.B('<P 3g=\" '+a+'\"></P>');4.H=4.t.19();6(!4.H.I||!4.H.1o('C-H'))4.H=4.t.B('<P></P>').19();4.R=$('.C-11',4.D);6(4.R.u()==0&&4.5.1Q!=7)4.R=4.H.1z(4.5.1Q).11();4.R.V(4.K('C-11'));4.U=$('.C-17',4.D);6(4.U.u()==0&&4.5.1S!=7)4.U=4.H.1z(4.5.1S).11();4.U.V(4.K('C-17'));4.H.V(4.K('C-H'));4.t.V(4.K('C-t'));4.D.V(4.K('C-D'));8 b=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 c=4.t.32('1F');8 d=4;6(c.u()>0){8 f=0,i=4.5.21;c.1b(9(){d.1I(4,i++);f+=d.S(4,b)});4.t.y(4.N,f+'T');6(!o||o.u===J)4.5.u=c.u()}4.D.y('1y','1A');4.U.y('1y','1A');4.R.y('1y','1A');4.2G=9(){d.17()};4.2b=9(){d.11()};4.1U=9(){d.2q()};6(4.5.1j!=7)4.5.1j(4,'2a');6($.2A.28){4.1f(F,F);$(27).1u('2I',9(){d.1t()})}10 4.1t()};8 r=$.C;r.1v=r.2H={C:'0.2.3'};r.1v.16=r.16=$.16;r.1v.16({1t:9(){4.A=7;4.G=7;4.X=7;4.13=7;4.14=F;4.1d=7;4.O=7;4.W=F;6(4.Q)z;4.t.y(4.E,4.1s(4.5.21)+'T');8 p=4.1s(4.5.25);4.X=4.13=7;4.1i(p,F);$(27).22('2E',4.1U).1u('2E',4.1U)},2D:9(){4.t.2C();4.t.y(4.E,'3u');4.t.y(4.N,'3t');6(4.5.1j!=7)4.5.1j(4,'2D');4.1t()},2q:9(){6(4.O!=7&&4.W)4.t.y(4.E,r.M(4.t.y(4.E))+4.O);4.O=7;4.W=F;6(4.5.1G!=7)4.5.1G(4);6(4.5.15!=7){8 a=4;8 b=1k.1P(4.1m()/4.5.15),N=0,E=0;$('1F',4.t).1b(9(i){N+=a.S(4,b);6(i+1<a.A)E=N});4.t.y(4.N,N+'T');4.t.y(4.E,-E+'T')}4.1c(4.A,F)},3s:9(){4.Q=1h;4.1f()},3r:9(){4.Q=F;4.1f()},u:9(s){6(s!=J){4.5.u=s;6(!4.Q)4.1f()}z 4.5.u},3q:9(i,a){6(a==J||!a)a=i;6(4.5.u!==7&&a>4.5.u)a=4.5.u;1r(8 j=i;j<=a;j++){8 e=4.L(j);6(!e.I||e.1o('C-1a-1D'))z F}z 1h},L:9(i){z $('.C-1a-'+i,4.t)},2u:9(i,s){8 e=4.L(i),20=0,2u=0;6(e.I==0){8 c,e=4.1B(i),j=r.M(i);1n(c=4.L(--j)){6(j<=0||c.I){j<=0?4.t.2r(e):c.1X(e);1p}}}10 20=4.S(e);e.1E(4.K('C-1a-1D'));1R s=='3l'?e.3k(s):e.2C().3j(s);8 a=4.5.15!=7?1k.1P(4.1m()/4.5.15):7;8 b=4.S(e,a)-20;6(i>0&&i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))-b+'T');4.t.y(4.N,r.M(4.t.y(4.N))+b+'T');z e},1V:9(i){8 e=4.L(i);6(!e.I||(i>=4.A&&i<=4.G))z;8 d=4.S(e);6(i<4.A)4.t.y(4.E,r.M(4.t.y(4.E))+d+'T');e.1V();4.t.y(4.N,r.M(4.t.y(4.N))-d+'T')},17:9(){4.1C();6(4.O!=7&&!4.W)4.1T(F);10 4.1c(((4.5.B=='1Z'||4.5.B=='G')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.1c)},11:9(){4.1C();6(4.O!=7&&4.W)4.1T(1h);10 4.1c(((4.5.B=='1Z'||4.5.B=='A')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.1c)},1T:9(b){6(4.Q||4.14||!4.O)z;8 a=r.M(4.t.y(4.E));!b?a-=4.O:a+=4.O;4.W=!b;4.X=4.A;4.13=4.G;4.1i(a)},1c:9(i,a){6(4.Q||4.14)z;4.1i(4.1s(i),a)},1s:9(i){6(4.Q||4.14)z;6(4.5.B!='18')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.M(4.t.y(4.E));8 f=4.5.B!='18'&&4.A<=1?1:4.A;8 c=a?4.L(f):4.L(4.G);8 j=a?f:f-1;8 e=7,l=0,p=F,d=0;1n(a?--j>=i:++j<i){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K('C-1a-1D'));c[a?'1z':'1X'](e)}c=e;d=4.S(e);6(p)l+=d;6(4.A!=7&&(4.5.B=='18'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1m();8 h=[];8 k=0,j=i,v=0;8 c=4.L(i-1);1n(++k){e=4.L(j);p=!e.I;6(e.I==0){e=4.1B(j).V(4.K('C-1a-1D'));c.I==0?4.t.2r(e):c[a?'1z':'1X'](e)}c=e;8 d=4.S(e);6(d==0){3f('3e: 3d 1H/26 3c 1r 3b. 3a 39 38 37 36 35. 34...');z 0}6(4.5.B!='18'&&4.5.u!==7&&j>4.5.u)h.33(e);10 6(p)l+=d;v+=d;6(v>=g)1p;j++}1r(8 x=0;x<h.I;x++)h[x].1V();6(l>0){4.t.y(4.N,4.S(4.t)+l+'T');6(a){b-=l;4.t.y(4.E,r.M(4.t.y(4.E))-l+'T')}}8 n=i+k-1;6(4.5.B!='18'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1n(++k){8 e=4.L(j--);6(!e.I)1p;v+=4.S(e);6(v>=g)1p}}8 o=n-k+1;6(4.5.B!='18'&&o<1)o=1;6(4.W&&a){b+=4.O;4.W=F}4.O=7;6(4.5.B!='18'&&n==4.5.u&&(n-k+1)>=1){8 m=r.Y(4.L(n),!4.5.Z?'1l':'1N');6((v-m)>g)4.O=v-g-m}1n(i-->o)b+=4.S(4.L(i));4.X=4.A;4.13=4.G;4.A=o;4.G=n;z b},1i:9(p,a){6(4.Q||4.14)z;4.14=1h;8 b=4;8 c=9(){b.14=F;6(p==0)b.t.y(b.E,0);6(b.5.B=='1Z'||b.5.B=='G'||b.5.u==7||b.G<b.5.u)b.2j();b.1f();b.1M('2i')};4.1M('31');6(!4.5.1K||a==F){4.t.y(4.E,p+'T');c()}10{8 o=!4.5.Z?{'24':p}:{'23':p};4.t.1i(o,4.5.1K,4.5.2c,c)}},2j:9(s){6(s!=J)4.5.1q=s;6(4.5.1q==0)z 4.1C();6(4.1d!=7)z;8 a=4;4.1d=30(9(){a.17()},4.5.1q*2Z)},1C:9(){6(4.1d==7)z;2Y(4.1d);4.1d=7},1f:9(n,p){6(n==J||n==7){8 n=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!='A')||4.5.u==7||4.G<4.5.u);6(!4.Q&&(!4.5.B||4.5.B=='A')&&4.5.u!=7&&4.G>=4.5.u)n=4.O!=7&&!4.W}6(p==J||p==7){8 p=!4.Q&&4.5.u!==0&&((4.5.B&&4.5.B!='G')||4.A>1);6(!4.Q&&(!4.5.B||4.5.B=='G')&&4.5.u!=7&&4.A==1)p=4.O!=7&&4.W}8 a=4;4.U[n?'1u':'22'](4.5.2m,4.2G)[n?'1E':'V'](4.K('C-17-1w')).1J('1w',n?F:1h);4.R[p?'1u':'22'](4.5.2k,4.2b)[p?'1E':'V'](4.K('C-11-1w')).1J('1w',p?F:1h);6(4.U.I>0&&(4.U[0].1g==J||4.U[0].1g!=n)&&4.5.1O!=7){4.U.1b(9(){a.5.1O(a,4,n)});4.U[0].1g=n}6(4.R.I>0&&(4.R[0].1g==J||4.R[0].1g!=p)&&4.5.1L!=7){4.R.1b(9(){a.5.1L(a,4,p)});4.R[0].1g=p}},1M:9(a){8 b=4.X==7?'2a':(4.X<4.A?'17':'11');4.12('2F',a,b);6(4.X!==4.A){4.12('2B',a,b,4.A);4.12('2z',a,b,4.X)}6(4.13!==4.G){4.12('2x',a,b,4.G);4.12('2v',a,b,4.13)}4.12('2s',a,b,4.A,4.G,4.X,4.13);4.12('2p',a,b,4.X,4.13,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==J||(1R 4.5[a]!='2h'&&b!='2i'))z;8 h=1R 4.5[a]=='2h'?4.5[a][b]:4.5[a];6(!$.2W(h))z;8 j=4;6(d===J)h(j,c,b);10 6(e===J)4.L(d).1b(9(){h(j,4,d,c,b)});10{1r(8 i=d;i<=e;i++)6(i!==7&&!(i>=f&&i<=g))4.L(i).1b(9(){h(j,4,i,c,b)})}},1B:9(i){z 4.1I('<1F></1F>',i)},1I:9(e,i){8 a=$(e).V(4.K('C-1a')).V(4.K('C-1a-'+i));a.1J('2V',i);z a},K:9(c){z c+' '+c+(!4.5.Z?'-2U':'-Z')},S:9(e,d){8 a=e.2g!=J?e[0]:e;8 b=!4.5.Z?a.1x+r.Y(a,'2f')+r.Y(a,'1l'):a.2e+r.Y(a,'2d')+r.Y(a,'1N');6(d==J||b==d)z b;8 w=!4.5.Z?d-r.Y(a,'2f')-r.Y(a,'1l'):d-r.Y(a,'2d')-r.Y(a,'1N');$(a).y(4.N,w+'T');z 4.S(a)},1m:9(){z!4.5.Z?4.H[0].1x-r.M(4.H.y('2T'))-r.M(4.H.y('2S')):4.H[0].2e-r.M(4.H.y('2R'))-r.M(4.H.y('3i'))},2P:9(i,s){6(s==J)s=4.5.u;z 1k.2O((((i-1)/s)-1k.2N((i-1)/s))*s)+1}});r.16({3m:9(d){z $.16(q,d||{})},Y:9(e,p){6(!e)z 0;8 a=e.2g!=J?e[0]:e;6(p=='1l'&&$.2A.28){8 b={'1y':'1A','2M':'2L','1H':'1q'},1Y,1W;$.29(a,b,9(){1Y=a.1x});b['1l']=0;$.29(a,b,9(){1W=a.1x});z 1W-1Y}z r.M($.y(a,p))},M:9(v){v=2K(v);z 2J(v)?0:v}})})(3v);",62,218,"||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|wrap|jcarousel|container|lt|false|last|clip|length|undefined|className|get|intval|wh|tail|div|locked|buttonPrev|dimension|px|buttonNext|addClass|inTail|prevFirst|margin|vertical|else|prev|callback|prevLast|animating|visible|extend|next|circular|parent|item|each|scroll|timer|split|buttons|jcarouselstate|true|animate|initCallback|Math|marginRight|clipping|while|hasClass|break|auto|for|pos|setup|bind|fn|disabled|offsetWidth|display|before|block|create|stopAuto|placeholder|removeClass|li|reloadCallback|width|format|attr|animation|buttonPrevCallback|notify|marginBottom|buttonNextCallback|ceil|buttonPrevHTML|typeof|buttonNextHTML|scrollTail|funcResize|remove|oWidth2|after|oWidth|both|old|offset|unbind|top|left|start|height|window|safari|swap|init|funcPrev|easing|marginTop|offsetHeight|marginLeft|jquery|object|onAfterAnimation|startAuto|buttonPrevEvent|click|buttonNextEvent|ol|ul|itemVisibleOutCallback|reload|prepend|itemVisibleInCallback|nodeName|add|itemLastOutCallback|skin|itemLastInCallback|indexOf|itemFirstOutCallback|browser|itemFirstInCallback|empty|reset|resize|itemLoadCallback|funcNext|prototype|load|isNaN|parseInt|none|float|floor|round|index|swing|borderTopWidth|borderRightWidth|borderLeftWidth|horizontal|jcarouselindex|isFunction|normal|clearTimeout|1000|setTimeout|onBeforeAnimation|children|push|Aborting|loop|infinite|an|cause|will|This|items|set|No|jCarousel|alert|class|find|borderBottomWidth|append|html|string|defaults|OL|UL|new|has|unlock|lock|10px|0px|jQuery".split("|"),0,{}));(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"y",duration:1};A.window=function(D){return C(window).scrollable()};C.fn.scrollable=function(){return this.map(function(){var G=this.parentWindow||this.defaultView,E=this.nodeName=="#document"?G.frameElement||G:this,F=E.contentDocument||(E.contentWindow||E).document,D=E.setInterval;return E.nodeName=="IFRAME"||D&&C.browser.safari?F.body:D?F.documentElement:this})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this.scrollable().each(function(){var M=this,K=C(M),L=F,J,H={},N=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){J=(L=C(L)).offset()}}C.each(D.axis.split(""),function(R,S){var T=S=="x"?"Left":"Top",V=T.toLowerCase(),Q="scroll"+T,O=M[Q],P=S=="x"?"Width":"Height",U=P.toLowerCase();if(J){H[Q]=J[V]+(N?0:O-K.offset()[V]);if(D.margin){H[Q]-=parseInt(L.css("margin"+T))||0;H[Q]-=parseInt(L.css("border"+T+"Width"))||0}H[Q]+=D.offset[V]||0;if(D.over[V]){H[Q]+=L[U]()*D.over[V]}}else{H[Q]=L[V]}if(/^\d+$/.test(H[Q])){H[Q]=H[Q]<=0?0:Math.min(H[Q],G(P))}if(!R&&D.queue){if(O!=H[Q]){I(D.onAfterFirst)}delete H[Q]}});I(D.onAfter);function I(O){K.animate(H,E,D.easing,O&&function(){O.call(this,F,D)})}function G(P){var O="scroll"+P,Q=M.ownerDocument;return N?Math.max(Q.documentElement[O],Q.body[O]):M[O]}}).end()};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);jQuery.fn.countdown=function(options){if(!options){options="()"}if(jQuery(this).length==0){return false}var obj=this;if(options.seconds<0||options.seconds=="undefined"){if(options.callback){eval(options.callback)}return null}window.setTimeout(function(){var nSecsPerMin=60;var nMinsPerHour=60;var nSecsPerHour=nSecsPerMin*nMinsPerHour;var nHoursPerDay=24;var nSecsPerDay=nSecsPerHour*nHoursPerDay;var nSecsToStartShowingRed=3*nSecsPerHour;var bSpaceSeparators=options.spaceSeparators;var nSecsLeft=options.seconds;var days=Math.floor(nSecsLeft/nSecsPerDay);nSecsLeft=nSecsLeft-(days*nSecsPerDay);var hours=Math.floor(nSecsLeft/nSecsPerHour);nSecsLeft=nSecsLeft-(hours*nSecsPerHour);var mins=Math.floor(nSecsLeft/nSecsPerMin);nSecsLeft=nSecsLeft-(mins*nSecsPerMin);var secs=nSecsLeft;var sDisplayTime="";if(days>0){sDisplayTime+=days+" day";if(days>1){sDisplayTime+="s"}if(bSpaceSeparators){sDisplayTime+=" "}else{if((hours>0)&&(mins>0)){sDisplayTime+=", "}else{if(hours>0){sDisplayTime+=" and "}}}}if(hours>0){sDisplayTime+=hours+" hour";if(hours>1){sDisplayTime+="s"}if(bSpaceSeparators){sDisplayTime+=" "}else{if((days>0)&&(mins>0)){sDisplayTime+=", and "}else{if(mins>0){sDisplayTime+=" and "}}}}if(mins>0){sDisplayTime+=mins+" minute";if(mins>1){sDisplayTime+="s"}sDisplayTime+=" "}jQuery(obj).html(String(sDisplayTime));if(options.seconds<nSecsToStartShowingRed){jQuery(obj).css("color",options.alertColor)}--options.seconds;window.setTimeout(function(){jQuery(obj).countdown(options)},1000)},0);return this};BN.namespace("shippingCountdown");BN.shippingCountdown={init:function(){var that=this;$("#shippingCountdown span.countdown, #dailyGemCountDown").each(function(){var start=$(this).attr("data-clockstart");var sAlertColor=$(this).attr("data-alertcolor");var sSpaceSeparators=$(this).attr("data-spaceSeparators");$(this).countdown({seconds:start,callback:"BN.shippingCountdown.expiredCountdown()",alertColor:sAlertColor?sAlertColor:"#cc3333",spaceSeparators:sSpaceSeparators?eval(sSpaceSeparators):true})})},expiredCountdown:function(){$("#shippingCountdown").html("<div></div>")}};(function(G){if(/1\.(0|1|2)\.(0|1|2)/.test(G.fn.jquery)||/^1.1/.test(G.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+G.fn.jquery);return }G.fn._fadeIn=G.fn.fadeIn;var I=document.documentMode||0;var D=G.browser.msie&&((G.browser.version<8&&!I)||I<8);var E=G.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!I;G.blockUI=function(O){C(window,O)};G.unblockUI=function(O){H(window,O)};G.growlUI=function(S,Q,R,O){var P=G('<div class="growlUI"></div>');if(S){P.append("<h1>"+S+"</h1>")}if(Q){P.append("<h2>"+Q+"</h2>")}if(R==undefined){R=3000}G.blockUI({message:P,fadeIn:700,fadeOut:1000,centerY:false,timeout:R,showOverlay:false,onUnblock:O,css:G.blockUI.defaults.growlCSS})};G.fn.block=function(O){return this.unblock({fadeOut:0}).each(function(){if(G.css(this,"position")=="static"){this.style.position="relative"}if(G.browser.msie){this.style.zoom=1}C(this,O)})};G.fn.unblock=function(O){return this.each(function(){H(this,O)})};G.blockUI.version=2.23;G.blockUI.defaults={message:'<img src="http://pics.bluenile.com/ai/diamond_search/updatingresults_anime.gif">',css:{padding:0,margin:0,width:"250px",height:"100px",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"2px solid #aaa",backgroundColor:"#fff",cursor:"wait"},overlayCSS:{backgroundColor:"#ddd",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:null,color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:0,fadeOut:0,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null,quirksmodeOffsetHack:4};var B=null;var F=[];function C(Q,O){var Z=(Q==window);var R=O&&O.message!==undefined?O.message:undefined;O=G.extend({},G.blockUI.defaults,O||{});O.overlayCSS=G.extend({},G.blockUI.defaults.overlayCSS,O.overlayCSS||{});var Y=G.extend({},G.blockUI.defaults.css,O.css||{});R=R===undefined?O.message:R;if(Z&&B){H(window,{fadeOut:0})}if(R&&typeof R!="string"&&(R.parentNode||R.jquery)){var T=R.jquery?R[0]:R;var X={};G(Q).data("blockUI.history",X);X.el=T;X.parent=T.parentNode;X.display=T.style.display;X.position=T.style.position;if(X.parent){X.parent.removeChild(T)}}var a=O.baseZ;var W=(G.browser.msie||O.forceIframe)?G('<iframe class="blockUI" style="z-index:'+(a++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+O.iframeSrc+'"></iframe>'):G('<div class="blockUI" style="display:none"></div>');var V=G('<div class="blockUI blockOverlay" style="z-index:'+(a++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var S=Z?G('<div class="blockUI blockMsg blockPage" style="z-index:'+a+';display:none;position:fixed"></div>'):G('<div class="blockUI blockMsg blockElement" style="z-index:'+a+';display:none;position:absolute"></div>');if(R){S.css(Y)}if(!O.applyPlatformOpacityRules||!(G.browser.mozilla&&/Linux/.test(navigator.platform))){V.css(O.overlayCSS)}V.css("position",Z?"fixed":"absolute");if(G.browser.msie||O.forceIframe){W.css("opacity",0)}G([W[0],V[0],S[0]]).appendTo(Z?"body":Q);var d=D&&(!G.boxModel||G("object,embed",Z?null:Q).length>0);if(E||d){if(Z&&O.allowBodyStretch&&G.boxModel){G("html,body").css("height","100%")}if((E||!G.boxModel)&&!Z){var e=L(Q,"borderTopWidth"),U=L(Q,"borderLeftWidth");var c=e?"(0 - "+e+")":0;var P=U?"(0 - "+U+")":0}G.each([W,V,S],function(f,k){var g=k[0].style;g.position="absolute";if(f<2){Z?g.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+O.quirksmodeOffsetHack+') + "px"'):g.setExpression("height",'this.parentNode.offsetHeight + "px"');Z?g.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):g.setExpression("width",'this.parentNode.offsetWidth + "px"');if(P){g.setExpression("left",P)}if(c){g.setExpression("top",c)}}else{if(O.centerY){if(Z){g.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}g.marginTop=0}else{if(!O.centerY&&Z){var h=(O.css&&O.css.top)?parseInt(O.css.top):0;var j="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+h+') + "px"';g.setExpression("top",j)}}}})}if(R){S.append(R);if(R.jquery||R.nodeType){G(R).show()}}if((G.browser.msie||O.forceIframe)&&O.showOverlay){W.show()}if(O.fadeIn){if(O.showOverlay){V._fadeIn(O.fadeIn)}if(R){S.fadeIn(O.fadeIn)}}else{if(O.showOverlay){V.show()}if(R){S.show()}}K(1,Q,O);if(Z){B=S[0];F=G(":input:enabled:visible",B);if(O.focusInput){setTimeout(N,20)}}else{A(S[0],O.centerX,O.centerY)}if(O.timeout){var b=setTimeout(function(){Z?G.unblockUI(O):G(Q).unblock(O)},O.timeout);G(Q).data("blockUI.timeout",b)}}function H(R,S){var Q=R==window;var P=G(R);var T=P.data("blockUI.history");var U=P.data("blockUI.timeout");if(U){clearTimeout(U);P.removeData("blockUI.timeout")}S=G.extend({},G.blockUI.defaults,S||{});K(0,R,S);var O=Q?G("body").children().filter(".blockUI"):G(".blockUI",R);if(Q){B=F=null}if(S.fadeOut){O.fadeOut(S.fadeOut);setTimeout(function(){J(O,T,S,R)},S.fadeOut)}else{J(O,T,S,R)}}function J(O,R,Q,P){O.each(function(S,T){if(this.parentNode){this.parentNode.removeChild(this)}});if(R&&R.el){R.el.style.display=R.display;R.el.style.position=R.position;if(R.parent){R.parent.appendChild(R.el)}G(R.el).removeData("blockUI.history")}if(typeof Q.onUnblock=="function"){Q.onUnblock(P,Q)}}function K(O,S,T){var R=S==window,Q=G(S);if(!O&&(R&&!B||!R&&!Q.data("blockUI.isBlocked"))){return }if(!R){Q.data("blockUI.isBlocked",O)}if(!T.bindEvents||(O&&!T.showOverlay)){return }var P="mousedown mouseup keydown keypress";O?G(document).bind(P,T,M):G(document).unbind(P,M)}function M(R){if(R.keyCode&&R.keyCode==9){if(B&&R.data.constrainTabKey){var Q=F;var P=!R.shiftKey&&R.target==Q[Q.length-1];var O=R.shiftKey&&R.target==Q[0];if(P||O){setTimeout(function(){N(O)},10);return false}}}if(G(R.target).parents("div.blockMsg").length>0){return true}return G(R.target).parents().children().filter("div.blockUI").length==0}function N(O){if(!F){return }var P=F[O===true?F.length-1:0];if(P){P.focus()}}function A(S,O,U){var T=S.parentNode,R=S.style;var P=((T.offsetWidth-S.offsetWidth)/2)-L(T,"borderLeftWidth");var Q=((T.offsetHeight-S.offsetHeight)/2)-L(T,"borderTopWidth");if(O){R.left=P>0?(P+"px"):"0"}if(U){R.top=Q>0?(Q+"px"):"0"}}function L(O,P){return parseInt(G.css(O,P))||0}})(jQuery);