jQuery.iUtil={getPosition:function(A){
    var H=0,G=0,F=A.style,D=false;
    if(jQuery(A).css("display")=="none"){
      var C=F.visibility,E=F.position;
      D=true;
      F.visibility="hidden";
      F.display="block";
      F.position="absolute";
    }
    var B=A;
    while(B){
      H+=B.offsetLeft+(B.currentStyle&&!jQuery.browser.opera?parseInt(B.currentStyle.borderLeftWidth)||0:0);
      G+=B.offsetTop+(B.currentStyle&&!jQuery.browser.opera?parseInt(B.currentStyle.borderTopWidth)||0:0);
      B=B.offsetParent;
    }
    B=A;
    while(B&&B.tagName&&B.tagName.toLowerCase()!="body"){
      H-=B.scrollLeft||0;
      G-=B.scrollTop||0;
      B=B.parentNode;
    }
    if(D==true){
      F.display="none";
      F.position=E;
      F.visibility=C;
    }
    return {x:H,y:G};
  },getPositionLite:function(A){
    var C=0,B=0;
    while(A){
      C+=A.offsetLeft||0;
      B+=A.offsetTop||0;
      A=A.offsetParent;
    }
    return {x:C,y:B};
  },getSize:function(B){
    var A=jQuery.css(B,"width"),H=jQuery.css(B,"height"),E=0,F=0,G=B.style;
    if(jQuery(B).css("display")!="none"){
      E=B.offsetWidth;
      F=B.offsetHeight;
    }else {
      var C=G.visibility,D=G.position;
      G.visibility="hidden";
      G.display="block";
      G.position="absolute";
      E=B.offsetWidth;
      F=B.offsetHeight;
      G.display="none";
      G.position=D;
      G.visibility=C;
    }
    return {w:A,h:H,wb:E,hb:F};
  },getSizeLite:function(A){
    return {wb:A.offsetWidth||0,hb:A.offsetHeight||0};
  },getClient:function(C){
    var D,B,A;
    if(C){
      B=C.clientWidth;
      D=C.clientHeight;
    }else {
      A=document.documentElement;
      B=window.innerWidth||self.innerWidth||(A&&A.clientWidth)||document.body.clientWidth;
      D=window.innerHeight||self.innerHeight||(A&&A.clientHeight)||document.body.clientHeight;
    }
    return {w:B,h:D};
  },getScroll:function(C){
    var B=0,F=0,A=0,G=0,E=0,D=0;
    if(C&&C.nodeName.toLowerCase()!="body"){
      B=C.scrollTop;
      F=C.scrollLeft;
      A=C.scrollWidth;
      G=C.scrollHeight;
      E=0;
      D=0;
    }else {
      if(document.documentElement){
        B=document.documentElement.scrollTop;
        F=document.documentElement.scrollLeft;
        A=document.documentElement.scrollWidth;
        G=document.documentElement.scrollHeight;
      }else {
        if(document.body){
          B=document.body.scrollTop;
          F=document.body.scrollLeft;
          A=document.body.scrollWidth;
          G=document.body.scrollHeight;
        }
      }
      E=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
      D=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
    }
    return {t:B,l:F,w:A,h:G,iw:E,ih:D};
  },getMargins:function(B,E){
    var D=jQuery(B),A=D.css("marginTop")||"",F=D.css("marginRight")||"",C=D.css("marginBottom")||"",G=D.css("marginLeft")||"";
    if(E){
      return {t:parseInt(A)||0,r:parseInt(F)||0,b:parseInt(C)||0,l:parseInt(G)};
    }else {
      return {t:A,r:F,b:C,l:G};
    }
  },getPadding:function(B,E){
    var D=jQuery(B),A=D.css("paddingTop")||"",F=D.css("paddingRight")||"",C=D.css("paddingBottom")||"",G=D.css("paddingLeft")||"";
    if(E){
      return {t:parseInt(A)||0,r:parseInt(F)||0,b:parseInt(C)||0,l:parseInt(G)};
    }else {
      return {t:A,r:F,b:C,l:G};
    }
  },getBorder:function(B,E){
    var D=jQuery(B),A=D.css("borderTopWidth")||"",F=D.css("borderRightWidth")||"",C=D.css("borderBottomWidth")||"",G=D.css("borderLeftWidth")||"";
    if(E){
      return {t:parseInt(A)||0,r:parseInt(F)||0,b:parseInt(C)||0,l:parseInt(G)||0};
    }else {
      return {t:A,r:F,b:C,l:G};
    }
  },getPointer:function(A){
    var C=A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0,B=A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;
    return {x:C,y:B};
  },traverseDOM:function(A,B){
    B(A);
    A=A.firstChild;
    while(A){
      jQuery.iUtil.traverseDOM(A,B);
      A=A.nextSibling;
    }
  },purgeEvents:function(A){
    jQuery.iUtil.traverseDOM(A,function(A){
      for(var B in A){
        if(typeof A[B]==="function"){
          A[B]=null;
        }
      }
    });
  },centerEl:function(B,A){
    var D=jQuery.iUtil.getScroll(),C=jQuery.iUtil.getSize(B);
    if(!A||A=="vertically"){
      jQuery(B).css({top:D.t+((Math.max(D.h,D.ih)-D.t-C.hb)/2)+"px"});
    }
    if(!A||A=="horizontally"){
      jQuery(B).css({left:D.l+((Math.max(D.w,D.iw)-D.l-C.wb)/2)+"px"});
    }
  },fixPNG:function(A,D){
    var C=jQuery("img[@src*=\"png\"]",A||document),B;
    C.each(function(){
      B=this.src;
      this.src=D;
      this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B+"')";
    });
  }};
[].indexOf||(Array.prototype.indexOf=function(A,B){
  B=(B==null)?0:B;
  var C=this.length;
  for(var D=B;D<C;D++){
    if(this[D]==A){
      return D;
    }
  }
  return -1;
});
jQuery.iDrag={helper:null,dragged:null,destroy:function(){
    return this.each(function(){
      if(this.isDraggable){
        this.dragCfg.dhe.unbind("mousedown",jQuery.iDrag.draginit);
        this.dragCfg=null;
        this.isDraggable=false;
        if(jQuery.browser.msie){
          this.unselectable="off";
        }else {
          this.style.MozUserSelect="";
          this.style.KhtmlUserSelect="";
          this.style.userSelect="";
        }
      }
    });
  },draginit:function(A){
    if(jQuery.iDrag.dragged!=null){
      jQuery.iDrag.dragstop(A);
      return false;
    }
    var B=this.dragElem;
    jQuery(document).bind("mousemove",jQuery.iDrag.dragmove).bind("mouseup",jQuery.iDrag.dragstop);
    B.dragCfg.pointer=jQuery.iUtil.getPointer(A);
    B.dragCfg.currentPointer=B.dragCfg.pointer;
    B.dragCfg.init=false;
    B.dragCfg.fromHandler=this!=this.dragElem;
    jQuery.iDrag.dragged=B;
    if(B.dragCfg.si&&this!=this.dragElem){
      parentPos=jQuery.iUtil.getPosition(B.parentNode);
      sliderSize=jQuery.iUtil.getSize(B);
      sliderPos={x:parseInt(jQuery.css(B,"left"))||0,y:parseInt(jQuery.css(B,"top"))||0};
      dx=B.dragCfg.currentPointer.x-parentPos.x-sliderSize.wb/2-sliderPos.x;
      dy=B.dragCfg.currentPointer.y-parentPos.y-sliderSize.hb/2-sliderPos.y;
      jQuery.iSlider.dragmoveBy(B,[dx,dy]);
    }
    return jQuery.selectKeyHelper||false;
  },dragstart:function(A){
    var B=jQuery.iDrag.dragged;
    B.dragCfg.init=true;
    var D=B.style;
    B.dragCfg.oD=jQuery.css(B,"display");
    B.dragCfg.oP=jQuery.css(B,"position");
    if(!B.dragCfg.initialPosition){
      B.dragCfg.initialPosition=B.dragCfg.oP;
    }
    B.dragCfg.oR={x:parseInt(jQuery.css(B,"left"))||0,y:parseInt(jQuery.css(B,"top"))||0};
    B.dragCfg.diffX=0;
    B.dragCfg.diffY=0;
    if(jQuery.browser.msie){
      var F=jQuery.iUtil.getBorder(B,true);
      B.dragCfg.diffX=F.l||0;
      B.dragCfg.diffY=F.t||0;
    }
    B.dragCfg.oC=jQuery.extend(jQuery.iUtil.getPosition(B),jQuery.iUtil.getSize(B));
    if(B.dragCfg.oP!="relative"&&B.dragCfg.oP!="absolute"){
      D.position="relative";
    }
    jQuery.iDrag.helper.empty();
    var E=B.cloneNode(true);
    jQuery(E).css({display:"block",left:"0px",top:"0px"});
    E.style.marginTop="0";
    E.style.marginRight="0";
    E.style.marginBottom="0";
    E.style.marginLeft="0";
    jQuery.iDrag.helper.append(E);
    var C=jQuery.iDrag.helper.get(0).style;
    if(B.dragCfg.autoSize){
      C.width="auto";
      C.height="auto";
    }else {
      C.height=B.dragCfg.oC.hb+"px";
      C.width=B.dragCfg.oC.wb+"px";
    }
    C.display="block";
    C.marginTop="0px";
    C.marginRight="0px";
    C.marginBottom="0px";
    C.marginLeft="0px";
    jQuery.extend(B.dragCfg.oC,jQuery.iUtil.getSize(E));
    if(B.dragCfg.cursorAt){
      if(B.dragCfg.cursorAt.left){
        B.dragCfg.oR.x+=B.dragCfg.pointer.x-B.dragCfg.oC.x-B.dragCfg.cursorAt.left;
        B.dragCfg.oC.x=B.dragCfg.pointer.x-B.dragCfg.cursorAt.left;
      }
      if(B.dragCfg.cursorAt.top){
        B.dragCfg.oR.y+=B.dragCfg.pointer.y-B.dragCfg.oC.y-B.dragCfg.cursorAt.top;
        B.dragCfg.oC.y=B.dragCfg.pointer.y-B.dragCfg.cursorAt.top;
      }
      if(B.dragCfg.cursorAt.right){
        B.dragCfg.oR.x+=B.dragCfg.pointer.x-B.dragCfg.oC.x-B.dragCfg.oC.hb+B.dragCfg.cursorAt.right;
        B.dragCfg.oC.x=B.dragCfg.pointer.x-B.dragCfg.oC.wb+B.dragCfg.cursorAt.right;
      }
      if(B.dragCfg.cursorAt.bottom){
        B.dragCfg.oR.y+=B.dragCfg.pointer.y-B.dragCfg.oC.y-B.dragCfg.oC.hb+B.dragCfg.cursorAt.bottom;
        B.dragCfg.oC.y=B.dragCfg.pointer.y-B.dragCfg.oC.hb+B.dragCfg.cursorAt.bottom;
      }
    }
    B.dragCfg.nx=B.dragCfg.oR.x;
    B.dragCfg.ny=B.dragCfg.oR.y;
    if(B.dragCfg.insideParent||B.dragCfg.containment=="parent"){
      parentBorders=jQuery.iUtil.getBorder(B.parentNode,true);
      B.dragCfg.oC.x=B.offsetLeft+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.l:parentBorders.l);
      B.dragCfg.oC.y=B.offsetTop+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.t:parentBorders.t);
      jQuery(B.parentNode).append(jQuery.iDrag.helper.get(0));
    }
    if(B.dragCfg.containment){
      jQuery.iDrag.getContainment(B);
      B.dragCfg.onDragModifier.containment=jQuery.iDrag.fitToContainer;
    }
    if(B.dragCfg.si){
      jQuery.iSlider.modifyContainer(B);
    }
    C.left=B.dragCfg.oC.x-B.dragCfg.diffX+"px";
    C.top=B.dragCfg.oC.y-B.dragCfg.diffY+"px";
    C.width=B.dragCfg.oC.wb+"px";
    C.height=B.dragCfg.oC.hb+"px";
    jQuery.iDrag.dragged.dragCfg.prot=false;
    if(B.dragCfg.gx){
      B.dragCfg.onDragModifier.grid=jQuery.iDrag.snapToGrid;
    }
    if(B.dragCfg.zIndex!=false){
      jQuery.iDrag.helper.css("zIndex",B.dragCfg.zIndex);
    }
    if(B.dragCfg.opacity){
      jQuery.iDrag.helper.css("opacity",B.dragCfg.opacity);
      if(window.ActiveXObject){
        jQuery.iDrag.helper.css("filter","alpha(opacity="+B.dragCfg.opacity*100+")");
      }
    }
    if(B.dragCfg.frameClass){
      jQuery.iDrag.helper.addClass(B.dragCfg.frameClass);
      jQuery.iDrag.helper.get(0).firstChild.style.display="none";
    }
    if(B.dragCfg.onStart){
      B.dragCfg.onStart.apply(B,[E,B.dragCfg.oR.x,B.dragCfg.oR.y]);
    }
    if(jQuery.iDrop&&jQuery.iDrop.count>0){
      jQuery.iDrop.highlight(B);
    }
    if(B.dragCfg.ghosting==false){
      D.display="none";
    }
    return false;
  },getContainment:function(A){
    if(A.dragCfg.containment.constructor==String){
      if(A.dragCfg.containment=="parent"){
        A.dragCfg.cont=jQuery.extend({x:0,y:0},jQuery.iUtil.getSize(A.parentNode));
        var C=jQuery.iUtil.getBorder(A.parentNode,true);
        A.dragCfg.cont.w=A.dragCfg.cont.wb-C.l-C.r;
        A.dragCfg.cont.h=A.dragCfg.cont.hb-C.t-C.b;
      }else {
        if(A.dragCfg.containment=="document"){
          var B=jQuery.iUtil.getClient();
          A.dragCfg.cont={x:0,y:0,w:B.w,h:B.h};
        }
      }
    }else {
      if(A.dragCfg.containment.constructor==Array){
        A.dragCfg.cont={x:parseInt(A.dragCfg.containment[0])||0,y:parseInt(A.dragCfg.containment[1])||0,w:parseInt(A.dragCfg.containment[2])||0,h:parseInt(A.dragCfg.containment[3])||0};
      }
    }
    A.dragCfg.cont.dx=A.dragCfg.cont.x-A.dragCfg.oC.x;
    A.dragCfg.cont.dy=A.dragCfg.cont.y-A.dragCfg.oC.y;
  },hidehelper:function(A){
    if(A.dragCfg.insideParent||A.dragCfg.containment=="parent"){
      jQuery("body",document).append(jQuery.iDrag.helper.get(0));
    }
    jQuery.iDrag.helper.empty().hide().css("opacity",1);
    if(window.ActiveXObject){
      jQuery.iDrag.helper.css("filter","alpha(opacity=100)");
    }
  },dragstop:function(A){
    jQuery(document).unbind("mousemove",jQuery.iDrag.dragmove).unbind("mouseup",jQuery.iDrag.dragstop);
    if(jQuery.iDrag.dragged==null){
      return ;
    }
    var F=jQuery.iDrag.dragged;
    jQuery.iDrag.dragged=null;
    if(F.dragCfg.init==false){
      return false;
    }
    if(F.dragCfg.so==true){
      jQuery(F).css("position",F.dragCfg.oP);
    }
    var C=F.style;
    if(F.si){
      jQuery.iDrag.helper.css("cursor","move");
    }
    if(F.dragCfg.frameClass){
      jQuery.iDrag.helper.removeClass(F.dragCfg.frameClass);
    }
    if(F.dragCfg.revert==false){
      if(F.dragCfg.fx>0){
        if(!F.dragCfg.axis||F.dragCfg.axis=="horizontally"){
          var E=new jQuery.fx(F,{duration:F.dragCfg.fx},"left");
          E.custom(F.dragCfg.oR.x,F.dragCfg.nRx);
        }
        if(!F.dragCfg.axis||F.dragCfg.axis=="vertically"){
          var D=new jQuery.fx(F,{duration:F.dragCfg.fx},"top");
          D.custom(F.dragCfg.oR.y,F.dragCfg.nRy);
        }
      }else {
        if(!F.dragCfg.axis||F.dragCfg.axis=="horizontally"){
          F.style.left=F.dragCfg.nRx+"px";
        }
        if(!F.dragCfg.axis||F.dragCfg.axis=="vertically"){
          F.style.top=F.dragCfg.nRy+"px";
        }
      }
      jQuery.iDrag.hidehelper(F);
      if(F.dragCfg.ghosting==false){
        jQuery(F).css("display",F.dragCfg.oD);
      }
    }else {
      if(F.dragCfg.fx>0){
        F.dragCfg.prot=true;
        var B=false;
        if(jQuery.iDrop&&jQuery.iSort&&F.dragCfg.so){
          B=jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0));
        }
        jQuery.iDrag.helper.animate({left:B?B.x:F.dragCfg.oC.x,top:B?B.y:F.dragCfg.oC.y},F.dragCfg.fx,function(){
          F.dragCfg.prot=false;
          if(F.dragCfg.ghosting==false){
            F.style.display=F.dragCfg.oD;
          }
          jQuery.iDrag.hidehelper(F);
        });
      }else {
        jQuery.iDrag.hidehelper(F);
        if(F.dragCfg.ghosting==false){
          jQuery(F).css("display",F.dragCfg.oD);
        }
      }
    }
    if(jQuery.iDrop&&jQuery.iDrop.count>0){
      jQuery.iDrop.checkdrop(F);
    }
    if(jQuery.iSort&&F.dragCfg.so){
      jQuery.iSort.check(F);
    }
    if(F.dragCfg.onChange&&(F.dragCfg.nRx!=F.dragCfg.oR.x||F.dragCfg.nRy!=F.dragCfg.oR.y)){
      F.dragCfg.onChange.apply(F,F.dragCfg.lastSi||[0,0,F.dragCfg.nRx,F.dragCfg.nRy]);
    }
    if(F.dragCfg.onStop){
      F.dragCfg.onStop.apply(F);
    }
    return false;
  },snapToGrid:function(D,C,A,B){
    if(A!=0){
      A=parseInt((A+(this.dragCfg.gx*A/Math.abs(A))/2)/this.dragCfg.gx)*this.dragCfg.gx;
    }
    if(B!=0){
      B=parseInt((B+(this.dragCfg.gy*B/Math.abs(B))/2)/this.dragCfg.gy)*this.dragCfg.gy;
    }
    return {dx:A,dy:B,x:0,y:0};
  },fitToContainer:function(D,C,A,B){
    A=Math.min(Math.max(A,this.dragCfg.cont.dx),this.dragCfg.cont.w+this.dragCfg.cont.dx-this.dragCfg.oC.wb);
    B=Math.min(Math.max(B,this.dragCfg.cont.dy),this.dragCfg.cont.h+this.dragCfg.cont.dy-this.dragCfg.oC.hb);
    return {dx:A,dy:B,x:0,y:0};
  },dragmove:function(B){
    if(jQuery.iDrag.dragged==null||jQuery.iDrag.dragged.dragCfg.prot==true){
      return ;
    }
    var F=jQuery.iDrag.dragged;
    F.dragCfg.currentPointer=jQuery.iUtil.getPointer(B);
    if(F.dragCfg.init==false){
      distance=Math.sqrt(Math.pow(F.dragCfg.pointer.x-F.dragCfg.currentPointer.x,2)+Math.pow(F.dragCfg.pointer.y-F.dragCfg.currentPointer.y,2));
      if(distance<F.dragCfg.snapDistance){
        return ;
      }else {
        jQuery.iDrag.dragstart(B);
      }
    }
    var C=F.dragCfg.currentPointer.x-F.dragCfg.pointer.x,D=F.dragCfg.currentPointer.y-F.dragCfg.pointer.y;
    for(var E in F.dragCfg.onDragModifier){
      var A=F.dragCfg.onDragModifier[E].apply(F,[F.dragCfg.oR.x+C,F.dragCfg.oR.y+D,C,D]);
      if(A&&A.constructor==Object){
        C=E!="user"?A.dx:(A.x-F.dragCfg.oR.x);
        D=E!="user"?A.dy:(A.y-F.dragCfg.oR.y);
      }
    }
    F.dragCfg.nx=F.dragCfg.oC.x+C-F.dragCfg.diffX;
    F.dragCfg.ny=F.dragCfg.oC.y+D-F.dragCfg.diffY;
    if(F.dragCfg.si&&(F.dragCfg.onSlide||F.dragCfg.onChange)){
      jQuery.iSlider.onSlide(F,F.dragCfg.nx,F.dragCfg.ny);
    }
    if(F.dragCfg.onDrag){
      F.dragCfg.onDrag.apply(F,[F.dragCfg.oR.x+C,F.dragCfg.oR.y+D]);
    }
    if(!F.dragCfg.axis||F.dragCfg.axis=="horizontally"){
      F.dragCfg.nRx=F.dragCfg.oR.x+C;
      jQuery.iDrag.helper.get(0).style.left=F.dragCfg.nx+"px";
    }
    if(!F.dragCfg.axis||F.dragCfg.axis=="vertically"){
      F.dragCfg.nRy=F.dragCfg.oR.y+D;
      jQuery.iDrag.helper.get(0).style.top=F.dragCfg.ny+"px";
    }
    if(jQuery.iDrop&&jQuery.iDrop.count>0){
      jQuery.iDrop.checkhover(F);
    }
    return false;
  },build:function(B){
    if(!jQuery.iDrag.helper){
      jQuery("body",document).append("<div id=\"dragHelper\"></div>");
      jQuery.iDrag.helper=jQuery("#dragHelper");
      var A=jQuery.iDrag.helper.get(0),C=A.style;
      C.position="absolute";
      C.display="none";
      C.cursor="move";
      C.listStyle="none";
      C.overflow="hidden";
      if(window.ActiveXObject){
        A.unselectable="on";
      }else {
        C.mozUserSelect="none";
        C.userSelect="none";
        C.KhtmlUserSelect="none";
      }
    }
    if(!B){
      B={};
    }
    return this.each(function(){
      if(this.isDraggable||!jQuery.iUtil){
        return ;
      }
      if(window.ActiveXObject){
        this.onselectstart=function(){
          return false;
        };
        this.ondragstart=function(){
          return false;
        };
      }
      var A=this,C=B.handle?jQuery(this).find(B.handle):jQuery(this);
      if(jQuery.browser.msie){
        C.each(function(){
          this.unselectable="on";
        });
      }else {
        C.css("-moz-user-select","none");
        C.css("user-select","none");
        C.css("-khtml-user-select","none");
      }
      this.dragCfg={dhe:C,revert:B.revert?true:false,ghosting:B.ghosting?true:false,so:B.so?B.so:false,si:B.si?B.si:false,insideParent:B.insideParent?B.insideParent:false,zIndex:B.zIndex?parseInt(B.zIndex)||0:false,opacity:B.opacity?parseFloat(B.opacity):false,fx:parseInt(B.fx)||null,hpc:B.hpc?B.hpc:false,onDragModifier:{},pointer:{},onStart:B.onStart&&B.onStart.constructor==Function?B.onStart:false,onStop:B.onStop&&B.onStop.constructor==Function?B.onStop:false,onChange:B.onChange&&B.onChange.constructor==Function?B.onChange:false,axis:/vertically|horizontally/.test(B.axis)?B.axis:false,snapDistance:B.snapDistance?parseInt(B.snapDistance)||0:0,cursorAt:B.cursorAt?B.cursorAt:false,autoSize:B.autoSize?true:false,frameClass:B.frameClass||false};
      if(B.onDragModifier&&B.onDragModifier.constructor==Function){
        this.dragCfg.onDragModifier.user=B.onDragModifier;
      }
      if(B.onDrag&&B.onDrag.constructor==Function){
        this.dragCfg.onDrag=B.onDrag;
      }
      if(B.containment&&((B.containment.constructor==String&&(B.containment=="parent"||B.containment=="document"))||(B.containment.constructor==Array&&B.containment.length==4))){
        this.dragCfg.containment=B.containment;
      }
      if(B.fractions){
        this.dragCfg.fractions=B.fractions;
      }
      if(B.grid){
        if(typeof B.grid=="number"){
          this.dragCfg.gx=parseInt(B.grid)||1;
          this.dragCfg.gy=parseInt(B.grid)||1;
        }else {
          if(B.grid.length==2){
            this.dragCfg.gx=parseInt(B.grid[0])||1;
            this.dragCfg.gy=parseInt(B.grid[1])||1;
          }
        }
      }
      if(B.onSlide&&B.onSlide.constructor==Function){
        this.dragCfg.onSlide=B.onSlide;
      }
      this.isDraggable=true;
      C.each(function(){
        this.dragElem=A;
      });
      C.bind("mousedown",jQuery.iDrag.draginit);
    });
  }};
jQuery.fn.extend({DraggableDestroy:jQuery.iDrag.destroy,Draggable:jQuery.iDrag.build});
jQuery.iDrop={fit:function(D,C,B,A){
    return D<=jQuery.iDrag.dragged.dragCfg.nx&&(D+B)>=(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)&&C<=jQuery.iDrag.dragged.dragCfg.ny&&(C+A)>=(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)?true:false;
  },intersect:function(D,C,B,A){
    return !(D>(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)||(D+B)<jQuery.iDrag.dragged.dragCfg.nx||C>(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)||(C+A)<jQuery.iDrag.dragged.dragCfg.ny)?true:false;
  },pointer:function(D,C,B,A){
    return D<jQuery.iDrag.dragged.dragCfg.currentPointer.x&&(D+B)>jQuery.iDrag.dragged.dragCfg.currentPointer.x&&C<jQuery.iDrag.dragged.dragCfg.currentPointer.y&&(C+A)>jQuery.iDrag.dragged.dragCfg.currentPointer.y?true:false;
  },overzone:false,highlighted:{},count:0,zones:{},highlight:function(B){
    if(jQuery.iDrag.dragged==null){
      return ;
    }
    var D;
    jQuery.iDrop.highlighted={};
    var C=false;
    for(D in jQuery.iDrop.zones){
      if(jQuery.iDrop.zones[D]!=null){
        var A=jQuery.iDrop.zones[D].get(0);
        if(jQuery(jQuery.iDrag.dragged).is("."+A.dropCfg.a)){
          if(A.dropCfg.m==false){
            A.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(A),jQuery.iUtil.getSizeLite(A));
            A.dropCfg.m=true;
          }
          if(A.dropCfg.ac){
            jQuery.iDrop.zones[D].addClass(A.dropCfg.ac);
          }
          jQuery.iDrop.highlighted[D]=jQuery.iDrop.zones[D];
          if(jQuery.iSort&&A.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){
            A.dropCfg.el=jQuery("."+A.dropCfg.a,A);
            B.style.display="none";
            jQuery.iSort.measure(A);
            A.dropCfg.os=jQuery.iSort.serialize(jQuery.attr(A,"id")).hash;
            B.style.display=B.dragCfg.oD;
            C=true;
          }
          if(A.dropCfg.onActivate){
            A.dropCfg.onActivate.apply(jQuery.iDrop.zones[D].get(0),[jQuery.iDrag.dragged]);
          }
        }
      }
    }
    if(C){
      jQuery.iSort.start();
    }
  },remeasure:function(){
    jQuery.iDrop.highlighted={};
    for(i in jQuery.iDrop.zones){
      if(jQuery.iDrop.zones[i]!=null){
        var A=jQuery.iDrop.zones[i].get(0);
        if(jQuery(jQuery.iDrag.dragged).is("."+A.dropCfg.a)){
          A.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(A),jQuery.iUtil.getSizeLite(A));
          if(A.dropCfg.ac){
            jQuery.iDrop.zones[i].addClass(A.dropCfg.ac);
          }
          jQuery.iDrop.highlighted[i]=jQuery.iDrop.zones[i];
          if(jQuery.iSort&&A.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){
            A.dropCfg.el=jQuery("."+A.dropCfg.a,A);
            elm.style.display="none";
            jQuery.iSort.measure(A);
            elm.style.display=elm.dragCfg.oD;
          }
        }
      }
    }
  },checkhover:function(D){
    if(jQuery.iDrag.dragged==null){
      return ;
    }
    jQuery.iDrop.overzone=false;
    var E,C=false,B=0;
    for(E in jQuery.iDrop.highlighted){
      var A=jQuery.iDrop.highlighted[E].get(0);
      if(jQuery.iDrop.overzone==false&&jQuery.iDrop[A.dropCfg.t](A.dropCfg.p.x,A.dropCfg.p.y,A.dropCfg.p.wb,A.dropCfg.p.hb)){
        if(A.dropCfg.hc&&A.dropCfg.h==false){
          jQuery.iDrop.highlighted[E].addClass(A.dropCfg.hc);
        }
        if(A.dropCfg.h==false&&A.dropCfg.onHover){
          C=true;
        }
        A.dropCfg.h=true;
        jQuery.iDrop.overzone=A;
        if(jQuery.iSort&&A.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){
          jQuery.iSort.helper.get(0).className=A.dropCfg.shc;
          jQuery.iSort.checkhover(A);
        }
        B++;
      }else {
        if(A.dropCfg.h==true){
          if(A.dropCfg.onOut){
            A.dropCfg.onOut.apply(A,[D,jQuery.iDrag.helper.get(0).firstChild,A.dropCfg.fx]);
          }
          if(A.dropCfg.hc){
            jQuery.iDrop.highlighted[E].removeClass(A.dropCfg.hc);
          }
          A.dropCfg.h=false;
        }
      }
    }
    if(jQuery.iSort&&!jQuery.iDrop.overzone&&jQuery.iDrag.dragged.so){
      jQuery.iSort.helper.get(0).style.display="none";
    }
    if(C){
      jQuery.iDrop.overzone.dropCfg.onHover.apply(jQuery.iDrop.overzone,[D,jQuery.iDrag.helper.get(0).firstChild]);
    }
  },checkdrop:function(B){
    var C;
    for(C in jQuery.iDrop.highlighted){
      var A=jQuery.iDrop.highlighted[C].get(0);
      if(A.dropCfg.ac){
        jQuery.iDrop.highlighted[C].removeClass(A.dropCfg.ac);
      }
      if(A.dropCfg.hc){
        jQuery.iDrop.highlighted[C].removeClass(A.dropCfg.hc);
      }
      if(A.dropCfg.s){
        jQuery.iSort.changed[jQuery.iSort.changed.length]=C;
      }
      if(A.dropCfg.onDrop&&A.dropCfg.h==true){
        A.dropCfg.h=false;
        A.dropCfg.onDrop.apply(A,[B,A.dropCfg.fx]);
      }
      A.dropCfg.m=false;
      A.dropCfg.h=false;
    }
    jQuery.iDrop.highlighted={};
  },destroy:function(){
    return this.each(function(){
      if(this.isDroppable){
        if(this.dropCfg.s){
          id=jQuery.attr(this,"id");
          jQuery.iSort.collected[id]=null;
          jQuery("."+this.dropCfg.a,this).DraggableDestroy();
        }
        jQuery.iDrop.zones["d"+this.idsa]=null;
        this.isDroppable=false;
        this.f=null;
      }
    });
  },build:function(A){
    return this.each(function(){
      if(this.isDroppable==true||!A.accept||!jQuery.iUtil||!jQuery.iDrag){
        return ;
      }
      this.dropCfg={a:A.accept,ac:A.activeclass||false,hc:A.hoverclass||false,shc:A.helperclass||false,onDrop:A.ondrop||A.onDrop||false,onHover:A.onHover||A.onhover||false,onOut:A.onOut||A.onout||false,onActivate:A.onActivate||false,t:A.tolerance&&(A.tolerance=="fit"||A.tolerance=="intersect")?A.tolerance:"pointer",fx:A.fx?A.fx:false,m:false,h:false};
      if(A.sortable==true&&jQuery.iSort){
        id=jQuery.attr(this,"id");
        jQuery.iSort.collected[id]=this.dropCfg.a;
        this.dropCfg.s=true;
        if(A.onChange){
          this.dropCfg.onChange=A.onChange;
          this.dropCfg.os=jQuery.iSort.serialize(id).hash;
        }
      }
      this.isDroppable=true;
      this.idsa=parseInt(Math.random()*10000);
      jQuery.iDrop.zones["d"+this.idsa]=jQuery(this);
      jQuery.iDrop.count++;
    });
  }};
jQuery.fn.extend({DroppableDestroy:jQuery.iDrop.destroy,Droppable:jQuery.iDrop.build});
jQuery.recallDroppables=jQuery.iDrop.remeasure;
jQuery.iSort={changed:[],collected:{},helper:false,inFrontOf:null,start:function(){
    if(jQuery.iDrag.dragged==null){
      return ;
    }
    var B,D,A,C;
    jQuery.iSort.helper.get(0).className=jQuery.iDrag.dragged.dragCfg.hpc;
    B=jQuery.iSort.helper.get(0).style;
    B.display="block";
    jQuery.iSort.helper.oC=jQuery.extend(jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0)),jQuery.iUtil.getSize(jQuery.iSort.helper.get(0)));
    B.width=jQuery.iDrag.dragged.dragCfg.oC.wb+"px";
    B.height=jQuery.iDrag.dragged.dragCfg.oC.hb+"px";
    D=jQuery.iUtil.getMargins(jQuery.iDrag.dragged);
    B.marginTop=D.t;
    B.marginRight=D.r;
    B.marginBottom=D.b;
    B.marginLeft=D.l;
    if(jQuery.iDrag.dragged.dragCfg.ghosting==true){
      A=jQuery.iDrag.dragged.cloneNode(true);
      C=A.style;
      C.marginTop="0px";
      C.marginRight="0px";
      C.marginBottom="0px";
      C.marginLeft="0px";
      C.display="block";
      jQuery.iSort.helper.empty().append(A);
    }
    jQuery(jQuery.iDrag.dragged).after(jQuery.iSort.helper.get(0));
    jQuery.iDrag.dragged.style.display="none";
  },check:function(D){
    if(!D.dragCfg.so&&jQuery.iDrop.overzone.sortable){
      if(D.dragCfg.onStop){
        D.dragCfg.onStop.apply(dragged);
      }
      jQuery(D).css("position",D.dragCfg.initialPosition||D.dragCfg.oP);
      jQuery(D).DraggableDestroy();
      jQuery(jQuery.iDrop.overzone).SortableAddItem(D);
    }
    jQuery.iSort.helper.removeClass(D.dragCfg.hpc).html("&nbsp;");
    jQuery.iSort.inFrontOf=null;
    var G=jQuery.iSort.helper.get(0).style;
    G.display="none";
    jQuery.iSort.helper.after(D);
    if(D.dragCfg.fx>0){
      jQuery(D).fadeIn(D.dragCfg.fx);
    }
    jQuery("body").append(jQuery.iSort.helper.get(0));
    var F=[],C=false;
    for(var H=0;H<jQuery.iSort.changed.length;H++){
      var B=jQuery.iDrop.zones[jQuery.iSort.changed[H]].get(0),A=jQuery.attr(B,"id"),E=jQuery.iSort.serialize(A);
      if(B.dropCfg.os!=E.hash){
        B.dropCfg.os=E.hash;
        if(C==false&&B.dropCfg.onChange){
          C=B.dropCfg.onChange;
        }
        E.id=A;
        F[F.length]=E;
      }
    }
    jQuery.iSort.changed=[];
    if(C!=false&&F.length>0){
      C(F);
    }
  },checkhover:function(A,C){
    if(!jQuery.iDrag.dragged){
      return ;
    }
    var B=false,D=0;
    if(A.dropCfg.el.size()>0){
      for(D=A.dropCfg.el.size();D>0;D--){
        if(A.dropCfg.el.get(D-1)!=jQuery.iDrag.dragged){
          if(!A.sortCfg.floats){
            if((A.dropCfg.el.get(D-1).pos.y+A.dropCfg.el.get(D-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){
              B=A.dropCfg.el.get(D-1);
            }else {
              break ;
            }
          }else {
            if((A.dropCfg.el.get(D-1).pos.x+A.dropCfg.el.get(D-1).pos.wb/2)>jQuery.iDrag.dragged.dragCfg.nx&&(A.dropCfg.el.get(D-1).pos.y+A.dropCfg.el.get(D-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){
              B=A.dropCfg.el.get(D-1);
            }
          }
        }
      }
    }
    if(B&&jQuery.iSort.inFrontOf!=B){
      jQuery.iSort.inFrontOf=B;
      jQuery(B).before(jQuery.iSort.helper.get(0));
    }else {
      if(!B&&(jQuery.iSort.inFrontOf!=null||jQuery.iSort.helper.get(0).parentNode!=A)){
        jQuery.iSort.inFrontOf=null;
        jQuery(A).append(jQuery.iSort.helper.get(0));
      }
    }
    jQuery.iSort.helper.get(0).style.display="block";
  },measure:function(A){
    if(jQuery.iDrag.dragged==null){
      return ;
    }
    A.dropCfg.el.each(function(){
      this.pos=jQuery.extend(jQuery.iUtil.getSizeLite(this),jQuery.iUtil.getPositionLite(this));
    });
  },serialize:function(A){
    var D,C="",B={};
    if(A){
      if(jQuery.iSort.collected[A]){
        B[A]=[];
        jQuery("#"+A+" ."+jQuery.iSort.collected[A]).each(function(){
          if(C.length>0){
            C+="&";
          }
          C+=A+"[]="+jQuery.attr(this,"id");
          B[A][B[A].length]=jQuery.attr(this,"id");
        });
      }else {
        for(a in A){
          if(jQuery.iSort.collected[A[a]]){
            B[A[a]]=[];
            jQuery("#"+A[a]+" ."+jQuery.iSort.collected[A[a]]).each(function(){
              if(C.length>0){
                C+="&";
              }
              C+=A[a]+"[]="+jQuery.attr(this,"id");
              B[A[a]][B[A[a]].length]=jQuery.attr(this,"id");
            });
          }
        }
      }
    }else {
      for(D in jQuery.iSort.collected){
        B[D]=[];
        jQuery("#"+D+" ."+jQuery.iSort.collected[D]).each(function(){
          if(C.length>0){
            C+="&";
          }
          C+=D+"[]="+jQuery.attr(this,"id");
          B[D][B[D].length]=jQuery.attr(this,"id");
        });
      }
    }
    return {hash:C,o:B};
  },addItem:function(A){
    if(!A.childNodes){
      return ;
    }
    return this.each(function(){
      if(!this.sortCfg||!jQuery(A).is("."+this.sortCfg.accept)){
        jQuery(A).addClass(this.sortCfg.accept);
      }
      jQuery(A).Draggable(this.sortCfg.dragCfg);
    });
  },destroy:function(){
    return this.each(function(){
      jQuery("."+this.sortCfg.accept).DraggableDestroy();
      jQuery(this).DroppableDestroy();
      this.sortCfg=null;
      this.isSortable=null;
    });
  },build:function(A){
    if(A.accept&&jQuery.iUtil&&jQuery.iDrag&&jQuery.iDrop){
      if(!jQuery.iSort.helper){
        jQuery("body",document).append("<div id=\"sortHelper\">&nbsp;</div>");
        jQuery.iSort.helper=jQuery("#sortHelper");
        jQuery.iSort.helper.get(0).style.display="none";
      }
      this.Droppable({accept:A.accept,activeclass:A.activeclass?A.activeclass:false,hoverclass:A.hoverclass?A.hoverclass:false,helperclass:A.helperclass?A.helperclass:false,onHover:A.onHover||A.onhover,onOut:A.onOut||A.onout,sortable:true,onChange:A.onChange||A.onchange,fx:A.fx?A.fx:false,ghosting:A.ghosting?true:false,tolerance:A.tolerance?A.tolerance:"intersect"});
      return this.each(function(){
        var B={revert:A.revert?true:false,zindex:3000,opacity:A.opacity?parseFloat(A.opacity):false,hpc:A.helperclass?A.helperclass:false,fx:A.fx?A.fx:false,so:true,ghosting:A.ghosting?true:false,handle:A.handle?A.handle:null,containment:A.containment?A.containment:null,onStart:A.onStart&&A.onStart.constructor==Function?A.onStart:false,onDrag:A.onDrag&&A.onDrag.constructor==Function?A.onDrag:false,onStop:A.onStop&&A.onStop.constructor==Function?A.onStop:false,axis:/vertically|horizontally/.test(A.axis)?A.axis:false,snapDistance:A.snapDistance?parseInt(A.snapDistance)||0:false,cursorAt:A.cursorAt?A.cursorAt:false};
        jQuery("."+A.accept,this).Draggable(B);
        this.isSortable=true;
        this.sortCfg={accept:A.accept,revert:A.revert?true:false,zindex:3000,opacity:A.opacity?parseFloat(A.opacity):false,hpc:A.helperclass?A.helperclass:false,fx:A.fx?A.fx:false,so:true,ghosting:A.ghosting?true:false,handle:A.handle?A.handle:null,containment:A.containment?A.containment:null,floats:A.floats?true:false,dragCfg:B};
      });
    }
  }};
jQuery.fn.extend({Sortable:jQuery.iSort.build,SortableAddItem:jQuery.iSort.addItem,SortableDestroy:jQuery.iSort.destroy});
jQuery.SortSerialize=jQuery.iSort.serialize;
jQuery.iAutoscroller={timer:null,elToScroll:null,elsToScroll:null,step:10,start:function(A,C,B,D){
    jQuery.iAutoscroller.elToScroll=A;
    jQuery.iAutoscroller.elsToScroll=C;
    jQuery.iAutoscroller.step=parseInt(B)||10;
    jQuery.iAutoscroller.timer=window.setInterval(jQuery.iAutoscroller.doScroll,parseInt(D)||40);
  },doScroll:function(){
    for(i=0;i<jQuery.iAutoscroller.elsToScroll.length;i++){
      if(!jQuery.iAutoscroller.elsToScroll[i].parentData){
        jQuery.iAutoscroller.elsToScroll[i].parentData=jQuery.extend(jQuery.iUtil.getPositionLite(jQuery.iAutoscroller.elsToScroll[i]),jQuery.iUtil.getSizeLite(jQuery.iAutoscroller.elsToScroll[i]),jQuery.iUtil.getScroll(jQuery.iAutoscroller.elsToScroll[i]));
      }else {
        jQuery.iAutoscroller.elsToScroll[i].parentData.t=jQuery.iAutoscroller.elsToScroll[i].scrollTop;
        jQuery.iAutoscroller.elsToScroll[i].parentData.l=jQuery.iAutoscroller.elsToScroll[i].scrollLeft;
      }
      if(jQuery.iAutoscroller.elToScroll.dragCfg&&jQuery.iAutoscroller.elToScroll.dragCfg.init==true){
        elementData={x:jQuery.iAutoscroller.elToScroll.dragCfg.nx,y:jQuery.iAutoscroller.elToScroll.dragCfg.ny,wb:jQuery.iAutoscroller.elToScroll.dragCfg.oC.wb,hb:jQuery.iAutoscroller.elToScroll.dragCfg.oC.hb};
      }else {
        elementData=jQuery.extend(jQuery.iUtil.getPositionLite(jQuery.iAutoscroller.elToScroll),jQuery.iUtil.getSizeLite(jQuery.iAutoscroller.elToScroll));
      }
      if(jQuery.iAutoscroller.elsToScroll[i].parentData.t>0&&jQuery.iAutoscroller.elsToScroll[i].parentData.y+jQuery.iAutoscroller.elsToScroll[i].parentData.t>elementData.y){
        jQuery.iAutoscroller.elsToScroll[i].scrollTop-=jQuery.iAutoscroller.step;
      }else {
        if(jQuery.iAutoscroller.elsToScroll[i].parentData.t<=jQuery.iAutoscroller.elsToScroll[i].parentData.h&&jQuery.iAutoscroller.elsToScroll[i].parentData.t+jQuery.iAutoscroller.elsToScroll[i].parentData.hb<elementData.y+elementData.hb){
          jQuery.iAutoscroller.elsToScroll[i].scrollTop+=jQuery.iAutoscroller.step;
        }
      }
      if(jQuery.iAutoscroller.elsToScroll[i].parentData.l>0&&jQuery.iAutoscroller.elsToScroll[i].parentData.x+jQuery.iAutoscroller.elsToScroll[i].parentData.l>elementData.x){
        jQuery.iAutoscroller.elsToScroll[i].scrollLeft-=jQuery.iAutoscroller.step;
      }else {
        if(jQuery.iAutoscroller.elsToScroll[i].parentData.l<=jQuery.iAutoscroller.elsToScroll[i].parentData.wh&&jQuery.iAutoscroller.elsToScroll[i].parentData.l+jQuery.iAutoscroller.elsToScroll[i].parentData.wb<elementData.x+elementData.wb){
          jQuery.iAutoscroller.elsToScroll[i].scrollLeft+=jQuery.iAutoscroller.step;
        }
      }
    }
  },stop:function(){
    window.clearInterval(jQuery.iAutoscroller.timer);
    jQuery.iAutoscroller.elToScroll=null;
    jQuery.iAutoscroller.elsToScroll=null;
    for(i in jQuery.iAutoscroller.elsToScroll){
      jQuery.iAutoscroller.elsToScroll[i].parentData=null;
    }
  }};
$(document).ready(function(){
  $("div#LeftFrame").Sortable({accept:"Left",helperclass:"sortHelper",handle:"b.rT",tolerance:"intersect",fit:true,opacity:0.6,onChange:function(A){
    },onStart:function(){
      $.iAutoscroller.start(this,$("#NetProfile, #UserProfile"));
      if(this.className.indexOf("Right")<0){
        this.dragCfg.axis="vertically";
        $("#dragHelper").find("b.rT,div.Title").css("cursor","n-resize");
        $("#dragHelper").css("cursor","n-resize");
      }
    },onStop:function(){
      $.iAutoscroller.stop();
      $("#dragHelper").css("cursor","move");
      RecordNavCP(this);
    }});
  $("div#RightFrame").Sortable({accept:"Right",helperclass:"sortHelper",handle:"b.rT",tolerance:"intersect",fit:true,opacity:0.6,onChange:function(A){
    },onStart:function(){
      $.iAutoscroller.start(this,$("#NetProfile, #UserProfile"));
      if(this.className.indexOf("Left")<0){
        this.dragCfg.axis="vertically";
        $("#dragHelper").find("b.rT,div.Title").css("cursor","n-resize");
        $("#dragHelper").css("cursor","n-resize");
      }
    },onStop:function(){
      $.iAutoscroller.stop();
      $("#dragHelper").css("cursor","move");
      RecordNavCP(this);
    }});
  MiniNav.runner(Profile);
});
function RecordNavCP(A){
  Left=$.SortSerialize("LeftFrame");
  Left=Left.hash.replace(/LeftFrame\[\]=/g,"L");
  Right=$.SortSerialize("RightFrame");
  Right=Right.hash.replace(/RightFrame\[\]=/g,"R");
  $.cookie((A.id.indexOf("Net")==0?"NavgationCNP":"NavgationCUP"),Left+"&"+Right,{expires:365,domain:domain});
}