/* combine : /javascript/common/libraries/underscore-min.js*/
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index<t.index?-1:1}),"value")};var F=function(n,t,r,e){var u={},i=k(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return F(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return F(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=function(n,t,r,e){r=null==r?w.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);/* complete : /javascript/common/libraries/underscore-min.js*/


/* combine : /javascript/desktop/common/jdw_popup.js*/
avoidLeft = 10000;
avoidRight = 1;
avoidTop = 10000;
avoidBottom = 1;

function findObj(n,d) { //v3.0
  var p,i,x;
  if (!d)
    d = document;
  if (((p=n.indexOf("?"))>0) && (parent.frames.length)) {
    d = parent.frames[n.substring(p+1)].document;
    n = n.substring(0,p);
  }
  if (n.length < 2)
    return null;
  x = d[n];
  if (!x && d.all)
    x = d.all[n];
  //for (i=0; !x && i<d.forms.length; i++)
  //x = eval("document.forms[" + i + "]." + n);
  //for (i=0; !x && d.layers && i<d.layers.length; i++)
  //x = findObj(n,d.layers[i].document);
  if (!x) {
    if ((navigator.appName == "Netscape") && (navigator.appVersion.indexOf("4.") < 0))
      x = document.getElementById(n);
  }
  return x;
}

function mapCoords(x,y,obj) {
  var xAdjust = 250;
  var yAdjust = 300;

  if (obj != null) {
    if (navigator.appName == "Netscape") {
      if (obj.clip) {
        xAdjust = obj.clip.width + 25;
        yAdjust = obj.clip.height + 25;
      }
    } else {
      xAdjust = obj.scrollWidth + 25;
      yAdjust = obj.scrollHeight + 25;
    }
  }

  if (navigator.appName == "Netscape") {
    var xMax,yMax;

    yMax = window.innerHeight - yAdjust;
    if (y > yMax)
      y = yMax;
    else
      y = y - 25;
    if (y < 1)
      y = 1;

    xMax = window.innerWidth - xAdjust;
    if (x > xMax)
      x = xMax;
    else
      x = x - 50;
    if (x < 1)
      x = 1;

    x += window.pageXOffset;
    y += window.pageYOffset;

    //to avoid opening over edit fields...
    var xMove = 0;
    if ((x <= avoidRight) && ((x+xAdjust) >= avoidLeft)) {
      xMove = (x+xAdjust) - avoidLeft;
      if (xMove > (avoidRight - x))
        xMove = x - avoidRight;
    }
    var yMove = 0;
    if ((y <= avoidBottom) && ((y+yAdjust) >= avoidTop)) {
      yMove = (y+yAdjust) - avoidTop;
      if (yMove > (avoidBottom - y))
        yMove = y - avoidBottom;
    }
    if (Math.abs(1.5*yMove) > Math.abs(xMove))
      x = x - xMove;
    else
      y = y - yMove;
  } else { //if (event)
    var xMax,yMax;
    var ind50 = (navigator.appVersion.indexOf("MSIE 5") >= 0);

    yMax = window.document.body.offsetHeight - yAdjust;
    if (! ind50)
      yMax += window.document.body.scrollTop;

    if (y > yMax)
      y = yMax;
    else
      y = y - 25;
    if (y < 1)
      y = 1;

    xMax = window.document.body.offsetWidth - xAdjust;
    if (! ind50)
      xMax += window.document.body.scrollLeft;

    if (x > xMax)
      x = xMax;
    else
      x = x - 50;
    if (x < 1)
      x = 1;

    if (ind50) {
      y += window.document.body.scrollTop;
      x += window.document.body.scrollLeft;
    }
  }
  return ((y<<16) | x);
}

/*
 * Variable arguments.
 *
 * Hide all the objects(DIVs) passed in as arguments except the last
 * one.
 */
function DoPopups() { //v3.0
  var args=DoPopups.arguments;
  var obj = null;
  if (args.length > 0)
    obj = findObj(args[args.length-1]);

  var xy = mapCoords(xLoc,yLoc,obj);

  var x = xy & 0x0000FFFF;
  var y = xy >> 16;

  var i,v,d;
  for (i=0; i<args.length; i++) {
    if (i == (args.length-1))
      v = 'show';
    else
      v = 'hide';

    if ((obj=findObj(args[i])) != null) {
      if (obj.style) {
        obj = obj.style;
        if (v == 'show') {
          v = 'visible';
          d = 'inline';
        }
        else if (v == 'hide') {
          v = 'hidden';
          d = 'none';
        }
      }
      if (navigator.appName == "Netscape") {
        obj.top = 0;
        obj.left = 0;
      } else {
        //PC 09/10/01. Change to make all hidden layers in IE move to the top left of the screen
        //And stop the scroll bars appearing.
        if (v == 'hidden') {
          obj.posTop = 0;
          obj.posLeft = 0;
        } else {
          obj.posTop = y;
          obj.posLeft = x;
        }
      }
      obj.visibility = v;
      obj.display = d;
    }
  }
}

function doAdvancedSearchPopup() {
    var width = '600';
    var height = '350';
  //if we have arguments then the advance search link has been clicked.
  //using the url passed in means we overwrite whatever is in the
  //advancedSearchUrl which may have been populated by the results of a
  //previous search.
  if(doAdvancedSearchPopup.arguments.length > 0) {
    advancedSearchPopupUrl = doAdvancedSearchPopup.arguments[0];
  }
  if(doAdvancedSearchPopup.arguments.length > 1) {
      width = doAdvancedSearchPopup.arguments[1];
  }
  if(doAdvancedSearchPopup.arguments.length > 2) {
      height = doAdvancedSearchPopup.arguments[2];
  }
  if(advancedSearchPopupUrl != null && advancedSearchPopupUrl != "") {
    var win = window.open(advancedSearchPopupUrl,'SearchWindow','dependant,resizeable,scrollbars=no,width=' + width + ',height=' + height + ',left=50,top=50');
    if (win) {
      win.focus();
    }
  }
}

var win=null; // spotts:36A1-HPR:1.6.2.2.8.3:2004/01/14:relocate from bottomNavigation_inc.jsp and faq_view.jsp
function fnNewWindow(mypage,myname,w,h,scroll){
  var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  var settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
  win = window.open(mypage,myname,settings);
}

var winPop = null; // spotts:36A1-HPR:1.6.2.2.8.3:2004/01/14:relocate from bottomNavigation_inc.jsp
function fnNewPopup(mypage,w,h){
  var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  var settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no, resizable=no, location=no, menubar=no';
  winPop = window.open(mypage,'myname',settings);
}

function MOREINFO(strUrl) {

    newWindow = window.open(strUrl, 'MoreInfoWindow',
            'dependant,resizeable,scrollbars=yes,width=600,height=600,left=50,top=50');

    if (newWindow) {
        newWindow.focus();
    }
}

function EXTRAINFO(strUrl,width,height) {

    newWindow = window.open(strUrl, 'ExtraInfoWindow',
        'dependant,scrollbars=no,width='+width+',height='+height+',left=100,top=100');

    if (newWindow) {
        newWindow.focus();
    }
}

// this one used by Hyperlinks
function OpenWindow(url,name,params) {
  var w = window.open(url, name, params);
  if (w)
    w.focus();
}/* complete : /javascript/desktop/common/jdw_popup.js*/


/* combine : /javascript/desktop/common/jdw_menuControl.js*/
var xLoc=0,yLoc=0; // mouse pointer position

function NetscapeMouseMove(e) {
  xLoc = e.pageX; // - window.pageXOffset;
  yLoc = e.pageY; // - window.pageYOffset;
  // PROD-588: Try/catch because newer browsers don't support this
  try {
	  window.routeEvent(e);
  } catch(err) {}
  }

function IEMouseClick() {
  if (navigator.appName != "Netscape") {
    xLoc = event.x; if (document.body) xLoc += document.body.scrollLeft;
    yLoc = event.y; if (document.body) yLoc += document.body.scrollTop;
  }
}

if ((navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Opera 4")==-1) && (window.Event)) {
  document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove = NetscapeMouseMove;
}

function MM_findObj(n, d) { //v4.0 Macromedia x-browser getObjectByID() routine
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && document.getElementById) x=document.getElementById(n); return x;
}

// START: stevepotts competition popup...
function togVis(elementId_str) {
  var obj=MM_findObj(document.layers?elementId_str+"_NN":elementId_str+"_IE"); 
  if(!document.layers) obj=obj.style;
  var v=obj.visibility; obj.visibility=(v.length<1||v.substr(0,3)=="hid")?"visible":"hidden";
}
function positionToCursor(elementId_str) {
  var obj=MM_findObj(document.layers?elementId_str+"_NN":elementId_str+"_IE"); 
  if(!document.layers) obj=obj.style; obj.left=xLoc-200; obj.top=yLoc-220;
}
// ...END

// START: "other great sites" rollover...
function changepic(pic) {
  document.roll01.src=pic;
}
// ...END

// START: "swapimage"
function swapImage(imgToChange,newImage) {
    imgToChange.src=newImage;
}

function onLoad() {}//artefact from previous menu system, unused by stevepotts menu

function deleteWebOfferItem(menuContainer_a){
  if(menuContainer_a!=null&&typeof(menuContainer_a)=="object"){
    if(menuContainer_a.length == 0){
    return;
    }
    
 
    if(menuContainer_a.length > 0){
      var d=document;
      if(typeof(menuContainer_a[0])=="object"){
      	var mc=menuContainer_a[0];
       
        
        if(mc.menuItem_a!=null&&typeof(mc.menuItem_a)=='object'){ //has popup
			deleteItem('webOfferMenuItem');
		
        } 
  	  }//if 
    }//if > 0

  }//if
  	
}

function deleteItem(itemName){

  var x=document.getElementById(itemName);
  if(x != null){
  	 x.parentNode.removeChild(x);
  }else{
  	// look to see if we need to delete the last item.
  	var maxItems = document.getElementById("maxNamMenuItems").value;
  	// total static menu items 
  	var staticMenu = document.getElementById('navmenuglobal').getElementsByTagName("table");
  	var staticCount = staticMenu.length;
  	
  	
  	if( parseInt(staticCount) > parseInt(maxItems)){
  		document.getElementById('navmenuglobal').deleteCell(-1);
  	}
  }
   
}



/* complete : /javascript/desktop/common/jdw_menuControl.js*/


/* combine : /javascript/desktop/common/messages.js*/
function strMessageCheck() {
  var pairs = location.search.substring(1).split(",");
  var pos = 0;
  var key = "";
  var value = "";
    
  for(var counter=0; counter < pairs.length; counter++) {
      var pos = pairs[counter].indexOf("=");
      if(pos == -1) {
          continue;
      }
      key = pairs[counter].substring(0,pos); 
      if(key == "strMsg") {
          value = unescape(pairs[counter].substring(pos+1));
          alert(value);
          return;
      }    
  }
}

function checkPromotionalState() {
  if (jPopUp == "claim" ) {
      DoPopups('CLAIM-popup');
  }else if (jPopUp == "omaMessage") {
      var win = window.open(url, "UserMessage", "width=400,height=200");
  } else if (jPopUp == "omaPopup") {
      var win = window.open(url, "OutOfDate", "width=400,height=200");
  }
}

function displayInvalidSearchPopup() {
    DoPopups('INVALID_SEARCH-popup');
}

function displayAbortTitleChangePopup() {
	DoPopups('TITLE_CHANGE_BAG-popup');
}   
            
function displayAnyPopups() {
    if (jPopUp) {
        DoPopups('CLAIM-popup');
        scroll(0,0);
    }
}/* complete : /javascript/desktop/common/messages.js*/


/* combine : /javascript/common/libraries/jquery/jquery-1.5.1.min.js*/
/*!
 * jQuery JavaScript Library v1.5.1
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Feb 23 13:55:29 2011 -0500
 */
(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bP(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bO(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bq.test(a)?e(a,f):bO(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bO(a+"["+f+"]",b[f],c,e)}function bN(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bH,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bN(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bN(a,c,d,e,"*",g));return l}function bM(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bB),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bo(a,b,c){var e=b==="width"?bi:bj,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function ba(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function _(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function $(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function Z(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function Y(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function O(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(J.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(p,"")===a.type?r.push(g.selector):t.splice(i--,1);f=d(a.target).closest(r,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&q.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=q.length;j<k;j++){f=q[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){c=1;try{while(a[0])a.shift().apply(d,f)}catch(g){throw g}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(d.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),e;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(e)return e;e=a={}}var c=z.length;while(c--)a[z[c]]=b[z[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){var b=arguments.length,c=b<=1&&a&&d.isFunction(a.promise)?a:d.Deferred(),e=c.promise();if(b>1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i<j;i++)h=g[i].name,h.indexOf("data-")===0&&(h=h.substr(5),f(this[0],h,e[h]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=f(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var h=/[\n\t\r]/g,i=/\s+/,j=/\r/g,k=/^(?:href|src|style)$/,l=/^(?:button|input)$/i,m=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,o=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(i);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var j=0,k=b.length;j<k;j++)g.indexOf(" "+b[j]+" ")<0&&(h+=" "+b[j]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(i);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var j=(" "+g.className+" ").replace(h," ");for(var k=0,l=c.length;k<l;k++)j=j.replace(" "+c[k]+" "," ");g.className=d.trim(j)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),j=b,k=a.split(i);while(f=k[g++])j=e?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(h," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k<l;k++){var m=h[k];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(o.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(j,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&o.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var w=s.handle;w&&(w.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,F(a.origType,a.selector),d.extend({},a,{handler:E,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,F(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?w:v):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=w;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w,this.stopPropagation()},isDefaultPrevented:v,isPropagationStopped:v,isImmediatePropagationStopped:v};var x=function(a){var b=a.relatedTarget;try{if(b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},y=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?y:x,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?y:x)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&C("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&C("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var z,A=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var D={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=p.exec(h),k="",j&&(k=j[0],h=h.replace(p,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(D[h]+k),h=h+k):h=(D[h]||h)+k;if(c==="live")for(var q=0,r=n.length;q<r;q++)d.event.add(n[q],"live."+F(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+F(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var G=/Until$/,H=/^(?:parents|prevUntil|prevAll)/,I=/,/,J=/^.[^:#\[\.,]*$/,K=Array.prototype.slice,L=d.expr.match.POS,M={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(O(this,a,!1),"not",a)},filter:function(a){return this.pushStack(O(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/<tbody/i,U=/<|&#?\w+;/,V=/<(?:script|object|embed|option|style)/i,W=/checked\s*(?:[^=]|=\s*.checked.)/i,X={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&W.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?Y(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,ba)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!V.test(a[0])&&(d.support.checkClone||!W.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1></$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bK[1]||q[2]!=bK[2]||(q[3]||(q[1]==="http:"?80:443))!=(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c):c()},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cd(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cc("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(cc("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cd(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(b$.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=b_.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(ca),ca=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var ce=/^t(?:able|d|h)$/i,cf=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=cg(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!ce.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!cf.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);/* complete : /javascript/common/libraries/jquery/jquery-1.5.1.min.js*/


/* combine : /javascript/common/libraries/jquery/jquery.overlay.js*/
/*
Options
	
	overlay.create({
		bindTo  //Element you wish to bind the overlay to... 
		behindOverlay [true,false],
		showDelay [int], //	time it takes for the please wait to appear
		closeDelay [int] //	time taken to close overlay from when it is created IF NOT SET A MANUAL CLOSE IS NEEDED
	});

	/***************************** /
	
		When clicking the 'addtobag' button the following below is used to execute the overlay message, however on execution the overlay is shown with 100% transparency
		'showDelay' specifies the time delay to show the overlay, 'closeDelay' is the time it takes to remove it. 
		
		however! a overlay.closeOverlay can be executed to break the operation and close the overlay sooner, possibly before the 'showDelay' is over.
		
		overlay.create('#prodOptionsPanelContainer .boxCurveContainer:eq(0)', {height:310,  'showDelay' : 200, 'closeDelay' : 4000});
	
	/***************************** /

*/
var overlay = {
	options : {  
			opacity : 0.8,
			showDelay : 1000,
			displayProcessing : 3000,
			displayTime : 0
	}, 
	
	delayCloseOverlay : function (delay) {
		$('body').animate({'dummy':'1'}, delay, function () {
				$('body').attr('style','');
				$('.overlay').attr('closeNow', '1');
				overlay.closeOverlay({closeNow : true });
		});
	}, 
	
	closeOverlay : function () {
						
			var removeOverlay = 0;
			var closeNow = 1;
										   
			if($('.overlay').css('opacity') > 0 && $('.overlay').attr('closeNow') == 0)
				var closeNow = 0;
				
			if(closeNow == 0 && $('.overlay').attr('closeNow') == 0) {
				var removeOverlay = (this.options.displayTime + this.options.displayProcessing) - new Date().getTime();
				
				if (removeOverlay < 0)
					removeOverlay = 0;
					
				this.delayCloseOverlay(removeOverlay);
			} else {
				$('.overlay').stop().animate({opacity:0}, function () {
					$(this).remove();
				});
			}

			return removeOverlay;
	},
	
	showPleaseWait : function () {
		if($('.overlay').size() == 1) {
			$('.overlay').fadeTo(1000, this.options.opacity);
			$('.overlay div').fadeIn(1000);
			
			this.options.displayTime = new Date().getTime();
		}
	},	
	setStyles : function (ele, overlayMods) {
			
			if(ele.css('width') && ele.attr('class') =='boxCurveContainer')
				$('.overlay').css({'width': (ele.width() + 6) + 'px', 'margin-left': '-3px'});
			else if(ele.css('width'))
				$('.overlay').css({'width': ele.css('width'), 'margin-left': '0px'});
			if(overlayMods.width)
				$('.overlay').css({'width': overlayMods.width + 'px'});
			if(overlayMods.height)
				$('.overlay').css({'height': overlayMods.height + 'px'});
			if(overlayMods.behindOverlay == true)
			   	$('.overlay').css({'zIndex': '4561'});
			if(overlayMods.cssStyle)
				$('.overlay').css(overlayMods.cssStyle);
	},
	create : function (overlayMods) {
					
			if(!overlayMods)
				var overlayMods = {};
			
			if(!overlayMods.msg) {
				overlayMods.msg = "Please Wait";
			}
			
			if($('.' + overlayMods.trigger).parents('div.displayOverlay').size() == 1){
				var ele = $('.' + overlayMods.trigger).parents('div.displayOverlay');
			} else {
				var ele = $('.' + overlayMods.trigger);
			}
			
		//	$('.' + overlayMods.trigger).removeClass(overlayMods.trigger);
			
			var opacity = this.options.opacity;
			var showDelay = (overlayMods.showDelay ? overlayMods.showDelay : 0);
			
			if(ele.css('position') == 'static' || !ele.css('position'))
				ele.css('position', 'relative')			
			if(showDelay > 0)
				opacity = 0;
			
			ele.append('<div class="overlay" closeNow="0" style="display:' + (opacity == 0 ? 'none' : 'block') + ';"><div id="mLoadingMessage" class="formOverlayBorder" style="display:' + (opacity == 0 ? 'none' : 'block') + ';"><div class="curveLT"></div><div class="curveRT"></div><div class="overlayCornerBL"></div><div class="overlayCornerBR"></div>' + overlayMods.msg + '</div></div>')
			.find('.overlay').animate({opacity:opacity},function(){$('.overlay').css('display', 'block');})
			
			if($('.formOverlayBorder').size() > 0)
				$('.formOverlayBorder').css({
					'margin-top':'-' + ($('.formOverlayBorder').height()) + 'px'
				});
			
			
			if(overlayMods.showDelay) {
				this.options.showDelay = overlayMods.showDelay;
				setTimeout("overlay.showPleaseWait()", showDelay);
			} else if(this.options.showDelay) {
				this.options.showDelay = 0;
			}
			
			this.setStyles(ele, overlayMods);
			
		   	if(overlayMods.closeDelay)
				overlay.delayCloseOverlay(overlayMods.closeDelay);
			
	}
};

/* complete : /javascript/common/libraries/jquery/jquery.overlay.js*/


/* combine : /javascript/common/libraries/jquery/jquery.easing.js*/
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 *//* complete : /javascript/common/libraries/jquery/jquery.easing.js*/


/* combine : /javascript/common/libraries/jquery/jquery.url.packed.js*/
jQuery.url=function(){var segments={};var parsed={};var options={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var parseUri=function(){str=decodeURI(options.url);var m=options.parser[options.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[options.key[i]]=m[i]||""}uri[options.q.name]={};uri[options.key[12]].replace(options.q.parser,function($0,$1,$2){if($1){uri[options.q.name][$1]=$2}});return uri};var key=function(key){if(!parsed.length){setUp()}if(key=="base"){if(parsed.port!==null&&parsed.port!==""){return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/"}else{return parsed.protocol+"://"+parsed.host+"/"}}return(parsed[key]==="")?null:parsed[key]};var param=function(item){if(!parsed.length){setUp()}return(parsed.queryKey[item]===null)?null:parsed.queryKey[item]};var setUp=function(){parsed=parseUri();getSegments()};var getSegments=function(){var p=parsed.path;segments=[];segments=parsed.path.length==1?{}:(p.charAt(p.length-1)=="/"?p.substring(1,p.length-1):path=p.substring(1)).split("/")};return{setMode:function(mode){strictMode=mode=="strict"?true:false;return this},setUrl:function(newUri){options.url=newUri===undefined?window.location:newUri;setUp();return this},segment:function(pos){if(!parsed.length){setUp()}if(pos===undefined){return segments.length}return(segments[pos]===""||segments[pos]===undefined)?null:segments[pos]},attr:key,param:param}}();/* complete : /javascript/common/libraries/jquery/jquery.url.packed.js*/


/* combine : /javascript/common/libraries/jquery/jquery-ui-1.8.14.custom.min.jsDoNotParse*/
/*!
 * jQuery UI 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
 * jQuery UI Mouse 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
 * jQuery UI Position 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Position
 */
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
;/*
 * jQuery UI Draggable 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,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},_create: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")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.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";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.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,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;
if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=
a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!=
"x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<
c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&
o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;/*
 * jQuery UI Droppable 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Droppables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 */
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.14"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
"none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=
!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parentsUntil("body").unbind("scroll.droppable");
a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
;/*
 * jQuery UI Resizable 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<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=a.handles||(!e(".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 c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=
false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});
this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff=
{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];
if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},
_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,
{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight:
Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=
b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&&
a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=
null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||
0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);
b!="resize"&&this._trigger(b,a,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}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?
e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=
e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,
step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=
e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;
var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:
a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-
d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,
f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,
display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=
e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=
d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
;/*
 * jQuery UI Selectable 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Selectables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.14"})})(jQuery);
;/*
 * jQuery UI Sortable 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,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:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):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 a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&
!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);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");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
a)}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(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=
this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=
d(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(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||
0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",
a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=
this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[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(a[0].style.width==
""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=
this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a=
{top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.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 a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?
document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=
this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&
this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=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-b.grid[0]:f+b.grid[0]:f}}return{top:g-
this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=
"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,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])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",
f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);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(!b){this._trigger("beforeStop",
a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.14"})})(jQuery);
;/*
 * jQuery UI Accordion 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14",
animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
;/*
 * jQuery UI Autocomplete 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Autocomplete
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
;/*
 * jQuery UI Button 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Button
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
"boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed",true);
var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
"radio"){var a=this.element.parents().filter(":last"),c="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):
b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
"ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
b.Widget.prototype.destroy.call(this)}})})(jQuery);
;/*
 * jQuery UI Dialog 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */
(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
h=c('<a href="#"></a>').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")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=
1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",
f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):
[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);
if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=
a.add(this)});a.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);
;/*
 * jQuery UI Slider 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=a.values&&a.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(a.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(a.range){if(a.range===true){if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length?
(h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i-
m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false;
this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=
this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=
this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);
c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c<f))c=f;if(c!==this.values(a)){f=this.values();f[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:f});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});
b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,f,e;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
this.value();else return this._values()},_setOption:function(b,a){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
_refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate);
if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.14"})})(jQuery);
;/*
 * jQuery UI Tabs 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Tabs
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){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(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},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 e=
d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(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")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
;/*
 * jQuery UI Progressbar 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Progressbar
 *
 * Depends:
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 */
(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.14"})})(jQuery);
;/*
 * jQuery UI Effects 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});
c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,
a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);
a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%",
"pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*
((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=
e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=
e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*
h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,
e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
;/*
 * jQuery UI Effects Blind 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Blind
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
;/*
 * jQuery UI Effects Bounce 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Bounce
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
;/*
 * jQuery UI Effects Clip 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Clip
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Drop 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Drop
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Explode 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Explode
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
;/*
 * jQuery UI Effects Fade 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Fade
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Fold 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Fold
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
;/*
 * jQuery UI Effects Highlight 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Highlight
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Pulsate 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Pulsate
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
;/*
 * jQuery UI Effects Scale 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Scale
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Shake 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Shake
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
;/*
 * jQuery UI Effects Slide 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Slide
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
;/*
 * jQuery UI Effects Transfer 1.8.14
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Effects/Transfer
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
b.dequeue()})})}})(jQuery);
;
/* complete : /javascript/common/libraries/jquery/jquery-ui-1.8.14.custom.min.js*/


/* combine : /javascript/common/libraries/jdw_ajax.js*/
$.fn.Sleep = function(duration, callback) {
	if(!callback)callback=function(){return false;};
	$(this).animate({dummy:1}, duration, callback);
	return this;
};
	
var modalLinkStack=[];       

var modalDefaults = {
	delay: 300,
	width : 500,
	height: 300,
	controlsHeight: 50,
	headerHeight: 50,			
	scrollTop: 60,			
	controls : '',
	closeDefault : '<div class="modalButtonClose modalButtonCloseFooter"><div class="modalButton"><div class="buttonCapLt"></div><a href="#" alt="Click to close this window" title="Click to close this window">Close this window</a><div class="buttonCapRt"></div></div></div>',
	backDefault : '<div class="modalButtonBack" id="modalButtonLeft" style="display:none;"><div class="modalButton"><div class="buttonCapLt"></div><a id="modalBackAnchor" href="#" alt="Click to Go Back" title="Click to go back">Back</a><div class="buttonCapRt"></div></div></div>',
	overlayClose : 'true', 
	backButton : 'true',
	nonModal: 'false'
};
			
var modalFunctions = {
	create : {
		container : function (data, showScrollbars, options) {			
			var new_overlay = 0;
			if($('#modal_overlay').size() == 0) {
				$('body').append('<div id="modal_overlay" style="display: none"></div>');
				$('body').append('<div id="modal_coremetrics_node" style="display: none"></div>');
				$('body').append('<div id="modal_outer" style="display: none"></div>');
				$('#modal_outer').append('<div id="modal_container" class="displayOverlay modal_container">' + data + '</div>');
				var new_overlay = 1;
			} else {
				$('#modal_outer').find('#modal_container').html(data);
			}

			$('#modal_overlay').css({'width':'100%'});

			if($.browser.msie == true) {
				$('#modal_overlay').fadeTo(1, 0.8);
			}
			
			var modalParam = $('#modal_outer').find('#modalParam');
			
			if($('#modal_outer').find('#modalParam').attr('title'))
				modalDefaults.title = modalParam.attr('title');
			if($('#modal_outer').find('#modalParam').attr('overlayClose'))
				modalDefaults.overlayClose = modalParam.attr('overlayClose');
			if($('#modal_outer').find('#modalParam').attr('backButton'))
				modalDefaults.backButton = modalParam.attr('backButton');
			if($('#modal_outer').find('#modalParam').attr('nonModal'))
				modalDefaults.nonModal = modalParam.attr('nonModal');
			if($('#modal_outer').find('#modalParam').attr('width'))	
				modalDefaults.width = modalParam.attr('width');
			if($('#modal_outer').find('#modalParam').attr('height'))
				modalDefaults.height = modalParam.attr('height');
			if($('#modal_outer').find('#modalParam').attr('controlsHeight'))
				modalDefaults.controlsHeight = modalParam.attr('controlsHeight');
			if($('#modal_outer').find('#modalParam').attr('scrollTopValue')) {
				modalDefaults.scrollTop = parseInt(modalParam.attr('scrollTopValue'));
		    }
		    
		    if(options && options.height) {
		    	modalDefaults.height = options.height;
		    }if(options && options.width) {
		    	modalDefaults.width = options.width;
		    }
			
			var marginLeft;	
            if($('#modal_outer').find('#modalParam').attr('marginLeft')){
				marginLeft =  parseInt(modalParam.attr('marginLeft'));
			} else {
			 	 marginLeft = -(modalDefaults.width/2);
			}				
			
			var outerHeight = parseInt(modalDefaults.height) + parseInt(modalDefaults.controlsHeight) + parseInt(modalDefaults.headerHeight);
			$('#modal_outer').css({'height': outerHeight + 'px','margin-left' : marginLeft + 'px', 'margin-top' : '-' + (outerHeight/2) + 'px'});
			$('#modal_outer').css({'position':'absolute', 'top': ($(window).scrollTop() + modalDefaults.scrollTop)+'px', 'marginTop': '0px'})
			
			var overflow = 'hidden';
			if(showScrollbars) {
			    overflow = 'auto';
			}
			var backgroundColor = $('#modal_outer').find('#modal_container').css("backgroundColor");
			if($('#modal_outer').find('#modalParam').attr('backgroundColor')) {
				backgroundColor = modalParam.attr('backgroundColor');
		    }
			var border = $('#modal_outer').find('#modal_container').css("border")
			if($('#modal_outer').find('#modalParam').attr('border')) {
				border = modalParam.attr('border');
		    }
			var height = $(document).height();
			$('#modal_overlay').css({'position':'absolute', 'height': height});
			
			if($.browser.msie){
				var modalContainerCSS = $('#modal_outer').find('#modal_container');
				var paddingtop = modalContainerCSS.css('padding-top').split("px")[0];
				var paddingbottom = modalContainerCSS.css('padding-bottom').split("px")[0];
	 		
				modalDefaults.height = parseInt(modalDefaults.height) + parseInt(paddingtop);
			}
			
			var modalContainer = $('#modal_outer').find('#modal_container');
			if ( typeof border != 'undefined' ){
				modalContainer.css({'height': (modalDefaults.height-20) + 'px', 'width': (modalDefaults.width-20) + 'px', 'overflow': overflow, 'backgroundColor': backgroundColor, 'border': border + 'px'});
			} else {
				modalContainer.css({'height': (modalDefaults.height-20) + 'px', 'width': (modalDefaults.width-20) + 'px', 'overflow': overflow, 'backgroundColor': backgroundColor});
			}
			
		}, header :	function (options) {
			
			var hideHeader = options ? options.hideHeader : false;
			if(!hideHeader) {
				if($('#modal_outer').find('#modal_header').size() == 0) {
					if ( typeof modalDefaults.title != 'undefined' ){
						$('#modal_outer').prepend('<div id="modal_header"><p class="title"></p></div>');
					} else {
						$('#modal_outer').prepend('<div id="modal_header"></div>');
					}
					
					if(options && options.closeButtonHeader) {
						$('#modal_header').append('<div class="modalButtonClose"><div class="buttonCapLt"></div><a style="cursor:pointer;">Close this window</a><div class="buttonCapRt"></div></div>');
					}
					
					if ( typeof modalDefaults.title != 'undefined' ){
						$('#modal_outer').find('#modal_header').find('.title').html(modalDefaults.title);
					}
					$('#modal_outer').find('#modal_header').css({'width': (modalDefaults.width-12) + 'px'});
				}	
			}
		}, footer : function(options) {
			
			var hideFooter = options ? options.hideFooter : false;
			if(!hideFooter) {
				modalDefaults.controls = modalFunctions.getModalControls(options);
				
				if($('#modal_outer').find('#controls').html()) {
					modalDefaults.controls = $('#modal_outer').find('#controls').html();
					$('#modal_outer').find('#controls').remove();
				}
				
				if($('#modal_outer').find('#modal_control').size() == 1)
					$('#modal_outer').find('#modal_control').remove();
				
				$('#modal_outer').append('<div id="modal_control">' + modalDefaults.controls + '</div>');
				$('#modal_outer').find('#modal_control').css({'width': (modalDefaults.width-20) + 'px'});
			}
		}, closeBtn : function (options) {
			var disableClose = options ? options.disableClose : false;
			if (modalDefaults.overlayClose == 'false' || disableClose) {
				$('.modalButtonClose').hide();
			}
			if(options && !options.closeButtonFooter) {
				$('.modalButtonCloseFooter').hide();
			}
		}, backBtn : function (disableClose, showScrollbars) {
		   	if (modalLinkStack.length > 1 && modalDefaults.backButton=='true'){		   		
		   		var options = {
		   				fromBack: true,
		   				scrollbars: showScrollbars,
		   				closeButtonFooter: !disableClose
		   		};		   		
		   		$('#modalBackAnchor').attr("modalBack", true);
		   		$('#modalBackAnchor').click(function() {
		   			jdwModal.displayModalFromUrl(modalLinkStack[modalLinkStack.length - 2], options);
		   		});
		   		//fade in 
		   		$('.modalButtonBack').show();	  	
  	       } 
		}	
	}, executeModal : function (data, disableClose, showScrollbars, options) {
	    if (getIEVersionNumber() <= 6) {
			setSelects("hidden");
		}
				
		if($('#modal_outer').find('#modal_container').size() == 1) {
			$('#modal_overlay').animate({opacity: 0.7}, 200, function () {
				$('#modal_overlay').animate({opacity: 0.8}, 200);
			});					
			
			this.create.container(data, showScrollbars, options);
						
			modalDefaults.controls = modalFunctions.getModalControls(options);
			
			if($('#modal_outer').find('#modal_container').find('#controls').html()) {
				modalDefaults.controls = $('#modal_outer').find('#modal_container').find('#controls').html();
				$('#modal_outer #modal_container #controls').fadeIn();
			}
			
			if(!options || !options.hideFooter) {
				$('#modal_outer').find('#modal_control').html(modalDefaults.controls);
			}
			
			this.create.header(options);
			$('#modal_outer').find('#modal_control').remove();
			this.create.footer(options);
   			this.create.closeBtn(options);
			this.create.backBtn(disableClose, showScrollbars);
		} else {
			this.create.container(data, showScrollbars,options);
			this.create.header(options);
			this.create.footer(options);
			this.create.closeBtn(options);
			setTimeout(function() {
				$('#modal_overlay, #modal_outer').animate({opacity: 'show'}, 10, function () {
					$('#modal_overlay').animate({opacity: 0.8}, 350, 'linear', function(){$('.modalLoadFocus').first().focus();});
				}); 
			}, 500);		
		}

		
		$('#modal_outer #modal_container').scrollTop(0);
		
		if(options && options.onSuccess) {
			options.onSuccess();
		}
	}, getModalControls : function(options) {

			var continueUrl; 
			var continueText; 
			var nextButton;
			var backButton = modalDefaults.backDefault;;
			var continueButton;
			var closeButton = modalDefaults.closeDefault;
			
			if(options) {
				continueUrl = (options.continueUrl ? options.continueUrl : null);
				continueText = (options.continueText ? options.continueText : 'Continue');		
			
				if(options.backText) {
					backButton = '<div class="modalButtonBack" id="modalButtonLeft" style="display:none;">' +
								 '<div class="modalButton"><div class="buttonCapLt"></div><a id="modalBackAnchor" ' +
								 'href="#" alt="Click to Go Back" title="Click to go back">' + options.backText + '</a>' +
								 '<div class="buttonCapRt"></div></div></div>';
				} 
				
				if(continueUrl) {
					continueButton = '<div class="modalButtonContinue" id="modalButtonRight"><div class="modalButton">' +
								 	 '<div class="buttonCapLt"></div><a id="modalContinueAnchor" ' + 
								 	 'onclick="'+ continueUrl + '"' + 
								 	 ' alt="Click to move forward" title="Click to move forward">' + continueText + 
								 	 '</a><div class="buttonCapRt"></div></div></div>';
				}
			
				if(options.closeText) {
					closeButton = '<div class="modalButtonClose" id="modalButtonLeft">' +
								  '<div class="modalButton"><div class="buttonCapLt"></div><a id="modalBackAnchor" ' +
								  'href="#" alt="Click to close" title="Click to close">' + options.closeText + '</a>' +
								  '<div class="buttonCapRt"></div></div></div>';
				} 
			}	
			
			var controls;
			if(backButton)
				controls = backButton;
				
			if(continueButton)
				controls+=continueButton;
			
			if(closeButton)
				controls+=closeButton
				
			return controls;
	}
}

function getIEVersionNumber() {
	if (/MSIE\s(\d+\.\d+);/.test(navigator.userAgent)) {
   		return new Number(RegExp.$1);
	} else {
   		return 999;
	}
}

function setSelects(visibility) {
    selects = document.getElementsByTagName('select');
    for(i = 0; i < selects.length; i++) {
        selects[i].style.visibility = visibility;
    }
}

function openModalJQ(data, url, fromBack, disableClose,  showScrollbars, options) {
	reset();	
	if(url)
		updateLinkStack(url, fromBack);   
   	    
    modalFunctions.executeModal(data, disableClose, showScrollbars, options);
    
    return false;
}

var closeModalDuration = 350;
function closeModalJQ() {
	$('#modal_overlay, #modal_outer').animate({opacity:'hide'}, closeModalDuration, function () { $(this).remove(); });
	if (getIEVersionNumber() <= 6) {
		setSelects("visible");
	}	
	if($.browser.msie == true) {
		$('body, html').css({'overflow':''});
		$('body, html').attr('style', '');
	}
	
	setTimeout(function () {
			if(typeof yourvar != 'undefined' && jdwModalOptions.onClose) {
				jdwModalOptions.onClose();
			}
		
			// clear stored links
			modalLinkStack = [];	
			jdwModalOptions = {};
		}, closeModalDuration + 500);
}

function enableCloseModalJQByClickingOutsideBorder(callBack) {
	/* Close overlay by clicking anywhere outside it's borders do this here so 
	when you close the overlay you go back to the home page. */		
	$('body').live('click', callBack, window.clickAnyWhereClickHandler);
}

function clickAnyWhereClickHandler(e){ 	// Add new event handler
	if($('#modal_overlay').size()!=0 && $(e.target).closest('.orderContainer').length==0){
		$('body').die('click', window.clickAnyWhereClickHandler); // Unbind default event handler defined in jdw_ajax.js
		closeModalJQ();
		//The call back function name is passed in as a string,
		//so the .live() function does not execute with 2 params, but uses 3 params.
		var clickAnyWhereCallBack = e.data;
		if (clickAnyWhereCallBack) {
			eval(clickAnyWhereCallBack + "()");
		}
	}
}

function disableCloseModalJQByClickingOutsideBorder(){
	$('body').die('click', window.clickAnyWhereClickHandler);	
}

function updateLinkStack(url,fromBack){
	// if not modal back button
    if (url && !fromBack) {
    	pushLink(url);
    } else if(fromBack) {
    	popLink();
    }
}

function pushLink(url) {		
	//push link onto stack
	if(modalLinkStack.length==0){
	  	modalLinkStack[0] = url;
	}else{
	 	modalLinkStack[modalLinkStack.length] = url;
	}
}

function popLink(){
	//pop link from stack
	modalLinkStack.splice(modalLinkStack.length - 1,1);
}

function reset(){
   	modalDefaults.backButton='true';
   	modalDefaults.overlayClose='true';
   	modalDefaults.nonModal='false';
}

$('.modalButtonClose').live('click', function(event){
	event.preventDefault(); 
	closeModalJQ(); 
	
	var onCloseFunctionName = $(this).attr('onClose');
	if ( onCloseFunctionName ) {
		eval( onCloseFunctionName + '()' );
	}
});

$(window).resize(function(){
		$('#modal_outer, #prodImageZoomify').css({'position':'absolute', 'top': ($(window).scrollTop() + 60)+'px', 'marginTop': '0px'})
		
		var height = $(document).height();
		var width =  $(document).width();
		$('#modal_overlay').css({'position':'absolute', 'height': height, 'width' : width });
});

function checkForRedirect(xmlHttpRequest) {
	var redirectUrl = xmlHttpRequest.getResponseHeader('REDIRECT_URL');
	if (redirectUrl == null || redirectUrl.length == 0) {
		return true;
	} else {
		location.href = redirectUrl;
	}
}

function getUniqueClass(selected) {
   	var uniqueID = new Date().getTime() + "Class";
   	$(selected).addClass(uniqueID);
   	
   	return uniqueID;
}

function ajaxGet(selected, successCallback, url) {
   	
   	if (!url) {
		var url = $(selected).attr('href');
	}
	
	if (!successCallback.hideUpdatingOverlay) {
	    overlay.create({'msg':'Updating', 'showDelay' : 1000, 'trigger': getUniqueClass(selected)});
	}

	var xhtmlRequest = $.get(url, function (data) {
		closedelay = overlay.closeOverlay();
	    if (checkForRedirect(xhtmlRequest)) {
	       successCallback(data);	
	    }
	});	
}

var closedelay;

function performAjaxRequest( urlString, beforeSendFunction, onCompleteFunction, dataType, data,
						onSuccessFunction, onErrorFunction, sendMethod, triggerData, 
						sessionTimeoutFunction ) {
	var xhtmlRequest;
	var createUpdatingOverlay = true;
	
	// Add timestamp to GET requests in order to prevent I.E. caching
	if(!sendMethod || sendMethod=='GET') {
	    var now = new Date();
	    var timeStamp = [{name:'timeStamp',value:now.getTime()}];
		data = data ? timeStamp.concat(data) : timeStamp; 
	}
	
	if (beforeSendFunction && beforeSendFunction.hideUpdatingOverlay) {
		createUpdatingOverlay = false;
	}
	
	var options = {
		url: urlString,
		beforeSend: function(data) {
			if (createUpdatingOverlay) {
			    overlay.create({ trigger:triggerData,
			    				 cssStyle:{height:'100%',marginLeft:'0px', marginTop:'0px',width:'100%'}, msg : 'Please Wait'});
			}
			if ( dataType ) {
				data.setRequestHeader( 'ajaxDataType', dataType );
			}
			if (beforeSendFunction) {
				var result = beforeSendFunction(data);
				if(result == false) {
					closedelay = overlay.closeOverlay();
				}
					
				return result;
			}
		},
		complete: function(data) {
			closedelay = overlay.closeOverlay();
			if (onCompleteFunction) {
				onCompleteFunction(data);
			}
		},
		dataType: dataType,
		data: data,
		contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
		success: function(data) {
			var dataType = xhtmlRequest.getResponseHeader('ajaxDataType');
			if ( 'json' === dataType ) {
				// For requests that expect a json response, session timeouts can be a problem
				//  since the redirect check below this code will return html.
				if ( data.isSessionTimeout ) {
					if ( sessionTimeoutFunction ) {
						sessionTimeoutFunction( data );
					} else {
						window.location = "/shop/session/timeout/sessionTimeout.action";
					}
					return;
				}
			}
			if (checkForRedirect(xhtmlRequest)) {
				if(onSuccessFunction) {
					onSuccessFunction(data, urlString);
				}
			}
		},
		error: function(data) {
			if(onErrorFunction) {
				onErrorFunction(data);
			} else {
				window.location = "/shop/session/timeout/sessionTimeout.action";
			}
		},
		type: sendMethod
	};
	
	xhtmlRequest = $.ajax(options);
}

		/* complete : /javascript/common/libraries/jdw_ajax.js*/


/* combine : /javascript/desktop/common/jdw_Modal.js*/
/* Facade to provide a simplified interface to display modal windows. */

var jdwModalOptions = {};

var jdwModal = function() {
	return {
	
		/*  Displays a modal window using the provided data.
		 *  ---------------------------------------------------------------
		 *	
		 *	data : 		A String of data to be displayed.
		 *			
		 *	options:	Object containing named options as appropriate.
		 *			
		 *	Available options are:
		 *	----------------------
		 *	continueUrl:	when continue button is clicked the modal will close and navigate to this URL. If not specified button will be hidden.
		 *	continueText:	the text displayed on the continue button default is 'Continue'.
		 *	closeText:		the text displayed on the close button. Default is 'Close'.
		 *  fromBack:		
		 *  hideClose:		hides the close button if true
		 *  closeButtonHeader: determines if we have a close button in the header
		 *  closeButtonFooter:		show a close button in the footer
		 * 	onSuccess: callback function
		 *  onClose:				function to call when the modal closes.
		 */	 		 
		displayModalFromData : function(data,options) {		
			var fromBack = false;
		 	var hideClose = false;
		 	if(options.fromBack) {
		 		fromBack = true;
		 		hideClose = true;
		 	}
			if(options && options.onClose) {
				jdwModalOptions.onClose = options.onClose;
			}
			openModalJQ(data,null,fromBack,hideClose,false,options); 		
		},
		
		/**  Displays a modal window retrieving the data from the given URL.
		 *  ---------------------------------------------------------------
		 *	
		 *	url : 		The url providing the data to display within the modal.  This can
		 *				also be a simple string to display in the modal.
		 *			
		 *	options:	Object containing named options as appropriate.
		 *			
		 *	Available options are:
		 *	----------------------
		 *	continueUrl:			when continue button is clicked the modal will close and navigate to this URL. If not specified button will be hidden.
		 *	continueText:			the text displayed on the continue button default is 'Continue'.
		 *	closeText:				the text displayed on the close button. Default is 'Close'.
		 *	backText:				the text displayed on the back button. Default is 'Back'.	
		 *	buttons:				an HTML snippet specifying the buttons that will appear (overrides all other options to do with buttons).		
		 *	hideBack:				force hiding of the back button.
		 *	hideClose:				force hiding of the close button.
		 * 	hideHeader:				hide the top panel where the title goes.
		 *  hideFooter:				hide the bottom panel where the buttons are.
		 *  onClose:				function to call when the modal closes.
		 *  width:					the width of the modal
		 *  height:					the height of the modal
		 *  closeButtonHeader:		show a header with a close button
		 *  closeButtonFooter:		show a close button in the footer
		 *  scrollbars:				show scrollbars on the modal
		 *  triggerData :			class name of a div for the updating overlay to cover
		 */	 
		displayModalFromUrl : function(url,options) {		
						
			var fromBack = (options ? options.fromBack : false);
			var hideClose = (options ? options.hideClose : false);
			var scrollbars = (options ? options.scrollbars : false);
					
			if(options && options.onClose) {
				jdwModalOptions.onClose = options.onClose;
			}
			
			var successCallback = function(data) {
				openModalJQ(data,url,fromBack,hideClose,scrollbars,options); 
			};
			
			var errorCallback = function(data) {
				if (data.status == 0) {
					openModalJQ('An unexpected error has occurred.  Please close this box and try again.',url,fromBack,hideClose,false,options); 
				}
			}
						
			performAjaxRequest(url,options.beforeSendFunction,null,null,null,successCallback,errorCallback,'GET',options.triggerData);	
		}
	}
}();/* complete : /javascript/desktop/common/jdw_Modal.js*/


/* combine : /javascript/desktop/common/modal.js*/
var jdw = jdw || {};

/* The following prototype functions would ideally be in a separate javascript utility file. */

/* Allows standard javascript arrays to be used as queues, by adding a peek() method to go with 
 *  the push() and pop() that they already have.
 */
Array.prototype.peek = function() {
	return ( (this.length > 0) ? this[this.length - 1] : null );
}
/* Allows us to get the boolean value of string objects if they contain "true" or "false".
 *  Case-insensitive.
 */
String.prototype.parseBoolean = function( defaultVal ) {
	var ret = defaultVal;
	if ( this.toLowerCase() === 'true' ) {
		ret = true;
	} else if ( this.toLowerCase() == 'false' ) {
		ret = false;
	}
	return ret;
}
/* Extends the normally split() functionality of strings by allowing us to specify an escape 
 *  character with which we can escape-out instances of the character used to split the string.  In
 *  this way, we can include instances of the split char within individual fields of the string
 *  without breaking parsing. eg:
 *  
 *  "item\ one item\ two".splitWithEscapeCharacters( ' ', '\' )
 *  
 *  ... would return the array ["item\ one","item\ two"].  Note that the escape characters are
 *  retained in the items in the split result. 
 */
String.prototype.splitWithEscapedCharacters = function( splitChar, escapeChar ) {
    var ret = [];
    var char = null;
    var currentSection = "";
    for ( i = 0 ; i < this.length ; i++ ) {
        char = this.charAt( i );
        if ( char == splitChar ) {
            ret.push( currentSection );
            currentSection = "";
        } else {
            if ( char == escapeChar ) {
                currentSection = currentSection + char;
                char = this.charAt(++i);
            }
            currentSection = currentSection + char;
	}
    }
    ret.push( currentSection );
    return ret;
}
/* Allow us to strip out a character where it is used to escape-out other characters (including
 *  itself). eg, if we wished to express the literal string "a b!" using the '!' character as an 
 *  escape character, and where the space character was considered a special character that needs
 *  escaping, we might write: 
 *  
 *      var escapedString = "a! b!!"
 *      
 * (Note that we've expressly made the '!' character a special character also by using it as an 
 *  escape character, thereby necessitating that it, too, be escaped.)
 * 
 * Once we've done any special parsing, we can remove the escape characters by:
 * 
 *      escapedString.stripEscapeCharacters('!')
 *  
 * ... giving us "a b!" once again.
 */
String.prototype.stripEscapeCharacters = function( escapeChar ) {
	var ret = "";
	var char = null;
	for ( i = 0 ; i < this.length ; i++ ) {
		char = this.charAt( i );
		if ( char == escapeChar ) {
			char = this.charAt(++i);
		}
		ret = ret + char;
	}
	return ret;
}


//==============================================================================================
//
//											JDW_MODAL
//
//==============================================================================================



//-----------------------------------------------------------------------------------------
// ModalsContainer - manages and possibly contains all the modals that can appear on this page.
//-----------------------------------------------------------------------------------------

jdw.ModalsContainer = function() {
	
	// Inside jquery function callbacks, 'this' is reassigned; so we assign a variable here in 
	//  order that we can always get hold of this containing object.
	var containerObj = this;
	
	var state = {
		currentModal : null,
		modalStack : []
	}
	
	var globalCloseButtonShown = false;
	
	// A map of modals that have been added using addModal(), and that can subsequently be shown
	//  by calling showModal with their ids
	var modals = {};
	
	this.setupModal = function() {
		// Add the divs we'll need to display modals, but only do that if they aren't already present 
		//  on the page.  The div structure is as follows:
		//
		// * #jdwModalBackground div provides the greyed-out background that covers the full browser
		//    viewport.
		// * #jdwModalBorder provides the smaller central container that constitutes the modal
		//    dialog itself.  This could feasibly have additional borders and extra styling on a use by 
		//    use basis.
		// * #jdwModalOuterContent provides a container for the modal content (including standard
		//    modal header and footer items such as back and close buttons) that can be hidden from
		//    view whilst content is added and removed, and that can be measured to determine what size
		//    the entire modal background should be based on css widths and heights.
		// * #jdwModalHeader provides a top section for all modal dialogs into which we can place a
		//    title and a close button.
		// * #jdwModalContent is the point into which the bespoke content for a given modal instance is 
		//    added.
		// * #jdwModalFooter provides a bottom section into which we can place a back button.
		if ( $('body', '#jdwModalBackground').length < 1 ) {
			$('body').append(
					'<div id="jdwModalCloseGlobal" style="display:none;">' +
						'<a href="#">Close<span></span></a>' + 
					'</div>' +
					'<div id="jdwModalBackground"></div>' +
					'<div id="jdwModalBorder">' +
						'<div id="jdwModalOuterContent">' + 
							'<div id="jdwModalHeader">' +
								'<h1 id="jdwModalTitle"></h1>' +
								'<div id="jdwModalClose" style="display:none;">' +
									'<a href="#">Close Window<span></span></a>' +
								'</div>' +
							'</div>' +
							'<div id="jdwModalContent"></div>' +
							'<div id="jdwModalFooter">' +
								'<div id="jdwModalBack" style="display:none;">' +
									'<span><a href="#">Back</a></span>' +
								'</div>' +
							'</div>' +
						'</div>' +
					'</div>'
			);
		}
		
		// assign some variables representing the content areas from the structure we just added 
		//  into the page
		this.background = $('body #jdwModalBackground');
		this.closeGlobal = $('body #jdwModalCloseGlobal');
		this.contentBorder = $('body #jdwModalBorder');
		this.outerContentContainer = $("body #jdwModalOuterContent");
		this.headerContainer = $('body #jdwModalHeader');
		this.contentContainer = $("body #jdwModalContent");
		this.footerContainer = $('body #jdwModalFooter');
		
		$("#jdwModalClose a").unbind('click').bind('click', function() {
			return dismissAllModals();
		});
		
		$("#jdwModalCloseGlobal").unbind('click').bind('click', function() {
			return dismissAllModals();
		});
		
		this.background.unbind('click').bind('click', function() {
			return dismissAllModals();
		});
		$("#jdwModalBack").unbind('click').bind('click', function() {
			containerObj.hideWebToolkit();
			reshowPreviousModal();
			return false;
		});
	};
	
	this.closeModal = function() {
		return dismissAllModals();
	}
	
	this.hideWebToolkit = function(){
		if($("#jdwModalContent").hasClass("webToolkit")){
			$("#jdwModalContent").removeClass("webToolkit");
		}
	}
	
	this.showPreviosModal = function(index, url){
		if(url.length>1){
			reshowPreviousModal(index, url);	
		}else{
			reshowPreviousModal(index);
		}
		return false;
	}

	
	this.modalLength = function(){
		return state.modalStack.length;
	}
	
	// Acts as a weak semaphore to stop multiple mouse clicks from causing sync issues.
	this.drawing = false;
	
	// === PUBLIC API ==========================================================================
	
	// Adds a new modal into this container's list of known modal instances, but doesn't show it 
	//  yet.  Modals added in this way can be shown by calling showModal() using the same id as that
	//  specified in the value options.id
	this.addModal = function( options ) {
		modals[options.id] = new jdw.Modal( options );
	};
	
	// Shows a known modal previously added using addModal(), or can be used to create a new unknown
	//  modal which is immediately shown.  The parameter 'idOrOption' is treated as the id of a 
	//  known modal if it is a simple string, otherwise it is treated as an options{} object 
	//  containing config values for a new modal.
	this.showModal = function( idOrOptions, event ) {
		if (typeof event != 'undefined') {
			preventDefault( event );
		}
		
		var modal = ( ( typeof idOrOptions == 'string' ) ? modals[idOrOptions] :
				new jdw.Modal( idOrOptions ) );
		
		if ( modal ) {
			this.drawing = true;
			this.outerContentContainer.css( {opacity:0} );
			modal.load( this.contentContainer, postLoadCallback );
		}
	};
	
	// Looks for any anchor elements in the dom below the specified base element, and checks them
	//  for 'rel' attributes.  Any that have a 'rel' value starting with 'jdwModal' are bound
	//  with an onclick event that will cause their content to be shown in a modal.
	this.bindRelLinks = function( baseElement ) {
		$('a[rel^="jdwModal"]', baseElement).each( function(index, element) {
			var options = parseOptions( element );
			$(element).unbind('click').bind('click', function(event){
				containerObj.showModal( options, event );
			});
		} );
	}
	
	this.reAnimate = function (width,height) {
		containerObj.contentBorder.animate({
			'width': width,
			'height': height,
			'marginLeft': 0 - (width / 2),
			'marginTop' : 0 - (height / 2),
			'opacity': 1.0
		}, 500, function() {
			containerObj.outerContentContainer.css({opacity:1});
			containerObj.drawing = false;
			containerObj.contentBorder.css('opacity','');
			containerObj.outerContentContainer.css('opacity','');
		});
	}
	
	this.modalShown = function() {
		return state.currentModal != null;
	}

	this.isGlobalCloseButtonShown = function() {
		return globalCloseButtonShown;
	}
	
	this.moveCloseButton = function() {
		// Show the close button outside the modal, and hide the inner one,
		//  but only if that isn't already the case ...
		var outsideModal = state.currentModal.isBiggerThan( 
				$("#jdwModalBackground").width(), $("#jdwModalBackground").height() );
	
		if ( outsideModal && !globalCloseButtonShown ) {
			$("#jdwModalCloseGlobal").show();
			$("#jdwModalCloseGlobal").css('opacity', '1.0');
			$("#jdwModalClose").hide();
			globalCloseButtonShown = true;
		} else if ( !outsideModal && globalCloseButtonShown ) {
			$("#jdwModalCloseGlobal").hide();
			$("#jdwModalClose").show();
			globalCloseButtonShown = false;
		} else if ( !outsideModal && !globalCloseButtonShown ) {
			$("#jdwModalClose").show();
		}
		state.currentModal.handleCloseMove( outsideModal );
	}
	
	// === PRIVATE =============================================================================

	// Directly bound to the BACK BUTTON, tells the modal to load its content, which will trigger
	//  the postReloadCallback on success.
	reshowPreviousModal = function(index, content) {
		var modal=''
		containerObj.drawing = true;
		containerObj.outerContentContainer.css( {opacity:0} );
		if(typeof index == 'undefined' && typeof content == 'undefined'){
			modal = state.modalStack.peek();
		}else {
			var data = function() {return content;};
			if(index == 0 && typeof content == 'undefined'){
				state.modalStack.pop();
				modal = state.modalStack[index];
			}else if(index != 0 && typeof content == 'undefined'){
				modal = state.modalStack.peek();
			}else if(index == 0 && content.length>1){
				state.modalStack.pop();
				modal = state.modalStack[index];
				modal.content = data;
			}else{
				modal = state.modalStack.peek();
				modal.content = data;
			}
		}
		modal.load( containerObj.contentContainer, postReloadCallback );
	}
	
	// Called once a new modal has loaded its content
	postLoadCallback = function( modal ) {
		
		var first = ( state.currentModal == null );
		if ( !first ) {
			state.modalStack.push( state.currentModal );
		}
		state.currentModal = modal;
		
		showHeader();
		applyHeaderClass();
		applyContentClass();
		applyFooterClass();
		showBackButton( !first );
		showCloseButton();
		if ( first ) {
			containerObj.background.fadeTo('slow',0.5);
			containerObj.contentBorder.width(0).height(0).show().css( {
				'margin-left': '0px',
				'margin-top' : '0px',
				'opacity': 0
			} );
		}
		animateResizeContent();		
	};

	// Called when reloading the previous modal in the current stack when the back button is used.
	postReloadCallback = function( modal ) {
		state.modalStack.pop();
		var first = ( state.modalStack.length == 0 );
		state.currentModal = modal;
		showHeader();
		applyHeaderClass();
		applyContentClass();
		applyFooterClass();
		showBackButton( !first );
		showCloseButton();
		animateResizeContent();
	}
	
	// Animate content size change from it's current size to a new size ...
	animateResizeContent = function() {
		$("#jdwModalTitle").html( state.currentModal.headingText );

		setTimeout( function(){
			containerObj.contentContainer.width( state.currentModal.width ).height( state.currentModal.height );
			
			var width = containerObj.contentContainer.outerWidth();
			
			if ( state.currentModal.fullHeight ) {
				var height = state.currentModal.fullHeight; 
			} else {
				var height = containerObj.outerContentContainer.outerHeight();
			}
			
			containerObj.background.show();
			containerObj.contentBorder.show();			
			containerObj.contentBorder.animate({
				'width': width,
				'height': height,
				'marginLeft': 0 - (width / 2),
				'marginTop' : 0 - (height / 2),
				'opacity': 1.0
			}, 500, function() {
				containerObj.outerContentContainer.css({opacity:1});
				containerObj.drawing = false;
				// the next two lines are required to clear the IE specific opacity filter
				// since it causes all sorts of problems when present and 100
				containerObj.contentBorder.css('opacity','');
				containerObj.outerContentContainer.css('opacity','');
			});
			containerObj.moveCloseButton();
			
		},100 );
	};
	
	// Dismiss any current modal, ditch the background greyed-out area, set the current modal to
	//  null and clear the modal stack.
	dismissAllModals= function() {
		if ( !containerObj.drawing ) {
			
			// Call any onClose function that might have been requested ... 
			if ( state.currentModal && state.currentModal.onClose ) {
				if(typeof state.currentModal.onClose === 'function') {
					state.currentModal.onClose();
				} else {
					runCallbackFunction(state.currentModal.onClose);
				}
			}
			
			state.currentModal = null;
			state.modalStack = [];
			var fadeTime = 250;
			containerObj.contentBorder.animate( {opacity:0}, fadeTime, function(){
				containerObj.contentBorder.hide()
			});
			containerObj.background.animate( {opacity:0}, fadeTime, function(){
				containerObj.background.hide()
			});
			containerObj.closeGlobal.animate({
				opacity : 0
			}, fadeTime, function() {
				containerObj.closeGlobal.hide()
			});
			containerObj.contentContainer.empty();
		}
		containerObj.hideWebToolkit();
		globalCloseButtonShown = false;
		return false;
	};
	
	// Show or hide the back button
	showBackButton = function( bool ) {
		if ( bool && state.currentModal.backButtonDisabled == false) {
			$("#jdwModalBack").show();
		} else {
			$("#jdwModalBack").hide();
		}
	};

	// Show or hide the close button
	showCloseButton = function() {
		if ( state.currentModal.closeButtonDisabled == false) {
			$("#jdwModalClose").show();
		} else {
			$("#jdwModalClose").hide();
		}
	};
	
	// Show or hide the header
	showHeader = function() {
		if ( state.currentModal.headerDisabled == false) {
			$("#jdwModalHeader").show();
		} else {
			$("#jdwModalHeader").hide();
		}
	};
	
	applyHeaderClass = function() {
		if (typeof state.currentModal.headerClass != "undefined" ) {
			$("#jdwModalHeader").addClass( state.currentModal.headerClass );
		}
	};
	
	applyContentClass = function() {
		if (typeof state.currentModal.contentClass != "undefined" ) {
			$("#jdwModalContent").addClass( state.currentModal.contentClass );
		}
	};
	
	applyFooterClass = function() {
		if (typeof state.currentModal.footerClass != "undefined" ) {
			$("#jdwModalFooter").addClass( state.currentModal.footerClass );
		}
	};
	
	// Parses the 'rel' value of an anchor like :
	//   <a href="content.html" rel="jdwModal,width=600,height=400"></a>
	// ... and creates an options object from it.
	parseOptions = function( hrefElement ) {
		var ret = {
			'id': hrefElement.id,
			'content': hrefElement.href,
			'ajax': true
		};
		
		var splitRel = $(hrefElement).attr('rel').splitWithEscapedCharacters( ',', '\\' );
		for ( var i = 1 ; i < splitRel.length ; i++ ) {
			var splitVal = splitRel[i].splitWithEscapedCharacters( ':', '\\' );
			if (splitVal[0] && splitVal[1]) {
				ret[splitVal[0].stripEscapeCharacters('\\')] = splitVal[1].stripEscapeCharacters('\\');
			}
		}
		return ret;
	}
	
	// Used with onclick events on anchor tags to stop them from trying to go to the page their
	//  href points at (since we want to AJAX that content into a modal instead).
	preventDefault = function( event ) {
		if ( !event ) { event = window.event; }
		if (  event ) {
			if ( event.preventDefault ) {
				event.preventDefault();
			} else {
				event.returnValue = false;
			}
		}
	};
	
	// --- INIT -------------
	
	
	// On creation of this modal container for a given page, we check all links on the page for any
	//  that have a 'rel' attribute value that starts with 'jdwModal'.  For any we find, we extract
	//  all of the additional modal configuration values specified as part of the 'rel' attribute
	//  value, from which we create an options object, and bind an onclick event to the link that
	//  will cause a modal to be shown using those options which the link is clicked.
	this.bindRelLinks( $('body') );
	
	$(window).resize(
		function(event) {
			if ( jdw.modalsContainer.modalShown() ) {
				jdw.modalsContainer.moveCloseButton();
			}
		}
	)
};

//-----------------------------------------------------------------------------------------
// Modal - Contains individual config for a particular modal that can appear on this page
//-----------------------------------------------------------------------------------------

jdw.Modal = function( options ) {
	this.id = options.id;
	this.width = parseInt(options.width);
	this.height = parseInt(options.height);
	if ( options.fullHeight ) {
		this.fullHeight = parseInt(options.fullHeight);
	}
	this.content = options.content;
	this.headingText = options.headingText;
	if ( options.ajax != null ) {
		this.ajax = ( ( typeof options.ajax == "string" ) 
				? options.ajax.parseBoolean() : options.ajax );
	} else {
		this.ajax = true;
	}
	this.loadStartedCallback = options.loadStartedCallback;
	this.loadCompletedCallback = options.loadCompletedCallback;
	this.contentLoadCallback = options.contentLoadCallback;
	this.closeMoveCallback = options.closeMoveCallback;
	this.linksTriggerModal = options.linksTriggerModal || false;
	this.onClose = options.onClose;
	this.backButtonDisabled = options.backButtonDisabled || false;
	this.closeButtonDisabled = options.closeButtonDisabled || false;
	this.headerDisabled = options.headerDisabled || false;
	this.headerClass = options.headerClass;
	this.contentClass = options.contentClass;
	this.footerClass = options.footerClass;
	
	var modal = this;
	
	// PUBLIC API --------------------------------------------------------------------------
	
	this.load = function( container, postLoadCallback ) {
		if ( modal.loadStartedCallback ) {
			runCallbackFunction(modal.loadStartedCallback);
		}
		if ( this.ajax ) {
			$("#jdwModalTitle").html( modal.headingText );
			container.load( this.content, function(data,status,requestObj) {
				var redirectUrl = requestObj.getResponseHeader('REDIRECT_URL');
				if (redirectUrl != null && redirectUrl.length > 0) {
					location.href = redirectUrl.split(',')[0];
				} else {
					bindNewLinks( container );
					if ( modal.contentLoadCallback ) {
						runCallbackFunction(modal.contentLoadCallback);
					}
					postLoadCallback( modal );
				}
				if ( modal.loadCompletedCallback ) {
					runCallbackFunction(modal.loadCompletedCallback);
				}
			} );
		} else {
			var extractedContent = $( ( typeof this.content == "function" )
					? this.content() : eval( this.content ) );
			container.html( extractedContent );
			
			bindNewLinks( container );
			if ( modal.contentLoadCallback ) {
				runCallbackFunction(modal.contentLoadCallback);
			}
			postLoadCallback( modal );
			if ( modal.loadCompletedCallback ) {
				runCallbackFunction(modal.loadCompletedCallback);
			}
		}
	};
	
	this.handleCloseMove = function( movedOutside ) {
		if (typeof modal.closeMoveCallback != 'undefined') {
			( function( moveOutsideModal ) { modal.closeMoveCallback( moveOutsideModal ); } )( movedOutside );
		}
	}
	
	this.isBiggerThan = function( width, height ) {		
		var modalHeight = $("#jdwModalBorder").height();
		if ( isNaN(modalHeight) || (modalHeight == 0) ) {
			modalHeight = this.fullHeight;
		}
		if ( isNaN(modalHeight) || (modalHeight == 0) ) {
			modalHeight = this.height;
		}
		//Adjust the modal height so that if the button is half covered, 
		//then the gloabl button will appear outside.
		var modalCloseButtonHeight = $("#jdwModalClose").height();
		modalHeight = modalHeight + modalCloseButtonHeight;
		return ( (width < this.width) || (height < modalHeight) );
	}
	
	// PRIVATE API --------------------------------------------------------------------------
	
	bindNewLinks = function( domRoot ) {
		if ( modal.linksTriggerModal ) {
			// bind click events to all links in the new modal content ...
			$('a', domRoot).not('a[rel^="jdwModal"]').each( function(index, element) {
				var options = {
					'id': element.id,
					'content': element.href,
					'ajax': true,
					'width': modal.width,
					'height': modal.height,
					'linksTriggerModal': true
				};
				$(element).unbind('click').bind('click', function(event){
					jdw.modalsContainer.showModal( options, event );
				});
			});
			jdw.modalsContainer.bindRelLinks( domRoot );
		} else {
			// Look for embedded explicit modal links
			jdw.modalsContainer.bindRelLinks( domRoot );
		}
	}
	
	runCallbackFunction = function ( fn ) {
		if ( typeof fn === 'function' ) {
			( function() { fn(); } )();
		} else if ( typeof fn === 'string' ) {
			eval( fn + '()' );
		}
		
	}
};

// SETUP ---------------------------------------------------------------
if ( !jdw.modalsContainer ) {
	jdw.modalsContainer = new jdw.ModalsContainer();
}

$(document).ready( function() {
	jdw.modalsContainer.setupModal();
	jdw.modalsContainer.bindRelLinks( $('body') );
});
/* complete : /javascript/desktop/common/modal.js*/


/* combine : /javascript/common/changeTitle.js*/
$(document).ready(function() {
	if ((typeof(jDisplayChangeTitleOverlay) != "undefined")
			&& (jDisplayChangeTitleOverlay == true)) {
		$.get('/content/changetitle/changeTitle.html', function(data) {
			displayChangeTitleOverlay(data);
		});
	}
});

function displayChangeTitleOverlay(data) {
	openModalJQ(data, null, null, null);
	populateOverlayData();
	PAGEVIEWTAG('Transfer Bag Modal', jTitle);
}

function populateOverlayData() {
	$('#modal_control, #modal_header').remove();
	$('#modal_container').css({'backgroundColor' : 'transparent', 'border' : '0px', 'height' : '382px', 'overflow' : 'hidden'});
	if (jDisplayChangeTitleOverlaySignedInMessage == true) {
		$('#modal_container').find('#titleOverlayTradingTitle').html(jAccountTitleName);
	} else {
		$('#modal_container').find('#signedInCopy').hide();
		$('#modal_container').find('#modalParam').attr('height', 325);
		$('#changetitleContainer').css({'height' : 255});
	}
	var buttonLabel = 'Go back to ' + jBackRegName;
	var goBackLink = $('#modal_container').find('#titleOverlayGoBackLink');
	goBackLink.html(buttonLabel);
	goBackLink.attr('title', buttonLabel);
	goBackLink.attr('alt', buttonLabel);
	goBackLink.attr('href', 'javascript:returnToPreviousSite();');
	var goShoppingLink = $('#modal_container').find('#titleOverlayGoShoppingLink');
	goShoppingLink.attr('href', 'javascript:goShopping();');
	var welcomeImage = $('#modal_container').find('#titleWelcome');
	welcomeImage.css('backgroundImage', 'url(' +  IMG_SERVER + '/content/images/changetitle/welcometo.png' + ')');
	welcomeImage.attr('title', 'Welcome');
	welcomeImage.attr('alt', 'Welcome');
	var titleImage = $('#modal_container').find('#titleImage');
	titleImage.css('backgroundImage', 'url(' +  $('#brandLogo-2 img').attr('src') + ')');
	titleImage.attr('title', $('#brandLogo-2 a').attr('title'));
	titleImage.attr('alt', $('#brandLogo-2 a').attr('alt'));
}

function returnToPreviousSite() {
	closeModalJQ();
	imageClick(newUrl, jBackUrl);
}

function goShopping() {
	closeModalJQ();
	MANUAL_LINK_CLICK('Go Shopping', jTitle);
}

function imageClick(toURL, destinationServer, destinationPage, coremetricsTag, elementSlot, pageFrom) {
	var splitUrl = toURL.split('newtitle=');
	var titleId = splitUrl[1];
	imageClickChangeTitle(titleId,elementSlot);
}

function changeTitleFreeFormat(titleId, ffpid, cm) {
	$.ajax({
		url: "/shop/changetitle/ajax/ChangeTitleLaunch.action?newtitle=" + titleId,
		type: "GET",
		cache: false,
		dataType: "json",
		success: function(data, status) {
			if(data.successful) {
				performChangeTitleRedirect(data.urlto, data.lastSessionId, "coremetrics="+cm, null, 
						ffpid);
				
			} else if (data.bagShareNotAllowed) {
				bagShareNotAllowed(data);
			}
		}
	});
}

function ChangeTitleHierarchy(titleId,cm,hierarchyPath) {
	$.ajax({
		url: "/shop/changetitle/ajax/ChangeTitleLaunch.action?newtitle=" + titleId,
		type: "GET",
		cache: false,
		dataType: "json",
		success: function(data, status) {
			if(data.successful) {
				performChangeTitleRedirect(data.urlto, data.lastSessionId, "coremetrics="+cm, 
						hierarchyPath,null);
				
			} else if (data.bagShareNotAllowed) {
				bagShareNotAllowed(data);
			}
		}
	});
}

function ChangeTitleProductDetails(titleId,cm,productDetailsPath) {
	$.ajax({
		url: "/shop/changetitle/ajax/ChangeTitleLaunch.action?newtitle=" + titleId,
		type: "GET",
		cache: false,
		dataType: "json",
		success: function(data, status) {
			if(data.successful) {
				performChangeTitleRedirect(data.urlto, data.lastSessionId, "coremetrics="+cm, 
						null,null,null,productDetailsPath);
				
			} else if (data.bagShareNotAllowed) {
				bagShareNotAllowed(data);
			}
		}
	});
}

function changeTitleSuperSites(titleId) {
	$.ajax({
		url: "/shop/changetitle/ajax/ChangeTitleLaunch.action?newtitle=" + titleId + "&elementSlot=SUPERSITE",
		type: "GET",
		cache: false,
		dataType: "json",
		success: function(data, status) {
			if(data.successful) {
				performChangeTitleRedirect(data.urlto, data.lastSessionId, data.coremetricsTag, 
						null, null, true);
				
			} else if (data.bagShareNotAllowed) {
				bagShareNotAllowed(data);
			}
		}
	});
}

function imageClickChangeTitle(titleId,elementSlot) {
	$.ajax({
		url: "/shop/changetitle/ajax/ChangeTitleLaunch.action?newtitle=" + titleId + "&elementSlot=S"+elementSlot,
		type: "GET",
		cache: false,
		dataType: "json",
		success: function(data, status) {
			if(data.successful) {
				performChangeTitleRedirect(data.urlto, data.lastSessionId, data.coremetricsTag);
			} else if (data.bagShareNotAllowed) {
				bagShareNotAllowed(data);
			}
		}
	});
}

function bagShareNotAllowed(data) {
	$('#proceed_to_link').html('Proceed to ' + data.newTitleName);

	ctNewtitle = data.newtitle;
	ctUrlto = data.urlto;
	ctForm = theForm;

	$('#TITLE_CHANGE_BAG-popup').css({'visibility' : 'visible',
		'display' : 'inline',
		'top' : '400',
		'left' : '100'});
}

function performChangeTitleRedirect(destinationServer, lastSessionId, coremetricsTag, hiararchy,
		ffpid, superSites,productDetailsPath) {
	
	var redirectUrl = destinationServer;
	
	// Add the session id if it is defined
	if (lastSessionId) {
		
		if (redirectUrl.indexOf("?") > -1) {
			redirectUrl = destinationServer + "&lastSessionId=" + lastSessionId;
		} else {
			redirectUrl = destinationServer + "?lastSessionId=" + lastSessionId;
		}
		
		// Add optional elements if they are defined
		if (coremetricsTag) {
			redirectUrl = redirectUrl + "&" + coremetricsTag;
		}
		
		// take to the product details page
		if (productDetailsPath) {
			redirectUrl = redirectUrl + "&productDetailsPath=" + productDetailsPath;
		}

		// Add hierarchy path if the change title will end up in a navigarion page rather than home
		if (hiararchy) {
			redirectUrl = redirectUrl + "&hierarchy=" + hiararchy;
		}
		
		// Add the free format page id 
		if (ffpid) {
			redirectUrl = redirectUrl + "&ffpid=" + ffpid;
		}
		
		// Add supersites flag to allow the action to return SuperSites String
		if (superSites) {
			redirectUrl = redirectUrl + "&superSites=" + superSites;
		}
		
		// Perform redirect
		window.location = redirectUrl;
	}
}

/* complete : /javascript/common/changeTitle.js*/


/* combine : /javascript/desktop/common/jdw_commonPageLoadFunctions.js*/
/* 
 * Capture the click event of all <a> tags with rel="modal" OR 
 * all <a> tags with an href urls containing request param "modal" 
 * with value "true" e.g. "/shop/warranties.jsp?modal=true"
 */ 
$(document).ready(function () {
	$('a').live('click', function (event) {
	    var url = $(this).attr('href');
	    var fromBack = $(this).attr('modalBack') ? true : false;
	    var disableClose = $(this).attr('disableModalClose') ? true : false;
	    var showScrollbars = $(this).attr('showscrollbars') ? true : false;
	    
	    if( $(this).attr('rel')=='modal' || jQuery.url.setUrl(url).param('modal')=='true' ){
		    // prevent default behaviour on click event
		    event.preventDefault(); 
		    
		    var modalCallBack = function (data) {
   		        openModalJQ(data,url,fromBack,disableClose, showScrollbars);
       		};
       		modalCallBack.hideUpdatingOverlay = true;
       		
			ajaxGet(this, modalCallBack);		
		}
	});
});

$(document).ready(function() {
    $('a[rel="ajaxSubmit"]').live('click', function (event) {
    	event.preventDefault();
    	
		var urlString = $(this).attr('href'); 	
    	if (urlString == null || urlString.length == 0) { 
			urlString = $(this).parents("form").attr('action');
		}
		
		performAjaxRequest(	urlString,
							eval($(this).attr('beforeSend')),
							eval($(this).attr('completeLoading')), 
							$(this).attr('dataType'),
							$(this).parents("form").serialize(), 
							eval($(this).attr('successLoading')), 
							eval($(this).attr('errorLoading')), 
							$(this).parents("form").attr('method'),
							getUniqueClass(this)
		);
	});
});

/*
 * Generate the dynamic tooltip elements.
 * Content is read from the static dropdown element, then edited to rename id attributes.
 * This avoids having elements with duplicate ids on the page.
 * Also added unique name element for each link, as this is required by LiveView.
 * Setting prerender to true enables the coremetrics script to attach events to the dynamic links at onload.
 */
$(document).ready(function () {
    $('#topNavigation .topNavItemWithMenu').each(function() {
        var target = $('.topnav', this);
        var content = $('.categoryDropNavContainer', this);

		var editedContent = content.clone();
		editedContent.find('a').attr('id', function() {
		  return 'DDM_'+this.id;
		});
		editedContent.find('a').attr('name', function() {
		  return this.id;
		});

        target.qtip({
            content: {
            	prerender: true,
                text: editedContent.html()
            },
            position: { 
                corner: getCorner(),
                adjust: {
                	screen: true,
                	scroll: false
                }
            },
            hide: { 
                when: 'mouseout', fixed: true 
            },
            style: {
                background: 'transparent',
                width: calculateColumnWidth(),
                padding: 0,
                border: {
                    width: 0,
                    radius: 0
                }
            },
            api: {
                onShow: function() {
                    target.addClass('hovered');
                },
                onHide: function() {
                    target.removeClass('hovered');
                }
            },
            show : {
            	delay: 0
            }
        });
        
        function calculateColumnWidth(){        	
        	var colWidth = calculateWidth();
        	var maxLeftPosition = $('#topNavigation').width() - colWidth;
        	var offset = getWidthWithMargin($('.promoColumnMiddle', content));
        	colWidth+=offset;
        	if(colWidth>maxLeftPosition){
        		colWidth-=offset;        		
        	}
        	return colWidth;        	
        }
        
        function getCorner() {
            var leftPosition = target.offset().left - $('#topNavigation').offset().left;
            var maxLeftPosition = $('#topNavigation').width() - calculateWidth();  
            
            if (leftPosition > maxLeftPosition) {
                return { target: 'bottomRight', tooltip: 'topRight' };
            } else {
                return { target: 'bottomLeft', tooltip: 'topLeft' };
            }
        }
        
        function calculateWidth() {
            var width = getWidthWithMargin($('.refinementsColumn', content));
            width +=  getWidthWithMargin($('.promoMiddleColumnSize1', content));
            width +=  getWidthWithMargin($('.promoMiddleColumnSize2', content));
            width +=  getWidthWithMargin($('.promoMiddleColumnSize3', content));
            width +=  getWidthWithMargin($('.promoMiddleColumnSize4', content));
            width +=  getWidthWithMargin($('.promoColumnRight', content));
            width +=  getCssDimension($('.categoryDropNavContent', content),'border-left-width');
            width +=  getCssDimension($('.categoryDropNavContent', content),'border-right-width');
            width +=  getCssDimension($('.topNavSpacer1', content),'width');
            width +=  getCssDimension($('.topNavSpacer2', content),'width');
            width +=  getCssDimension($('.topNavSpacer3', content),'width');
            width +=  getCssDimension($('.topNavSpacer4', content),'width');
            width +=  getCssDimension($('.topNavSpacer5', content),'width');
 
            return width;
        }
        
        function getWidthWithMargin(element) {
            var width = getCssDimension(element,'width');
            width += getCssDimension(element,'margin-left');
            width += getCssDimension(element,'margin-right');
            
            return width;
        }
        
        function getCssDimension(element, cssClass) {
            if (element.css(cssClass)) {
                return parseInt(element.css(cssClass).replace('px', ''));
            }
            return 0;
        }     
    });
});

/* 
 * NEW js method for calculating how much of a sub-navigation will be off screen.
 * Adjusts the left offset position accordingly.
*/
    
$(document).ready(function () {
	var navRow = $('.mainNav');
	if (! navRow) return;
	if (! navRow.offset()) return;
	var rightEdge = navRow.offset().left + navRow.outerWidth();
	
	$('.navColumnContainer').each(function(){
		var dropDown = $(this);
		var ddLeft = dropDown.offset().left;
		var ddTop = dropDown.offset().top;
		var ddRightEdge = ddLeft + dropDown.outerWidth();
		var overhang = rightEdge - ddRightEdge;
		if (overhang < 0) {
			dropDown.offset({left: ddLeft + overhang, top: ddTop });
		}
	});
});
    
/*
 * The following functions need to run on each page load in order to maintain a user based 
 * set of footer logos. The logos below will be removed based on the customers account type,
 * and also whether 3d secure has been turned on or off.
 */

$(document).ready(function(){
	if (typeof removeCreditLogo != 'undefined') {
		if (removeCreditLogo == 'true') {
			$("div[id='personalAccount']").remove();
		}
	}
});
$(document).ready(function(){
	if (typeof display3DSecureFooterLogos != 'undefined') {
		if (display3DSecureFooterLogos == 'false') {
			$("img[title='Verified by Visa']").remove();
			$("img[title='MasterCard Securecode']").remove();
		}
	}
});/* complete : /javascript/desktop/common/jdw_commonPageLoadFunctions.js*/


/* combine : /javascript/common/libraries/jquery/jquery.qtip-1.0.js*/
/*!
 * jquery.qtip. The jQuery tooltip plugin
 *
 * Copyright (c) 2009 Craig Thompson
 * http://craigsworks.com
 *
 * Licensed under MIT
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Launch  : February 2009
 * Version : 1.0.0-rc3
 * Released: Tuesday 12th May, 2009 - 00:00
 * Debug: jquery.qtip.debug.js
 */
(function($)
{
   // Implementation
   $.fn.qtip = function(options, blanket)
   {
      var i, id, interfaces, opts, obj, command, config, api;

      // Return API / Interfaces if requested
      if(typeof options == 'string')
      {
         // Make sure API data exists if requested
         if(typeof $(this).data('qtip') !== 'object')
            $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.NO_TOOLTIP_PRESENT, false);

         // Return requested object
         if(options == 'api')
            return $(this).data('qtip').interfaces[ $(this).data('qtip').current ];
         else if(options == 'interfaces')
            return $(this).data('qtip').interfaces;
      }

      // Validate provided options
      else
      {
         // Set null options object if no options are provided
         if(!options) options = {};

         // Sanitize option data
         if(typeof options.content !== 'object' || (options.content.jquery && options.content.length > 0)) options.content = { text: options.content };
         if(typeof options.content.title !== 'object') options.content.title = { text: options.content.title };
         if(typeof options.position !== 'object') options.position = { corner: options.position };
         if(typeof options.position.corner !== 'object') options.position.corner = { target: options.position.corner, tooltip: options.position.corner };
         if(typeof options.show !== 'object') options.show = { when: options.show };
         if(typeof options.show.when !== 'object') options.show.when = { event: options.show.when };
         if(typeof options.show.effect !== 'object') options.show.effect = { type: options.show.effect };
         if(typeof options.hide !== 'object') options.hide = { when: options.hide };
         if(typeof options.hide.when !== 'object') options.hide.when = { event: options.hide.when };
         if(typeof options.hide.effect !== 'object') options.hide.effect = { type: options.hide.effect };
         if(typeof options.style !== 'object') options.style = { name: options.style };
         options.style = sanitizeStyle(options.style);

         // Build main options object
         opts = $.extend(true, {}, $.fn.qtip.defaults, options);

         // Inherit all style properties into one syle object and include original options
         opts.style = buildStyle.call({ options: opts }, opts.style);
         opts.user = $.extend(true, {}, options);
      };

      // Iterate each matched element
      return $(this).each(function() // Return original elements as per jQuery guidelines
      {
         // Check for API commands
         if(typeof options == 'string')
         {
            command = options.toLowerCase();
            interfaces = $(this).qtip('interfaces');

            // Make sure API data exists$('.qtip').qtip('destroy')
            if(typeof interfaces == 'object')
            {
               // Check if API call is a BLANKET DESTROY command
               if(blanket === true && command == 'destroy')
                  while(interfaces.length > 0) interfaces[interfaces.length-1].destroy();

               // API call is not a BLANKET DESTROY command
               else
               {
                  // Check if supplied command effects this tooltip only (NOT BLANKET)
                  if(blanket !== true) interfaces = [ $(this).qtip('api') ];

                  // Execute command on chosen qTips
                  for(i = 0; i < interfaces.length; i++)
                  {
                     // Destroy command doesn't require tooltip to be rendered
                     if(command == 'destroy') interfaces[i].destroy();

                     // Only call API if tooltip is rendered and it wasn't a destroy call
                     else if(interfaces[i].status.rendered === true)
                     {
                        if(command == 'show') interfaces[i].show();
                        else if(command == 'hide') interfaces[i].hide();
                        else if(command == 'focus') interfaces[i].focus();
                        else if(command == 'disable') interfaces[i].disable(true);
                        else if(command == 'enable') interfaces[i].disable(false);
                     };
                  };
               };
            };
         }

         // No API commands, continue with qTip creation
         else
         {
            // Create unique configuration object
            config = $.extend(true, {}, opts);
            config.hide.effect.length = opts.hide.effect.length;
            config.show.effect.length = opts.show.effect.length;

            // Sanitize target options
            if(config.position.container === false) config.position.container = $(document.body);
            if(config.position.target === false) config.position.target = $(this);
            if(config.show.when.target === false) config.show.when.target = $(this);
            if(config.hide.when.target === false) config.hide.when.target = $(this);

            // Determine tooltip ID (Reuse array slots if possible)
            id = $.fn.qtip.interfaces.length;
            for(i = 0; i < id; i++)
            {
               if(typeof $.fn.qtip.interfaces[i] == 'undefined'){ id = i; break; };
            };

            // Instantiate the tooltip
            obj = new qTip($(this), config, id);

            // Add API references
            $.fn.qtip.interfaces[id] = obj;

            // Check if element already has qTip data assigned
            if(typeof $(this).data('qtip') == 'object')
            {
               // Set new current interface id
               if(typeof $(this).attr('qtip') === 'undefined')
                  $(this).data('qtip').current = $(this).data('qtip').interfaces.length;

               // Push new API interface onto interfaces array
               $(this).data('qtip').interfaces.push(obj);
            }

            // No qTip data is present, create now
            else $(this).data('qtip', { current: 0, interfaces: [obj] });

            // If prerendering is disabled, create tooltip on showEvent
            if(config.content.prerender === false && config.show.when.event !== false && config.show.ready !== true)
            {
               config.show.when.target.bind(config.show.when.event+'.qtip-'+id+'-create', { qtip: id }, function(event)
               {
                  // Retrieve API interface via passed qTip Id
                  api = $.fn.qtip.interfaces[ event.data.qtip ];

                  // Unbind show event and cache mouse coords
                  api.options.show.when.target.unbind(api.options.show.when.event+'.qtip-'+event.data.qtip+'-create');
                  api.cache.mouse = { x: event.pageX, y: event.pageY };

                  // Render tooltip and start the event sequence
                  construct.call( api );
                  api.options.show.when.target.trigger(api.options.show.when.event);
               });
            }

            // Prerendering is enabled, create tooltip now
            else
            {
               // Set mouse position cache to top left of the element
               obj.cache.mouse = {
                  x: config.show.when.target.offset().left,
                  y: config.show.when.target.offset().top
               };

               // Construct the tooltip
               construct.call(obj);
            }
         };
      });
   };

   // Instantiator
   function qTip(target, options, id)
   {
      // Declare this reference
      var self = this;

      // Setup class attributes
      self.id = id;
      self.options = options;
      self.status = {
         animated: false,
         rendered: false,
         disabled: false,
         focused: false
      };
      self.elements = {
         target: target.addClass(self.options.style.classes.target),
         tooltip: null,
         wrapper: null,
         content: null,
         contentWrapper: null,
         title: null,
         button: null,
         tip: null,
         bgiframe: null
      };
      self.cache = {
         mouse: {},
         position: {},
         toggle: 0
      };
      self.timers = {};

      // Define exposed API methods
      $.extend(self, self.options.api,
      {
         show: function(event)
         {
            var returned, solo;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'show');

            // Only continue if element is visible
            if(self.elements.tooltip.css('display') !== 'none') return self;

            // Clear animation queue
            self.elements.tooltip.stop(true, false);

            // Call API method and if return value is false, halt
            returned = self.beforeShow.call(self, event);
            if(returned === false) return self;

            // Define afterShow callback method
            function afterShow()
            {
               // Call API method and focus if it isn't static
               if(self.options.position.type !== 'static') self.focus();
               self.onShow.call(self, event);

               // Prevent antialias from disappearing in IE7 by removing filter attribute
               if($.browser.msie) self.elements.tooltip.get(0).style.removeAttribute('filter');
            };

            // Maintain toggle functionality if enabled
            self.cache.toggle = 1;

            // Update tooltip position if it isn't static
            if(self.options.position.type !== 'static')
               self.updatePosition(event, (self.options.show.effect.length > 0));

            // Hide other tooltips if tooltip is solo
            if(typeof self.options.show.solo == 'object') solo = $(self.options.show.solo);
            else if(self.options.show.solo === true) solo = $('div.qtip').not(self.elements.tooltip);
            if(solo) solo.each(function(){ if($(this).qtip('api').status.rendered === true) $(this).qtip('api').hide(); });

            // Show tooltip
            if(typeof self.options.show.effect.type == 'function')
            {
               self.options.show.effect.type.call(self.elements.tooltip, self.options.show.effect.length);
               self.elements.tooltip.queue(function(){ afterShow(); $(this).dequeue(); });
            }
            else
            {
               switch(self.options.show.effect.type.toLowerCase())
               {
                  case 'fade':
                     self.elements.tooltip.fadeIn(self.options.show.effect.length, afterShow);
                     break;
                  case 'slide':
                     self.elements.tooltip.slideDown(self.options.show.effect.length, function()
                     {
                        afterShow();
                        if(self.options.position.type !== 'static') self.updatePosition(event, true);
                     });
                     break;
                  case 'grow':
                     self.elements.tooltip.show(self.options.show.effect.length, afterShow);
                     break;
                  default:
                     self.elements.tooltip.show(null, afterShow);
                     break;
               };

               // Add active class to tooltip
               self.elements.tooltip.addClass(self.options.style.classes.active);
            };

            // Log event and return
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_SHOWN, 'show');
         },

         hide: function(event)
         {
            var returned;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'hide');

            // Only continue if element is visible
            else if(self.elements.tooltip.css('display') === 'none') return self;

            // Stop show timer and animation queue
            clearTimeout(self.timers.show);
            self.elements.tooltip.stop(true, false);

            // Call API method and if return value is false, halt
            returned = self.beforeHide.call(self, event);
            if(returned === false) return self;

            // Define afterHide callback method
            function afterHide(){ self.onHide.call(self, event); };

            // Maintain toggle functionality if enabled
            self.cache.toggle = 0;

            // Hide tooltip
            if(typeof self.options.hide.effect.type == 'function')
            {
               self.options.hide.effect.type.call(self.elements.tooltip, self.options.hide.effect.length);
               self.elements.tooltip.queue(function(){ afterHide(); $(this).dequeue(); });
            }
            else
            {
               switch(self.options.hide.effect.type.toLowerCase())
               {
                  case 'fade':
                     self.elements.tooltip.fadeOut(self.options.hide.effect.length, afterHide);
                     break;
                  case 'slide':
                     self.elements.tooltip.slideUp(self.options.hide.effect.length, afterHide);
                     break;
                  case 'grow':
                     self.elements.tooltip.hide(self.options.hide.effect.length, afterHide);
                     break;
                  default:
                     self.elements.tooltip.hide(null, afterHide);
                     break;
               };

               // Remove active class to tooltip
               self.elements.tooltip.removeClass(self.options.style.classes.active);
            };

            // Log event and return
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_HIDDEN, 'hide');
         },

         updatePosition: function(event, animate)
         {
            var i, target, tooltip, coords, mapName, imagePos, newPosition, ieAdjust, ie6Adjust, borderAdjust, mouseAdjust, offset, curPosition, returned

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'updatePosition');

            // If tooltip is static, return
            else if(self.options.position.type == 'static')
               return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.CANNOT_POSITION_STATIC, 'updatePosition');

            // Define property objects
            target = {
               position: { left: 0, top: 0 },
               dimensions: { height: 0, width: 0 },
               corner: self.options.position.corner.target
            };
            tooltip = {
               position: self.getPosition(),
               dimensions: self.getDimensions(),
               corner: self.options.position.corner.tooltip
            };

            // Target is an HTML element
            if(self.options.position.target !== 'mouse')
            {
               // If the HTML element is AREA, calculate position manually
               if(self.options.position.target.get(0).nodeName.toLowerCase() == 'area')
               {
                  // Retrieve coordinates from coords attribute and parse into integers
                  coords = self.options.position.target.attr('coords').split(',');
                  for(i = 0; i < coords.length; i++) coords[i] = parseInt(coords[i]);

                  // Setup target position object
                  mapName = self.options.position.target.parent('map').attr('name');
                  imagePos = $('img[usemap="#'+mapName+'"]:first').offset();
                  target.position = {
                     left: Math.floor(imagePos.left + coords[0]),
                     top: Math.floor(imagePos.top + coords[1])
                  };

                  // Determine width and height of the area
                  switch(self.options.position.target.attr('shape').toLowerCase())
                  {
                     case 'rect':
                        target.dimensions = {
                           width: Math.ceil(Math.abs(coords[2] - coords[0])),
                           height: Math.ceil(Math.abs(coords[3] - coords[1]))
                        };
                        break;

                     case 'circle':
                        target.dimensions = {
                           width: coords[2] + 1,
                           height: coords[2] + 1
                        };
                        break;

                     case 'poly':
                        target.dimensions = {
                           width: coords[0],
                           height: coords[1]
                        };

                        for(i = 0; i < coords.length; i++)
                        {
                           if(i % 2 == 0)
                           {
                              if(coords[i] > target.dimensions.width)
                                 target.dimensions.width = coords[i];
                              if(coords[i] < coords[0])
                                 target.position.left = Math.floor(imagePos.left + coords[i]);
                           }
                           else
                           {
                              if(coords[i] > target.dimensions.height)
                                 target.dimensions.height = coords[i];
                              if(coords[i] < coords[1])
                                 target.position.top = Math.floor(imagePos.top + coords[i]);
                           };
                        };

                        target.dimensions.width = target.dimensions.width - (target.position.left - imagePos.left);
                        target.dimensions.height = target.dimensions.height - (target.position.top - imagePos.top);
                        break;

                     default:
                        return $.fn.qtip.log.error.call(self, 4, $.fn.qtip.constants.INVALID_AREA_SHAPE, 'updatePosition');
                        break;
                  };

                  // Adjust position by 2 pixels (Positioning bug?)
                  target.dimensions.width -= 2; target.dimensions.height -= 2;
               }

               // Target is the document
               else if(self.options.position.target.add(document.body).length === 1)
               {
                  target.position = { left: $(document).scrollLeft(), top: $(document).scrollTop() };
                  target.dimensions = { height: $(window).height(), width: $(window).width() };
               }

               // Target is a regular HTML element, find position normally
               else
               {
                  // Check if the target is another tooltip. If its animated, retrieve position from newPosition data
                  if(typeof self.options.position.target.attr('qtip') !== 'undefined')
                     target.position = self.options.position.target.qtip('api').cache.position;
                  else
                     target.position = self.options.position.target.offset();

                  // Setup dimensions objects
                  target.dimensions = {
                     height: self.options.position.target.outerHeight(),
                     width: self.options.position.target.outerWidth()
                  };
               };

               // Calculate correct target corner position
               newPosition = $.extend({}, target.position);
               if(target.corner.search(/right/i) !== -1)
                  newPosition.left += target.dimensions.width;

               if(target.corner.search(/bottom/i) !== -1)
                  newPosition.top += target.dimensions.height;

               if(target.corner.search(/((top|bottom)Middle)|center/) !== -1)
                  newPosition.left += (target.dimensions.width / 2);

               if(target.corner.search(/((left|right)Middle)|center/) !== -1)
                  newPosition.top += (target.dimensions.height / 2);
            }

            // Mouse is the target, set position to current mouse coordinates
            else
            {
               // Setup target position and dimensions objects
               target.position = newPosition = { left: self.cache.mouse.x, top: self.cache.mouse.y };
               target.dimensions = { height: 1, width: 1 };
            };

            // Calculate correct target corner position
            if(tooltip.corner.search(/right/i) !== -1)
               newPosition.left -= tooltip.dimensions.width;

            if(tooltip.corner.search(/bottom/i) !== -1)
               newPosition.top -= tooltip.dimensions.height;

            if(tooltip.corner.search(/((top|bottom)Middle)|center/) !== -1)
               newPosition.left -= (tooltip.dimensions.width / 2);

            if(tooltip.corner.search(/((left|right)Middle)|center/) !== -1)
               newPosition.top -= (tooltip.dimensions.height / 2);

            // Setup IE adjustment variables (Pixel gap bugs)
            ieAdjust = ($.browser.msie) ? 1 : 0; // And this is why I hate IE...
            ie6Adjust = ($.browser.msie && parseInt($.browser.version.charAt(0)) === 6) ? 1 : 0; // ...and even more so IE6!

            // Adjust for border radius
            if(self.options.style.border.radius > 0)
            {
               if(tooltip.corner.search(/Left/) !== -1)
                  newPosition.left -= self.options.style.border.radius;
               else if(tooltip.corner.search(/Right/) !== -1)
                  newPosition.left += self.options.style.border.radius;

               if(tooltip.corner.search(/Top/) !== -1)
                  newPosition.top -= self.options.style.border.radius;
               else if(tooltip.corner.search(/Bottom/) !== -1)
                  newPosition.top += self.options.style.border.radius;
            };

            // IE only adjustments (Pixel perfect!)
            if(ieAdjust)
            {
               if(tooltip.corner.search(/top/) !== -1)
                  newPosition.top -= ieAdjust
               else if(tooltip.corner.search(/bottom/) !== -1)
                  newPosition.top += ieAdjust

               if(tooltip.corner.search(/left/) !== -1)
                  newPosition.left -= ieAdjust
               else if(tooltip.corner.search(/right/) !== -1)
                  newPosition.left += ieAdjust

               if(tooltip.corner.search(/leftMiddle|rightMiddle/) !== -1)
                  newPosition.top -= 1
            };

            // If screen adjustment is enabled, apply adjustments
            if(self.options.position.adjust.screen === true)
               newPosition = screenAdjust.call(self, newPosition, target, tooltip);

            // If mouse is the target, prevent tooltip appearing directly under the mouse
            if(self.options.position.target === 'mouse' && self.options.position.adjust.mouse === true)
            {
               if(self.options.position.adjust.screen === true && self.elements.tip)
                  mouseAdjust = self.elements.tip.attr('rel');
               else
                  mouseAdjust = self.options.position.corner.tooltip;

               newPosition.left += (mouseAdjust.search(/right/i) !== -1) ? -6 : 6;
               newPosition.top += (mouseAdjust.search(/bottom/i) !== -1) ? -6 : 6;
            }

            // Initiate bgiframe plugin in IE6 if tooltip overlaps a select box or object element
            if(!self.elements.bgiframe && $.browser.msie && parseInt($.browser.version.charAt(0)) == 6)
            {
               $('select, object').each(function()
               {
                  offset = $(this).offset();
                  offset.bottom = offset.top + $(this).height();
                  offset.right = offset.left + $(this).width();

                  if(newPosition.top + tooltip.dimensions.height >= offset.top
                  && newPosition.left + tooltip.dimensions.width >= offset.left)
                     bgiframe.call(self);
               });
            };

            // Add user xy adjustments
            newPosition.left += self.options.position.adjust.x;
            newPosition.top += self.options.position.adjust.y;

            // Set new tooltip position if its moved, animate if enabled
            curPosition = self.getPosition();
            if(newPosition.left != curPosition.left || newPosition.top != curPosition.top)
            {
               // Call API method and if return value is false, halt
               returned = self.beforePositionUpdate.call(self, event);
               if(returned === false) return self;

               // Cache new position
               self.cache.position = newPosition;

               // Check if animation is enabled
               if(animate === true)
               {
                  // Set animated status
                  self.status.animated = true;

                  // Animate and reset animated status on animation end
                  self.elements.tooltip.animate(newPosition, 200, 'swing', function(){ self.status.animated = false });
               }

               // Set new position via CSS
               else self.elements.tooltip.css(newPosition);

               // Call API method and log event if its not a mouse move
               self.onPositionUpdate.call(self, event);
               if(typeof event !== 'undefined' && event.type && event.type !== 'mousemove')
                  $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_POSITION_UPDATED, 'updatePosition');
            };

            return self;
         },

         updateWidth: function(newWidth)
         {
            var hidden;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'updateWidth');

            // Make sure supplied width is a number and if not, return
            else if(newWidth && typeof newWidth !== 'number')
               return $.fn.qtip.log.error.call(self, 2, 'newWidth must be of type number', 'updateWidth');

            // Setup elements which must be hidden during width update
            hidden = self.elements.contentWrapper.siblings().add(self.elements.tip).add(self.elements.button);

            // Calculate the new width if one is not supplied
            if(!newWidth)
            {
               // Explicit width is set
               if(typeof self.options.style.width.value == 'number')
                  newWidth = self.options.style.width.value;

               // No width is set, proceed with auto detection
               else
               {
                  // Set width to auto initally to determine new width and hide other elements
                  self.elements.tooltip.css({ width: 'auto' });
                  hidden.hide();

                  // Set position and zoom to defaults to prevent IE hasLayout bug
                  if($.browser.msie)
                     self.elements.wrapper.add(self.elements.contentWrapper.children()).css({ zoom: 'normal' });

                  // Set the new width
                  newWidth = self.getDimensions().width + 1;

                  // Make sure its within the maximum and minimum width boundries
                  if(!self.options.style.width.value)
                  {
                     if(newWidth > self.options.style.width.max) newWidth = self.options.style.width.max
                     if(newWidth < self.options.style.width.min) newWidth = self.options.style.width.min
                  };
               };
            };

            // Adjust newWidth by 1px if width is odd (IE6 rounding bug fix)
            if(newWidth % 2 !== 0) newWidth -= 1;

            // Set the new calculated width and unhide other elements
            self.elements.tooltip.width(newWidth);
            hidden.show();

            // Set the border width, if enabled
            if(self.options.style.border.radius)
            {
               self.elements.tooltip.find('.qtip-betweenCorners').each(function(i)
               {
                  $(this).width(newWidth - (self.options.style.border.radius * 2));
               })
            };

            // IE only adjustments
            if($.browser.msie)
            {
               // Reset position and zoom to give the wrapper layout (IE hasLayout bug)
               self.elements.wrapper.add(self.elements.contentWrapper.children()).css({ zoom: '1' });

               // Set the new width
               self.elements.wrapper.width(newWidth);

               // Adjust BGIframe height and width if enabled
               if(self.elements.bgiframe) self.elements.bgiframe.width(newWidth).height(self.getDimensions.height);
            };

            // Log event and return
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_WIDTH_UPDATED, 'updateWidth');
         },

         updateStyle: function(name)
         {
            var tip, borders, context, corner, coordinates;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'updateStyle');

            // Return if style is not defined or name is not a string
            else if(typeof name !== 'string' || !$.fn.qtip.styles[name])
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.STYLE_NOT_DEFINED, 'updateStyle');

            // Set the new style object
            self.options.style = buildStyle.call(self, $.fn.qtip.styles[name], self.options.user.style);

            // Update initial styles of content and title elements
            self.elements.content.css( jQueryStyle(self.options.style) );
            if(self.options.content.title.text !== false)
               self.elements.title.css( jQueryStyle(self.options.style.title, true) );

            // Update CSS border colour
            self.elements.contentWrapper.css({ borderColor: self.options.style.border.color });

            // Update tip color if enabled
            if(self.options.style.tip.corner !== false)
            {
               if($('<canvas>').get(0).getContext)
               {
                  // Retrieve canvas context and clear
                  tip = self.elements.tooltip.find('.qtip-tip canvas:first');
                  context = tip.get(0).getContext('2d');
                  context.clearRect(0,0,300,300);

                  // Draw new tip
                  corner = tip.parent('div[rel]:first').attr('rel');
                  coordinates = calculateTip(corner, self.options.style.tip.size.width, self.options.style.tip.size.height);
                  drawTip.call(self, tip, coordinates, self.options.style.tip.color || self.options.style.border.color);
               }
               else if($.browser.msie)
               {
                  // Set new fillcolor attribute
                  tip = self.elements.tooltip.find('.qtip-tip [nodeName="shape"]');
                  tip.attr('fillcolor', self.options.style.tip.color || self.options.style.border.color);
               };
            };

            // Update border colors if enabled
            if(self.options.style.border.radius > 0)
            {
               self.elements.tooltip.find('.qtip-betweenCorners').css({ backgroundColor: self.options.style.border.color });

               if($('<canvas>').get(0).getContext)
               {
                  borders = calculateBorders(self.options.style.border.radius)
                  self.elements.tooltip.find('.qtip-wrapper canvas').each(function()
                  {
                     // Retrieve canvas context and clear
                     context = $(this).get(0).getContext('2d');
                     context.clearRect(0,0,300,300);

                     // Draw new border
                     corner = $(this).parent('div[rel]:first').attr('rel')
                     drawBorder.call(self, $(this), borders[corner],
                        self.options.style.border.radius, self.options.style.border.color);
                  });
               }
               else if($.browser.msie)
               {
                  // Set new fillcolor attribute on each border corner
                  self.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function()
                  {
                     $(this).attr('fillcolor', self.options.style.border.color)
                  });
               };
            };

            // Log event and return
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_STYLE_UPDATED, 'updateStyle');
         },

         updateContent: function(content, reposition)
         {
            var parsedContent, images, loadedImages;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'updateContent');

            // Make sure content is defined before update
            else if(!content)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.NO_CONTENT_PROVIDED, 'updateContent');

            // Call API method and set new content if a string is returned
            parsedContent = self.beforeContentUpdate.call(self, content);
            if(typeof parsedContent == 'string') content = parsedContent;
            else if(parsedContent === false) return;

            // Set position and zoom to defaults to prevent IE hasLayout bug
            if($.browser.msie) self.elements.contentWrapper.children().css({ zoom: 'normal' });

            // Append new content if its a DOM array and show it if hidden
            if(content.jquery && content.length > 0)
               content.clone(true).appendTo(self.elements.content).show();

            // Content is a regular string, insert the new content
            else self.elements.content.html(content);

            // Check if images need to be loaded before position is updated to prevent mis-positioning
            images = self.elements.content.find('img[complete=false]');
            if(images.length > 0)
            {
               loadedImages = 0;
               images.each(function(i)
               {
                  $('<img src="'+ $(this).attr('src') +'" />')
                     .load(function(){ if(++loadedImages == images.length) afterLoad(); });
               });
            }
            else afterLoad();

            function afterLoad()
            {
               // Update the tooltip width
               self.updateWidth();

               // If repositioning is enabled, update positions
               if(reposition !== false)
               {
                  // Update position if tooltip isn't static
                  if(self.options.position.type !== 'static')
                     self.updatePosition(self.elements.tooltip.is(':visible'), true);

                  // Reposition the tip if enabled
                  if(self.options.style.tip.corner !== false)
                     positionTip.call(self);
               };
            };

            // Call API method and log event
            self.onContentUpdate.call(self);
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_CONTENT_UPDATED, 'loadContent');
         },

         loadContent: function(url, data, method)
         {
            var returned;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'loadContent');

            // Call API method and if return value is false, halt
            returned = self.beforeContentLoad.call(self);
            if(returned === false) return self;

            // Load content using specified request type
            if(method == 'post')
               $.post(url, data, setupContent);
            else
               $.get(url, data, setupContent);

            function setupContent(content)
            {
               // Call API method and log event
               self.onContentLoad.call(self);
               $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_CONTENT_LOADED, 'loadContent');

               // Update the content
               self.updateContent(content);
            };

            return self;
         },

         updateTitle: function(content)
         {
            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'updateTitle');

            // Make sure content is defined before update
            else if(!content)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.NO_CONTENT_PROVIDED, 'updateTitle');

            // Call API method and if return value is false, halt
            returned = self.beforeTitleUpdate.call(self);
            if(returned === false) return self;

            // Set the new content and reappend the button if enabled
            if(self.elements.button) self.elements.button = self.elements.button.clone(true);
            self.elements.title.html(content)
            if(self.elements.button) self.elements.title.prepend(self.elements.button);

            // Call API method and log event
            self.onTitleUpdate.call(self);
            return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_TITLE_UPDATED, 'updateTitle');
         },

         focus: function(event)
         {
            var curIndex, newIndex, elemIndex, returned;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'focus');

            else if(self.options.position.type == 'static')
               return $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.CANNOT_FOCUS_STATIC, 'focus');

            // Set z-index variables
            curIndex = parseInt( self.elements.tooltip.css('z-index') );
            newIndex = 6000 + $('div.qtip[qtip]').length - 1;

            // Only update the z-index if it has changed and tooltip is not already focused
            if(!self.status.focused && curIndex !== newIndex)
            {
               // Call API method and if return value is false, halt
               returned = self.beforeFocus.call(self, event);
               if(returned === false) return self;

               // Loop through all other tooltips
               $('div.qtip[qtip]').not(self.elements.tooltip).each(function()
               {
                  if($(this).qtip('api').status.rendered === true)
                  {
                     elemIndex = parseInt($(this).css('z-index'));

                     // Reduce all other tooltip z-index by 1
                     if(typeof elemIndex == 'number' && elemIndex > -1)
                        $(this).css({ zIndex: parseInt( $(this).css('z-index') ) - 1 });

                     // Set focused status to false
                     $(this).qtip('api').status.focused = false;
                  }
               })

               // Set the new z-index and set focus status to true
               self.elements.tooltip.css({ zIndex: newIndex });
               self.status.focused = true;

               // Call API method and log event
               self.onFocus.call(self, event);
               $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_FOCUSED, 'focus');
            };

            return self;
         },

         disable: function(state)
         {
            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'disable');

            if(state)
            {
               // Tooltip is not already disabled, proceed
               if(!self.status.disabled)
               {
                  // Set the disabled flag and log event
                  self.status.disabled = true;
                  $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_DISABLED, 'disable');
               }

               // Tooltip is already disabled, inform user via log
               else  $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED, 'disable');
            }
            else
            {
               // Tooltip is not already enabled, proceed
               if(self.status.disabled)
               {
                  // Reassign events, set disable status and log
                  self.status.disabled = false;
                  $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_ENABLED, 'disable');
               }

               // Tooltip is already enabled, inform the user via log
               else $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED, 'disable');
            };

            return self;
         },

         destroy: function()
         {
            var i, returned, interfaces;

            // Call API method and if return value is false, halt
            returned = self.beforeDestroy.call(self);
            if(returned === false) return self;

            // Check if tooltip is rendered
            if(self.status.rendered)
            {
               // Remove event handlers and remove element
               self.options.show.when.target.unbind('mousemove.qtip', self.updatePosition);
               self.options.show.when.target.unbind('mouseout.qtip', self.hide);
               self.options.show.when.target.unbind(self.options.show.when.event + '.qtip');
               self.options.hide.when.target.unbind(self.options.hide.when.event + '.qtip');
               self.elements.tooltip.unbind(self.options.hide.when.event + '.qtip');
               self.elements.tooltip.unbind('mouseover.qtip', self.focus);
               self.elements.tooltip.remove();
            }

            // Tooltip isn't yet rendered, remove render event
            else self.options.show.when.target.unbind(self.options.show.when.event+'.qtip-create');

            // Check to make sure qTip data is present on target element
            if(typeof self.elements.target.data('qtip') == 'object')
            {
               // Remove API references from interfaces object
               interfaces = self.elements.target.data('qtip').interfaces;
               if(typeof interfaces == 'object' && interfaces.length > 0)
               {
                  // Remove API from interfaces array
                  for(i = 0; i < interfaces.length - 1; i++)
                     if(interfaces[i].id == self.id) interfaces.splice(i, 1)
               }
            }
            delete $.fn.qtip.interfaces[self.id];

            // Set qTip current id to previous tooltips API if available
            if(typeof interfaces == 'object' && interfaces.length > 0)
               self.elements.target.data('qtip').current = interfaces.length -1;
            else
               self.elements.target.removeData('qtip');

            // Call API method and log destroy
            self.onDestroy.call(self);
            $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_DESTROYED, 'destroy');

            return self.elements.target
         },

         getPosition: function()
         {
            var show, offset;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'getPosition');

            show = (self.elements.tooltip.css('display') !== 'none') ? false : true;

            // Show and hide tooltip to make sure coordinates are returned
            if(show) self.elements.tooltip.css({ visiblity: 'hidden' }).show();
            offset = self.elements.tooltip.offset();
            if(show) self.elements.tooltip.css({ visiblity: 'visible' }).hide();

            return offset;
         },

         getDimensions: function()
         {
            var show, dimensions;

            // Make sure tooltip is rendered and if not, return
            if(!self.status.rendered)
               return $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.TOOLTIP_NOT_RENDERED, 'getDimensions');

            show = (!self.elements.tooltip.is(':visible')) ? true : false;

            // Show and hide tooltip to make sure dimensions are returned
            if(show) self.elements.tooltip.css({ visiblity: 'hidden' }).show();
            dimensions = {
               height: self.elements.tooltip.outerHeight(),
               width: self.elements.tooltip.outerWidth()
            };
            if(show) self.elements.tooltip.css({ visiblity: 'visible' }).hide();

            return dimensions;
         }
      });
   };

   // Define priamry construct function
   function construct()
   {
      var self, adjust, content, url, data, method, tempLength;
      self = this;

      // Call API method
      self.beforeRender.call(self);

      // Set rendered status to true
      self.status.rendered = true;

      // Create initial tooltip elements
      self.elements.tooltip =  '<div qtip="'+self.id+'" ' +
         'class="qtip '+(self.options.style.classes.tooltip || self.options.style)+'"' +
         'style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;' +
         'position:'+self.options.position.type+';">' +
         '  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">' +
         '    <div class="qtip-contentWrapper" style="overflow:hidden;">' +
         '       <div class="qtip-content '+self.options.style.classes.content+'"></div>' +
         '</div></div></div>';

      // Append to container element
      self.elements.tooltip = $(self.elements.tooltip);
      self.elements.tooltip.appendTo(self.options.position.container)

      // Setup tooltip qTip data
      self.elements.tooltip.data('qtip', { current: 0, interfaces: [self] });

      // Setup element references
      self.elements.wrapper = self.elements.tooltip.children('div:first');
      self.elements.contentWrapper = self.elements.wrapper.children('div:first').css({ background: self.options.style.background });
      self.elements.content = self.elements.contentWrapper.children('div:first').css( jQueryStyle(self.options.style) );

      // Apply IE hasLayout fix to wrapper and content elements
      if($.browser.msie) self.elements.wrapper.add(self.elements.content).css({ zoom: 1 });

      // Setup tooltip attributes
      if(self.options.hide.when.event == 'unfocus') self.elements.tooltip.attr('unfocus', true);

      // If an explicit width is set, updateWidth prior to setting content to prevent dirty rendering
      if(typeof self.options.style.width.value == 'number') self.updateWidth();

      // Create borders and tips if supported by the browser
      if($('<canvas>').get(0).getContext || $.browser.msie)
      {
         // Create border
         if(self.options.style.border.radius > 0)
            createBorder.call(self);
         else
            self.elements.contentWrapper.css({ border: self.options.style.border.width+'px solid '+self.options.style.border.color  });

         // Create tip if enabled
         if(self.options.style.tip.corner !== false)
            createTip.call(self);
      }

      // Neither canvas or VML is supported, tips and borders cannot be drawn!
      else
      {
         // Set defined border width
         self.elements.contentWrapper.css({ border: self.options.style.border.width+'px solid '+self.options.style.border.color  });

         // Reset border radius and tip
         self.options.style.border.radius = 0;
         self.options.style.tip.corner = false;

         // Inform via log
         $.fn.qtip.log.error.call(self, 2, $.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED, 'render');
      };

      // Use the provided content string or DOM array
      if((typeof self.options.content.text == 'string' && self.options.content.text.length > 0)
      || (self.options.content.text.jquery && self.options.content.text.length > 0))
         content = self.options.content.text;

      // Use title string for content if present
      else if(typeof self.elements.target.attr('title') == 'string' && self.elements.target.attr('title').length > 0)
      {
         content = self.elements.target.attr('title').replace("\\n", '<br />');
         self.elements.target.attr('title', ''); // Remove title attribute to prevent default tooltip showing
      }

      // No title is present, use alt attribute instead
      else if(typeof self.elements.target.attr('alt') == 'string' && self.elements.target.attr('alt').length > 0)
      {
         content = self.elements.target.attr('alt').replace("\\n", '<br />');
         self.elements.target.attr('alt', ''); // Remove alt attribute to prevent default tooltip showing
      }

      // No valid content was provided, inform via log
      else
      {
         content = ' ';
         $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.NO_VALID_CONTENT, 'render');
      };

      // Set the tooltips content and create title if enabled
      if(self.options.content.title.text !== false) createTitle.call(self);
      self.updateContent(content);

      // Assign events and toggle tooltip with focus
      assignEvents.call(self);
      if(self.options.show.ready === true) self.show();

      // Retrieve ajax content if provided
      if(self.options.content.url !== false)
      {
         url = self.options.content.url;
         data = self.options.content.data;
         method = self.options.content.method || 'get';
         self.loadContent(url, data, method);
      };

      // Call API method and log event
      self.onRender.call(self);
      $.fn.qtip.log.error.call(self, 1, $.fn.qtip.constants.EVENT_RENDERED, 'render');
   };

   // Create borders using canvas and VML
   function createBorder()
   {
      var self, i, width, radius, color, coordinates, containers, size, betweenWidth, betweenCorners, borderTop, borderBottom, borderCoord, sideWidth, vertWidth;
      self = this;

      // Destroy previous border elements, if present
      self.elements.wrapper.find('.qtip-borderBottom, .qtip-borderTop').remove();

      // Setup local variables
      width = self.options.style.border.width;
      radius = self.options.style.border.radius;
      color = self.options.style.border.color || self.options.style.tip.color;

      // Calculate border coordinates
      coordinates = calculateBorders(radius);

      // Create containers for the border shapes
      containers = {};
      for(i in coordinates)
      {
         // Create shape container
         containers[i] = '<div rel="'+i+'" style="'+((i.search(/Left/) !== -1) ? 'left' : 'right') + ':0; ' +
            'position:absolute; height:'+radius+'px; width:'+radius+'px; overflow:hidden; line-height:0.1px; font-size:1px">';

         // Canvas is supported
         if($('<canvas>').get(0).getContext)
            containers[i] += '<canvas height="'+radius+'" width="'+radius+'" style="vertical-align: top"></canvas>';

         // No canvas, but if it's IE use VML
         else if($.browser.msie)
         {
            size = radius * 2 + 3;
            containers[i] += '<v:arc stroked="false" fillcolor="'+color+'" startangle="'+coordinates[i][0]+'" endangle="'+coordinates[i][1]+'" ' +
               'style="width:'+size+'px; height:'+size+'px; margin-top:'+((i.search(/bottom/) !== -1) ? -2 : -1)+'px; ' +
               'margin-left:'+((i.search(/Right/) !== -1) ? coordinates[i][2] - 3.5 : -1)+'px; ' +
               'vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>';

         };

         containers[i] += '</div>';
      };

      // Create between corners elements
      betweenWidth = self.getDimensions().width - (Math.max(width, radius) * 2);
      betweenCorners = '<div class="qtip-betweenCorners" style="height:'+radius+'px; width:'+betweenWidth+'px; ' +
         'overflow:hidden; background-color:'+color+'; line-height:0.1px; font-size:1px;">';

      // Create top border container
      borderTop = '<div class="qtip-borderTop" dir="ltr" style="height:'+radius+'px; ' +
         'margin-left:'+radius+'px; line-height:0.1px; font-size:1px; padding:0;">' +
         containers['topLeft'] + containers['topRight'] + betweenCorners;
      self.elements.wrapper.prepend(borderTop);

      // Create bottom border container
      borderBottom = '<div class="qtip-borderBottom" dir="ltr" style="height:'+radius+'px; ' +
         'margin-left:'+radius+'px; line-height:0.1px; font-size:1px; padding:0;">' +
         containers['bottomLeft'] + containers['bottomRight'] + betweenCorners;
      self.elements.wrapper.append(borderBottom);

      // Draw the borders if canvas were used (Delayed til after DOM creation)
      if($('<canvas>').get(0).getContext)
      {
         self.elements.wrapper.find('canvas').each(function()
         {
            borderCoord = coordinates[ $(this).parent('[rel]:first').attr('rel') ];
            drawBorder.call(self, $(this), borderCoord, radius, color);
         })
      }

      // Create a phantom VML element (IE won't show the last created VML element otherwise)
      else if($.browser.msie) self.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>');

      // Setup contentWrapper border
      sideWidth = Math.max(radius, (radius + (width - radius)) )
      vertWidth = Math.max(width - radius, 0);
      self.elements.contentWrapper.css({
         border: '0px solid ' + color,
         borderWidth: vertWidth + 'px ' + sideWidth + 'px'
      })
   };

   // Border canvas draw method
   function drawBorder(canvas, coordinates, radius, color)
   {
      // Create corner
      var context = canvas.get(0).getContext('2d');
      context.fillStyle = color;
      context.beginPath();
      context.arc(coordinates[0], coordinates[1], radius, 0, Math.PI * 2, false);
      context.fill();
   };

   // Create tip using canvas and VML
   function createTip(corner)
   {
      var self, color, coordinates, coordsize, path;
      self = this;

      // Destroy previous tip, if there is one
      if(self.elements.tip !== null) self.elements.tip.remove();

      // Setup color and corner values
      color = self.options.style.tip.color || self.options.style.border.color;
      if(self.options.style.tip.corner === false) return;
      else if(!corner) corner = self.options.style.tip.corner;

      // Calculate tip coordinates
      coordinates = calculateTip(corner, self.options.style.tip.size.width, self.options.style.tip.size.height);

      // Create tip element
      self.elements.tip =  '<div class="'+self.options.style.classes.tip+'" dir="ltr" rel="'+corner+'" style="position:absolute; ' +
         'height:'+self.options.style.tip.size.height+'px; width:'+self.options.style.tip.size.width+'px; ' +
         'margin:0 auto; line-height:0.1px; font-size:1px;">';

      // Use canvas element if supported
      if($('<canvas>').get(0).getContext)
          self.elements.tip += '<canvas height="'+self.options.style.tip.size.height+'" width="'+self.options.style.tip.size.width+'"></canvas>';

      // Canvas not supported - Use VML (IE)
      else if($.browser.msie)
      {
         // Create coordize and tip path using tip coordinates
         coordsize = self.options.style.tip.size.width + ',' + self.options.style.tip.size.height;
         path = 'm' + coordinates[0][0] + ',' + coordinates[0][1];
         path += ' l' + coordinates[1][0] + ',' + coordinates[1][1];
         path += ' ' + coordinates[2][0] + ',' + coordinates[2][1];
         path += ' xe';

         // Create VML element
         self.elements.tip += '<v:shape fillcolor="'+color+'" stroked="false" filled="true" path="'+path+'" coordsize="'+coordsize+'" ' +
            'style="width:'+self.options.style.tip.size.width+'px; height:'+self.options.style.tip.size.height+'px; ' +
            'line-height:0.1px; display:inline-block; behavior:url(#default#VML); ' +
            'vertical-align:'+((corner.search(/top/) !== -1) ? 'bottom' : 'top')+'"></v:shape>';

         // Create a phantom VML element (IE won't show the last created VML element otherwise)
         self.elements.tip += '<v:image style="behavior:url(#default#VML);"></v:image>';

         // Prevent tooltip appearing above the content (IE z-index bug)
         self.elements.contentWrapper.css('position', 'relative');
      };

      // Attach new tip to tooltip element
      self.elements.tooltip.prepend(self.elements.tip + '</div>');

      // Create element reference and draw the canvas tip (Delayed til after DOM creation)
      self.elements.tip = self.elements.tooltip.find('.'+self.options.style.classes.tip).eq(0);
      if($('<canvas>').get(0).getContext)
         drawTip.call(self, self.elements.tip.find('canvas:first'), coordinates, color);

      // Fix IE small tip bug
      if(corner.search(/top/) !== -1 && $.browser.msie && parseInt($.browser.version.charAt(0)) === 6)
         self.elements.tip.css({ marginTop: -4 });

      // Set the tip position
      positionTip.call(self, corner);
   };

   // Canvas tip drawing method
   function drawTip(canvas, coordinates, color)
   {
      // Setup properties
      var context = canvas.get(0).getContext('2d');
      context.fillStyle = color;

      // Create tip
      context.beginPath();
      context.moveTo(coordinates[0][0], coordinates[0][1]);
      context.lineTo(coordinates[1][0], coordinates[1][1]);
      context.lineTo(coordinates[2][0], coordinates[2][1]);
      context.fill();
   };

   function positionTip(corner)
   {
      var self, ieAdjust, paddingCorner, paddingSize, newMargin;
      self = this;

      // Return if tips are disabled or tip is not yet rendered
      if(self.options.style.tip.corner === false || !self.elements.tip) return;
      if(!corner) corner = self.elements.tip.attr('rel');

      // Setup adjustment variables
      ieAdjust = positionAdjust = ($.browser.msie) ? 1 : 0;

      // Set initial position
      self.elements.tip.css(corner.match(/left|right|top|bottom/)[0], 0);

      // Set position of tip to correct side
      if(corner.search(/top|bottom/) !== -1)
      {
         // Adjustments for IE6 - 0.5px border gap bug
         if($.browser.msie)
         {
            if(parseInt($.browser.version.charAt(0)) === 6)
               positionAdjust = (corner.search(/top/) !== -1) ? -3 : 1;
            else
               positionAdjust = (corner.search(/top/) !== -1) ? 1 : 2;
         };

         if(corner.search(/Middle/) !== -1)
            self.elements.tip.css({ left: '50%', marginLeft: -(self.options.style.tip.size.width / 2) });

         else if(corner.search(/Left/) !== -1)
            self.elements.tip.css({ left: self.options.style.border.radius - ieAdjust });

         else if(corner.search(/Right/) !== -1)
            self.elements.tip.css({ right: self.options.style.border.radius + ieAdjust });

         if(corner.search(/top/) !== -1)
            self.elements.tip.css({ top: -positionAdjust });
         else
            self.elements.tip.css({ bottom: positionAdjust });

      }
      else if(corner.search(/left|right/) !== -1)
      {
         // Adjustments for IE6 - 0.5px border gap bug
         if($.browser.msie)
            positionAdjust = (parseInt($.browser.version.charAt(0)) === 6) ? 1 : ((corner.search(/left/) !== -1) ? 1 : 2);

         if(corner.search(/Middle/) !== -1)
            self.elements.tip.css({ top: '50%', marginTop: -(self.options.style.tip.size.height / 2) });

         else if(corner.search(/Top/) !== -1)
            self.elements.tip.css({ top: self.options.style.border.radius - ieAdjust });

         else if(corner.search(/Bottom/) !== -1)
            self.elements.tip.css({ bottom: self.options.style.border.radius + ieAdjust });

         if(corner.search(/left/) !== -1)
            self.elements.tip.css({ left: -positionAdjust });
         else
            self.elements.tip.css({ right: positionAdjust });
      };

      // Adjust tooltip padding to compensate for tip
      paddingCorner = 'padding-' + corner.match(/left|right|top|bottom/)[0];
      paddingSize = self.options.style.tip.size[ (paddingCorner.search(/left|right/) !== -1) ? 'width' : 'height' ];
      self.elements.tooltip.css('padding', 0);
      self.elements.tooltip.css(paddingCorner, paddingSize);

      // Match content margin to prevent gap bug in IE6 ONLY
      if($.browser.msie && parseInt($.browser.version.charAt(0)) == 6)
      {
         newMargin = parseInt(self.elements.tip.css('margin-top')) || 0;
         newMargin += parseInt(self.elements.content.css('margin-top')) || 0;

         self.elements.tip.css({ marginTop: newMargin });
      };
   };

   // Create title bar for content
   function createTitle()
   {
      var self = this;

      // Destroy previous title element, if present
      if(self.elements.title !== null) self.elements.title.remove();

      // Create title element
      self.elements.title = $('<div class="'+self.options.style.classes.title+'">')
         .css( jQueryStyle(self.options.style.title, true) )
         .css({ zoom: ($.browser.msie) ? 1 : 0 })
         .prependTo(self.elements.contentWrapper);

      // Update title with contents if enabled
      if(self.options.content.title.text) self.updateTitle.call(self, self.options.content.title.text);

      // Create title close buttons if enabled
      if(self.options.content.title.button !== false
      && typeof self.options.content.title.button == 'string')
      {
         self.elements.button = $('<a class="'+self.options.style.classes.button+'" style="float:right; position: relative"></a>')
            .css( jQueryStyle(self.options.style.button, true) )
            .html(self.options.content.title.button)
            .prependTo(self.elements.title)
            .click(function(event){ if(!self.status.disabled) self.hide(event) });
      };
   };

   // Assign hide and show events
   function assignEvents()
   {
      var self, showTarget, hideTarget, inactiveEvents;
      self = this;

      // Setup event target variables
      showTarget = self.options.show.when.target;
      hideTarget = self.options.hide.when.target;

      // Add tooltip as a hideTarget is its fixed
      if(self.options.hide.fixed) hideTarget = hideTarget.add(self.elements.tooltip);

      // Check if the hide event is special 'inactive' type
      if(self.options.hide.when.event == 'inactive')
      {
         // Define events which reset the 'inactive' event handler
         inactiveEvents = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove',
         'mouseout', 'mouseenter', 'mouseleave', 'mouseover' ];

         // Define 'inactive' event timer method
         function inactiveMethod(event)
         {
            if(self.status.disabled === true) return;

            //Clear and reset the timer
            clearTimeout(self.timers.inactive);
            self.timers.inactive = setTimeout(function()
            {
               // Unassign 'inactive' events
               $(inactiveEvents).each(function()
               {
                  hideTarget.unbind(this+'.qtip-inactive');
                  self.elements.content.unbind(this+'.qtip-inactive');
               });

               // Hide the tooltip
               self.hide(event);
            }
            , self.options.hide.delay);
         };
      }

      // Check if the tooltip is 'fixed'
      else if(self.options.hide.fixed === true)
      {
         self.elements.tooltip.bind('mouseover.qtip', function()
         {
            if(self.status.disabled === true) return;

            // Reset the hide timer
            clearTimeout(self.timers.hide);
         });
      };

      // Define show event method
      function showMethod(event)
      {
         if(self.status.disabled === true) return;

         // If set, hide tooltip when inactive for delay period
         if(self.options.hide.when.event == 'inactive')
         {
            // Assign each reset event
            $(inactiveEvents).each(function()
            {
               hideTarget.bind(this+'.qtip-inactive', inactiveMethod);
               self.elements.content.bind(this+'.qtip-inactive', inactiveMethod);
            });

            // Start the inactive timer
            inactiveMethod();
         };

         // Clear hide timers
         clearTimeout(self.timers.show);
         clearTimeout(self.timers.hide);

         // Start show timer
         self.timers.show = setTimeout(function(){ self.show(event); }, self.options.show.delay);
      };

      // Define hide event method
      function hideMethod(event)
      {
         if(self.status.disabled === true) return;

         // Prevent hiding if tooltip is fixed and event target is the tooltip
         if(self.options.hide.fixed === true
         && self.options.hide.when.event.search(/mouse(out|leave)/i) !== -1
         && $(event.relatedTarget).parents('div.qtip[qtip]').length > 0)
         {
            // Prevent default and popagation
            event.stopPropagation();
            event.preventDefault();

            // Reset the hide timer
            clearTimeout(self.timers.hide);
            return false;
         };

         // Clear timers and stop animation queue
         clearTimeout(self.timers.show);
         clearTimeout(self.timers.hide);
         self.elements.tooltip.stop(true, true);

         // If tooltip has displayed, start hide timer
         self.timers.hide = setTimeout(function(){ self.hide(event); }, self.options.hide.delay);
      };

      // Both events and targets are identical, apply events using a toggle
      if((self.options.show.when.target.add(self.options.hide.when.target).length === 1
      && self.options.show.when.event == self.options.hide.when.event
      && self.options.hide.when.event !== 'inactive')
      || self.options.hide.when.event == 'unfocus')
      {
         self.cache.toggle = 0;
         // Use a toggle to prevent hide/show conflicts
         showTarget.bind(self.options.show.when.event + '.qtip', function(event)
         {
            if(self.cache.toggle == 0) showMethod(event);
            else hideMethod(event);
         });
      }

      // Events are not identical, bind normally
      else
      {
         showTarget.bind(self.options.show.when.event + '.qtip', showMethod);

         // If the hide event is not 'inactive', bind the hide method
         if(self.options.hide.when.event !== 'inactive')
            hideTarget.bind(self.options.hide.when.event + '.qtip', hideMethod);
      };

      // Focus the tooltip on mouseover
      if(self.options.position.type.search(/(fixed|absolute)/) !== -1)
         self.elements.tooltip.bind('mouseover.qtip', self.focus);

      // If mouse is the target, update tooltip position on mousemove
      if(self.options.position.target === 'mouse' && self.options.position.type !== 'static')
      {
         showTarget.bind('mousemove.qtip', function(event)
         {
            // Set the new mouse positions if adjustment is enabled
            self.cache.mouse = { x: event.pageX, y: event.pageY };

            // Update the tooltip position only if the tooltip is visible and adjustment is enabled
            if(self.status.disabled === false
            && self.options.position.adjust.mouse === true
            && self.options.position.type !== 'static'
            && self.elements.tooltip.css('display') !== 'none')
               self.updatePosition(event);
         });
      };
   };

   // Screen position adjustment
   function screenAdjust(position, target, tooltip)
   {
      var self, adjustedPosition, adjust, newCorner, overflow, corner;
      self = this;

      // Setup corner and adjustment variable
      if(tooltip.corner == 'center') return target.position // TODO: 'center' corner adjustment
      adjustedPosition = $.extend({}, position);
      newCorner = { x: false, y: false };

      // Define overflow properties
      overflow = {
         left: (adjustedPosition.left < $.fn.qtip.cache.screen.scroll.left),
         right: (adjustedPosition.left + tooltip.dimensions.width + 2 >= $.fn.qtip.cache.screen.width + $.fn.qtip.cache.screen.scroll.left),
         top: (adjustedPosition.top < $.fn.qtip.cache.screen.scroll.top),
         bottom: (adjustedPosition.top + tooltip.dimensions.height + 2 >= $.fn.qtip.cache.screen.height + $.fn.qtip.cache.screen.scroll.top)
      };

      // Determine new positioning properties
      adjust = {
         left: (overflow.left && (tooltip.corner.search(/right/i) != -1 || (tooltip.corner.search(/right/i) == -1 && !overflow.right))),
         right: (overflow.right && (tooltip.corner.search(/left/i) != -1 || (tooltip.corner.search(/left/i) == -1 && !overflow.left))),
         top: (overflow.top && tooltip.corner.search(/top/i) == -1),
         bottom: (overflow.bottom && tooltip.corner.search(/bottom/i) == -1)
      };

      // Tooltip overflows off the left side of the screen
      if(adjust.left)
      {
         if(self.options.position.target !== 'mouse')
            adjustedPosition.left = target.position.left + target.dimensions.width;
         else
            adjustedPosition.left = self.cache.mouse.x

         newCorner.x = 'Left';
      }

      // Tooltip overflows off the right side of the screen
      else if(adjust.right)
      {
         if(self.options.position.target !== 'mouse')
            adjustedPosition.left = target.position.left - tooltip.dimensions.width;
         else
            adjustedPosition.left = self.cache.mouse.x - tooltip.dimensions.width;

         newCorner.x = 'Right';
      };

      // Tooltip overflows off the top of the screen
      if(adjust.top)
      {
         if(self.options.position.target !== 'mouse')
            adjustedPosition.top = target.position.top + target.dimensions.height;
         else
            adjustedPosition.top = self.cache.mouse.y

         newCorner.y = 'top';
      }

      // Tooltip overflows off the bottom of the screen
      else if(adjust.bottom)
      {
         if(self.options.position.target !== 'mouse')
            adjustedPosition.top = target.position.top - tooltip.dimensions.height;
         else
            adjustedPosition.top = self.cache.mouse.y - tooltip.dimensions.height;

         newCorner.y = 'bottom';
      };

      // Don't adjust if resulting position is negative
      if(adjustedPosition.left < 0)
      {
         adjustedPosition.left = position.left;
         newCorner.x = false;
      };
      if(adjustedPosition.top < 0)
      {
         adjustedPosition.top = position.top;
         newCorner.y = false;
      };

      // Change tip corner if positioning has changed and tips are enabled
      if(self.options.style.tip.corner !== false)
      {
         // Determine new corner properties
         adjustedPosition.corner = new String(tooltip.corner);
         if(newCorner.x !== false) adjustedPosition.corner = adjustedPosition.corner.replace(/Left|Right|Middle/, newCorner.x);
         if(newCorner.y !== false) adjustedPosition.corner = adjustedPosition.corner.replace(/top|bottom/, newCorner.y);

         // Adjust tip if position has changed and tips are enabled
         if(adjustedPosition.corner !== self.elements.tip.attr('rel'))
            createTip.call(self, adjustedPosition.corner);
      };

      return adjustedPosition;
   };

   // Build a jQuery style object from supplied style object
   function jQueryStyle(style, sub)
   {
      var styleObj, i;

      styleObj = $.extend(true, {}, style);
      for(i in styleObj)
      {
         if(sub === true && i.search(/(tip|classes)/i) !== -1)
            delete styleObj[i];
         else if(!sub && i.search(/(width|border|tip|title|classes|user)/i) !== -1)
            delete styleObj[i];
      };

      return styleObj;
   };

   // Sanitize styles
   function sanitizeStyle(style)
   {
      if(typeof style.tip !== 'object') style.tip = { corner: style.tip };
      if(typeof style.tip.size !== 'object') style.tip.size = { width: style.tip.size, height: style.tip.size };
      if(typeof style.border !== 'object') style.border = { width: style.border };
      if(typeof style.width !== 'object') style.width = { value: style.width };
      if(typeof style.width.max == 'string') style.width.max = parseInt(style.width.max.replace(/([0-9]+)/i, "$1"));
      if(typeof style.width.min == 'string') style.width.min = parseInt(style.width.min.replace(/([0-9]+)/i, "$1"));

      // Convert deprecated x and y tip values to width/height
      if(typeof style.tip.size.x == 'number')
      {
         style.tip.size.width = style.tip.size.x;
         delete style.tip.size.x;
      };
      if(typeof style.tip.size.y == 'number')
      {
         style.tip.size.height = style.tip.size.y;
         delete style.tip.size.y;
      };

      return style;
   };

   // Build styles recursively with inheritance
   function buildStyle()
   {
      var self, i, styleArray, styleExtend, finalStyle, ieAdjust;
      self = this;

      // Build style options from supplied arguments
      styleArray = [true, {}];
      for(i = 0; i < arguments.length; i++)
         styleArray.push(arguments[i]);
      styleExtend = [ $.extend.apply($, styleArray) ];

      // Loop through each named style inheritance
      while(typeof styleExtend[0].name == 'string')
      {
         // Sanitize style data and append to extend array
         styleExtend.unshift( sanitizeStyle($.fn.qtip.styles[ styleExtend[0].name ]) );
      };

      // Make sure resulting tooltip className represents final style
      styleExtend.unshift(true, {classes:{ tooltip: 'qtip-' + (arguments[0].name || 'defaults') }}, $.fn.qtip.styles.defaults);

      // Extend into a single style object
      finalStyle = $.extend.apply($, styleExtend);

      // Adjust tip size if needed (IE 1px adjustment bug fix)
      ieAdjust = ($.browser.msie) ? 1 : 0;
      finalStyle.tip.size.width += ieAdjust;
      finalStyle.tip.size.height += ieAdjust;

      // Force even numbers for pixel precision
      if(finalStyle.tip.size.width % 2 > 0) finalStyle.tip.size.width += 1;
      if(finalStyle.tip.size.height % 2 > 0) finalStyle.tip.size.height += 1;

      // Sanitize final styles tip corner value
      if(finalStyle.tip.corner === true)
         finalStyle.tip.corner = (self.options.position.corner.tooltip === 'center') ? false : self.options.position.corner.tooltip;

      return finalStyle;
   };

   // Tip coordinates calculator
   function calculateTip(corner, width, height)
   {
      // Define tip coordinates in terms of height and width values
      var tips = {
         bottomRight:   [[0,0],              [width,height],      [width,0]],
         bottomLeft:    [[0,0],              [width,0],           [0,height]],
         topRight:      [[0,height],         [width,0],           [width,height]],
         topLeft:       [[0,0],              [0,height],          [width,height]],
         topMiddle:     [[0,height],         [width / 2,0],       [width,height]],
         bottomMiddle:  [[0,0],              [width,0],           [width / 2,height]],
         rightMiddle:   [[0,0],              [width,height / 2],  [0,height]],
         leftMiddle:    [[width,0],          [width,height],      [0,height / 2]]
      };
      tips.leftTop = tips.bottomRight;
      tips.rightTop = tips.bottomLeft;
      tips.leftBottom = tips.topRight;
      tips.rightBottom = tips.topLeft;

      return tips[corner];
   };

   // Border coordinates calculator
   function calculateBorders(radius)
   {
      var borders;

      // Use canvas element if supported
      if($('<canvas>').get(0).getContext)
      {
         borders = {
            topLeft: [radius,radius], topRight: [0,radius],
            bottomLeft: [radius,0], bottomRight: [0,0]
         };
      }

      // Canvas not supported - Use VML (IE)
      else if($.browser.msie)
      {
         borders = {
            topLeft: [-90,90,0], topRight: [-90,90,-radius],
            bottomLeft: [90,270,0], bottomRight: [90, 270,-radius]
         };
      };

      return borders;
   };

   // BGIFRAME JQUERY PLUGIN ADAPTION
   //   Special thanks to Brandon Aaron for this plugin
   //   http://plugins.jquery.com/project/bgiframe
   function bgiframe()
   {
      var self, html, dimensions;
      self = this;
      dimensions = self.getDimensions();

      // Setup iframe HTML string
      html = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" '+
         'style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; ' +
         'height:'+dimensions.height+'px; width:'+dimensions.width+'px" />';

      // Append the new HTML and setup element reference
      self.elements.bgiframe = self.elements.wrapper.prepend(html).children('.qtip-bgiframe:first');
   };

   // Assign cache and event initialisation on document load
   $(document).ready(function()
   {
      // Setup library cache with window scroll and dimensions of document
      $.fn.qtip.cache = {
         screen: {
            scroll: { left: $(window).scrollLeft(), top: $(window).scrollTop() },
            width: $(window).width(),
            height: $(window).height()
         }
      };

      // Adjust positions of the tooltips on window resize or scroll if enabled
      var adjustTimer;
      $(window).bind('resize scroll', function(event)
      {
         clearTimeout(adjustTimer);
         adjustTimer = setTimeout(function()
         {
            // Readjust cached screen values
            if(event.type === 'scroll')
               $.fn.qtip.cache.screen.scroll = { left: $(window).scrollLeft(), top: $(window).scrollTop() };
            else
            {
               $.fn.qtip.cache.screen.width = $(window).width();
               $.fn.qtip.cache.screen.height = $(window).height();
            };

            for(i = 0; i < $.fn.qtip.interfaces.length; i++)
            {
               // Access current elements API
               var api = $.fn.qtip.interfaces[i];

               // Update position if resize or scroll adjustments are enabled
               if(api.status.rendered === true
               && (api.options.position.type !== 'static'
               || api.options.position.adjust.scroll && event.type === 'scroll'
               || api.options.position.adjust.resize && event.type === 'resize'))
               {
                  // Queue the animation so positions are updated correctly
                  api.updatePosition(event, true);
               }
            };
         }
         , 100);
      })

      // Hide unfocus toolipts on document mousedown
      $(document).bind('mousedown.qtip', function(event)
      {
         if($(event.target).parents('div.qtip').length === 0)
         {
            $('.qtip[unfocus]').each(function()
            {
               var api = $(this).qtip("api");

               // Only hide if its visible and not the tooltips target
               if($(this).is(':visible') && !api.status.disabled
               && $(event.target).add(api.elements.target).length > 1)
                  api.hide(event);
            })
         };
      })
   });

   // Define qTip API interfaces array
   $.fn.qtip.interfaces = []

   // Define log and constant place holders
   $.fn.qtip.log = { error: function(){ return this; } };
   $.fn.qtip.constants = {};

   // Define configuration defaults
   $.fn.qtip.defaults = {
      // Content
      content: {
         prerender: false,
         text: false,
         url: false,
         data: null,
         title: {
            text: false,
            button: false
         }
      },
      // Position
      position: {
         target: false,
         corner: {
            target: 'bottomRight',
            tooltip: 'topLeft'
         },
         adjust: {
            x: 0, y: 0,
            mouse: true,
            screen: false,
            scroll: true,
            resize: true
         },
         type: 'absolute',
         container: false
      },
      // Effects
      show: {
         when: {
            target: false,
            event: 'mouseover'
         },
         effect: {
            type: 'fade',
            length: 100
         },
         delay: 140,
         solo: false,
         ready: false
      },
      hide: {
         when: {
            target: false,
            event: 'mouseout'
         },
         effect: {
            type: 'fade',
            length: 100
         },
         delay: 0,
         fixed: false
      },
      // Callbacks
      api: {
         beforeRender: function(){},
         onRender: function(){},
         beforePositionUpdate: function(){},
         onPositionUpdate: function(){},
         beforeShow: function(){},
         onShow: function(){},
         beforeHide: function(){},
         onHide: function(){},
         beforeContentUpdate: function(){},
         onContentUpdate: function(){},
         beforeContentLoad: function(){},
         onContentLoad: function(){},
         beforeTitleUpdate: function(){},
         onTitleUpdate: function(){},
         beforeDestroy: function(){},
         onDestroy: function(){},
         beforeFocus: function(){},
         onFocus: function(){}
      }
   };

   $.fn.qtip.styles = {
      defaults: {
         background: 'white',
         color: '#111',
         overflow: 'hidden',
         textAlign: 'left',
         width: {
            min: 0,
            max: 250
         },
         padding: '5px 9px',
         border: {
            width: 1,
            radius: 0,
            color: '#d3d3d3'
         },
         tip: {
            corner: false,
            color: false,
            size: { width: 13, height: 13 },
            opacity: 1
         },
         title: {
            background: '#e1e1e1',
            fontWeight: 'bold',
            padding: '7px 12px'
         },
         button: {
            cursor: 'pointer'
         },
         classes: {
            target: '',
            tip: 'qtip-tip',
            title: 'qtip-title',
            button: 'qtip-button',
            content: 'qtip-content',
            active: 'qtip-active'
         }
      },
      cream: {
         border: {
            width: 3,
            radius: 0,
            color: '#F9E98E'
         },
         title: {
            background: '#F0DE7D',
            color: '#A27D35'
         },
         background: '#FBF7AA',
         color: '#A27D35',

         classes: { tooltip: 'qtip-cream' }
      },
      light: {
         border: {
            width: 3,
            radius: 0,
            color: '#E2E2E2'
         },
         title: {
            background: '#f1f1f1',
            color: '#454545'
         },
         background: 'white',
         color: '#454545',

         classes: { tooltip: 'qtip-light' }
      },
      dark: {
         border: {
            width: 3,
            radius: 0,
            color: '#303030'
         },
         title: {
            background: '#404040',
            color: '#f3f3f3'
         },
         background: '#505050',
         color: '#f3f3f3',

         classes: { tooltip: 'qtip-dark' }
      },
      red: {
         border: {
            width: 3,
            radius: 0,
            color: '#CE6F6F'
         },
         title: {
            background: '#f28279',
            color: '#9C2F2F'
         },
         background: '#F79992',
         color: '#9C2F2F',

         classes: { tooltip: 'qtip-red' }
      },
      green: {
         border: {
            width: 3,
            radius: 0,
            color: '#A9DB66'
         },
         title: {
            background: '#b9db8c',
            color: '#58792E'
         },
         background: '#CDE6AC',
         color: '#58792E',

         classes: { tooltip: 'qtip-green' }
      },
      blue: {
         border: {
            width: 3,
            radius: 0,
            color: '#ADD9ED'
         },
         title: {
            background: '#D0E9F5',
            color: '#5E99BD'
         },
         background: '#E5F6FE',
         color: '#4D9FBF',

         classes: { tooltip: 'qtip-blue' }
      }
   };
})(jQuery);/* complete : /javascript/common/libraries/jquery/jquery.qtip-1.0.js*/


/* combine : /javascript/desktop/common/affiliateSitesPromoCodeModalPopup.js*/
/***********************************************************************************************
 * Static data and functions are all contained within the "affiliateSitesPromoModal" object, 
 * to avoid namespace conflicts. 
 ***********************************************************************************************/
var affiliateSitesPromoModal = {
	getUrlParam: function(param) {
		param = param.replace(/([\[\](){}*?+^$.\\|])/g, "\\$1");
		var regex = new RegExp("[?&]" + param + "=([^&#]*)");
		var url   = decodeURIComponent(window.location.href);
		var match = regex.exec(url);
		return match ? match[1] : "";
	},

	displayAffiliateSiteOverlay: function(data) {
		openModalJQ(data, null, null, null);
		affiliateSitesPromoModal.populateOverlayData();
	
		enableCloseModalJQByClickingOutsideBorder();
	},

	populateOverlayData: function() {
		$('#modal_outer').find('#modal_header').remove();
		$('#modal_outer').find('#modal_control').remove();
		$('#modal_outer').find('#tradingTitleImage').html(jTitle);
		$('#modal_outer').css({'margin-left' : '-300px'});
	
		var goShoppingLink = $('#modal_outer').find('#promoOverlayGoShoppingLink');
		goShoppingLink.attr('href', 'javascript:goShopping();');
		goShoppingLink.html("Shop at " + jTitle);
	},

	goShopping: function() {
		closeModalJQ();
	
	}
};

$(document).ready(function() {
	var param = affiliateSitesPromoModal.getUrlParam("promo");
    if (param != null && param != "" && param == jAffiliatedSitesPromoCode) {
		$.getJSON('/shop/affiliatesites/getdetails.action', function(data) {	  
			var actionStatus = data.status;
			if (actionStatus != null && actionStatus != 'undefined' && actionStatus == "error") {
				return;
			}
			
			$.get('/shop/affiliatesites/show.action', function(data) {	  
					affiliateSitesPromoModal.displayAffiliateSiteOverlay(data);
				});
        });
	}
});
/* complete : /javascript/desktop/common/affiliateSitesPromoCodeModalPopup.js*/


/* combine : /javascript/common/jdw_commonHeaderFunctions.js*/
(function() {
	if ((typeof(jDisplayChangeTitleOverlay) != "undefined")
		&& (jDisplayChangeTitleOverlay == true)) {
		$.get('/content/changetitle/changeTitle.html', function(data) {
			displayChangeTitleOverlay(data)
		});
	}
})();

$(document).ready(function () {
	var googleAnalyticsContent = $('#googleAnalyticsContent');
	if (googleAnalyticsContent.length > 0) {
		googleAnalyticsContent.load("/shop/3rdparty/get-google-analytics.action");
	}
  
});

/* ----------------------------------------------------------------------------*/
/* Global location for methods required when adding warranties to products.
 * Moved here to avoid duplication and a new javascript file.
 */
function updateBagItems( numberOfBasketItems ) {
	//To set the contents of a div...below
	if(top != self) {
		top.$('#numItemsInBag').html(numberOfBasketItems);
	} else {
		$('#numItemsInBag').html(numberOfBasketItems);
	}
}

/* -------------------------------- Minibag Functions -------------------------*/

/*
 * The jQuery below generates the qTip used by the minibag. Coremetrics tags are also included
 * below.
 */
$(document).ready(function () {
	if (activateMinibag) {
		var target = '#gotoCheckOutContainerLink';		
		$(target).qtip({ 
			content: {
				url: '/shop/minibag/show.action',
				// IE will cache the ajax request unless POST is used.
				method: 'post'
			},		
			position: {
				corner: {
					target: 'bottomLeft',
					tooltip: 'topRight'
				},
				adjust: {
					x: calculateXaxis(), y: -25
				}			
			},
			show: {
				delay: 300
			},
			hide: {		
				fixed: true,
				when: 'mouseout', 
				delay: 100
			},
			style: {
				background: 'transparent',
				border: {
					width: 0,
					radius: 0,
					colour: '#181818'
				},
				width: calculateWidth()
			},
			api: {
				beforeShow: function() {		
					this.loadContent(this.options.content.url,this.options.content.data,this.options.content.method);
				},
				onShow: function() {
					PAGEVIEWTAG('MINIBAG', titleUID + '-' + 'MINIBAG');
					// Generate a click event for celebrus to track the qtip opening.
					$(target).click();
				}
			}
		});
		
		if (document.getElementById("noMinibag")) {
			$(target).qtip('destroy');
			$(target).removeData('qtip');
		}
	}		
});

function calculateXaxis(){
//	if(!showJDWRecentlyViewed){
//		return 450;
//	}
	return 195;
}

function calculateWidth() {
//	if(!showJDWRecentlyViewed){
//		return 292;
//	}
	if($.browser.msie){
		return 527;
	} return 531;
}

function miniBagCMEvent(e, name) {
	MANUAL_LINK_CLICK_EX(e.target.href, titleUID + ' - MINBAG - ' + name, titleUID + ' - MINIBAG');
}

(function() {
	/* View minibag item */
	$("a[name='minibagView']").live('click', function(e) {		
		miniBagCMEvent(e, 'VIEW BAG ITEM');
	});
	
	/* Remove minibag item */
	$("a[name='minibagRemove']").live('click', function(e) {
		miniBagCMEvent(e, 'REMOVE BAG ITEM');
	});
	
	/* View recently viewed item */
	$("a[name='recentView']").live('click', function(e) {
		miniBagCMEvent(e, 'VIEW RECENT ITEM');
	});

	/* Continue to checkout */
	$("a[name='minibagCheckout']").live('click', function(e) {
		miniBagCMEvent(e, 'CHECKOUT');
	});	
})();

var itemRemoved;
var numberItemsInBasket;
var deleteOptions;
var refreshOptions;

function ajaxMinibagDelete(lineitem, lpUid) {
	deleteOptions = {
		url : '/shop/minibag/json/minibagRemoveItem.action?lineitem='+lineitem+'&pdLpUid='+lpUid,
		handler: handleAjaxMinibagDelete
	};
	submitMinibagAjax(deleteOptions);
}

function handleAjaxMinibagDelete(returnObj) {
	itemRemoved = returnObj.itemRemoved;
	numberItemsInBasket = returnObj.numberItemsInBasket;
	if (itemRemoved) {
		$('#numItemsInBag').html(numberItemsInBasket);
		$('#shoppingBagSize').html(numberItemsInBasket);
		eval(returnObj.celebrusData); // for mini bag remove
		
		refreshOptions = {
			url: '/shop/minibag/show.action',
			dataType: 'html',
			handler: handleAjaxMinibagRefresh				
		};
		submitMinibagAjax(refreshOptions);
	}
}

function handleAjaxMinibagRefresh(returnObj) {
	$('#minibagOuter').html(returnObj);
	$('#qtip-0').width(calculateWidth());
}

/* -------------------------------- Top-nav Search Functions -------------------------*/

/**
 * Apply events to search category/search button
 * 
 * @param searchAreaSelector: CSS selector for search div/form
 * @param searchCategorySelector: CSS selector for search category drop-down
 * @param searchKeywordSelector: CSS selector for search keyword input box
 * @param defaultSearchText: Default text on search box
 */
function applySearchBoxEvents(searchAreaSelector, searchCategorySelector, searchKeywordSelector, searchButtonSelector, defaultSearchText, searchTerm) {

	// Set action on search button
	$(searchButtonSelector).click(function() {
		submitSearch(defaultSearchText,
					$(searchCategorySelector).val(), 
					$(searchKeywordSelector).val());			
	});
	
	// Hide default search text when click on search keywords box
	$(searchKeywordSelector).focus( function(){
		if ($(this).val() == defaultSearchText) {
			$(this).val('');
		}
	});
	
	// When enter key is pressed, press search button
	applyEventOnEnterKey($(searchButtonSelector), $(searchAreaSelector));
}

/**
 * Submits a search query
 * 
 * @param defaultText
 * @param categoryUrl
 * @param searchKeywords
 * @return: True if validation was successful, or false
 */
function submitSearch(defaultText, categoryUrl, searchKeywords) {	
   	// If search value equals default value then set to empty string
   	if( searchKeywords == defaultText) {
   		searchKeywords = '';
   	}
   		
   	// Validate empty input
   	var idx;
   	if ( searchKeywords.length > 1 )
   	{
     	for(idx=0;idx < searchKeywords.length;idx++) 
     	{
       		if ( searchKeywords.charAt(idx) != " " ) 
       		{				
       			// Valid input -> re-direct to search page url
   				window.location = generateSearchPageUrl(categoryUrl, searchKeywords);
   				return true;
       		}
     	}
   	}
   	
   	alert("Please enter a search value");
 	return false;		
}

/**
 * Generate a search page Url
 * 
 * @param categoryUrl: The generic url for the category
 * @param searchKeywords: Search keywords
 * @return: The url of the search page
 */
function generateSearchPageUrl(categoryUrl, searchKeywords) {		
	var productAction = "/products/show.action";	
	
	// WebSphere cannot deal with URLs that have a ; in the base part - so strip these
	var escapedSearchKeywords = encodeURIComponent(searchKeywords.replace(/;|\//g,"")).replace(/%20/g, "+");
	// Append Ntt parameter into URL - immediately before product action component
	var replacement = "/Ntt-" + escapedSearchKeywords + productAction;
	var searchAction = categoryUrl.replace(productAction, replacement);

	return searchAction;
}	

/**
 * Autocomplete function for search terms
 * 
 * @param searchTermSelector: CSS selector for search term input box
 * @param searchCategorySelector: CSS selector for category drop-down
 * @param formSelector: CSS selector for form containing search term and category selector
 * @return: Nothing
 */
function applySearchAutoCompleteFunction(searchTermSelector, searchCategorySelector, searchButtonSelector, searchActionUrl) {

	// Define function to generate autocomplete entries for search box
	function searchSourceFunction ( request, response ) {
		var searchPageAction = generateSearchPageUrl($(searchCategorySelector).val(),	$(searchTermSelector).val());
		params = searchPageAction.substring(
							searchPageAction.indexOf('_'),
							searchPageAction.indexOf("/products/show.action"));

		$.ajax({
			type: "GET",
			url: searchActionUrl,
			dataType: "json",
			data: {
				term: request.term, endecaParams: params
			},
				contentType: "application/json; charset=utf-8",
			success: function( data ) {
				response(data.model);
			}
		});
	}
	
	// Apply generic autocomplete function using reference function just created
	applyAutoCompleteFunction(searchTermSelector, searchButtonSelector, searchSourceFunction);
}


/* -------------------------------- Utility Functions -------------------------*/

/**
 * Utility function for submitting AJAX requests. 
 *
 * options = { url : url of AJAX request, 
 *	 handler: function to handle AJAX callback, 
 *	 formId: optiiona, used to sumbit form data along with AJAX request, 
 *	 dataType: data type for expected data, defualts to JSON
 * }
*/
function submitMinibagAjax(options) {
	var defaults = {dataType: 'json'};
	var options = $.extend({}, defaults, options); 
	
	performAjaxRequest(options.url,null,null,options.dataType,null,
		options.handler,null,'POST',null);
}

function updateAvailableToSpend(availableToSpend) {
	if (top != self) {
		top.$('#logInTitleCreditValue').html(availableToSpend);
	} else {
		$('#logInTitleCreditValue').html(availableToSpend);
	}
}

function convertCurrencySymbols(amount) {
	var ret = '';
	if (amount) {
		ret = amount.replace(/&euro;/g, '\u20AC');
		ret = amount.replace(/&pound;/g, '\u00A3');
	}
	return ret;
}


/**
 * Apply an autocomplete function to perform some action as a user is typing into an input box
 * 
 * @param searchTermSelector: CSS selector for the input box containing the search term
 * @param formSelector: CSS selector for form, which will be submitted when the desired search term has been selected
 * @param searchSourceFunction: The function to perform each time a letter is added/deleted
 * @return
 */
function applyAutoCompleteFunction(searchTermSelector, searchButtonSelector, searchSourceFunction) {
	var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
	
	$( searchTermSelector ).autocomplete({
		source: searchSourceFunction,
		minLength: 3,
		select: function( event, ui ) {
			$(searchTermSelector).val(ui.item.label);
			$(searchButtonSelector).click();
		},
		open: function( event, ui ) {
		  //Change the Z-index so that the autocomplete drop down appears on top
		  //of everything else.
		  $( this ).autocomplete( "widget" ).css('z-index', '999');
		  
		  //Add alternative line styling
		  $( this ).autocomplete( "widget" )
		    .find( "ui-menu-item-alternate" )
		      .removeClass( "ui-menu-item-alternate" )
		    .end()
		    .find( "li.ui-menu-item:odd a" )
		      .addClass( "ui-menu-item-alternate" );

		  //High light the search term the user has entered in the search result.
          var
            acData = $(this).data('autocomplete'),
            trimedSearchterm = jQuery.trim(acData.term),
            trimedSearchterm = trimedSearchterm.toLowerCase(),
            styledTerm = termTemplate.replace('%s', trimedSearchterm);

          acData
            .menu
            .element
            .find('li.ui-menu-item a')
            .each(function() {
                var me = $(this);
                me.html( me.text().replace(trimedSearchterm, styledTerm) );
            });
		}
	});	
}

/**
 * Apply a click event to an object when enter is pressed on a trigger area
 * @param clickableTarget: The object to apply the click event to
 * @param triggerArea: The area on which to detect events
 * @return
 */
function applyEventOnEnterKey(clickableTarget, triggerArea) {	
	// Trigger target when enter is pressed
	triggerArea.keydown( function(e) {
        var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
        if(key == 13) {
        	clickableTarget.click();
        }
    });	
}
/* complete : /javascript/common/jdw_commonHeaderFunctions.js*/


/* combine : /javascript/desktop/common/actionTags.js*/
// actionTags.js

function writeDynamicTag( tagCode ) {
	if ( tagCode ) {
			$('#dynamicTagScript').append( '<script type="text/javascript">try { ' + tagCode + ' } catch(e){}</script>');
	}
}
//overture parameters
var pm_tagname = "universalTag.txt";
var pm_accountid;
var pm_customargs;

//rocket fule vars
var cachebust = (Math.random() + "").substr(2);
//shopzilla parameters
var mid;
var cust_type;
var order_value;
var order_id;
var units_ordered;

//google parameters
var google_conversion_id;
var google_conversion_language = "en_GB";
var google_conversion_format = "1";
var google_conversion_color = "FFFFFF";
var google_conversion_value;
var google_conversion_label;


//doubleclick parameters
var axel = Math.random()+"";
var a = axel * 10000000000000;

//shopping.com
var merchant_id;
var order_id;
var order_amt;
var category_id = "";
var category_name = "";
var product_id = "";
var product_name = "";

//nexTag
var id;
var rev;
var order;
var cats = "";
var prods = "";
var units = ""

// mediaplex CACHEBUSTER value
var mpt = new Date();
var mpts = mpt.getTimezoneOffset() + mpt.getTime();


//Begin Rocket Fuel Universal Pixel
(function () {
	if ((typeof (pid) != "undefined") && (typeof (rbid) != "undefined") & (pid.length != 0) && (rbid.length != 0)) {
		new Image().src = getProtocol()+"//"+pid+"p.rfihub.com/ca.gif?rb="+rbid+"&ca="+pid+"&ra="+cachebust;
	}
})();
//End Rocket Fuel Universal Pixel
//Inserts underscores between the parameters seperated by a |
function insertUnderscores(src) {

	var productList = "";

	if(typeof (src) != "undefined") {
		var splitValues = src.split("|");
		for(x = 0; x < splitValues.length; x++) {
			productList += splitValues[x];
			if(x + 1 < splitValues.length) {
				productList += "_";
			}
		}
	}
	return productList;
}

//nexTag
function nexTag(merchId) {
	id = merchId;
	rev = jTotalValue;
	order = jOrderid;
	prods = escape(jProductUids);
}

function rocketFuelPixelTag(pied){
	if ($('#atlasActionTag').length == 0){
		$('<div id="atlasActionTag"></div>').css('display', 'none').appendTo('body');
    }
	$("#atlasActionTag").append('<img src="'+getProtocol()+'//'+pied+'p.rfihub.com/ca.gif?rb='+rbid+'&ca='+pied+'&ra='+cachebust+'" height="0" width="0" style="display:none" alt="Rocket Fuel">');
}

//web loyalty
function webLoyalty(title) {
 	  var tag1 = '<div id="webLoyalty"><a href="' + getProtocol() + 'ad.doubleclick.net/jump/N3446.jdwilliams/' + title +
		';sz=300x130;ord=' + escape(jTimestamp) + '?" target=_blank>' +
		'<img src="' + getProtocol() + 'ad.doubleclick.net/ad/N3446.jdwilliams/' + title +
		';sz=300x130;ord=' + escape(jTimestamp) + '?" BORDER=0 WIDTH=300 HEIGHT=130 ALT="Click Here Now" target="_blank"></a></div>';
 	  $("#webLoyaltyContainer").append(tag1);
}


//pricerunner
function pricerunner(actionId, enterpriseId) {
	document.writeln('<img src="' + getProtocol() + 'www.emjcd.com/u?' +
	'AMOUNT=' + escape(jTotalValue) + '&CID=' + enterpriseId +
	'&OID=' + escape(jOrderid) +
	'&TYPE=' + actionId +
	'&CURRENCY=' + escape(jCurrency) +
	'&METHOD=IMG" height="1" width="20">');
}

//shopping.com checkout complete
function shopping(mercId) {
	merchant_id = mercId;
	order_id = jOrderid;
	order_amt = jTotalValue;
}

//channel advisor checkout complete
function channel_adv_cc(clientId) {
	//channel advisor checkout complete
	document.writeln('<IMG SRC="https://tracking.searchmarketing.com/thankyou.asp?' +
		'SMCID='+ clientId +'&oVal='+ escape(jTotalValue) +
		'&OrderID=' + escape(jOrderid) +
		'&ProductID=' +	escape(jProductUids) + '" ' +
		'WIDTH="1" HEIGHT="1" BORDER="0">');
}

/*
 * This function is for a dynamic tag, so it does not itself attempt to document.writeln anything into the page.
 * Instead it returns a string to be written into the page by the writeDynamicTag function.
 */
function channel_intelligence_product_details(clientId) {
	$(document).ready(function() {
		var tag = '<script type="text/javascript" src="' + getProtocol() + 'cts.channelintelligence.com/' + clientId + '_landing.js" defer></script>';
		$('#dynamicTagScript').append(tag);
    });
}

function channel_intelligence_checkout_complete(clientId) {
	document.writeln('<script type="text/javascript">');
	document.writeln('var CI_OrderID = "' + escape(jOrderid) + '";');
	document.writeln('var CI_ItemIDs = "' + jProductUidsCI + '".split(",");');
	document.writeln('var CI_ItemQtys = "' + jProductQuantitiesCI + '".split(",");');
	document.writeln('var CI_ItemPrices = "' + jProductPricesCI + '".split(",");');
	document.writeln('</script>');
	document.writeln('<script type="text/javascript" src="' + getProtocol() + 'cts-secure.channelintelligence.com/' + clientId + '_confirmation.js" defer></script>');
}

function affiliateWindow_dwin(merchantId) {
	$(document).ready(function() {
		var tag = '<script src="https://www.dwin1.com/'+merchantId+'.js" type="text/javascript" defer="defer"></script>';
		$('#dynamicTagScript').append(tag);
	  });
}

//affiliate window checkout completed
function affiliateWindow_cc(merchantId) {
	(jNewWebCustomer == 'Y') ? customerType="new" : customerType="existing";
	affiliateWindow_cc_product(merchantId, customerType);

	document.writeln('<script type="text/javascript">');
	document.writeln('var AWIN={};');
	document.writeln('AWIN.Tracking={};');
	document.writeln('AWIN.Tracking.Sale={};');
	document.writeln('AWIN.Tracking.Sale.amount="' + escape(jTotalValue) + '";');
	document.writeln('AWIN.Tracking.Sale.currency="' + escape(jCurrency) + '";');
	document.writeln('AWIN.Tracking.Sale.orderRef="' + escape(jOrderid) + '";');
	document.writeln('AWIN.Tracking.Sale.parts="' + customerType + ':' + escape(jTotalValue) + '";');
	document.writeln('AWIN.Tracking.Sale.voucher="";');
	document.writeln('AWIN.Tracking.Sale.test="0";');
	document.writeln('</script>');
	document.writeln('<script src="https://www.dwin1.com/'+merchantId+'.js" type="text/javascript" defer="defer"></script>');
}

function affiliateWindow_cc_product(merchantId, customerType) {
	document.writeln('<form style="display:none;" name="aw_basket_form">');
	document.writeln('<textarea wrap="physical" id="aw_basket">');

	var productIds = jProductUidsMT.split("|");
	var productNames = jProductNamesMT.split("|");
	var productPrices = jProductPricesMT.split("|");
	var productQuantities = jProductQuantitiesMT.split("|");
	var d = '|';

	for (i=0; i<productIds.length; i++ ) {
		var s = 'AW:P' + d
			+ merchantId + d
			+ jOrderid + d
			+ productIds[i] + d
			+ productNames[i] + d
			+ productPrices[i] + d
			+ productQuantities[i] + d
			+ '' + d
			+ customerType + d
			+ '';
		document.writeln(s);
	}
	document.writeln('</textarea>');
	document.writeln('</form>');
}

function affiliateWindow_makeLine (merchantId, orderRef, productId, productName, unitPrice, quantity, skuData, commissionGroup, category) {
	var d = '|';
	var line = 'AW:P' + d + merchantId + d + orderRef + d + productId + d + productName + d + unitPrice + d + quantity + d + skuData + d + commissionGroup + d + category;
	return line;
}

function mvi_doubleclick(src, type, cat) {

	var productList = "";

	if(typeof (jProductUidsMT) != "undefined") {
		productList = insertUnderscores(jProductUidsMT);
	}

	document.write('<IFRAME SRC="' + getProtocol() + 'fls.uk.doubleclick.net/activityi' +
	';src=' + src + ';type=' + type + ';cat=' + cat + ';u2=' + escape(jTitle) +
	';u11=' + escape(productList) + ';ord=1;num='+ a + '?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
}


//Should be used for overlays (e.g. minibag) where document.write does not work correctly.
//divid must be the id of a <div> tag with style="display:none"
//into which the iframe html is placed

function mvi_overlayDoubleclick(divid, src, type, cat) {

	var productList = "";

	if(typeof (jProductUidsMT) != "undefined") {
		productList = insertUnderscores(jProductUidsMT);
	}

	var html = '<IFRAME SRC="' + getProtocol() + 'fls.uk.doubleclick.net/activityi' +
	';src=' + src + ';type=' + type + ';cat=' + cat + ';u2=' + escape(jTitle) +
	';u11=' + escape(productList) + ';ord=1;num='+ a + '?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>';

	$('#' + divid).html(html);
}



//doubleclick checkout completed
function doubleclick_cc() {
	document.writeln('<IFRAME SRC="' + getProtocol() + 'fls.doubleclick.net/activityi' +
	';src=1792610;type=sales842;cat=011or841;u1=' + escape(jOrderid) +
	';u2=' + escape(jTitle) + ';u3=' + escape(jNewWebCustomer) +
	';u4=' + escape(jAccountid) + ';u5=' + escape(jQuantity) +
	';u6=' + escape(jTotalValue) + ';u7=' + escape(jBillingPostCode) +
	';qty=' + escape(jQuantity) + ';cost=' + escape(jTotalValue) +
	';ord=' + escape(jOrderid) + '" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
}

//doubleclick checkout complete irish sites
/**
*  Name of the TAG: $ {WEBSITE_TITLE}CFV
<iframe src="http://4236481.fls.doubleclick.net/activityi;src=4236481;type=cfv;cat=simpl850;qty=1;cost=
[Revenue];u2=[Item Price];u1=[Item Name];u4=[Product Details];u3= [Quantity];ord=[OrderID]?" width="1" height="1" frameborder="0"
style="display:none"></iframe>
*
**/
function doubleclick_cc_irish_cfv(src, type, cat) {
	document.writeln('<IFRAME SRC="' + getProtocol() + src +'.fls.doubleclick.net/activityi' +
	';src='+src+';type='+type+';cat='+cat +
	';qty=1;cost=' + escape(jTotalValue) +
	';u2=' + escape(jProductPricesMT) +';u1=' + escape(jProductUidsMT) +
	';u4=' + escape(jProductNamesMT) + ';u3=' + escape(jProductQuantitiesMT) +
	';ord=' + escape(jOrderid) + '" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
}

//doubleclick checkout completed
function doubleclick_cc_extrafields() {
	var quantities = "";
	if(typeof (jProductQuantitiesMT) != "undefined") {
		quantities = insertUnderscores(jProductQuantitiesMT);
	}

	var product_ids = "";
	if(typeof (jProductUidsMT) != "undefined") {
		product_ids = insertUnderscores(jProductUidsMT);
	}

	var prices = "";
	if(typeof (jProductPricesMT) != "undefined") {
		prices = insertUnderscores(jProductPricesMT);
	}

	document.writeln('<IFRAME SRC="' + getProtocol() + 'fls.doubleclick.net/activityi' +
	';src=1792610;type=sales842;cat=011or841;u1=' + escape(jOrderid) +
	';u2=' + escape(jTitle) + ';u3=' + escape(jNewWebCustomer) +
	';u4=' + escape(jAccountid) + ';u5=' + escape(jQuantity) +
	';u6=' + escape(jTotalValue) + ';u7=' + escape(jBillingPostCode) +
	';u9=' + escape(quantities) + ';u11=' + escape(product_ids) +
	';u15=' + escape(prices) +
	';qty=' + escape(jQuantity) + ';cost=' + escape(jTotalValue) +
	';ord=' + escape(jOrderid) + '" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
}
/*this becomes obsolete as this is replaced by the one below*/
function doubleclick_irishRegComplete()
{
	if(jAccountid == null || jAccountid=="" )
	{
		jAccountid = "unknown";
	}

	regCheckoutFrame = document.getElementsByName("regCheckoutFrameUK")[0];

	strTest = getProtocol() + 'fls.doubleclick.net/activityi;' +
			'src=1792610;type=count825;cat=012regst' +
			';u2='+ escape(jTitle) +
			';u4=' + escape(jAccountid) +
			';u7=' + jBillingPostCode+
			';u8=ord=1;num=' + a + '?'

	regCheckoutFrame.setAttribute("src", strTest);

}
/*new double click tags for the irish registration completion */
function doubleclick_irish_regcomplete(src, type, cat){
	regCheckoutFrame = document.getElementsByName("regCheckoutFrameIrish")[0];
	strTest = getProtocol() + src+'.fls.doubleclick.net/activityi;' +
			 'src='+ src +';type=' + type + ';cat=' + cat +';ord=1;num=' + a + '?';

	regCheckoutFrame.setAttribute("src", strTest);
}

function doubleclick_regcomplete(){
	document.write('<iframe src="' + getProtocol() + '1792610.fls.doubleclick.net/activityi;'+
			' src=1792610;type=count825;cat=012regst;u2='+ escape(jTitle) +';' +
			' u7='+ jBillingPostCode +';u4='+ escape(jAccountid) +';ord=' + a + '?"' +
			' width="1" height="1" frameborder="0" style="display:none"></iframe>');
}


//doubleclick catalogue request
function doubleclick_catReqConf() {
	catalogueRequestFrame = document.getElementsByName("FlsDoubleClickTags")[0];

	strTest = getProtocol() + 'fls.uk.doubleclick.net/activityi;' +
			'src=1792610;type=count825;cat=10cat270' +
			';u2=' + escape(jTitle) +
			';u3=' + escape(jNewWebCustomer) +
			';u4=' + escape(jAccountid) +
			';u7=' + escape(jBillingPostCode) +
			';u8=;ord=1;num='+ a + '?';

	catalogueRequestFrame .setAttribute("src", strTest);
}

//doubleclick registration complete
function doubleclick_rc() {
	document.write('<IFRAME SRC="' + getProtocol() + 'fls.uk.doubleclick.net/activityi;' +
	'src=1792610;type=count825;cat=012regst' +
	';u2=' + escape(jTitle) +
	';u4=' + escape(jAccountid) +
	';u7=' + escape(jBillingPostCode) +
	';u8=;ord=1;num='+ a + '?" WIDTH=1 HEIGHT=1 FRAMEBORDER=0></IFRAME>');
}

//doubleclick floodlight home with UK src number
function doubleclick_irish_home(src){
	document.write('<iframe src="//'+src+'.fls.doubleclick.net/activityi;' +
			'src='+ src +';type=count825;cat=01hom308;' +
			'u2=' + escape(jTitle) +';ord=1;num='+ a +'?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
}

//doubleclick floodlight home
function doubleclick_fl_home(src, type, cat) {
	document.write('<iframe src="//fls.doubleclick.net/activityi;' +
	'src='+ src +';type=' + type + ';cat=' + cat +
	';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');
}

//new doubleclick floodlight tag for the irish pages. They are the same for all the pages from where they are being thrown
function doubleclick_fl_irish(src, type, cat) {
	$(document).ready(function() {
		$('body').append('<iframe src="//'+src+'.fls.doubleclick.net/activityi;' +
		'src='+ src +';type=' + type + ';cat=' + cat +
		';ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
	});
}

//doubleclick floodlight account

function doubleclick_fl_acct(src, type, cat) {
	document.write('<iframe src="//fls.doubleclick.net/activityi;' +
	'src='+ src +';type=' + type + ';cat=' + cat +
	';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');
}

// doubleclick floodlight checkout completed
function doubleclick_fl_cc(src, type, cat) {
	document.write('<iframe src="//fls.doubleclick.net/activityi;' +
	'src='+ src +';type=' + type + ';cat=' + cat +
	';u1=' + escape(jProductUids) +';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>');
}

/*
 * Doubleclick floodlight product details page.
 * This function is for a dynamic tag, so it does not itself attempt to document.write anything into the page.
 * Instead it returns a string to be written into the page by the writeDynamicTag function.
 */
function doubleclick_fl_pd(src, type, cat) {
	$(document).ready(function() {
		var tag = '<iframe src="http://fls.doubleclick.net/activityi;' +
			'src=' + src +
			';type=' + type +
			';cat=' + cat +
			';u11=' + jProductId +
			';u2=' + jTitle +
			';ord=1;num=' + a +
			'?" width="1" height="1" frameborder="0"></iframe>';
		$('#dynamicTagScript').append(tag);
	  });
}

function cj_sale(eid,aid,currency) {
    document.write('<img src="https://www.emjcd.com/u?AMOUNT='+jTotalValue+'&CID='+
    eid+'&OID='+jOrderid+';'+jQuantity+'&TYPE='+aid+'&CURRENCY='+currency+'&METHOD=IMG" height="1" width="20">');
}

function cj_lead(eid,aid,currency) {
    document.write('<img src="' + getProtocol() + 'www.emjcd.com/u?AMOUNT=00.00&CID='+eid+
    '&TYPE='+aid+'&CURRENCY='+currency+'&METHOD=IMG" height="1" width="20">');
}

function cj_saleConfirmationItems(eid,aid,currency) {
	document.write('<img src="https://www.emjcd.com/u?' +
		'CID=' + eid +
		'&amp;OID=' + jOrderid +
		'&amp;TYPE=' + aid +
		cj_orderLines(jProductUidsMT, jProductPricesMT, jProductQuantitiesMT) +
		'&amp;CURRENCY=' + currency +
		'&METHOD=IMG" height="1" width="20">');
}

function cj_orderLines( itemStr, amtStr, qtyStr ) {
	var ret = '';
	var items = itemStr.split("|");
	var amts = amtStr.split("|");
	var qtys = qtyStr.split("|");

	for ( i = 0; i < items.length -1; i++ ) {
		ret += '&amp;ITEM' + (i+1) + '=' + items[i] + '&amp;AMT' + (i+1) + '=' + escape(amts[i]) + '&amp;QTY' + (i+1) + '=' + qtys[i];
	}
	ret += '&amp;ITEM' + (i+1) + '=' + items[i] + '&amp;AMT' + (i+1) + '=' + escape(amts[i]) + '&amp;QTY' + (i+1) + '=' + qtys[i];

	return ret;
}

function shopzilla_cc(merchantId) {
    mid            = merchantId;
    if(jNewCustomer == "Y") {
	    cust_type      = '1';
	} else {
	    cust_type      = '0';
	}
	order_value    = jTotalValue;
	order_id       = jOrderid;
	units_ordered  = jQuantity;
}

function google(conversion_id, label, conversion_format, conversion_value) {
    google_conversion_id =  conversion_id;
    google_conversion_value = conversion_value ? conversion_value : 1.0;
	google_conversion_label =  label;
	google_conversion_format = conversion_format;
}

function googleUrchin(code) {
    //_uacct = "UA-245925-1"; VLD
    //_uacct = "UA-245925-2"; PMA
    //_uacct = "UA-245925-3"; NAT
    _uacct = code;
	urchinTracker();
}

function getProtocol() {
	return isSecureProtocol() ? "https://" : "http://";
}

function isSecureProtocol() {
	return location.href.indexOf("https") === 0;
}

/* URL-encodes the urlStr, but leaves those parts of the string that match exludeStr intact.
*/
function escapeExcluding( urlStr, excludeStr ) {
	var ret = "";
	var sections = urlStr.split( excludeStr );
	for ( i = 0 ; i < sections.length - 1; i++ ) {
		ret += ( escape(sections[i]) + excludeStr );
	}
	ret += escape(sections[i]);
	return ret;
}


function facebook_tracking(id, h) {
	try {  FB.Insights.impression({
	     'id': id,
	     'h' : h  });
	} catch (e) {}
}


function mediaplex_cc(title) {
  $(document).ready(function() {
      var mediaTag = "<div id=\"mediaplexCC\"><a href=\"" + getProtocol() + "altfarm.mediaplex.com/ad/ck/" + title+ "?" + "mpt=" + mpts
	    + "\"><img src=\"" + getProtocol() + "altfarm.mediaplex.com/ad/bn/" + title+ "?" + "mpt=" + mpts
	    + "\" alt=\"Click Here\" border=\"0\"></a></div>";
     $("#affiliateMedia").append(mediaTag);
  });
}

function letsgorewards_cc(ref) {
  $(document).ready(function() {
      var mediaTag = "<div id=\"letsgorewardsCC\"><a href=\"" + getProtocol() + "www.letsgorewards.co.uk/global/scripts/promo.asp?ref=" + ref
	    + "\"><img src=\"" + IMG_SERVER + "/content/common/images/letsgorewards.gif"
	    + "\" alt=\"Click Here\" border=\"0\"></a></div>";
    $("#affiliateMedia").append(mediaTag);
  });

}

function doubleclick_ns(arg1, arg2){
	if (document.referrer) {
		document.write('<script language="JavaScript1.1" src="' + getProtocol() + 'images2.drct2u.com/content/javascript/naturalSearch/' + arg1 + '_dcadv' + arg2 + '.js?ord=' + a + '"></script>');
		// Original double click implementation
		// document.write('<script language="JavaScript1.1" src="' + getProtocol() + 'ad.doubleclick.net/adj/N4378.N10463.nso.codesrv/' + arg1 +';dcadv=' + arg2 + ';sz=1x2;ord=' + a + '?"></script>');
	}
}

//price grabber checkout complete
function price_grabber_cc(clientId) {
	document.writeln('<img src="https://www.pricegrabber.com/conversion.php?retid='+ clientId +'">');
}

//Shopzilla Survey checkout completed. Only when promo code is shopzilla (1120)
function shopzilla_survey(merchantId, requiredPromoCode) {
	if ((typeof (marketingCode) != "undefined") && (marketingCode == requiredPromoCode)) {

		document.writeln('<!-- BEGIN: Shopzilla Survey Invitation HTML -->');
		document.writeln('<script language="JavaScript" src="https://evaleu.shopzilla.com/js/pos_'+merchantId+'.js" type="text/javascript"></script>');
		document.writeln('<!-- END: Shopzilla Survey Invitation HTML -->');
	}
}

//Price Grabber Survey checkout completed. Only when promo code is Price Grabber (0002)
function price_grabber_survey(merchantId, requiredPromoCode) {
	if ((typeof (marketingCode) != "undefined") && (marketingCode == requiredPromoCode)) {

		document.writeln('<script type="text/javascript">');
		document.writeln('var popup_pos_x = screen.availWidth - (screen.availWidth * 0.75);');
		document.writeln('var popup_pos_y = screen.availHeight - (screen.availHeight * 0.88);');
		document.writeln('var popup_order_number = jOrderid ;');
		document.writeln('var popup_email = custEmail;');
		document.writeln('</script>');
		document.writeln('<!-- PriceGrabber Merchant Evaluation Code -->');
		document.writeln('<script type="text/javascript" charset="UTF-8" src="https://www.pricegrabber.com/rating_merchrevpopjs.php?retid='+merchantId+'"></script>');
		document.writeln('<noscript><a href="http://www.pricegrabber.co.uk/rating_merchrev.php?retid='+merchantId+'" target=_blank><img src="https://images.pricegrabber.com/images/mr_noprize.jpg" border="0" width="272" height="238" alt="Merchant Evaluation"></a></noscript>');
		document.writeln('<!-- End PriceGrabber Code -->');
	}
}

//responsys checkout complete - UK titles
function responsys_cc_uk() {
	responsys_cc('X0Gzc2X%3DWQpglLjHJlTQGrizfmGfr2rsYHeAdeGcX6AO', 'Em6kwSd_Zf9OrW5gM0fktuw')
}

//responsys checkout complete - IRISH titles
function responsys_cc_irish() {
	responsys_cc('X0Gzc2X%3DWQpglLjHJlTQGmwzai1azdqTT3w6zbzbsqRuzbzfG', 'EsiGhFlmEtiGNUyZwIdzjqM')
}

//responsys checkout complete - common code.
function responsys_cc(firstParameter, secondParameter) {
	document.writeln('<img src="' + getProtocol()
		+ 'link.e-comms.net/pub/cct?_ri_=' + firstParameter
		+ '&_ei_=' + secondParameter
		+ '&action=once'
		+ '&OrderID=' + escape(jOrderid)
		+ '&OrderTotal=' + escape(jTotalValue)
		+ '&numItems=' + escape(jQuantity)
		+ '&customerID=' + escape(jAccountid)
		+ '&Type=purchase'
		+ '" height="1" width="1">');
}

// Responsys conversion pixel.
function responsys_conversionpixel_cc(id,seg){
	document.writeln('<script src="' + getProtocol() + 'secure.adnxs.com/px?id='+id+'&seg='+seg+'&order_id='+escape(jOrderid)+'&value='+escape(jTotalValue)+'&t=1" type="text/javascript"></script>');
}

//responsys signin complete cookie
function responsys_signin_complete() {
	document.writeln('<!-- BEGIN: Responsys Signin complete pixel -->');
	document.writeln('<script type="text/javascript" src="' + getProtocol() + 'tag.yieldoptimizer.com/ps/ps?t=s&p=1332&u=$lookup(CUSTOMER_ID_)$"></script>');
	document.writeln('<!-- END: Responsys Signin complete pixel -->');
}

//Responsys create customer (encrypted) email address image pixel.
function responsys_create_customer_email_address_pixel(){
	if (typeof(jEncryptedCustomerEmailAddressPixel) === "undefined"){
		// No encrypted customer email address pixel.
		return;
	}
	document.writeln(jEncryptedCustomerEmailAddressPixel);
}
/* complete : /javascript/desktop/common/actionTags.js*/


/* combine : /javascript/desktop/common/checkoutDeliveryClick2Collect.js*/
/*******************************************************************************************
  Javascript file for the Checkout click 2 collect
********************************************************************************************/

function ajaxClick2CollectStores() {
	var path;
	if(typeof(inRegistration) == 'undefined') {
		path = '/shop/checkout/fragment/click2CollectStoresList.action';
	} else {
		path = '/shop/checkout/registration/fragment/click2CollectStoresList.action';
	}
	
	var options = {
		url : path,
		dataType : 'html',
		handler: handleClick2CollectStores
	};
	
	submitCheckoutClick2CollectAjax(options);
}

function handleClick2CollectStores(htmlString) {
	$('#click2CollectPane').html(htmlString);
}

function submitCheckoutClick2CollectAjax(options) {
	var defaults = {dataType: 'json'};
	var options = $.extend({}, defaults, options); 
	
	var formData = options.formId==null ? null : $('#'+options.formId).serializeArray();
	
	performAjaxRequest(options.url,null,null,options.dataType,formData,
		options.handler,null,'POST','displayOverlay',null);
}

/* complete : /javascript/desktop/common/checkoutDeliveryClick2Collect.js*/


/* combine : /javascript/desktop/common/prettyCheckboxes.js*/
/* ------------------------------------------------------------------------
	prettyCheckboxes
	
	Developped By: Stephane Caron (http://www.no-margin-for-errors.com)
	Inspired By: All the non user friendly custom checkboxes solutions ;)
	Version: 1.1
	
	Copyright: Feel free to redistribute the script/modify it, as
			   long as you leave my infos at the top.
------------------------------------------------------------------------- */
	
	jQuery.fn.prettyCheckboxes = function(settings) {
		settings = jQuery.extend({
					checkboxWidth: 17,
					checkboxHeight: 17,
					className : 'prettyCheckbox',
					display: 'list'
				}, settings);

		$(this).each(function(){
			// Find the label
			$label = $('label[for="'+$(this).attr('id')+'"]');

			// Add the checkbox holder to the label
			$label.prepend("<span class='holderWrap'><span class='holder'></span></span>");

			// If the checkbox is checked, display it as checked
			if($(this).is(':checked')) { $label.addClass('checked'); };

			// Assign the class on the label
			$label.addClass(settings.className).addClass($(this).attr('type')).addClass(settings.display);

			// Assign the dimensions to the checkbox display
			$label.find('span.holderWrap').width(settings.checkboxWidth).height(settings.checkboxHeight);
			$label.find('span.holder').width(settings.checkboxWidth);

			// Hide the checkbox
			$(this).addClass('hiddenCheckbox');

			// Associate the click event
			$label.bind('click',function(){
				$('input#' + $(this).attr('for')).triggerHandler('click');
				
				if($('input#' + $(this).attr('for')).is(':checkbox')){
					$(this).toggleClass('checked');
					$('input#' + $(this).attr('for')).checked = true;
					
					$(this).find('span.holder').css('top',0);
				}else{
					$toCheck = $('input#' + $(this).attr('for'));

					// Uncheck all radio
					$('input[name="'+$toCheck.attr('name')+'"]').each(function(){
						$('label[for="' + $(this).attr('id')+'"]').removeClass('checked');	
					});

					$(this).addClass('checked');
					$toCheck.attr('checked', 'checked');
				};
			});
			
			$('input#' + $label.attr('for')).bind('keypress',function(e){
				if(e.keyCode == 32){
					if($.browser.msie){
						$('label[for="'+$(this).attr('id')+'"]').toggleClass("checked");
					}else{
						$(this).trigger('click');
					}
					return false;
				};
			});
		});
	};
	
	checkAllPrettyCheckboxes = function(caller, container){
		if($(caller).is(':checked')){
			// Find the label corresponding to each checkbox and click it
			$(container).find('input[type=checkbox]:not(:checked)').each(function(){
				$('label[for="'+$(this).attr('id')+'"]').trigger('click');
				if($.browser.msie){
					$(this).attr('checked','checked');
				}else{
					$(this).trigger('click');
				};
			});
		}else{
			$(container).find('input[type=checkbox]:checked').each(function(){
				$('label[for="'+$(this).attr('id')+'"]').trigger('click');
				if($.browser.msie){
					$(this).attr('checked','');
				}else{
					$(this).trigger('click');
				};
			});
		};
	};/* complete : /javascript/desktop/common/prettyCheckboxes.js*/


/* combine : /javascript/desktop/common/jdw_search.js*/
var jdw = jdw || {};
var searchActionUrl = "/shop/search/typeahead/search.action"

//==============================================================================================
//
//												JDW_SEARCH
//
//==============================================================================================
	
	
//-----------------------------------------------------------------------------------------
// Search - Defines function to apply search triggers to top navigation bar
//-----------------------------------------------------------------------------------------

jdw.SearchFunction = function(options) {
	
	this.searchAreaSelector = options.searchAreaSelector;
	this.searchCategorySelector = options.searchCategorySelector;
	this.searchKeywordSelector = options.searchKeywordSelector;
	this.searchButtonSelector = options.searchButtonSelector;
	this.defaultSearchText = options.defaultSearchText;
	this.autoCompleteEnabled = options.autoCompleteEnabled;
	this.showSearchText = options.showSearchText;

	// Inside jquery function callbacks, 'this' is reassigned; so we assign a variable here in 
	//  order that we can always get hold of this containing object.
	var ob = this;

	// === PUBLIC ==============================================================================
	
	// Bind search and autocomplete events
	this.load = function() {

		bindSearchEvents();
		if (this.autoCompleteEnabled) {
			bindAutoComplete();
		}
	};
	
	// Enable autocomplete functionality
	this.enableAutoComplete = function() {
		
		this.autoCompleteEnabled = true;
	}
	
	// === CALLBACK FUNCTIONS ==================================================================	
	
	// Submits the search	
	var submitSearch = function(newSearchTerm) {

		// Update search term on page if new one is specified
		if (typeof(newSearchTerm) == 'string') {
			$(ob.searchKeywordSelector).val(newSearchTerm);
		}
		
		if (validateSearchKeywords()) {
			// Valid input -> re-direct to search page url
			window.location = getSearchPageUrl();
		}
	};	
	
	// Call this bit of Ajax to populate the autocomplete terms
	var getAutoCompleteTermsFunction = function( request, response ) {
		
		var searchPageAction = getSearchPageUrl();
		params = searchPageAction.substring(
							searchPageAction.indexOf('_'),
							searchPageAction.indexOf("/products/show.action"));

		$.ajax({
			type: "GET",
			url: searchActionUrl,
			dataType: "json",
			data: {
				term: request.term, endecaParams: params
			},
				contentType: "application/json; charset=utf-8",
			success: function( data ) {
				response(data.model);
			}
		});
	}	
	
	// === PRIVATE ==============================================================================
		
	// Bind search events
	var bindSearchEvents = function() {
		// Bind click and enter key to submit
		$(ob.searchButtonSelector).unbind('click').bind('click', submitSearch);
		applyEventOnEnterKey($(ob.searchButtonSelector), $(ob.searchAreaSelector));	
	}
	
	// Bind autocomplete functionality to search	
	var bindAutoComplete = function() {	
		var options = {
			"selectTermCallback" : submitSearch,
			"getTermsCallback" : getAutoCompleteTermsFunction,
			"callingTextBox"   : ob.searchKeywordSelector
		}
		var autoComplete = new jdw.AutoComplete( options );
		$(ob.searchKeywordSelector).autocomplete(autoComplete.getData);
	}
	
	// Get the URL for the search page
	var getSearchPageUrl = function() {
		
		var productAction = "/products/show.action";
		var searchKeywords = $(ob.searchKeywordSelector).val();
		var categoryUrl = $(ob.searchCategorySelector).val();
		
		var escapedSearchKeywords = encodeURIComponent(searchKeywords.replace(/;|\//g,"")).replace(/%20/g, "+");
		// Append Ntt parameter into URL - immediately before product action component
		var replacement = "/Ntt-" + escapedSearchKeywords + productAction;
		var searchAction = categoryUrl.replace(productAction, replacement);
		return searchAction;
	};
	
	// Validate the current keywords
	var validateSearchKeywords = function() {
		var searchKeywords = $(ob.searchKeywordSelector).val();			
	 	// If search value equals default value then set to empty string
		if( ob.showSearchText && searchKeywords == ob.defaultSearchText) {
			$(ob.searchKeywordSelector).val('');
		}else{
			 // Validate empty input
		   	var idx;
		   	if ( searchKeywords.length > 1) {
		     	for(idx=0;idx < searchKeywords.length;idx++) {
		       		if ( searchKeywords.charAt(idx) != " " ) {	       			
		   				return true;
		       		}
		     	}
		   	}
		}
		if ( $(ob.searchKeywordSelector).val().length == 0) {	
			$(ob.searchKeywordSelector).focus();
			alert("Please enter a search value");
		}else{
			$(ob.searchKeywordSelector).focus();
			alert("Please enter a bigger search value");	
		}	   	
	 	return false;			   	
	};
}

//-----------------------------------------------------------------------------------------
// AutoComplete - Defines function to get autocomplete data
//-----------------------------------------------------------------------------------------

jdw.AutoComplete = function(options) {

	this.getTermsCallback = options.getTermsCallback;
	this.selectTermCallback = options.selectTermCallback;
	this.callingTextBox = options.callingTextBox;
	
	var ob = this;
	
	this.getData = {			
		source: this.getTermsCallback,
		minLength: 3,
		select: function( event, ui ) {
			var textBoxId = "searchForm/" + $(ob.callingTextBox)[0].id;
			var textBoxName = $(ob.callingTextBox)[0].name;
			celReportTextChanged(ui.item.label,textBoxId,textBoxName);
			ob.selectTermCallback(ui.item.label);			
		},
		open: function( event, ui ) {
		  //Change the Z-index so that the autocomplete drop down appears on top
		  //of everything else.
		  $( this ).autocomplete( "widget" ).css('z-index', '999');
		  
		  //Add alternative line styling
		  $( this ).autocomplete( "widget" )
		    .find( "ui-menu-item-alternate" )
		      .removeClass( "ui-menu-item-alternate" )
		    .end()
		    .find( "li.ui-menu-item:odd a" )
		      .addClass( "ui-menu-item-alternate" );

		  //High light the search term the user has entered in the search result.
		  var termTemplate = "<span class='ui-autocomplete-term'>%s</span>";
		  
		  var
            acData = $(this).data('autocomplete'),
            trimedSearchterm = jQuery.trim(acData.term),
            trimedSearchterm = trimedSearchterm.toLowerCase(),
            styledTerm = termTemplate.replace('%s', trimedSearchterm);

          acData
            .menu
            .element
            .find('li.ui-menu-item a')
            .each(function() {
                var me = $(this);
                me.html( me.text().replace(trimedSearchterm, styledTerm) );
            });
		}
	}
}

//-----------------------------------------------------------------------------------------
// Setup - Applies search to page based on CSS selectors
//-----------------------------------------------------------------------------------------

// Apply search events to search again
jdw.ApplySearchEventsToSearchAgain = function() {
	var optionsAgain = {
			"searchAreaSelector" : "#searchAgainBox #searchAgainForm",
			"searchCategorySelector" : "#searchAgainBox #searchAgainForm #autoCompleteMainUrl",
			"searchKeywordSelector" : "#searchAgainBox #searchAgainForm #searchString",
			"searchButtonSelector" : "#searchAgainBox #searchAgainForm #button",
			"showSearchText" : false
	};		
	jdw.searchAgain = new jdw.SearchFunction( optionsAgain );
	jdw.searchAgain.load();
}

var options = {
		"searchAreaSelector" : "#searchArea-4 #searchForm",
		"searchCategorySelector" : "#searchArea-4 #searchForm #autoCompleteMainUrl",
		"searchKeywordSelector" : "#searchArea-4 #searchForm #searchKeyWords",
		"searchButtonSelector" : "#searchArea-4 #searchForm #searchButton",
		"defaultSearchText" : "Keyword or Catalogue Number",
		"autoCompleteEnabled" : this.autoCompleteEnabled,
		"showSearchText" : true
};		
jdw.search = new jdw.SearchFunction( options );

$(document).ready( function() {
	jdw.search.load();
});/* complete : /javascript/desktop/common/jdw_search.js*/


/* combine : /javascript/common/libraries/jquery/jquery.cookie.js*/
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};/* complete : /javascript/common/libraries/jquery/jquery.cookie.js*/


/* combine : /javascript/common/swfobject.js*/
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();/* complete : /javascript/common/swfobject.js*/


/* combine : /javascript/common/libraries/jquery/jquery.pdfobject.js*/
/* 
	PDFObject, copyright (C) 2008 Philip Hutchison (pipwerks.com)
	Documentation and examples are at www.pdfobject.com 
	Version 1.2, April 2011
	MIT style license
*/

/*global ActiveXObject, window */


var PDFObject = function (obj){
	
	if(!obj || !obj.url){ return false; }

	var pdfobjectversion = "1.2",
		//Set reasonable defaults
		id = obj.id || false,
		width = obj.width || "100%",
		height = obj.height || "100%",
		pdfOpenParams = obj.pdfOpenParams,
		url,
		pluginTypeFound;
	

	/* ----------------------------------------------------
	   Supporting functions
	   ---------------------------------------------------- */

	//Tests specifically for Adobe Reader (aka Acrobat) in Internet Explorer
	var hasReaderActiveX = function (){

		var axObj = null;
		
		if (window.ActiveXObject) {
			
			axObj = new ActiveXObject("AcroPDF.PDF");
				
			//If "AcroPDF.PDF" didn't work, try "PDF.PdfCtrl"
			if(!axObj){
				axObj = new ActiveXObject("PDF.PdfCtrl");
			}
			
			//If either "AcroPDF.PDF" or "PDF.PdfCtrl" are found, return true
			if (axObj !== null) {
				return true;
			}
	
		}
		
		//If you got to this point, there's no ActiveXObject for PDFs
		return false;
		
	};



	//Tests specifically for Adobe Reader (aka Adobe Acrobat) in non-IE browsers
	var hasReader = function (){
	
		var i,
			n = navigator.plugins,
			count = n.length,
			regx = /Adobe Reader|Adobe PDF|Acrobat/gi;
		
		for(i=0; i<count; i++){
			if(regx.test(n[i].name)){
				return true;
			}
		}
		
		return false;
	
	};


	//Detects unbranded PDF support
	var hasGeneric = function (){
		var plugin = navigator.mimeTypes["application/pdf"];
		return (plugin && plugin.enabledPlugin);
	};
	

	//Determines what kind of PDF support is available: Adobe or generic
	var pluginFound = function (){
	
		var type = null;
		
		if(hasReader() || hasReaderActiveX()){
			
			type = "Adobe";
		
		} else if(hasGeneric()) {
		
			type = "generic";
		
		}
		
		return type;
	
	};


	//If setting PDF to fill page, need to handle some CSS first
	var setCssForFullWindowPdf = function (){
		
		var html = document.getElementsByTagName("html");
		if(!html){ return false; }
		
		var html_style = html[0].style,
			body_style = document.body.style;
		
		html_style.height = "100%";
		html_style.overflow = "hidden";	
		body_style.margin = "0";
		body_style.padding = "0";
		body_style.height = "100%";
		body_style.overflow = "hidden";
		
	};


	//Creating a querystring for using PDF Open parameters when embedding PDF
	var buildQueryString = function(pdfParams){
		
		var string = "",
			prop;
		
		if(!pdfParams){ return string; }
		
		for (prop in pdfParams) {
			
			if (pdfParams.hasOwnProperty(prop)) {
				
				string += prop + "=";
				
				if(prop === "search") {
					
					string += encodeURI(pdfParams[prop]);
				
				} else {
					
					string += pdfParams[prop];
					
				}	
				
				string += "&";
				
			}
			
		}
		
		//Remove last ampersand
		return string.slice(0, string.length - 1);
	
	};


	//Simple function for returning values from PDFObject
	var get = function(prop){

		var value = null;

		switch(prop){
			case "url" : value = url; break;
			case "id" : value = id; break;
			case "width" : value = width; break;
			case "height" : value = height; break;
			case "pdfOpenParams" : value = pdfOpenParams; break;
			case "pluginTypeFound" : value = pluginTypeFound; break;
			case "pdfobjectversion" : value = pdfobjectversion; break;
		}

		return value;

	};


	/* ----------------------------------------------------
	   PDF Embedding functions
	   ---------------------------------------------------- */

	
	var embed = function(targetID){

		if(!pluginTypeFound){ return false; }

		var targetNode = null;

		if(targetID){

			//Allow users to pass an element OR an element's ID
			targetNode = (targetID.nodeType && targetID.nodeType === 1) ? targetID : document.getElementById(targetID);
			
			//Ensure target element is found in document before continuing
			if(!targetNode){ return false; }

		} else {

			targetNode = document.body; 
			setCssForFullWindowPdf();
			width = "100%";
			height = "100%";

		}

		targetNode.innerHTML = '<object	data="' +url +'" type="application/pdf" width="' +width +'" height="' +height +'" id="' +id +'"></object>';

		return targetNode.getElementsByTagName("object")[0];

	};

	//The hash (#) prevents odd behavior in Windows
	//Append optional Adobe params for opening document
	url = encodeURI(obj.url) + "#" + buildQueryString(pdfOpenParams);
	pluginTypeFound = pluginFound();
	
	this.get = function(prop){ return get(prop); };
	this.embed = function(id){ return embed(id); };
	
	return this;
	
};/* complete : /javascript/common/libraries/jquery/jquery.pdfobject.js*/


/* combine : /javascript/common/p13n.js*/
//p13n.js Copyright 2007-2012 RichRelevance, Inc. All Rights Reserved.
var rr_v = '1.0',
    rr_rev = '$Rev: 43492 $';
var rr_onload_called = false;

function rr_flush() {}

function rr_flush_onload() {
    if (!RR.onloadCalled) {
        RR.onloadCalled = true;
        rr_onload_called = true;
        rr_flush()
    }
}

function rr_promo_flush_onload() {}

function r3_flush_onload() {
    rr_flush_onload()
}

function r3_promo_flush_onload() {}

function rr_create_script(a) {
    var b = document.createElement('script');
    b.type = 'text/javascript';
    b.charset = RR.charset;
    b.src = a;
    b.async = true;
    document.getElementsByTagName('head')[0].appendChild(b)
}

function rr_create_inline_style(a) {
    var b = document.createElement('style');
    b.type = 'text/css';
    document.getElementsByTagName('head')[0].appendChild(b);
    if (b.styleSheet) {
        b.styleSheet.cssText = a
    } else {
        b.appendChild(document.createTextNode(a))
    }
}
var rr_placements = [];
var rr_placement_place_holders = [];

function r3_getRecs() {
    return false
}
var RR = function () {
    var o = function (a, b) {
        var c = a.cloneNode(false),
            i, len;
        if (c.nodeName === 'SCRIPT') {
            c.text = a.innerHTML;
            b.appendChild(c)
        } else if (c.nodeName === '#text') {
            b.appendChild(c)
        } else {
            b.appendChild(c);
            for (i = 0, len = a.childNodes.length; i < len; i++) {
                o(a.childNodes[i], c)
            }
        }
    }, beacon = function (a) {
            var b = new Image();
            b.src = a
        }, _isArray = function (a) {
            return Object.prototype.toString.call(a) == '[object Array]'
        };
    return {
        U: 'undefined',
        charset: 'UTF-8',
        setCharset: function (c) {
            RR.charset = c
        },
        l: location.href,
        d: document,
        c: function (a, b, c) {
            if (typeof b == RR.U || b == null) {
                if (c == -1) {
                    RR.d.cookie = a + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT'
                } else {
                    if (RR.d.cookie.length > 0) {
                        var d = RR.d.cookie.indexOf(a + '=');
                        if (d !== -1) {
                            d = d + a.length + 1;
                            var e = RR.d.cookie.indexOf(';', d);
                            if (e === -1) {
                                e = RR.d.cookie.length
                            }
                            return unescape(RR.d.cookie.substring(d, e))
                        }
                    }
                    return ''
                }
            } else {
                if (c) {
                    var f = new Date();
                    f = new Date(f.getTime() + (c * 1000 * 60 * 60 * 24));
                    RR.d.cookie = a + '=' + escape(b) + ';expires=' + f.toUTCString()
                } else {
                    RR.d.cookie = a + '=' + escape(b)
                }
            }
        },
        id: function (a) {
            return RR.d.getElementById(a)
        },
        lc: function (n) {
            if (n.indexOf('=') === -1) {
                n += '='
            }
            if (n.indexOf('?') === -1 && n.indexOf('&') === -1) {
                var a = RR.l.indexOf('?' + n);
                if (a === -1) {
                    a = RR.l.indexOf('&' + n)
                }
                return a !== -1
            } else {
                return (RR.l.indexOf(n) !== -1)
            }
        },
        ol: function (b) {
            if (typeof window.onload !== 'function') {
                window.onload = b
            } else {
                if (typeof window.rr_onloads == RR.U) {
                    var c = window.onload;
                    window.rr_onloads = [c];
                    window.onload = function (e) {
                        while (window.rr_onloads.length > 0) {
                            var a = window.rr_onloads.shift();
                            if (a && typeof a === 'function') {
                                a.call(window, e)
                            }
                        }
                    }
                }
                window.rr_onloads.push(b)
            }
        },
        pq: function (n) {
            var a = RR.l.indexOf("?" + n + '=');
            if (a == -1) {
                a = RR.l.indexOf("&" + n + '=')
            }
            var v;
            if (a !== -1) {
                a++;
                var b = RR.l.indexOf("&", a);
                if (b != -1) {
                    v = RR.l.substring(a + n.length + 1, b)
                } else {
                    v = RR.l.substring(a + n.length + 1, RR.l.length)
                }
            } else {
                v = ''
            }
            return v
        },
        debugWindow: function (a) {
            var b = RR.d.createElement('DIV');
            b.innerHTML = a;
            b.style.position = 'absolute';
            b.style.top = '0px';
            b.style.right = '0px';
            b.style.zIndex = '10000';
            b.style.width = '200px';
            b.style.border = '2px solid black';
            b.style.padding = '5px';
            b.style.background = '#DDD';
            RR.d.body.insertBefore(b, RR.d.body.firstChild)
        },
        rotatorCallback: function (a) {},
        jsonCallback: function (a) {},
        defaultCallback: function (a) {
            var b = a.placements,
                placeholders = rr_placement_place_holders,
                placeholder, doc = document,
                div, range, parsedHTML, inserted, i, j, k, l, m = b.length,
                n, x, y;
            for (i = 0; i < m; i++) {
                if (b[i].type === 'rotator') {
                    RR.rotatorCallback(b[i]);
                    b[i].used = true
                }
            }
            for (j = 0, l = placeholders.length; j < l; j++) {
                inserted = false;
                placeholder = RR.id('rr_placement_' + j);
                if (placeholder && typeof placeholder != 'undefined') {
                    for (i = 0; i < m; i++) {
                        if (!b[i].used && b[i].placementType == placeholders[j]) {
                            b[i].used = true;
                            if (b[i].html.indexOf('<script') == -1) {
                                placeholder.innerHTML = b[i].html;
                                inserted = true
                            } else if (doc.implementation.hasFeature('Range', '2.0') && doc.createRange) {
                                range = doc.createRange();
                                if (range.selectNodeContents && range.createContextualFragment && range.detach) {
                                    range.selectNodeContents(placeholder);
                                    parsedHTML = range.createContextualFragment(b[i].html);
                                    placeholder.appendChild(parsedHTML);
                                    range.detach();
                                    inserted = true
                                }
                            }
                            if (!inserted) {
                                div = doc.createElement('div');
                                div.innerHTML = b[i].html;
                                for (k = 0, n = div.childNodes.length; k < n; k++) {
                                    o(div.childNodes[k], placeholder)
                                }
                            }
                            break
                        }
                    }
                }
            }
            rr_placements = [];
            for (x = 0, y = b.length; x < y; x++) {
                rr_placements[x] = [(b[x].used ? 1 : 0), b[x].placementType, b[x].html]
            }
        },
        onloadCalled: false,
        useJsonRecs: function () {},
        useJsonRecsOnload: function () {
            if (!RR.onloadCalled) {
                RR.onloadCalled = true;
                RR.useJsonRecs()
            }
        },
        js: function () {
            if (typeof R3_COMMON != RR.U && typeof R3_COMMON.baseUrl != RR.U && typeof R3_COMMON.apiKey != RR.U) {
                var a = '',
                    placementsEmpty = false,
                    emptyPlacementName = '',
                    r3_pagetype;
                if (typeof R3_COMMON.placementTypes === RR.U || R3_COMMON.placementTypes === '') {
                    placementsEmpty = true
                }
                if (typeof R3_ITEM !== RR.U) {
                    emptyPlacementName = 'item_page';
                    r3_pagetype = R3_ITEM
                }
                if (typeof R3_CATEGORY !== RR.U) {
                    emptyPlacementName = 'category_page';
                    if (R3_COMMON.apiKey == 'bc93f72255d4cec0' && !window.RROAS) {
                        return true
                    }
                    r3_pagetype = R3_CATEGORY
                }
                if (typeof R3_CART !== RR.U) {
                    emptyPlacementName = 'cart_page';
                    r3_pagetype = R3_CART
                }
                if (typeof R3_ADDTOCART !== RR.U) {
                    emptyPlacementName = 'add_to_cart_page';
                    r3_pagetype = R3_ADDTOCART
                }
                if (typeof R3_PURCHASED !== RR.U) {
                    emptyPlacementName = 'purchase_complete_page';
                    r3_pagetype = R3_PURCHASED
                }
                if (typeof R3_SEARCH !== RR.U) {
                    emptyPlacementName = 'search_page';
                    r3_pagetype = R3_SEARCH
                }
                if (typeof R3_DLP !== RR.U) {
                    emptyPlacementName = 'dynamic_landing_page';
                    r3_pagetype = R3_DLP
                }
                if (typeof R3_HOME !== RR.U) {
                    emptyPlacementName = 'home_page';
                    r3_pagetype = R3_HOME
                }
                if (typeof R3_ERROR !== RR.U) {
                    emptyPlacementName = 'error_page';
                    r3_pagetype = R3_ERROR
                }
                if (typeof R3_MYRECS !== RR.U) {
                    emptyPlacementName = 'my_recs_page';
                    r3_pagetype = R3_MYRECS
                }
                if (typeof R3_WISHLIST !== RR.U) {
                    emptyPlacementName = 'cart_page';
                    r3_pagetype = R3_WISHLIST
                }
                if (typeof R3_GENERIC !== RR.U) {
                    emptyPlacementName = 'generic_page';
                    r3_pagetype = R3_GENERIC
                }
                if (typeof R3_LANDING !== RR.U) {
                    emptyPlacementName = 'landing_page';
                    r3_pagetype = R3_LANDING
                }
                if (typeof R3_PERSONAL !== RR.U) {
                    emptyPlacementName = 'personal_page';
                    r3_pagetype = R3_PERSONAL
                }
                if (typeof R3_MERCHANDISED !== RR.U) {
                    emptyPlacementName = 'merchandised_page';
                    r3_pagetype = R3_MERCHANDISED
                }
                if (typeof R3_ENSEMBLE != RR.U) {
                    emptyPlacementName = 'ensemble_page';
                    r3_pagetype = R3_ENSEMBLE
                }
                if (typeof R3_REGISTRY !== RR.U) {
                    emptyPlacementName = 'registry_page';
                    r3_pagetype = R3_REGISTRY
                }
                if (typeof R3_ADDTOREGISTRY !== RR.U) {
                    emptyPlacementName = 'add_to_registry_page';
                    r3_pagetype = R3_ADDTOREGISTRY
                }
                if (typeof R3_BRAND !== RR.U) {
                    emptyPlacementName = 'brand_page';
                    r3_pagetype = R3_BRAND
                }
                if (r3_pagetype) {
                    a = r3_pagetype.createScript(a)
                }
                a = R3_COMMON.createScript(a, placementsEmpty, emptyPlacementName);
                setTimeout(function () {
                    rr_create_script(a)
                }, 10);
                RR.ol(rr_flush_onload);
                RR.ol(RR.useJsonRecsOnload)
            }
        },
        log: function (a, b) {
            var c = '',
                prop, propValue, internalProp;
            if (b) {
                c = b.addCoreParams(c, 'log')
            } else {
                var d = new Date();
                c = a.baseUrl + path + '?a=' + encodeURIComponent(a.apiKey) + '&ts=' + d.getTime() + ((a.baseUrl.toLowerCase().indexOf('https://') === 0) ? '&ssl=t' : '') + c;
                delete a.baseUrl;
                delete a.apiKey;
                if (a.placementTypes) {
                    c += '&pt=' + encodeURIComponent(a.placementTypes);
                    delete a.placementTypes
                }
                if (a.userId) {
                    c += '&u=' + encodeURIComponent(a.userId);
                    delete a.userId
                }
                if (a.sessionId) {
                    c += '&s=' + encodeURIComponent(a.sessionId);
                    delete a.sessionId
                }
                if (a.viewGuid && a.viewGuid !== '') {
                    c += '&vg=' + encodeURIComponent(a.viewGuid);
                    delete a.viewGuid
                }
                if (a.segments) {
                    c += '&sgs=' + encodeURIComponent(a.segments);
                    delete a.segments
                }
                if (a.channel) {
                    c += '&channelId=' + encodeURIComponent(a.channel);
                    delete a.channel
                }
            }
            for (prop in a) {
                propValue = a[prop];
                c += '&' + prop + '=';
                if (_isArray(propValue)) {
                    c += encodeURIComponent(propValue.join('|'))
                } else if (propValue === Object(propValue)) {
                    var e = '';
                    for (internalProp in propValue) {
                        e += '|' + internalProp + ':';
                        if (_isArray(propValue[internalProp])) {
                            e += propValue[internalProp].join(';')
                        } else {
                            e += propValue[internalProp]
                        }
                    }
                    c += encodeURIComponent(e)
                } else {
                    c += encodeURIComponent(propValue)
                }
            }
            beacon(c)
        },
        insert: function (a, b, c) {
            var d, doc = document,
                div, range, parsedHTML, i, j, k, l;
            for (i = 0, l = c.length; i < l; i++) {
                d = false;
                if (c[i][0] === 0 && c[i][1] == b) {
                    c[i][0] = 1;
                    if (c[i][2].indexOf('<script') == -1) {
                        a.innerHTML = c[i][2];
                        d = true
                    } else if (doc.implementation.hasFeature('Range', '2.0') && doc.createRange) {
                        range = doc.createRange();
                        if (range.selectNodeContents && range.createContextualFragment && range.detach) {
                            range.selectNodeContents(a);
                            parsedHTML = range.createContextualFragment(c[i][2]);
                            a.appendChild(parsedHTML);
                            range.detach();
                            d = true
                        }
                    }
                    if (!d) {
                        div = doc.createElement('div');
                        div.innerHTML = c[i][2];
                        for (j = 0, k = div.childNodes.length; j < k; j++) {
                            o(div.childNodes[j], a)
                        }
                    }
                    return
                }
            }
            return
        },
        installHandler: function (b, c) {
            if (!window.rr_handlers) {
                window.rr_handlers = {}
            }
            if (typeof window[b] !== 'function') {
                window[b] = c
            } else {
                if (!window.rr_handlers[b]) {
                    var d = window[b],
                        key;
                    window.rr_handlers[b] = [d];
                    window[b] = function () {
                        for (key in window.rr_handlers[b]) {
                            var a = window.rr_handlers[b][key];
                            if (a && typeof a === 'function') {
                                a.call()
                            }
                        }
                    }
                }
                window.rr_handlers[b].push(c)
            }
        },
        setupGlassViews: function () {
            var a = [],
                rr_i;
            for (rr_i = 0; rr_i < rr_placement_place_holders.length; rr_i++) {
                var b = rr_placement_place_holders[rr_i].replace('.', '_');
                var c = document.getElementById('rr_location_' + b);
                var d;
                if (c) {
                    d = c
                } else {
                    d = document.getElementById('rr_placement_' + rr_i)
                }
                var e = RR.gv_urls[b];
                var f = RR.findPos(d);
                if (e && f) {
                    var g = {};
                    g.url = e;
                    g.pos = f;
                    a.push(g)
                }
            }
            var h = function () {
                RR.glassView(a)
            };
            RR.installHandler('onresize', h);
            RR.installHandler('onscroll', h);
            RR.glassView(a)
        },
        glassView: function (a) {
            var b;
            for (b in a) {
                placementData = a[b];
                if (!placementData.callHome) {
                    if (RR.onScreen(placementData.pos)) {
                        var c = new Image();
                        c.src = placementData.url;
                        placementData.callHome = c
                    }
                }
            }
        },
        onScreen: function (a) {
            var b = document.documentElement;
            var c = b.clientHeight;
            var d = b.clientWidth;
            var e = document.documentElement.scrollTop + document.body.scrollTop;
            var f = document.documentElement.scrollLeft + document.body.scrollLeft;
            var g = Number(c) + Number(e) - 40;
            var h = Number(d) + Number(f) - 60;
            if (a[1] < g) {
                visible = true
            } else {
                visible = false
            } if (a[0] > h) {
                visible = false
            }
            if (visible) {
                return true
            } else {
                return false
            }
        },
        findPos: function (a) {
            var b = 0,
                curtop = 0;
            if (a.offsetParent) {
                do {
                    b += a.offsetLeft;
                    curtop += a.offsetTop
                } while (a = a.offsetParent);
                return [b, curtop]
            } else {
                return null
            }
        },
        ui: {
            richDisplay: function (h, i) {
                var j = this;
                j.slider = {
                    direction: h.direction,
                    slideSpeed: h.slideSpeed,
                    timer: h.timer,
                    hoverPause: (h.hoverPause || 0),
                    active: false,
                    useFlash: h.useFlash,
                    swfFile: h.swfFile,
                    swfDiv: h.swfDiv,
                    swfHeight: h.swfHeight,
                    swfWidth: h.swfWidth,
                    swfFlashVars: h.swfFlashVars,
                    swfId: h.swfId,
                    swfVer: h.swfVer,
                    swfParams: h.swfParams,
                    swfAttributes: h.swfAttributes,
                    clickMode: h.clickMode
                };
                j.e4bDiv = i["rr_e4b"];
                j.rollerDiv = i["rr_rollerbox"];
                j.contentDiv = i["rr_rollerbox_content"];
                j.movieDiv = i["rr_rollerbox_movie"];
                j.clickDivObj = i["rr_clickDiv"];
                j.closeDiv = i["rr_closeDiv"];
                j.flashMovieDiv = i["rr_flashMovieDiv"];
                j.closeDiv.onclick = function () {
                    j.showHideContent()
                };
                if (j.slider.clickMode == 2) {
                    j.clickDivObj.onclick = function () {
                        j.showHideContent()
                    }
                } else {
                    j.clickDivObj.onmouseover = function () {
                        j.showHideContent()
                    }
                } if (j.slider.direction === 2 || j.slider.direction === 8) {
                    j.rollerDiv.style.width = '1px'
                } else if (j.slider.direction === 4 || j.slider.direction === 6) {
                    j.rollerDiv.style.left = j.e4bDiv.offsetWidth + 'px';
                    j.rollerDiv.style.width = '1px'
                } else if (j.slider.direction === 1 || j.slider.direction === 3 || j.slider.direction === 5 || j.slider.direction === 7) {
                    j.rollerDiv.style.height = '1px'
                }
                j.insertMovie = function (a) {
                    var b = '<div id="' + j.slider.swfDiv + '"></div>';
                    if (a === 1) {
                        j.flashMovieDiv.innerHTML = b;
                        RR.swfobject.embedSWF(j.slider.swfFile, j.slider.swfDiv, j.slider.swfWidth, j.slider.swfHeight, j.slider.swfVer, "", j.slider.swfFlashVars, j.slider.swfParams, j.slider.swfAttributes)
                    } else {
                        j.flashMovieDiv.innerHTML = b
                    }
                };
                j.showHideContent = function (e) {
                    var a = false;
                    if (j.slider.active) {
                        return
                    }
                    if (window.event) {
                        a = window.event.type.indexOf("mouseover") > -1
                    } else if ( !! e) {
                        a = e.type == "mouseover"
                    }
                    j.slider.active = true;
                    if (!j.rollerDiv.style.display || j.rollerDiv.style.display == "none") {
                        j.showHideTimeout = setTimeout(function () {
                            j.rollerDiv.style.display = "block";
                            j.rollerDiv.style.visibility = "visible";
                            j.clickDivObj.onmouseover = "";
                            j.clickDivObj.onclick = j.showHideContent;
                            j.slideContent(j.slider.slideSpeed);
                            j.showHideTimeout = -1
                        }, a ? j.slider.hoverPause : 0)
                    } else {
                        j.movieDiv.style.display = "none";
                        j.rollerDiv.style.overflow = "hidden";
                        j.slideContent(j.slider.slideSpeed * -1)
                    }
                };
                j.showHideTimeout = -1;
                j.showHideCancel = function () {
                    if (j.slider.active && j.showHideTimeout != -1) {
                        clearTimeout(j.showHideTimeout);
                        j.showHideTimeout = -1;
                        j.slider.active = false
                    }
                };
                j.slideContent = function (a, b) {
                    if (j.slider.direction % 2 === 0) {
                        j.innerSlide(a, j.rollerDiv.clientWidth, 'offsetWidth', 'width', 'left')
                    } else {
                        j.innerSlide(a, j.rollerDiv.clientHeight, 'offsetHeight', 'height', 'top')
                    }
                };
                j.innerSlide = function (a, b, c, d, e) {
                    var f = true;
                    if (b === 0) {
                        b = j.rollerDiv[c]
                    }
                    b = b + Number(a);
                    if (b > j.contentDiv[c]) {
                        b = j.contentDiv[c];
                        f = false
                    }
                    if (b <= 1) {
                        b = 1;
                        f = false
                    }
                    j.rollerDiv.style[d] = b + "px";
                    var g = j.slider.direction;
                    if (g === 1) {
                        j.rollerDiv.style[e] = j.e4bDiv[c] - b + "px"
                    }
                    if (g === 4) {
                        j.rollerDiv.style[e] = j.clickDivObj.offsetLeft - b + "px"
                    }
                    if (g === 5 || g === 8) {
                        j.rollerDiv.style[e] = (b * -1) + "px"
                    }
                    if (f) {
                        j.movieDiv.style.display = "none";
                        setTimeout(function () {
                            j.slideContent(a, g)
                        }, j.slider.timer)
                    } else {
                        if (b <= 1) {
                            j.slider.active = false;
                            j.rollerDiv.style.display = "none";
                            j.rollerDiv.style.visibility = "hidden";
                            if (j.slider.useFlash === 1) {
                                j.insertMovie(0)
                            }
                            if (j.slider.clickMode === 0) {
                                j.clickDivObj.onmouseover = j.showHideContent;
                                j.clickDivObj.onmouseout = j.showHideCancel
                            }
                        } else {
                            j.slider.active = false;
                            if (j.slider.useFlash === 1) {
                                j.insertMovie(1)
                            }
                            j.movieDiv.style.display = "block";
                            j.rollerDiv.style.overflow = "visible"
                        }
                    }
                }
            },
            innerSlide: function (a, b, c, d, e) {
                var f = true;
                if (b === 0) {
                    b = RR.ui.rollerDiv[c]
                }
                b = b + Number(a);
                if (b > RR.ui.contentDiv[c]) {
                    b = RR.ui.contentDiv[c];
                    f = false
                }
                if (b <= 1) {
                    b = 1;
                    f = false
                }
                RR.ui.rollerDiv.style[d] = b + "px";
                var g = RR.ui.slider.direction;
                if (g === 1) {
                    RR.ui.rollerDiv.style[e] = RR.ui.e4bDiv[c] - b + "px"
                }
                if (g === 4) {
                    RR.ui.rollerDiv.style[e] = RR.ui.clickDivObj.offsetLeft - b + "px"
                }
                if (g === 5 || g === 8) {
                    RR.ui.rollerDiv.style[e] = (b * -1) + "px"
                }
                if (f) {
                    RR.ui.movieDiv.style.display = "none";
                    setTimeout(function () {
                        RR.ui.slideContent(a, g)
                    }, RR.ui.slider.timer)
                } else {
                    if (b <= 1) {
                        RR.ui.slider.active = false;
                        RR.ui.rollerDiv.style.display = "none";
                        RR.ui.rollerDiv.style.visibility = "hidden";
                        if (RR.ui.slider.useFlash === 1) {
                            RR.ui.insertMovie(0)
                        }
                        if (RR.ui.slider.clickMode === 0) {
                            RR.ui.clickDivObj.onmouseover = RR.ui.showHideContent
                        }
                    } else {
                        RR.ui.slider.active = false;
                        if (RR.ui.slider.useFlash === 1) {
                            RR.ui.insertMovie(1)
                        }
                        RR.ui.movieDiv.style.display = "block"
                    }
                }
            },
            slideContent: function (a, b) {
                if (RR.ui.slider.direction % 2 === 0) {
                    RR.ui.innerSlide(a, RR.ui.rollerDiv.clientWidth, 'offsetWidth', 'width', 'left')
                } else {
                    RR.ui.innerSlide(a, RR.ui.rollerDiv.clientHeight, 'offsetHeight', 'height', 'top')
                }
            },
            showHideContent: function () {
                if (RR.ui.slider.active) {
                    return
                }
                RR.ui.slider.active = true;
                if (!RR.ui.rollerDiv.style.display || RR.ui.rollerDiv.style.display == "none") {
                    RR.ui.rollerDiv.style.display = "block";
                    RR.ui.rollerDiv.style.visibility = "visible";
                    RR.ui.clickDivObj.onmouseover = "";
                    RR.ui.clickDivObj.onclick = RR.ui.showHideContent;
                    RR.ui.slideContent(RR.ui.slider.slideSpeed)
                } else {
                    RR.ui.movieDiv.style.display = "none";
                    RR.ui.slideContent(RR.ui.slider.slideSpeed * -1)
                }
            },
            brandedDisplay: function (a) {
                RR.ui.slider = {
                    direction: a.direction,
                    slideSpeed: a.slideSpeed,
                    timer: a.timer,
                    active: false,
                    useFlash: a.useFlash,
                    swfFile: a.swfFile,
                    swfDiv: a.swfDiv,
                    swfHeight: a.swfHeight,
                    swfWidth: a.swfWidth,
                    swfFlashVars: a.swfFlashVars,
                    swfId: a.swfId,
                    swfVer: a.swfVer,
                    swfParams: a.swfParams,
                    swfAttributes: a.swfAttributes,
                    clickMode: a.clickMode
                };
                RR.ui.e4bDiv = RR.id("rr_e4b");
                RR.ui.rollerDiv = RR.id("rr_rollerbox");
                RR.ui.contentDiv = RR.id("rr_rollerbox_content");
                RR.ui.movieDiv = RR.id("rr_rollerbox_movie");
                RR.ui.clickDivObj = RR.id("rr_clickDiv");
                RR.id("rr_closeDiv").onclick = RR.ui.showHideContent;
                if (RR.ui.slider.clickMode == 2) {
                    RR.ui.clickDivObj.onclick = RR.ui.showHideContent
                } else {
                    RR.ui.clickDivObj.onmouseover = RR.ui.showHideContent
                } if (RR.ui.slider.direction === 2 || RR.ui.slider.direction === 8) {
                    RR.ui.rollerDiv.style.width = '1px'
                } else if (RR.ui.slider.direction === 4 || RR.ui.slider.direction === 6) {
                    RR.ui.rollerDiv.style.left = RR.ui.e4bDiv.offsetWidth + 'px';
                    RR.ui.rollerDiv.style.width = '1px'
                } else if (RR.ui.slider.direction === 1 || RR.ui.slider.direction === 3 || RR.ui.slider.direction === 5 || RR.ui.slider.direction === 7) {
                    RR.ui.rollerDiv.style.height = '1px'
                }
            },
            insertMovie: function (a) {
                var b = '<div id="rr_flashMovieTarget"></div>';
                if (a === 1) {
                    RR.id("rr_flashMovie").innerHTML = b;
                    RR.swfobject.embedSWF(RR.ui.slider.swfFile, RR.ui.slider.swfDiv, RR.ui.slider.swfWidth, RR.ui.slider.swfHeight, RR.ui.slider.swfVer, "", RR.ui.slider.swfFlashVars, RR.ui.slider.swfParams, RR.ui.slider.swfAttributes)
                } else {
                    RR.id("rr_flashMovie").innerHTML = b
                }
            }
        }
    }
}();
RR.tgtMap = {};
RR.tgtMap['DVM-Single.1-192x192'] = 'category_page.DVM_Single_192x192_1';
RR.tgtMap['DVM-Single.2-192x192'] = 'category_page.DVM_Single_192x192_2';
RR.tgtMap['DVM-Double Wide-385x192'] = 'category_page.DVM_Double_Wide_385x192_1';

function rr_addCategory(a, b) {
    if (typeof this.categories == RR.U) {
        this.categories = ''
    }
    if (typeof b == RR.U) {
        b = a
    }
    if (a.indexOf('&amp;') > -1) {
        a = a.replace(/&amp;/g, "&")
    }
    if (a.indexOf('&#039;') > -1) {
        a = a.replace(/&#039;/g, "'")
    }
    this.categories += '|' + a + ':' + b
}

function rr_addCategoryId(a) {
    if (typeof this.categoryIds == RR.U) {
        this.categoryIds = ''
    }
    if (a.indexOf('&amp;') > -1) {
        a = a.replace(/&amp;/g, "&")
    }
    if (a.indexOf('&#039;') > -1) {
        a = a.replace(/&#039;/g, "'")
    }
    this.categoryIds += '|' + a
}

function rr_addItemId(a) {
    if (typeof this.itemIds == RR.U) {
        this.itemIds = ''
    }
    this.itemIds += '|' + a
}

function rr_addItemIdCentsQuantity(a, b, c) {
    R3_COMMON.addItemId(a);
    if (typeof this.purchasesCents == RR.U) {
        this.purchasesCents = ''
    }
    if (typeof b == RR.U) {
        b = 0
    }
    this.purchasesCents += '|' + b;
    if (typeof this.quantities == RR.U) {
        this.quantities = ''
    }
    if (typeof c == RR.U) {
        c = -1
    }
    c = c + '';
    if (c.indexOf('.') != -1) {
        c = c.substring(0, c.indexOf('.'))
    }
    this.quantities += '|' + c
}

function rr_addItemIdDollarsAndCentsQuantity(a, b, c) {
    R3_COMMON.addItemId(a);
    if (typeof this.purchasesDollarsAndCents == RR.U) {
        this.purchasesDollarsAndCents = ''
    }
    if (typeof b == RR.U) {
        b = 0
    }
    this.purchasesDollarsAndCents += '|' + b;
    if (typeof this.quantities == RR.U) {
        this.quantities = ''
    }
    if (typeof c == RR.U) {
        c = -1
    }
    c = c + '';
    if (c.indexOf('.') != -1) {
        c = c.substring(0, c.indexOf('.'))
    }
    this.quantities += '|' + c
}

function rr_addItemIdPriceQuantity(a, b, c) {
    R3_COMMON.addItemId(a);
    if (typeof this.purchasesPrice == RR.U) {
        this.purchasesPrice = ''
    }
    if (typeof b == RR.U) {
        b = 0
    }
    this.purchasesPrice += '|' + b;
    if (typeof this.quantities == RR.U) {
        this.quantities = ''
    }
    if (typeof c == RR.U) {
        c = -1
    }
    c = c + '';
    if (c.indexOf('.') != -1) {
        c = c.substring(0, c.indexOf('.'))
    }
    this.quantities += '|' + c
}

function rr_setBrand(a) {
    if (a.indexOf('&amp;') > -1) {
        a = a.replace(/&amp;/g, "&")
    }
    if (a.indexOf('&#039;') > -1) {
        a = a.replace(/&#039;/g, "'")
    }
    this.brand = a
}

function rr_setId(a) {
    if (a.indexOf('&amp;') > -1) {
        a = a.replace(/&amp;/g, "&")
    }
    if (a.indexOf('&#039;') > -1) {
        a = a.replace(/&#039;/g, "'")
    }
    this.id = a
}

function rr_setName(a) {
    this.name = a
}

function rr_setRecommendable(a) {
    this.recommendable = a
}

function rr_setTopLevelGenre(a) {
    this.topLevelGenre = a
}

function rr_setRegistryId(a) {
    this.registryId = a
}

function rr_setPageTypeId(a) {
    this.pageTypeId = a
}

function rr_reach(a, b) {
    setTimeout('rr_reachLoad(\'' + a + '\')', b)
}

function rr_reachLoad(a) {
    var b = document.createElement('div');
    b.innerHTML = (a);
    document.body.appendChild(b)
}

function r3_common() {
    var m = this,
        internal = {}, _isArray = function (a) {
            return Object.prototype.toString.call(a) == '[object Array]'
        }, _getEnv = function () {
            var a = RR.pq('r3_env'),
                envCookie = RR.pq('r3_envCookie');
            if (a !== '') {
                if (envCookie === 'session') {
                    RR.c('r3_env', a)
                } else if (!isNaN(parseInt(envCookie))) {
                    RR.c('r3_env', a, envCookie)
                } else {
                    RR.c('r3_env', null, -1)
                }
                RR.debugWindow('RR Environment set to "' + a + '".');
                return a
            } else {
                a = RR.c('r3_env');
                if (a && a != '') {
                    if (envCookie === 'remove') {
                        RR.c('r3_env', null, -1)
                    } else {
                        RR.debugWindow('RR Environment set to "' + a + '". To remove from cookie, add r3_envCookie=remove to your query parameters.');
                        return a
                    }
                }
            }
            return null
        };
    m.baseUrl = 'http://recs.richrelevance.com/rrserver/';
    m.jsFileName = 'p13n_generated.js';
    m.setPageBrand = rr_setBrand;
    m.addCategoryHintId = function (a) {
        if (typeof m.categoryHintIds == RR.U) {
            m.categoryHintIds = ''
        }
        if (a.indexOf('&amp;') > -1) {
            a = a.replace(/&amp;/g, "&")
        }
        if (a.indexOf('&#039;') > -1) {
            a = a.replace(/&#039;/g, "'")
        }
        m.categoryHintIds += '|' + a
    };
    m.addClickthruParams = function (a, b) {
        if (typeof m.clickthruParams == RR.U) {
            m.clickthruParams = ''
        }
        m.clickthruParams += '|' + encodeURIComponent(a) + ':' + encodeURIComponent(b)
    };
    m.addContext = function (c, d) {
        var e, propValue, innerProp;
        if (typeof internal.context == RR.U || d) {
            internal.context = {}
        }
        for (e in c) {
            propValue = c[e];
            if (internal.context[e] === undefined) {
                internal.context[e] = propValue
            } else if (internal.context[e] === Object(internal.context[e]) && propValue === Object(propValue)) {
                for (innerProp in propValue) {
                    internal.context[e][innerProp] = propValue[innerProp]
                }
            } else {
                var a = internal.context[e],
                    b = propValue;
                if (!_isArray(a)) {
                    a = [a]
                }
                if (!_isArray(propValue)) {
                    b = [propValue]
                }
                internal.context[e] = a.concat(b)
            }
        }
    };
    m.addFilter = function (a) {
        if (typeof m.filters == RR.U) {
            m.filters = ''
        }
        m.filters += '|' + a
    };
    m.addFilterBrand = function (a) {
        if (typeof m.filterBrands == RR.U) {
            m.filterBrands = ''
        }
        if (a.indexOf('&amp;') > -1) {
            a = a.replace(/&amp;/g, "&")
        }
        if (a.indexOf('&#039;') > -1) {
            a = a.replace(/&#039;/g, "'")
        }
        m.filterBrands += '|' + a
    };
    m.addFilterCategory = function (a) {
        if (typeof m.filterCategories == RR.U) {
            m.filterCategories = ''
        }
        if (a.indexOf('&amp;') > -1) {
            a = a.replace(/&amp;/g, "&")
        }
        if (a.indexOf('&#039;') > -1) {
            a = a.replace(/&#039;/g, "'")
        }
        m.filterCategories += '|' + a
    };
    m.addForcedPoolItem = function (a) {
        if (typeof m.forcedPoolItems == RR.U) {
            m.forcedPoolItems = ''
        }
        m.forcedPoolItems += '|' + a
    };
    m.addForcedTemplate = function (a) {
        if (typeof m.forcedTemplates == RR.U) {
            m.forcedTemplates = ''
        }
        m.forcedTemplates += '|' + a
    };
    m.addItemId = function (a) {
        if (typeof m.itemIds == RR.U) {
            m.itemIds = ''
        }
        m.itemIds += '|' + a
    };
    m.addItemIdToCart = function (a) {
        if (typeof m.addedToCartItemIds == RR.U) {
            m.addedToCartItemIds = ''
        }
        m.addedToCartItemIds += '|' + a
    };
    m.addPlacementType = function (a) {
        if (typeof m.placementTypes == RR.U) {
            m.placementTypes = ''
        }
        if (m.apiKey == '632d581ca7b9feb3') {
            if (a == 'home_page.DVM_Skyscraper_160x600_1') {
                RR.tgtMap['category_page.banner_1'] = 'home_page.NON_EXISTING'
            }
            if (RR.tgtMap[a]) {
                a = RR.tgtMap[a]
            }
        }
        m.placementTypes += '|' + a
    };
    m.addPromoType = function (a) {
        m.addPlacementType(a)
    };
    m.addRefinement = function (a, b) {
        if (typeof m.refinements == RR.U) {
            m.refinements = ''
        }
        m.refinements += '|' + a + ':' + b
    };
    m.addSearchTerm = function (a) {
        if (typeof m.searchTerms == RR.U) {
            m.searchTerms = ''
        }
        m.searchTerms += '|' + a
    };
    m.addSegment = function (a, b) {
        if (typeof m.segmentIds == RR.U) {
            m.segments = ''
        }
        if (b === undefined) {
            m.segments += '|' + a
        } else {
            m.segments += '|' + a + ':' + b
        }
    };
    m.addStrategy = function (a) {
        if (typeof m.forcedStrategies == RR.U) {
            m.forcedStrategies = ''
        }
        m.forcedStrategies += '|' + a
    };
    m.addUID = function (a) {
        if (typeof m.uids == RR.U) {
            m.uids = ''
        }
        m.uids += '|' + a
    };
    m.enableJson = function () {
        m.jsonEnabled = 't'
    };
    m.forceImmediateCallback = function () {
        m.immediateCallbackForced = 't'
    };
    m.forceListenMode = function () {
        m.listenModeForced = 't'
    };
    m.forceDisplayMode = function () {
        m.displayModeForced = 't'
    };
    m.forceDevMode = function () {
        m.devModeForced = 't'
    };
    m.setApiKey = function (a) {
        m.apiKey = a
    };
    m.setBaseUrl = function (a) {
        if ('http://media.richrelevance.com/rrserver/' == a) {
            a = 'http://recs.richrelevance.com/rrserver/'
        }
        if ('https://media.richrelevance.com/rrserver/' == a) {
            a = 'https://recs.richrelevance.com/rrserver/'
        }
        m.baseUrl = a
    };
    m.setCartValue = function (a) {
        internal.cartValue = a
    };
    m.setChannel = function (a) {
        internal.channel = a
    };
    m.setClearancePage = function (a) {
        m.clearancePage = a
    };
    m.setClickthruServer = function (a) {
        m.clickthruServer = a
    };
    m.setFilterBrandsIncludeMatchingElements = function (a) {
        m.filterBrandsInclude = a
    };
    m.setFilterCategoriesIncludeMatchingElements = function (a) {
        m.filterCategoriesInclude = a
    };
    m.setFilterPriceCentsMax = function (a) {
        m.filterPriceCentsMax = a
    };
    m.setFilterPriceCentsMin = function (a) {
        m.filterPriceCentsMin = a
    };
    m.setFilterPriceIncludeMatchingElements = function (a) {
        m.filterPriceInclude = a
    };
    m.setFilterPriceMax = function (a) {
        m.filterPriceMax = a
    };
    m.setFilterPriceMin = function (a) {
        m.filterPriceMin = a
    };
    m.setForcedCampaign = function (a) {
        m.forcedCampaign = a
    };
    m.showNoAds = function () {
        if (typeof m.forcedCampaign == RR.U) {
            m.forcedCampaign = '0'
        }
    };
    m.setIpOverride = function (a) {
        m.ipOverride = a
    };
    m.setForcedTreatment = function (a) {
        m.forcedTreatment = a
    };
    m.setMVTForcedTreatment = function (a) {
        m.mvtforcedTreatment = a
    };
    m.setImageServer = function (a) {
        m.imageServer = a
    };
    m.setJsFileName = function (a) {
        m.jsFileName = a
    };
    m.setJsonCallback = function (a) {
        m.jsonCallback = a
    };
    m.setJsPromoFileName = function (a) {};
    m.setLocale = function (a) {
        m.locale = a
    };
    m.setRegionId = function (a) {
        m.regionId = a
    };
    m.setSessionId = function (a) {
        m.sessionId = a
    };
    m.setUserId = function (a) {
        m.userId = a
    };
    m.useDummyData = function () {
        m.dummyDataUsed = 't';
        m.displayModeForced = 't'
    };
    m.blockItemId = function (a) {
        if (typeof m.blockeditemIds == RR.U) {
            m.blockeditemIds = ''
        }
        m.blockeditemIds += '|' + a
    };
    m.initFromParams = function () {
        var a = _getEnv();
        if (a && a != '') {
            m.baseUrl = ((m.baseUrl.toLowerCase().indexOf('https://') === 0) ? 'https://' : 'http://') + a + '.richrelevance.com/rrserver/'
        }
        if (RR.lc('r3_forceDisplay=true')) {
            m.debugMode = true;
            m.displayModeForced = 't'
        }
        if (RR.lc('r3_forceDev=true')) {
            m.debugMode = true;
            m.devModeForced = 't'
        }
        if (RR.lc('r3_rad=true')) {
            m.debugMode = true;
            m.devModeForced = 't';
            m.rad = true;
            var b = RR.pq('r3_radLevel');
            if (b !== '') {
                m.radLevel = b
            }
        }
        if (RR.lc('r3_useDummyData=true')) {
            m.debugMode = true;
            m.dummyDataUsed = 't';
            m.displayModeForced = 't'
        }
        var c = RR.pq('r3_addTemplates');
        if (c !== '') {
            m.debugMode = true;
            if (typeof m.forcedTemplates == RR.U) {
                m.forcedTemplates = ''
            }
            m.forcedTemplates += c
        }
        var d = RR.pq('r3_addPoolItems');
        if (d !== '') {
            m.debugMode = true;
            if (typeof m.forcedPoolItems == RR.U) {
                m.forcedPoolItems = ''
            }
            m.forcedPoolItems += d
        }
        var e = RR.pq('r3_forcedTreatment');
        if (e && e != '') {
            m.forcedTreatment = e
        }
        var f = RR.pq('r3_mvtTreatmentId');
        if (f && f != '') {
            m.mvtforcedTreatment = f
        }
        var g = RR.pq('r3_forcedCampaign');
        if (g && g != '') {
            m.forcedCampaign = g
        }
        g = RR.pq('r3_fc');
        if (g && g != '') {
            m.forcedCampaign = g
        }
        var h = RR.pq('r3_ipOverride');
        if (h && h != '') {
            m.ipOverride = h
        }
        var i = RR.pq('r3_ftp');
        if (i && i != '') {
            m.forcedFtp = i
        }
        var j = RR.pq('r3_responseDetails');
        if (j && j != '') {
            m.rap = j
        }
        if (RR.lc('r3_debugMode=true')) {
            m.debugMode = true
        } else if (RR.lc('r3_debugMode=false')) {
            m.debugMode = false
        }
        if (RR.lc('rr_vg=')) {
            m.viewGuid = RR.pq('rr_vg')
        }
        if (typeof m.viewGuid == RR.U && RR.lc('vg=')) {
            m.viewGuid = RR.pq('vg')
        }
        if (RR.lc('rm=')) {
            m.fromRichMail = RR.pq('rm')
        }
        if (RR.lc('rr_u=')) {
            m.userId = RR.pq('rr_u')
        }
        if (RR.lc('rr_pcam=')) {
            m.promoCampaignId = RR.pq('rr_pcam')
        }
        if (RR.lc('rr_pcre=')) {
            m.promoCreativeId = RR.pq('rr_pcre')
        }
        if (RR.lc('rr_propt=')) {
            m.promoPlacementType = RR.pq('rr_propt')
        }
        if (RR.lc('rr_spoof=')) {
            m.spoof = RR.pq('rr_spoof')
        }
        if (RR.lc('rr_lpid=')) {
            m.landingPageId = RR.pq('rr_lpid')
        }
    };
    m.addCoreParams = function (a, b) {
        var d = new Date();
        a = m.baseUrl + b + '?a=' + encodeURIComponent(m.apiKey) + '&ts=' + d.getTime() + ((m.baseUrl.toLowerCase().indexOf('https://') === 0) ? '&ssl=t' : '') + a;
        if (m.placementTypes) {
            if ((m.apiKey === '10155') && m.placementTypes === '|wish_list_page.content_json') {
                a += '&pt=' + encodeURIComponent('|cart_page.content_json')
            } else if ((m.apiKey === '10155') && m.placementTypes === '|generic_page.content_json') {
                a += '&pt=' + encodeURIComponent('|cart_page.content_json')
            } else {
                a += '&pt=' + encodeURIComponent(m.placementTypes)
            }
        }
        if (m.userId) {
            a += '&u=' + encodeURIComponent(m.userId)
        }
        if (m.sessionId) {
            a += '&s=' + encodeURIComponent(m.sessionId)
        }
        if (m.viewGuid && m.viewGuid !== '') {
            a += '&vg=' + encodeURIComponent(m.viewGuid)
        }
        if (m.segments) {
            a += '&sgs=' + encodeURIComponent(m.segments)
        }
        if (internal.channel) {
            a += '&channelId=' + encodeURIComponent(internal.channel)
        }
        return a
    };
    m.createScript = function (d, e, f) {
        m.initFromParams();
        var g = '',
            agent, prop, propValue, internalProp;
        if (m.apiKey === '632d581ca7b9feb3') {
            agent = navigator.userAgent;
            if (agent.indexOf('SOASTA', 0) === 0) {
                m.baseUrl = '//loadtest-recs.richrelevance.com/rrserver/';
                m.debugMode = true;
                m.devModeForced = 't'
            }
        }
        if (e) {
            m.addPlacementType(f)
        }
        d = m.addCoreParams(d, m.jsFileName);
        d += (e && m.apiKey !== 'bc93f72255d4cec0' ? '&pte=t' : '');
        if (m.clickthruServer) {
            d += '&cts=' + encodeURIComponent(m.clickthruServer)
        }
        if (m.imageServer) {
            d += '&imgsrv=' + encodeURIComponent(m.imageServer)
        }
        if (m.jsonEnabled && m.jsonEnabled == 't') {
            d += '&je=t'
        }
        if (typeof m.landingPageId != RR.U) {
            d += '&lpid=' + m.landingPageId
        }
        if (m.addedToCartItemIds) {
            d += '&atcid=' + encodeURIComponent(m.addedToCartItemIds)
        }
        if (internal.cartValue) {
            d += '&cv=' + encodeURIComponent(internal.cartValue)
        }
        if (m.forcedStrategies) {
            d += '&fs=' + encodeURIComponent(m.forcedStrategies)
        }
        if (m.listenModeForced && m.listenModeForced == 't') {
            d += '&flm=t'
        }
        if (m.forcedTreatment && m.forcedTreatment !== '') {
            d += '&ftr=' + encodeURIComponent(m.forcedTreatment)
        }
        if (m.mvtforcedTreatment && m.mvtforcedTreatment !== '') {
            d += '&mvt_ftr=' + encodeURIComponent(m.mvtforcedTreatment)
        }
        if (typeof m.forcedCampaign != RR.U && m.forcedCampaign != '') {
            d += '&fcmpn=' + encodeURIComponent(m.forcedCampaign)
        }
        if (typeof m.ipOverride != RR.U && m.ipOverride != '') {
            d += '&ipor=' + encodeURIComponent(m.ipOverride)
        }
        if (m.forcedFtp && m.forcedFtp != '') {
            d += '&ftp=' + encodeURIComponent(m.forcedFtp)
        }
        if (m.rap && m.rap != '') {
            d += '&rap=' + encodeURIComponent(m.rap)
        }
        if (m.fromRichMail && m.fromRichMail != '') {
            d += '&rm=' + encodeURIComponent(m.fromRichMail)
        }
        if (m.categoryHintIds) {
            d += '&chi=' + encodeURIComponent(m.categoryHintIds)
        }
        if (m.locale) {
            d += '&flo=' + encodeURIComponent(m.locale)
        }
        if (m.brand) {
            d += '&fpb=' + encodeURIComponent(m.brand)
        }
        if (typeof m.uids != RR.U) {
            d += '&uid=' + encodeURIComponent(m.uids)
        }
        if (typeof m.clearancePage != RR.U) {
            d += '&clp=' + encodeURIComponent(m.clearancePage)
        }
        if (m.filterBrands) {
            d += '&filbr=' + encodeURIComponent(m.filterBrands)
        }
        if (m.filterBrandsInclude) {
            d += '&filbrinc=' + encodeURIComponent(m.filterBrandsInclude)
        }
        if (m.filterCategories) {
            d += '&filcat=' + encodeURIComponent(m.filterCategories)
        }
        if (m.filterCategoriesInclude) {
            d += '&filcatinc=' + encodeURIComponent(m.filterCategoriesInclude)
        }
        if (m.filterPriceCentsMin) {
            d += '&filprcmin=' + encodeURIComponent(m.filterPriceCentsMin)
        }
        if (m.filterPriceCentsMax) {
            d += '&filprcmax=' + encodeURIComponent(m.filterPriceCentsMax)
        }
        if (m.filterPriceMin) {
            d += '&filprmin=' + encodeURIComponent(m.filterPriceMin)
        }
        if (m.filterPriceMax) {
            d += '&filprmax=' + encodeURIComponent(m.filterPriceMax)
        }
        if (m.filterPriceInclude) {
            d += '&filprinc=' + encodeURIComponent(m.filterPriceInclude)
        }
        if (m.clickthruParams) {
            d += '&ctp=' + encodeURIComponent(m.clickthruParams)
        }
        if (m.regionId) {
            d += '&rid=' + encodeURIComponent(m.regionId)
        }
        if (m.filters) {
            d += '&if=' + encodeURIComponent(m.filters)
        }
        if (m.refinements) {
            d += '&rfm=' + encodeURIComponent(m.refinements)
        }
        if (typeof m.rad != RR.U) {
            d += '&rad=t'
        }
        if (typeof m.radLevel != RR.U) {
            d += '&radl=' + encodeURIComponent(m.radLevel)
        }
        if (typeof m.promoCampaignId != RR.U) {
            d += '&pcam=' + encodeURIComponent(m.promoCampaignId)
        }
        if (typeof m.promoCreativeId != RR.U) {
            d += '&pcre=' + encodeURIComponent(m.promoCreativeId)
        }
        if (typeof m.promoPlacementType != RR.U) {
            d += '&propt=' + encodeURIComponent(m.promoPlacementType)
        }
        if (typeof m.spoof != RR.U) {
            d += '&spoof=' + m.spoof
        }
        if (typeof internal.context != RR.U) {
            for (prop in internal.context) {
                propValue = internal.context[prop];
                d += '&' + prop + '=';
                if (_isArray(propValue)) {
                    d += encodeURIComponent(propValue.join('|'))
                } else if (propValue === Object(propValue)) {
                    var h = '';
                    for (internalProp in propValue) {
                        h += '|' + internalProp + ':';
                        if (_isArray(propValue[internalProp])) {
                            h += propValue[internalProp].join(';')
                        } else {
                            h += propValue[internalProp]
                        }
                    }
                    d += encodeURIComponent(h)
                } else {
                    d += encodeURIComponent(propValue)
                }
            }
        }
        if (typeof m.searchTerms != RR.U) {
            if (m.apiKey === 'bc93f72255d4cec0') {
                var j = function (a, b) {
                    var c = new RegExp("(?:^|\\s)" + a + "(?:$|\\s)"),
                        allElements = RR.d.getElementsByTagName(b),
                        i, element, elementClass;
                    for (i = 0;
                        (element = allElements[i]) != null; i++) {
                        elementClass = element.className;
                        if (elementClass && elementClass.indexOf(a) != -1 && c.test(elementClass)) {
                            return element
                        }
                    }
                    return false
                }, correctedSearchTermTag = j('SearchMsg', 'H1');
                if (correctedSearchTermTag) {
                    m.searchTerms = "|" + correctedSearchTermTag.innerHTML
                }
            }
            d += '&st=' + encodeURIComponent(m.searchTerms)
        }
        if (m.jsonCallback) {
            d += '&jcb=' + encodeURIComponent(m.jsonCallback)
        }
        if (m.immediateCallbackForced) {
            d += '&icf=t'
        }
        if (m.blockeditemIds) {
            d += '&bi=' + encodeURIComponent(m.blockeditemIds)
        }
        if (m.itemIds) {
            d += '&p=' + encodeURIComponent(m.itemIds)
        }
        if (m.debugMode) {
            if (m.displayModeForced && m.displayModeForced == 't') {
                d += '&fdm=t'
            }
            if (m.devModeForced && m.devModeForced == 't') {
                d += '&dev=t'
            }
            if (m.dummyDataUsed && m.dummyDataUsed == 't') {
                d += '&udd=t'
            }
            if (m.forcedTemplates) {
                d += '&ft=' + encodeURIComponent(m.forcedTemplates)
            }
            if (m.forcedPoolItems) {
                d += '&fp=' + encodeURIComponent(m.forcedPoolItems)
            }
        }
        var k = RR.swfobject.getFlashPlayerVersion();
        var l = k.major + "." + k.minor + "." + k.release;
        d += '&flv=' + encodeURIComponent(l);
        if (document.referrer !== '' && typeof document.referrer != RR.U) {
            g = document.referrer
        }
        if (g === '' && document.referer !== '' && typeof document.referer != RR.U) {
            g = document.referer
        }
        if (g !== '') {
            d += '&pref=' + encodeURIComponent(g)
        }
        d += '&l=1';
        return d
    }
}

function r3_item() {
    var c = this;
    c.blockItemId = R3_COMMON.blockItemId;
    c.setBrand = rr_setBrand;
    c.setId = rr_setId;
    c.setName = rr_setName;
    c.setTopLevelGenre = rr_setTopLevelGenre;
    c.addAttribute = function (a, b) {
        if (typeof c.attributes == RR.U) {
            c.attributes = ''
        }
        c.attributes += '|' + a + ':' + b
    };
    c.addCategory = rr_addCategory;
    c.addCategoryId = rr_addCategoryId;
    c.setCents = function (a) {
        c.cents = a
    };
    c.setDescription = function (a) {
        c.description = a
    };
    c.setDollarsAndCents = function (a) {
        c.dollarsAndCents = a
    };
    c.setEndDate = function (a) {
        c.endDate = a
    };
    c.setImageId = function (a) {
        c.imageId = a
    };
    c.setInStock = function (a) {
        c.inStock = a
    };
    c.setLinkId = function (a) {
        c.linkId = a
    };
    c.setPrice = function (a) {
        c.price = a
    };
    c.setRating = function (a) {
        c.rating = a
    };
    c.setReleaseDate = function (a) {
        c.releaseDate = a
    };
    c.setRecommendable = rr_setRecommendable;
    c.setSaleCents = function (a) {
        c.saleCents = a
    };
    c.setSaleDollarsAndCents = function (a) {
        c.saleDollarsAndCents = a
    };
    c.setSalePrice = function (a) {
        c.salePrice = a
    };
    c.createScript = function (a) {
        if (c.topLevelGenre) {
            a += '&tg=' + encodeURIComponent(c.topLevelGenre)
        }
        if (c.categories) {
            a += '&cs=' + encodeURIComponent(c.categories)
        }
        if (c.categoryIds) {
            a += '&cis=' + encodeURIComponent(c.categoryIds)
        }
        if (c.id) {
            a += '&p=' + encodeURIComponent(c.id)
        }
        if (c.name) {
            a += '&n=' + encodeURIComponent(c.name)
        }
        if (c.description) {
            a += '&d=' + encodeURIComponent(c.description)
        }
        if (c.imageId) {
            a += '&ii=' + encodeURIComponent(c.imageId)
        }
        if (c.linkId) {
            a += '&li=' + encodeURIComponent(c.linkId)
        }
        if (c.releaseDate) {
            a += '&rd=' + encodeURIComponent(c.releaseDate)
        }
        if (c.dollarsAndCents) {
            a += '&np=' + encodeURIComponent(c.dollarsAndCents)
        }
        if (c.cents) {
            a += '&npc=' + encodeURIComponent(c.cents)
        }
        if (c.saleDollarsAndCents) {
            a += '&sp=' + encodeURIComponent(c.saleDollarsAndCents)
        }
        if (c.saleCents) {
            a += '&spc=' + encodeURIComponent(c.saleCents)
        }
        if (c.price) {
            a += '&np=' + encodeURIComponent(c.price)
        }
        if (c.salePrice) {
            a += '&sp=' + encodeURIComponent(c.salePrice)
        }
        if (c.endDate) {
            a += '&ed=' + encodeURIComponent(c.endDate)
        }
        if (c.rating) {
            a += '&r=' + encodeURIComponent(c.rating)
        }
        if (typeof c.recommendable != RR.U) {
            a += '&re=' + encodeURIComponent(c.recommendable)
        }
        if (c.brand) {
            a += '&b=' + encodeURIComponent(c.brand)
        }
        if (c.attributes) {
            a += '&at=' + encodeURIComponent(c.attributes)
        }
        if (typeof c.inStock != RR.U) {
            a += '&ins=' + encodeURIComponent(c.inStock)
        }
        return a
    }
}

function r3_category() {
    var b = this;
    b.addItemId = R3_COMMON.addItemId;
    b.setBrand = rr_setBrand;
    b.setId = rr_setId;
    b.setName = rr_setName;
    b.setTopLevelGenre = rr_setTopLevelGenre;
    b.setParentId = function (a) {
        if (a.indexOf('&amp;') > -1) {
            a = a.replace(/&amp;/g, "&")
        }
        if (a.indexOf('&#039;') > -1) {
            a = a.replace(/&#039;/g, "'")
        }
        b.parentId = a
    };
    b.setTopName = function (a) {
        b.topName = a
    };
    b.createScript = function (a) {
        if (b.topLevelGenre) {
            a += '&tg=' + encodeURIComponent(b.topLevelGenre)
        }
        if (b.name) {
            a += '&cn=' + encodeURIComponent(b.name)
        }
        if (b.id) {
            a += '&c=' + encodeURIComponent(b.id)
        }
        if (b.parentId) {
            a += '&pc=' + encodeURIComponent(b.parentId)
        }
        if (b.topName) {
            a += '&tcn=' + encodeURIComponent(b.topName)
        }
        if (b.brand) {
            a += '&b=' + encodeURIComponent(b.brand)
        }
        return a
    }
}

function r3_cart() {
    var b = this;
    b.addItemId = R3_COMMON.addItemId;
    b.addItemIdCentsQuantity = rr_addItemIdCentsQuantity;
    b.addItemIdDollarsAndCentsQuantity = rr_addItemIdDollarsAndCentsQuantity;
    b.addItemIdPriceQuantity = rr_addItemIdPriceQuantity;
    b.createScript = function (a) {
        if (b.purchasesCents) {
            a += '&ppc=' + encodeURIComponent(b.purchasesCents)
        }
        if (b.purchasesDollarsAndCents) {
            a += '&pp=' + encodeURIComponent(b.purchasesDollarsAndCents)
        }
        if (b.quantities) {
            a += '&q=' + encodeURIComponent(b.quantities)
        }
        if (b.purchasesPrice) {
            a += '&pp=' + encodeURIComponent(b.purchasesPrice)
        }
        return a
    }
}

function r3_addtocart() {
    var b = this;
    b.addItemIdToCart = R3_COMMON.addItemIdToCart;
    b.createScript = function (a) {
        return a
    }
}

function r3_purchased() {
    var b = this;
    b.addItemId = rr_addItemIdCentsQuantity;
    b.addItemIdCentsQuantity = rr_addItemIdCentsQuantity;
    b.addItemIdDollarsAndCentsQuantity = rr_addItemIdDollarsAndCentsQuantity;
    b.addItemIdPriceQuantity = rr_addItemIdPriceQuantity;
    b.setOrderNumber = function (a) {
        b.orderNumber = a
    };
    b.createScript = function (a) {
        if (b.orderNumber) {
            a += '&o=' + encodeURIComponent(b.orderNumber)
        }
        if (b.purchasesCents) {
            a += '&ppc=' + encodeURIComponent(b.purchasesCents)
        }
        if (b.purchasesDollarsAndCents) {
            a += '&pp=' + encodeURIComponent(b.purchasesDollarsAndCents)
        }
        if (b.quantities) {
            a += '&q=' + encodeURIComponent(b.quantities)
        }
        if (b.purchasesPrice) {
            a += '&pp=' + encodeURIComponent(b.purchasesPrice)
        }
        return a
    }
}

function r3_search() {
    var b = this;
    b.addItemId = R3_COMMON.addItemId;
    b.setBrand = rr_setBrand;
    b.setTerms = R3_COMMON.addSearchTerm;
    b.createScript = function (a) {
        if (b.brand) {
            a += '&b=' + encodeURIComponent(b.brand)
        }
        return a
    }
}

function r3_home() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}

function r3_dlp() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}

function r3_error() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}

function r3_myrecs() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}

function r3_personal() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}

function r3_merchandised() {
    var b = this;
    b.addItemId = R3_COMMON.addItemId;
    b.setName = rr_setName;
    b.createScript = function (a) {
        if (b.name) {
            a += '&n=' + encodeURIComponent(b.name)
        }
        return a
    }
}

function r3_wishlist() {
    var b = this;
    b.addItemId = R3_COMMON.addItemId;
    b.createScript = function (a) {
        return a
    }
}

function r3_generic() {
    var b = this;
    b.setPageTypeId = rr_setPageTypeId;
    b.createScript = function (a) {
        return a
    }
}

function r3_landing() {
    var b = this;
    b.isValid = function () {
        return true
    };
    b.createScript = function (a) {
        return a
    }
}

function r3_ensemble() {
    var b = this;
    b.addCategoryId = rr_addCategoryId;
    b.setId = rr_setId;
    b.setRecommendable = rr_setRecommendable;
    b.createScript = function (a) {
        if (b.categoryIds) {
            a += '&cis=' + encodeURIComponent(b.categoryIds)
        }
        if (b.id) {
            a += '&p=' + encodeURIComponent(b.id)
        }
        if (typeof b.recommendable != RR.U) {
            a += '&re=' + encodeURIComponent(b.recommendable)
        }
        return a
    }
}

function r3_registry() {
    var b = this;
    b.setRegistryId = rr_setRegistryId;
    b.createScript = function (a) {
        if (b.registryId) {
            a += '&rg=' + encodeURIComponent(b.registryId)
        }
        return a
    }
}

function r3_addtoregistry() {
    var b = this;
    b.setRegistryId = rr_setRegistryId;
    b.addAlreadyAddedItemId = function (a) {
        if (typeof b.alreadyAddedRegistryItemIds == RR.U) {
            b.alreadyAddedRegistryItemIds = ''
        }
        b.alreadyAddedRegistryItemIds += '|' + a
    };
    b.createScript = function (a) {
        if (b.registryId) {
            a += '&aari=' + encodeURIComponent(b.alreadyAddedRegistryItemIds) + '&rg=' + encodeURIComponent(b.registryId)
        }
        return a
    }
}

function r3_brand() {
    var b = this;
    b.createScript = function (a) {
        return a
    }
}
var rr_cells = [],
    rr_display_count = [],
    rr_showing = [];

function rr_scroll(a, b) {
    var c, cells = rr_cells[a],
        showing = rr_showing[a],
        display_count = rr_display_count[a];
    if (display_count >= cells.length) {
        var d = document.getElementById('rr_scroller' + a);
        if (d) {
            d.parentNode.removeChild(d)
        }
        var e = document.getElementById('rr_prev' + a);
        if (e) {
            e.parentNode.removeChild(e)
        }
        var f = document.getElementById('rr_next' + a);
        if (f) {
            f.parentNode.removeChild(f)
        }
        display_count = cells.length
    }
    if (showing.length === 0) {
        c = 0
    } else if (b < 0) {
        var g = showing[0];
        c = g - display_count;
        if (c < 0) {
            c = cells.length + c
        }
    } else {
        var h = showing[showing.length - 1];
        c = h + 1;
        if (c > cells.length - 1) {
            c = c - cells.length
        }
    }
    var j = c,
        i;
    for (i = 0; i < display_count; i++) {
        if (document.getElementById('rr_cell' + a + '_' + i)) {
            document.getElementById('rr_cell' + a + '_' + i).innerHTML = cells[j];
            showing[i] = j;
            j++;
            if (j == cells.length) {
                j = 0
            }
        }
    }
}

function rr_addCell(a, b) {
    if (typeof rr_cells[a] == RR.U) {
        rr_cells[a] = [];
        rr_showing[a] = []
    }
    rr_cells[a][rr_cells[a].length] = b
}

function rr_setDisplayCount(a, b) {
    rr_display_count[a] = b
}

function r3_placement(a) {
	/*
	 * Document.write had to be removed from p13n.js to work in C3 after ajax refresh
	 * This line writes the appropriate div to the page without document.write
	 * If p13n.js is ever replaced then this line must be included and document.write removed
	 */
	$('div.rrPlacement').first().attr('id','rr_placement_' + rr_placement_place_holders.length).removeClass('rrPlacement');
    /*document.write('<div id="rr_placement_' + rr_placement_place_holders.length + '"></div>');*/
	
    if (typeof R3_COMMON !== 'undefined' && R3_COMMON.apiKey == '632d581ca7b9feb3') {
        if (RR.tgtMap[a]) a = RR.tgtMap[a]
    }
    rr_placement_place_holders[rr_placement_place_holders.length] = a
}

function r3_promo_placement(a) {
    r3_placement(a)
}

function r3_promo() {}

function r3(a, b, c) {
    if (typeof c != RR.U && c) {
        return
    }
    RR.js()
}

function rr_insert_placement(a, b) {
    RR.insert(a, b, rr_placements)
}

function rr_parseQueryValue(n) {
    return RR.pq(n)
}

function rr_addLoadEvent(a) {
    RR.ol(a)
}
RR.swfobject = function () {
    var D = "undefined",
        r = "object",
        S = "Shockwave Flash",
        W = "ShockwaveFlash.ShockwaveFlash",
        q = "application/x-shockwave-flash",
        R = "SWFObjectExprInst",
        x = "onreadystatechange",
        O = window,
        j = document,
        t = navigator,
        T = false,
        U = [h],
        o = [],
        N = [],
        I = [],
        l, Q, E, B, J = false,
        a = false,
        n, G, m = true,
        M = function () {
            var a = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
                ah = t.userAgent.toLowerCase(),
                Y = t.platform.toLowerCase(),
                ae = Y ? /win/.test(Y) : /win/.test(ah),
                ac = Y ? /mac/.test(Y) : /mac/.test(ah),
                af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
                X = !+"\v1",
                ag = [0, 0, 0],
                ab = null;
            if (typeof t.plugins != D && typeof t.plugins[S] == r) {
                ab = t.plugins[S].description;
                if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
                    T = true;
                    X = false;
                    ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                    ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
                    ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                    ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
                }
            } else {
                if (typeof O.ActiveXObject != D) {
                    try {
                        var b = new ActiveXObject(W);
                        if (b) {
                            ab = b.GetVariable("$version");
                            if (ab) {
                                X = true;
                                ab = ab.split(" ")[1].split(",");
                                ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                            }
                        }
                    } catch (Z) {}
                }
            }
            return {
                w3: a,
                pv: ag,
                wk: af,
                ie: X,
                win: ae,
                mac: ac
            }
        }(),
        k = function () {
            if (!M.w3) {
                return
            }
            if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
                f()
            }
            if (!J) {
                if (typeof j.addEventListener != D) {
                    j.addEventListener("DOMContentLoaded", f, false)
                }
                if (M.ie && M.win) {
                    j.attachEvent(x, function () {
                        if (j.readyState == "complete") {
                            j.detachEvent(x, arguments.callee);
                            f()
                        }
                    });
                    if (O == top) {
                        (function () {
                            if (J) {
                                return
                            }
                            try {
                                j.documentElement.doScroll("left")
                            } catch (X) {
                                setTimeout(arguments.callee, 0);
                                return
                            }
                            f()
                        })()
                    }
                }
                if (M.wk) {
                    (function () {
                        if (J) {
                            return
                        }
                        if (!/loaded|complete/.test(j.readyState)) {
                            setTimeout(arguments.callee, 0);
                            return
                        }
                        f()
                    })()
                }
                s(f)
            }
        }();

    function f() {
        if (J) {
            return
        }
        try {
            var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
            Z.parentNode.removeChild(Z)
        } catch (aa) {
            return
        }
        J = true;
        var X = U.length;
        for (var Y = 0; Y < X; Y++) {
            U[Y]()
        }
    }

    function K(X) {
        if (J) {
            X()
        } else {
            U[U.length] = X
        }
    }

    function s(Y) {
        if (typeof O.addEventListener != D) {
            O.addEventListener("load", Y, false)
        } else {
            if (typeof j.addEventListener != D) {
                j.addEventListener("load", Y, false)
            } else {
                if (typeof O.attachEvent != D) {
                    i(O, "onload", Y)
                } else {
                    if (typeof O.onload == "function") {
                        var X = O.onload;
                        O.onload = function () {
                            X();
                            Y()
                        }
                    } else {
                        O.onload = Y
                    }
                }
            }
        }
    }

    function h() {
        if (T) {
            V()
        } else {
            H()
        }
    }

    function V() {
        var X = j.getElementsByTagName("body")[0];
        var b = C(r);
        b.setAttribute("type", q);
        var Z = X.appendChild(b);
        if (Z) {
            var Y = 0;
            (function () {
                if (typeof Z.GetVariable != D) {
                    var a = Z.GetVariable("$version");
                    if (a) {
                        a = a.split(" ")[1].split(",");
                        M.pv = [parseInt(a[0], 10), parseInt(a[1], 10), parseInt(a[2], 10)]
                    }
                } else {
                    if (Y < 10) {
                        Y++;
                        setTimeout(arguments.callee, 10);
                        return
                    }
                }
                X.removeChild(b);
                Z = null;
                H()
            })()
        } else {
            H()
        }
    }

    function H() {
        var a = o.length;
        if (a > 0) {
            for (var b = 0; b < a; b++) {
                var Y = o[b].id;
                var d = o[b].callbackFn;
                var e = {
                    success: false,
                    id: Y
                };
                if (M.pv[0] > 0) {
                    var f = c(Y);
                    if (f) {
                        if (F(o[b].swfVersion) && !(M.wk && M.wk < 312)) {
                            w(Y, true);
                            if (d) {
                                e.success = true;
                                e.ref = z(Y);
                                d(e)
                            }
                        } else {
                            if (o[b].expressInstall && A()) {
                                var g = {};
                                g.data = o[b].expressInstall;
                                g.width = f.getAttribute("width") || "0";
                                g.height = f.getAttribute("height") || "0";
                                if (f.getAttribute("class")) {
                                    g.styleclass = f.getAttribute("class")
                                }
                                if (f.getAttribute("align")) {
                                    g.align = f.getAttribute("align")
                                }
                                var h = {};
                                var X = f.getElementsByTagName("param");
                                var i = X.length;
                                for (var j = 0; j < i; j++) {
                                    if (X[j].getAttribute("name").toLowerCase() != "movie") {
                                        h[X[j].getAttribute("name")] = X[j].getAttribute("value")
                                    }
                                }
                                P(g, h, Y, d)
                            } else {
                                p(f);
                                if (d) {
                                    d(e)
                                }
                            }
                        }
                    }
                } else {
                    w(Y, true);
                    if (d) {
                        var Z = z(Y);
                        if (Z && typeof Z.SetVariable != D) {
                            e.success = true;
                            e.ref = Z
                        }
                        d(e)
                    }
                }
            }
        }
    }

    function z(a) {
        var X = null;
        var Y = c(a);
        if (Y && Y.nodeName == "OBJECT") {
            if (typeof Y.SetVariable != D) {
                X = Y
            } else {
                var Z = Y.getElementsByTagName(r)[0];
                if (Z) {
                    X = Z
                }
            }
        }
        return X
    }

    function A() {
        return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
    }

    function P(b, d, X, Z) {
        a = true;
        E = Z || null;
        B = {
            success: false,
            id: X
        };
        var e = c(X);
        if (e) {
            if (e.nodeName == "OBJECT") {
                l = g(e);
                Q = null
            } else {
                l = e;
                Q = X
            }
            b.id = R;
            if (typeof b.width == D || (!/%$/.test(b.width) && parseInt(b.width, 10) < 310)) {
                b.width = "310"
            }
            if (typeof b.height == D || (!/%$/.test(b.height) && parseInt(b.height, 10) < 137)) {
                b.height = "137"
            }
            j.title = j.title.slice(0, 47) + " - Flash Player Installation";
            var f = M.ie && M.win ? "ActiveX" : "PlugIn",
                ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + f + "&MMdoctitle=" + j.title;
            if (typeof d.flashvars != D) {
                d.flashvars += "&" + ac
            } else {
                d.flashvars = ac
            } if (M.ie && M.win && e.readyState != 4) {
                var Y = C("div");
                X += "SWFObjectNew";
                Y.setAttribute("id", X);
                e.parentNode.insertBefore(Y, e);
                e.style.display = "none";
                (function () {
                    if (e.readyState == 4) {
                        e.parentNode.removeChild(e)
                    } else {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            }
            u(b, d, X)
        }
    }

    function p(Y) {
        if (M.ie && M.win && Y.readyState != 4) {
            var X = C("div");
            Y.parentNode.insertBefore(X, Y);
            X.parentNode.replaceChild(g(Y), X);
            Y.style.display = "none";
            (function () {
                if (Y.readyState == 4) {
                    Y.parentNode.removeChild(Y)
                } else {
                    setTimeout(arguments.callee, 10)
                }
            })()
        } else {
            Y.parentNode.replaceChild(g(Y), Y)
        }
    }

    function g(a) {
        var b = C("div");
        if (M.win && M.ie) {
            b.innerHTML = a.innerHTML
        } else {
            var Y = a.getElementsByTagName(r)[0];
            if (Y) {
                var c = Y.childNodes;
                if (c) {
                    var X = c.length;
                    for (var Z = 0; Z < X; Z++) {
                        if (!(c[Z].nodeType == 1 && c[Z].nodeName == "PARAM") && !(c[Z].nodeType == 8)) {
                            b.appendChild(c[Z].cloneNode(true))
                        }
                    }
                }
            }
        }
        return b
    }

    function u(a, b, Y) {
        var X, aa = c(Y);
        if (M.wk && M.wk < 312) {
            return X
        }
        if (aa) {
            if (typeof a.id == D) {
                a.id = Y
            }
            if (M.ie && M.win) {
                var d = "";
                for (var f in a) {
                    if (a[f] != Object.prototype[f]) {
                        if (f.toLowerCase() == "data") {
                            b.movie = a[f]
                        } else {
                            if (f.toLowerCase() == "styleclass") {
                                d += ' class="' + a[f] + '"'
                            } else {
                                if (f.toLowerCase() != "classid") {
                                    d += " " + f + '="' + a[f] + '"'
                                }
                            }
                        }
                    }
                }
                var g = "";
                for (var h in b) {
                    if (b[h] != Object.prototype[h]) {
                        g += '<param name="' + h + '" value="' + b[h] + '" />'
                    }
                }
                aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + d + ">" + g + "</object>";
                N[N.length] = a.id;
                X = c(a.id)
            } else {
                var Z = C(r);
                Z.setAttribute("type", q);
                for (var i in a) {
                    if (a[i] != Object.prototype[i]) {
                        if (i.toLowerCase() == "styleclass") {
                            Z.setAttribute("class", a[i])
                        } else {
                            if (i.toLowerCase() != "classid") {
                                Z.setAttribute(i, a[i])
                            }
                        }
                    }
                }
                for (var j in b) {
                    if (b[j] != Object.prototype[j] && j.toLowerCase() != "movie") {
                        e(Z, j, b[j])
                    }
                }
                aa.parentNode.replaceChild(Z, aa);
                X = Z
            }
        }
        return X
    }

    function e(Z, X, Y) {
        var a = C("param");
        a.setAttribute("name", X);
        a.setAttribute("value", Y);
        Z.appendChild(a)
    }

    function y(Y) {
        var X = c(Y);
        if (X && X.nodeName == "OBJECT") {
            if (M.ie && M.win) {
                X.style.display = "none";
                (function () {
                    if (X.readyState == 4) {
                        b(Y)
                    } else {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            } else {
                X.parentNode.removeChild(X)
            }
        }
    }

    function b(Z) {
        var Y = c(Z);
        if (Y) {
            for (var X in Y) {
                if (typeof Y[X] == "function") {
                    Y[X] = null
                }
            }
            Y.parentNode.removeChild(Y)
        }
    }

    function c(Z) {
        var X = null;
        try {
            X = j.getElementById(Z)
        } catch (Y) {}
        return X
    }

    function C(X) {
        return j.createElement(X)
    }

    function i(Z, X, Y) {
        Z.attachEvent(X, Y);
        I[I.length] = [Z, X, Y]
    }

    function F(Z) {
        var Y = M.pv,
            X = Z.split(".");
        X[0] = parseInt(X[0], 10);
        X[1] = parseInt(X[1], 10) || 0;
        X[2] = parseInt(X[2], 10) || 0;
        return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
    }

    function v(a, Y, b, c) {
        if (M.ie && M.mac) {
            return
        }
        var d = j.getElementsByTagName("head")[0];
        if (!d) {
            return
        }
        var X = (b && typeof b == "string") ? b : "screen";
        if (c) {
            n = null;
            G = null
        }
        if (!n || G != X) {
            var Z = C("style");
            Z.setAttribute("type", "text/css");
            Z.setAttribute("media", X);
            n = d.appendChild(Z);
            if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
                n = j.styleSheets[j.styleSheets.length - 1]
            }
            G = X
        }
        if (M.ie && M.win) {
            if (n && typeof n.addRule == r) {
                n.addRule(a, Y)
            }
        } else {
            if (n && typeof j.createTextNode != D) {
                n.appendChild(j.createTextNode(a + " {" + Y + "}"))
            }
        }
    }

    function w(Z, X) {
        if (!m) {
            return
        }
        var Y = X ? "visible" : "hidden";
        if (J && c(Z)) {
            c(Z).style.visibility = Y
        } else {
            v("#" + Z, "visibility:" + Y)
        }
    }

    function L(Y) {
        var Z = /[\\\"<>\.;]/;
        var X = Z.exec(Y) != null;
        return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
    }
    var d = function () {
        if (M.ie && M.win) {
            window.attachEvent("onunload", function () {
                var a = I.length;
                for (var b = 0; b < a; b++) {
                    I[b][0].detachEvent(I[b][1], I[b][2])
                }
                var Z = N.length;
                for (var c = 0; c < Z; c++) {
                    y(N[c])
                }
                for (var Y in M) {
                    M[Y] = null
                }
                M = null;
                for (var X in RR.swfobject) {
                    RR.swfobject[X] = null
                }
                RR.swfobject = null
            })
        }
    }();
    return {
        registerObject: function (a, X, b, Z) {
            if (M.w3 && a && X) {
                var Y = {};
                Y.id = a;
                Y.swfVersion = X;
                Y.expressInstall = b;
                Y.callbackFn = Z;
                o[o.length] = Y;
                w(a, false)
            } else {
                if (Z) {
                    Z({
                        success: false,
                        id: a
                    })
                }
            }
        },
        getObjectById: function (X) {
            if (M.w3) {
                return z(X)
            }
        },
        embedSWF: function (g, h, i, j, Y, k, Z, l, m, n) {
            var X = {
                success: false,
                id: h
            };
            if (M.w3 && !(M.wk && M.wk < 312) && g && h && i && j && Y) {
                w(h, false);
                K(function () {
                    i += "";
                    j += "";
                    var a = {};
                    if (m && typeof m === r) {
                        for (var b in m) {
                            a[b] = m[b]
                        }
                    }
                    a.data = g;
                    a.width = i;
                    a.height = j;
                    var c = {};
                    if (l && typeof l === r) {
                        for (var d in l) {
                            c[d] = l[d]
                        }
                    }
                    if (Z && typeof Z === r) {
                        for (var e in Z) {
                            if (typeof c.flashvars != D) {
                                c.flashvars += "&" + e + "=" + Z[e]
                            } else {
                                c.flashvars = e + "=" + Z[e]
                            }
                        }
                    }
                    if (F(Y)) {
                        var f = u(a, c, h);
                        if (a.id == h) {
                            w(h, true)
                        }
                        X.success = true;
                        X.ref = f
                    } else {
                        if (k && A()) {
                            a.data = k;
                            P(a, c, h, n);
                            return
                        } else {
                            w(h, true)
                        }
                    } if (n) {
                        n(X)
                    }
                })
            } else {
                if (n) {
                    n(X)
                }
            }
        },
        switchOffAutoHideShow: function () {
            m = false
        },
        ua: M,
        getFlashPlayerVersion: function () {
            return {
                major: M.pv[0],
                minor: M.pv[1],
                release: M.pv[2]
            }
        },
        hasFlashPlayerVersion: F,
        createSWF: function (Z, Y, X) {
            if (M.w3) {
                return u(Z, Y, X)
            } else {
                return undefined
            }
        },
        showExpressInstall: function (Z, a, X, Y) {
            if (M.w3 && A()) {
                P(Z, a, X, Y)
            }
        },
        removeSWF: function (X) {
            if (M.w3) {
                y(X)
            }
        },
        createCSS: function (a, Z, Y, X) {
            if (M.w3) {
                v(a, Z, Y, X)
            }
        },
        addDomLoadEvent: K,
        addLoadEvent: s,
        getQueryParamValue: function (a) {
            var Z = j.location.search || j.location.hash;
            if (Z) {
                if (/\?/.test(Z)) {
                    Z = Z.split("?")[1]
                }
                if (a == null) {
                    return L(Z)
                }
                var Y = Z.split("&");
                for (var X = 0; X < Y.length; X++) {
                    if (Y[X].substring(0, Y[X].indexOf("=")) == a) {
                        return L(Y[X].substring((Y[X].indexOf("=") + 1)))
                    }
                }
            }
            return ""
        },
        expressInstallCallback: function () {
            if (a) {
                var X = c(R);
                if (X && l) {
                    X.parentNode.replaceChild(l, X);
                    if (Q) {
                        w(Q, true);
                        if (M.ie && M.win) {
                            l.style.display = "block"
                        }
                    }
                    if (E) {
                        E(B)
                    }
                }
                a = false
            }
        }
    }
}();
if (window.RROAS) {
    RROAS.process()
}

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
RR.swfobject = function () {
    var D = "undefined",
        r = "object",
        S = "Shockwave Flash",
        W = "ShockwaveFlash.ShockwaveFlash",
        q = "application/x-shockwave-flash",
        R = "SWFObjectExprInst",
        x = "onreadystatechange",
        O = window,
        j = document,
        t = navigator,
        T = false,
        U = [h],
        o = [],
        N = [],
        I = [],
        l, Q, E, B, J = false,
        a = false,
        n, G, m = true,
        M = function () {
            var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
                ah = t.userAgent.toLowerCase(),
                Y = t.platform.toLowerCase(),
                ae = Y ? /win/.test(Y) : /win/.test(ah),
                ac = Y ? /mac/.test(Y) : /mac/.test(ah),
                af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
                X = !+"\v1",
                ag = [0, 0, 0],
                ab = null;
            if (typeof t.plugins != D && typeof t.plugins[S] == r) {
                ab = t.plugins[S].description;
                if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) {
                    T = true;
                    X = false;
                    ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                    ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
                    ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                    ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
                }
            } else {
                if (typeof O.ActiveXObject != D) {
                    try {
                        var ad = new ActiveXObject(W);
                        if (ad) {
                            ab = ad.GetVariable("$version");
                            if (ab) {
                                X = true;
                                ab = ab.split(" ")[1].split(",");
                                ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                            }
                        }
                    } catch (Z) {}
                }
            }
            return {
                w3: aa,
                pv: ag,
                wk: af,
                ie: X,
                win: ae,
                mac: ac
            }
        }(),
        k = function () {
            if (!M.w3) {
                return
            }
            if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) {
                f()
            }
            if (!J) {
                if (typeof j.addEventListener != D) {
                    j.addEventListener("DOMContentLoaded", f, false)
                }
                if (M.ie && M.win) {
                    j.attachEvent(x, function () {
                        if (j.readyState == "complete") {
                            j.detachEvent(x, arguments.callee);
                            f()
                        }
                    });
                    if (O == top) {
                        (function () {
                            if (J) {
                                return
                            }
                            try {
                                j.documentElement.doScroll("left")
                            } catch (X) {
                                setTimeout(arguments.callee, 0);
                                return
                            }
                            f()
                        })()
                    }
                }
                if (M.wk) {
                    (function () {
                        if (J) {
                            return
                        }
                        if (!/loaded|complete/.test(j.readyState)) {
                            setTimeout(arguments.callee, 0);
                            return
                        }
                        f()
                    })()
                }
                s(f)
            }
        }();

    function f() {
        if (J) {
            return
        }
        try {
            var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
            Z.parentNode.removeChild(Z)
        } catch (aa) {
            return
        }
        J = true;
        var X = U.length;
        for (var Y = 0; Y < X; Y++) {
            U[Y]()
        }
    }

    function K(X) {
        if (J) {
            X()
        } else {
            U[U.length] = X
        }
    }

    function s(Y) {
        if (typeof O.addEventListener != D) {
            O.addEventListener("load", Y, false)
        } else {
            if (typeof j.addEventListener != D) {
                j.addEventListener("load", Y, false)
            } else {
                if (typeof O.attachEvent != D) {
                    i(O, "onload", Y)
                } else {
                    if (typeof O.onload == "function") {
                        var X = O.onload;
                        O.onload = function () {
                            X();
                            Y()
                        }
                    } else {
                        O.onload = Y
                    }
                }
            }
        }
    }

    function h() {
        if (T) {
            V()
        } else {
            H()
        }
    }

    function V() {
        var X = j.getElementsByTagName("body")[0];
        var aa = C(r);
        aa.setAttribute("type", q);
        var Z = X.appendChild(aa);
        if (Z) {
            var Y = 0;
            (function () {
                if (typeof Z.GetVariable != D) {
                    var ab = Z.GetVariable("$version");
                    if (ab) {
                        ab = ab.split(" ")[1].split(",");
                        M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                    }
                } else {
                    if (Y < 10) {
                        Y++;
                        setTimeout(arguments.callee, 10);
                        return
                    }
                }
                X.removeChild(aa);
                Z = null;
                H()
            })()
        } else {
            H()
        }
    }

    function H() {
        var ag = o.length;
        if (ag > 0) {
            for (var af = 0; af < ag; af++) {
                var Y = o[af].id;
                var ab = o[af].callbackFn;
                var aa = {
                    success: false,
                    id: Y
                };
                if (M.pv[0] > 0) {
                    var ae = c(Y);
                    if (ae) {
                        if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) {
                            w(Y, true);
                            if (ab) {
                                aa.success = true;
                                aa.ref = z(Y);
                                ab(aa)
                            }
                        } else {
                            if (o[af].expressInstall && A()) {
                                var ai = {};
                                ai.data = o[af].expressInstall;
                                ai.width = ae.getAttribute("width") || "0";
                                ai.height = ae.getAttribute("height") || "0";
                                if (ae.getAttribute("class")) {
                                    ai.styleclass = ae.getAttribute("class")
                                }
                                if (ae.getAttribute("align")) {
                                    ai.align = ae.getAttribute("align")
                                }
                                var ah = {};
                                var X = ae.getElementsByTagName("param");
                                var ac = X.length;
                                for (var ad = 0; ad < ac; ad++) {
                                    if (X[ad].getAttribute("name").toLowerCase() != "movie") {
                                        ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
                                    }
                                }
                                P(ai, ah, Y, ab)
                            } else {
                                p(ae);
                                if (ab) {
                                    ab(aa)
                                }
                            }
                        }
                    }
                } else {
                    w(Y, true);
                    if (ab) {
                        var Z = z(Y);
                        if (Z && typeof Z.SetVariable != D) {
                            aa.success = true;
                            aa.ref = Z
                        }
                        ab(aa)
                    }
                }
            }
        }
    }

    function z(aa) {
        var X = null;
        var Y = c(aa);
        if (Y && Y.nodeName == "OBJECT") {
            if (typeof Y.SetVariable != D) {
                X = Y
            } else {
                var Z = Y.getElementsByTagName(r)[0];
                if (Z) {
                    X = Z
                }
            }
        }
        return X
    }

    function A() {
        return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
    }

    function P(aa, ab, X, Z) {
        a = true;
        E = Z || null;
        B = {
            success: false,
            id: X
        };
        var ae = c(X);
        if (ae) {
            if (ae.nodeName == "OBJECT") {
                l = g(ae);
                Q = null
            } else {
                l = ae;
                Q = X
            }
            aa.id = R;
            if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) {
                aa.width = "310"
            }
            if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) {
                aa.height = "137"
            }
            j.title = j.title.slice(0, 47) + " - Flash Player Installation";
            var ad = M.ie && M.win ? "ActiveX" : "PlugIn",
                ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
            if (typeof ab.flashvars != D) {
                ab.flashvars += "&" + ac
            } else {
                ab.flashvars = ac
            } if (M.ie && M.win && ae.readyState != 4) {
                var Y = C("div");
                X += "SWFObjectNew";
                Y.setAttribute("id", X);
                ae.parentNode.insertBefore(Y, ae);
                ae.style.display = "none";
                (function () {
                    if (ae.readyState == 4) {
                        ae.parentNode.removeChild(ae)
                    } else {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            }
            u(aa, ab, X)
        }
    }

    function p(Y) {
        if (M.ie && M.win && Y.readyState != 4) {
            var X = C("div");
            Y.parentNode.insertBefore(X, Y);
            X.parentNode.replaceChild(g(Y), X);
            Y.style.display = "none";
            (function () {
                if (Y.readyState == 4) {
                    Y.parentNode.removeChild(Y)
                } else {
                    setTimeout(arguments.callee, 10)
                }
            })()
        } else {
            Y.parentNode.replaceChild(g(Y), Y)
        }
    }

    function g(ab) {
        var aa = C("div");
        if (M.win && M.ie) {
            aa.innerHTML = ab.innerHTML
        } else {
            var Y = ab.getElementsByTagName(r)[0];
            if (Y) {
                var ad = Y.childNodes;
                if (ad) {
                    var X = ad.length;
                    for (var Z = 0; Z < X; Z++) {
                        if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) {
                            aa.appendChild(ad[Z].cloneNode(true))
                        }
                    }
                }
            }
        }
        return aa
    }

    function u(ai, ag, Y) {
        var X, aa = c(Y);
        if (M.wk && M.wk < 312) {
            return X
        }
        if (aa) {
            if (typeof ai.id == D) {
                ai.id = Y
            }
            if (M.ie && M.win) {
                var ah = "";
                for (var ae in ai) {
                    if (ai[ae] != Object.prototype[ae]) {
                        if (ae.toLowerCase() == "data") {
                            ag.movie = ai[ae]
                        } else {
                            if (ae.toLowerCase() == "styleclass") {
                                ah += ' class="' + ai[ae] + '"'
                            } else {
                                if (ae.toLowerCase() != "classid") {
                                    ah += " " + ae + '="' + ai[ae] + '"'
                                }
                            }
                        }
                    }
                }
                var af = "";
                for (var ad in ag) {
                    if (ag[ad] != Object.prototype[ad]) {
                        af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
                    }
                }
                aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
                N[N.length] = ai.id;
                X = c(ai.id)
            } else {
                var Z = C(r);
                Z.setAttribute("type", q);
                for (var ac in ai) {
                    if (ai[ac] != Object.prototype[ac]) {
                        if (ac.toLowerCase() == "styleclass") {
                            Z.setAttribute("class", ai[ac])
                        } else {
                            if (ac.toLowerCase() != "classid") {
                                Z.setAttribute(ac, ai[ac])
                            }
                        }
                    }
                }
                for (var ab in ag) {
                    if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") {
                        e(Z, ab, ag[ab])
                    }
                }
                aa.parentNode.replaceChild(Z, aa);
                X = Z
            }
        }
        return X
    }

    function e(Z, X, Y) {
        var aa = C("param");
        aa.setAttribute("name", X);
        aa.setAttribute("value", Y);
        Z.appendChild(aa)
    }

    function y(Y) {
        var X = c(Y);
        if (X && X.nodeName == "OBJECT") {
            if (M.ie && M.win) {
                X.style.display = "none";
                (function () {
                    if (X.readyState == 4) {
                        b(Y)
                    } else {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            } else {
                X.parentNode.removeChild(X)
            }
        }
    }

    function b(Z) {
        var Y = c(Z);
        if (Y) {
            for (var X in Y) {
                if (typeof Y[X] == "function") {
                    Y[X] = null
                }
            }
            Y.parentNode.removeChild(Y)
        }
    }

    function c(Z) {
        var X = null;
        try {
            X = j.getElementById(Z)
        } catch (Y) {}
        return X
    }

    function C(X) {
        return j.createElement(X)
    }

    function i(Z, X, Y) {
        Z.attachEvent(X, Y);
        I[I.length] = [Z, X, Y]
    }

    function F(Z) {
        var Y = M.pv,
            X = Z.split(".");
        X[0] = parseInt(X[0], 10);
        X[1] = parseInt(X[1], 10) || 0;
        X[2] = parseInt(X[2], 10) || 0;
        return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
    }

    function v(ac, Y, ad, ab) {
        if (M.ie && M.mac) {
            return
        }
        var aa = j.getElementsByTagName("head")[0];
        if (!aa) {
            return
        }
        var X = (ad && typeof ad == "string") ? ad : "screen";
        if (ab) {
            n = null;
            G = null
        }
        if (!n || G != X) {
            var Z = C("style");
            Z.setAttribute("type", "text/css");
            Z.setAttribute("media", X);
            n = aa.appendChild(Z);
            if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) {
                n = j.styleSheets[j.styleSheets.length - 1]
            }
            G = X
        }
        if (M.ie && M.win) {
            if (n && typeof n.addRule == r) {
                n.addRule(ac, Y)
            }
        } else {
            if (n && typeof j.createTextNode != D) {
                n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
            }
        }
    }

    function w(Z, X) {
        if (!m) {
            return
        }
        var Y = X ? "visible" : "hidden";
        if (J && c(Z)) {
            c(Z).style.visibility = Y
        } else {
            v("#" + Z, "visibility:" + Y)
        }
    }

    function L(Y) {
        var Z = /[\\\"<>\.;]/;
        var X = Z.exec(Y) != null;
        return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
    }
    var d = function () {
        if (M.ie && M.win) {
            window.attachEvent("onunload", function () {
                var ac = I.length;
                for (var ab = 0; ab < ac; ab++) {
                    I[ab][0].detachEvent(I[ab][1], I[ab][2])
                }
                var Z = N.length;
                for (var aa = 0; aa < Z; aa++) {
                    y(N[aa])
                }
                for (var Y in M) {
                    M[Y] = null
                }
                M = null;
                for (var X in RR.swfobject) {
                    RR.swfobject[X] = null
                }
                RR.swfobject = null
            })
        }
    }();
    return {
        registerObject: function (ab, X, aa, Z) {
            if (M.w3 && ab && X) {
                var Y = {};
                Y.id = ab;
                Y.swfVersion = X;
                Y.expressInstall = aa;
                Y.callbackFn = Z;
                o[o.length] = Y;
                w(ab, false)
            } else {
                if (Z) {
                    Z({
                        success: false,
                        id: ab
                    })
                }
            }
        },
        getObjectById: function (X) {
            if (M.w3) {
                return z(X)
            }
        },
        embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) {
            var X = {
                success: false,
                id: ah
            };
            if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) {
                w(ah, false);
                K(function () {
                    ae += "";
                    ag += "";
                    var aj = {};
                    if (af && typeof af === r) {
                        for (var al in af) {
                            aj[al] = af[al]
                        }
                    }
                    aj.data = ab;
                    aj.width = ae;
                    aj.height = ag;
                    var am = {};
                    if (ad && typeof ad === r) {
                        for (var ak in ad) {
                            am[ak] = ad[ak]
                        }
                    }
                    if (Z && typeof Z === r) {
                        for (var ai in Z) {
                            if (typeof am.flashvars != D) {
                                am.flashvars += "&" + ai + "=" + Z[ai]
                            } else {
                                am.flashvars = ai + "=" + Z[ai]
                            }
                        }
                    }
                    if (F(Y)) {
                        var an = u(aj, am, ah);
                        if (aj.id == ah) {
                            w(ah, true)
                        }
                        X.success = true;
                        X.ref = an
                    } else {
                        if (aa && A()) {
                            aj.data = aa;
                            P(aj, am, ah, ac);
                            return
                        } else {
                            w(ah, true)
                        }
                    } if (ac) {
                        ac(X)
                    }
                })
            } else {
                if (ac) {
                    ac(X)
                }
            }
        },
        switchOffAutoHideShow: function () {
            m = false
        },
        ua: M,
        getFlashPlayerVersion: function () {
            return {
                major: M.pv[0],
                minor: M.pv[1],
                release: M.pv[2]
            }
        },
        hasFlashPlayerVersion: F,
        createSWF: function (Z, Y, X) {
            if (M.w3) {
                return u(Z, Y, X)
            } else {
                return undefined
            }
        },
        showExpressInstall: function (Z, aa, X, Y) {
            if (M.w3 && A()) {
                P(Z, aa, X, Y)
            }
        },
        removeSWF: function (X) {
            if (M.w3) {
                y(X)
            }
        },
        createCSS: function (aa, Z, Y, X) {
            if (M.w3) {
                v(aa, Z, Y, X)
            }
        },
        addDomLoadEvent: K,
        addLoadEvent: s,
        getQueryParamValue: function (aa) {
            var Z = j.location.search || j.location.hash;
            if (Z) {
                if (/\?/.test(Z)) {
                    Z = Z.split("?")[1]
                }
                if (aa == null) {
                    return L(Z)
                }
                var Y = Z.split("&");
                for (var X = 0; X < Y.length; X++) {
                    if (Y[X].substring(0, Y[X].indexOf("=")) == aa) {
                        return L(Y[X].substring((Y[X].indexOf("=") + 1)))
                    }
                }
            }
            return ""
        },
        expressInstallCallback: function () {
            if (a) {
                var X = c(R);
                if (X && l) {
                    X.parentNode.replaceChild(l, X);
                    if (Q) {
                        w(Q, true);
                        if (M.ie && M.win) {
                            l.style.display = "block"
                        }
                    }
                    if (E) {
                        E(B)
                    }
                }
                a = false
            }
        }
    }
}();

if (window.RROAS) {
    RROAS.process();
}/* complete : /javascript/common/p13n.js*/


/* combine : /javascript/common/libraries/modernizr.custom.js*/
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */;
window.Modernizr = function (a, b, c) {
  function C(a) {
    j.cssText = a
  }
  function D(a, b) {
    return C(n.join(a + ";") + (b || ""))
  }
  function E(a, b) {
    return typeof a === b
  }
  function F(a, b) {
    return !!~ ("" + a).indexOf(b)
  }
  function G(a, b) {
    for (var d in a) {
      var e = a[d];
      if (!F(e, "-") && j[e] !== c) return b == "pfx" ? e : !0
    }
    return !1
  }
  function H(a, b, d) {
    for (var e in a) {
      var f = b[a[e]];
      if (f !== c) return d === !1 ? a[e] : E(f, "function") ? f.bind(d || b) : f
    }
    return !1
  }
  function I(a, b, c) {
    var d = a.charAt(0).toUpperCase() + a.slice(1),
      e = (a + " " + p.join(d + " ") + d).split(" ");
    return E(b, "string") || E(b, "undefined") ? G(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "), H(e, b, c))
  }
  function J() {
    e.input = function (c) {
      for (var d = 0, e = c.length; d < e; d++) u[c[d]] = c[d] in k;
      return u.list && (u.list = !! b.createElement("datalist") && !! a.HTMLDataListElement), u
    }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")), e.inputtypes = function (a) {
      for (var d = 0, e, f, h, i = a.length; d < i; d++) k.setAttribute("type", f = a[d]), e = k.type !== "text", e && (k.value = l, k.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(f) && k.style.WebkitAppearance !== c ? (g.appendChild(k), h = b.defaultView, e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0, g.removeChild(k)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : e = k.value != l)), t[a[d]] = !! e;
      return t
    }("search tel url email datetime date month week time datetime-local number range color".split(" "))
  }
  var d = "2.6.2",
    e = {}, f = !0,
    g = b.documentElement,
    h = "modernizr",
    i = b.createElement(h),
    j = i.style,
    k = b.createElement("input"),
    l = ":)",
    m = {}.toString,
    n = " -webkit- -moz- -o- -ms- ".split(" "),
    o = "Webkit Moz O ms",
    p = o.split(" "),
    q = o.toLowerCase().split(" "),
    r = {
      svg: "http://www.w3.org/2000/svg"
    }, s = {}, t = {}, u = {}, v = [],
    w = v.slice,
    x, y = function (a, c, d, e) {
      var f, i, j, k, l = b.createElement("div"),
        m = b.body,
        n = m || b.createElement("body");
      if (parseInt(d, 10)) while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), l.appendChild(j);
      return f = ["&#173;", '<style id="s', h, '">', a, "</style>"].join(""), l.id = h, (m ? l : n).innerHTML += f, n.appendChild(l), m || (n.style.background = "", n.style.overflow = "hidden", k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i = c(l, a), m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k), !! i
    }, z = function () {
      function d(d, e) {
        e = e || b.createElement(a[d] || "div"), d = "on" + d;
        var f = d in e;
        return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""), f = E(e[d], "function"), E(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))), e = null, f
      }
      var a = {
        select: "input",
        change: "input",
        submit: "form",
        reset: "form",
        error: "img",
        load: "img",
        abort: "img"
      };
      return d
    }(),
    A = {}.hasOwnProperty,
    B;
  !E(A, "undefined") && !E(A.call, "undefined") ? B = function (a, b) {
    return A.call(a, b)
  } : B = function (a, b) {
    return b in a && E(a.constructor.prototype[b], "undefined")
  }, Function.prototype.bind || (Function.prototype.bind = function (b) {
    var c = this;
    if (typeof c != "function") throw new TypeError;
    var d = w.call(arguments, 1),
      e = function () {
        if (this instanceof e) {
          var a = function () {};
          a.prototype = c.prototype;
          var f = new a,
            g = c.apply(f, d.concat(w.call(arguments)));
          return Object(g) === g ? g : f
        }
        return c.apply(b, d.concat(w.call(arguments)))
      };
    return e
  }), s.flexbox = function () {
    return I("flexWrap")
  }, s.canvas = function () {
    var a = b.createElement("canvas");
    return !!a.getContext && !! a.getContext("2d")
  }, s.canvastext = function () {
    return !!e.canvas && !! E(b.createElement("canvas").getContext("2d").fillText, "function")
  }, s.webgl = function () {
    return !!a.WebGLRenderingContext
  }, s.touch = function () {
    var c;
    return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : y(["@media (", n.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function (a) {
      c = a.offsetTop === 9
    }), c
  }, s.geolocation = function () {
    return "geolocation" in navigator
  }, s.postmessage = function () {
    return !!a.postMessage
  }, s.websqldatabase = function () {
    return !!a.openDatabase
  }, s.indexedDB = function () {
    return !!I("indexedDB", a)
  }, s.hashchange = function () {
    return z("hashchange", a) && (b.documentMode === c || b.documentMode > 7)
  }, s.history = function () {
    return !!a.history && !! history.pushState
  }, s.draganddrop = function () {
    var a = b.createElement("div");
    return "draggable" in a || "ondragstart" in a && "ondrop" in a
  }, s.websockets = function () {
    return "WebSocket" in a || "MozWebSocket" in a
  }, s.rgba = function () {
    return C("background-color:rgba(150,255,150,.5)"), F(j.backgroundColor, "rgba")
  }, s.hsla = function () {
    return C("background-color:hsla(120,40%,100%,.5)"), F(j.backgroundColor, "rgba") || F(j.backgroundColor, "hsla")
  }, s.multiplebgs = function () {
    return C("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background)
  }, s.backgroundsize = function () {
    return I("backgroundSize")
  }, s.borderimage = function () {
    return I("borderImage")
  }, s.borderradius = function () {
    return I("borderRadius")
  }, s.boxshadow = function () {
    return I("boxShadow")
  }, s.textshadow = function () {
    return b.createElement("div").style.textShadow === ""
  }, s.opacity = function () {
    return D("opacity:.55"), /^0.55$/.test(j.opacity)
  }, s.cssanimations = function () {
    return I("animationName")
  }, s.csscolumns = function () {
    return I("columnCount")
  }, s.cssgradients = function () {
    var a = "background-image:",
      b = "gradient(linear,left top,right bottom,from(#9f9),to(white));",
      c = "linear-gradient(left top,#9f9, white);";
    return C((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)), F(j.backgroundImage, "gradient")
  }, s.cssreflections = function () {
    return I("boxReflect")
  }, s.csstransforms = function () {
    return !!I("transform")
  }, s.csstransforms3d = function () {
    var a = !! I("perspective");
    return a && "webkitPerspective" in g.style && y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function (b, c) {
      a = b.offsetLeft === 9 && b.offsetHeight === 3
    }), a
  }, s.csstransitions = function () {
    return I("transition")
  }, s.fontface = function () {
    var a;
    return y('@font-face {font-family:"font";src:url("https://")}', function (c, d) {
      var e = b.getElementById("smodernizr"),
        f = e.sheet || e.styleSheet,
        g = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "";
      a = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0
    }), a
  }, s.generatedcontent = function () {
    var a;
    return y(["#", h, "{font:0/0 a}#", h, ':after{content:"', l, '";visibility:hidden;font:3px/1 a}'].join(""), function (b) {
      a = b.offsetHeight >= 3
    }), a
  }, s.video = function () {
    var a = b.createElement("video"),
      c = !1;
    try {
      if (c = !! a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")
    }
    catch (d) {}
    return c
  }, s.audio = function () {
    var a = b.createElement("audio"),
      c = !1;
    try {
      if (c = !! a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "")
    }
    catch (d) {}
    return c
  }, s.localstorage = function () {
    try {
      return localStorage.setItem(h, h), localStorage.removeItem(h), !0
    }
    catch (a) {
      return !1
    }
  }, s.sessionstorage = function () {
    try {
      return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0
    }
    catch (a) {
      return !1
    }
  }, s.webworkers = function () {
    return !!a.Worker
  }, s.applicationcache = function () {
    return !!a.applicationCache
  }, s.svg = function () {
    return !!b.createElementNS && !! b.createElementNS(r.svg, "svg").createSVGRect
  }, s.inlinesvg = function () {
    var a = b.createElement("div");
    return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg
  }, s.smil = function () {
    return !!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")))
  }, s.svgclippaths = function () {
    return !!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")))
  };
  for (var K in s) B(s, K) && (x = K.toLowerCase(), e[x] = s[K](), v.push((e[x] ? "" : "no-") + x));
  return e.input || J(), e.addTest = function (a, b) {
    if (typeof a == "object") for (var d in a) B(a, d) && e.addTest(d, a[d]);
    else {
      a = a.toLowerCase();
      if (e[a] !== c) return e;
      b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a), e[a] = b
    }
    return e
  }, C(""), i = k = null,
  function (a, b) {
    function k(a, b) {
      var c = a.createElement("p"),
        d = a.getElementsByTagName("head")[0] || a.documentElement;
      return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
    }
    function l() {
      var a = r.elements;
      return typeof a == "string" ? a.split(" ") : a
    }
    function m(a) {
      var b = i[a[g]];
      return b || (b = {}, h++, a[g] = h, i[h] = b), b
    }
    function n(a, c, f) {
      c || (c = b);
      if (j) return c.createElement(a);
      f || (f = m(c));
      var g;
      return f.cache[a] ? g = f.cache[a].cloneNode() : e.test(a) ? g = (f.cache[a] = f.createElem(a)).cloneNode() : g = f.createElem(a), g.canHaveChildren && !d.test(a) ? f.frag.appendChild(g) : g
    }
    function o(a, c) {
      a || (a = b);
      if (j) return a.createDocumentFragment();
      c = c || m(a);
      var d = c.frag.cloneNode(),
        e = 0,
        f = l(),
        g = f.length;
      for (; e < g; e++) d.createElement(f[e]);
      return d
    }
    function p(a, b) {
      b.cache || (b.cache = {}, b.createElem = a.createElement, b.createFrag = a.createDocumentFragment, b.frag = b.createFrag()), a.createElement = function (c) {
        return r.shivMethods ? n(c, a, b) : b.createElem(c)
      }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + l().join().replace(/\w+/g, function (a) {
        return b.createElem(a), b.frag.createElement(a), 'c("' + a + '")'
      }) + ");return n}")(r, b.frag)
    }
    function q(a) {
      a || (a = b);
      var c = m(a);
      return r.shivCSS && !f && !c.hasCSS && (c.hasCSS = !! k(a, "article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")), j || p(a, c), a
    }
    var c = a.html5 || {}, d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
      e = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
      f, g = "_html5shiv",
      h = 0,
      i = {}, j;
    (function () {
      try {
        var a = b.createElement("a");
        a.innerHTML = "<xyz></xyz>", f = "hidden" in a, j = a.childNodes.length == 1 || function () {
          b.createElement("a");
          var a = b.createDocumentFragment();
          return typeof a.cloneNode == "undefined" || typeof a.createDocumentFragment == "undefined" || typeof a.createElement == "undefined"
        }()
      }
      catch (c) {
        f = !0, j = !0
      }
    })();
    var r = {
      elements: c.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
      shivCSS: c.shivCSS !== !1,
      supportsUnknownElements: j,
      shivMethods: c.shivMethods !== !1,
      type: "default",
      shivDocument: q,
      createElement: n,
      createDocumentFragment: o
    };
    a.html5 = r, q(b)
  }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p, e.hasEvent = z, e.testProp = function (a) {
    return G([a])
  }, e.testAllProps = I, e.testStyles = y, e.prefixed = function (a, b, c) {
    return b ? I(a, b, c) : I(a, "pfx")
  }, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""), e
}(this, this.document),
function (a, b, c) {
  function d(a) {
    return "[object Function]" == o.call(a)
  }
  function e(a) {
    return "string" == typeof a
  }
  function f() {}
  function g(a) {
    return !a || "loaded" == a || "complete" == a || "uninitialized" == a
  }
  function h() {
    var a = p.shift();
    q = 1, a ? a.t ? m(function () {
      ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
    }, 0) : (a(), h()) : q = 0
  }
  function i(a, c, d, e, f, i, j) {
    function k(b) {
      if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
        "img" != a && m(function () {
          t.removeChild(l)
        }, 50);
        for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload()
      }
    }
    var j = j || B.errorTimeout,
      l = b.createElement(a),
      o = 0,
      r = 0,
      u = {
        t: d,
        s: c,
        e: f,
        a: i,
        x: j
      };
    1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function () {
      k.call(this, r)
    }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
  }
  function j(a, b, c, d, f) {
    return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), 1 == p.length && h()), this
  }
  function k() {
    var a = B;
    return a.loader = {
      load: j,
      i: 0
    }, a
  }
  var l = b.documentElement,
    m = a.setTimeout,
    n = b.getElementsByTagName("script")[0],
    o = {}.toString,
    p = [],
    q = 0,
    r = "MozAppearance" in l.style,
    s = r && !! b.createRange().compareNode,
    t = s ? l : n.parentNode,
    l = a.opera && "[object Opera]" == o.call(a.opera),
    l = !! b.attachEvent && !l,
    u = r ? "object" : l ? "script" : "img",
    v = l ? "script" : u,
    w = Array.isArray || function (a) {
      return "[object Array]" == o.call(a)
    }, x = [],
    y = {}, z = {
      timeout: function (a, b) {
        return b.length && (a.timeout = b[0]), a
      }
    }, A, B;
  B = function (a) {
    function b(a) {
      var a = a.split("!"),
        b = x.length,
        c = a.pop(),
        d = a.length,
        c = {
          url: c,
          origUrl: c,
          prefixes: a
        }, e, f, g;
      for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
      for (f = 0; f < b; f++) c = x[f](c);
      return c
    }
    function g(a, e, f, g, h) {
      var i = b(a),
        j = i.autoCallback;
      i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout), (d(e) || d(j)) && f.load(function () {
        k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2
      })))
    }
    function h(a, b) {
      function c(a, c) {
        if (a) {
          if (e(a)) c || (j = function () {
            var a = [].slice.call(arguments);
            k.apply(this, a), l()
          }), g(a, j, b, 0, h);
          else if (Object(a) === a) for (n in m = function () {
            var b = 0,
              c;
            for (c in a) a.hasOwnProperty(c) && b++;
            return b
          }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
            var a = [].slice.call(arguments);
            k.apply(this, a), l()
          } : j[n] = function (a) {
            return function () {
              var b = [].slice.call(arguments);
              a && a.apply(this, b), l()
            }
          }(k[n])), g(a[n], j, b, n, h))
        }
        else !c && l()
      }
      var h = !! a.test,
        i = a.load || a.both,
        j = a.callback || f,
        k = j,
        l = a.complete || f,
        m, n;
      c(h ? a.yep : a.nope, !! i), i && c(i)
    }
    var i, j, l = this.yepnope.loader;
    if (e(a)) g(a, 0, l, 0);
    else if (w(a)) for (i = 0; i < a.length; i++) j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l);
    else Object(a) === a && h(a, l)
  }, B.addPrefix = function (a, b) {
    z[a] = b
  }, B.addFilter = function (a) {
    x.push(a)
  }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () {
    b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
  }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
    var k = b.createElement("script"),
      l, o, e = e || B.errorTimeout;
    k.src = a;
    for (o in d) k.setAttribute(o, d[o]);
    c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
      !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
    }, m(function () {
      l || (l = 1, c(1))
    }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
  }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
    var e = b.createElement("link"),
      j, c = i ? h : c || f;
    e.href = a, e.rel = "stylesheet", e.type = "text/css";
    for (j in d) e.setAttribute(j, d[j]);
    g || (n.parentNode.insertBefore(e, n), m(c, 0))
  }
}(this, document), Modernizr.load = function () {
  yepnope.apply(window, [].slice.call(arguments, 0))
};/* complete : /javascript/common/libraries/modernizr.custom.js*/


/* combine : /javascript/common/celebrus/celebrusHelper.js*/
/*
 * The following functions aid in the creation of Celebrus data tags.
 *
 */
//Function to set up object and pass it to the CSA
function reportAddToBasket(addedProductID, addedValue, addedCurrency,
						displayName, skuNum, addedQuantity, valueIsPerItem)
{
	var eventObj = new Object();
	eventObj.action = "add";
	eventObj.productID = addedProductID;
	eventObj.value = addedValue;
	eventObj.currency = addedCurrency;
	eventObj.productDisplayName = displayName;
	eventObj.skuNumber = skuNum;
	eventObj.quantity = addedQuantity;
	eventObj.valuePerItem = valueIsPerItem;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Failed to add to basket.
function reportFailedToAddToBasket(addedProductID)
{
	var eventObj = new Object();
	eventObj.action = "failedAdd";
	eventObj.productID = addedProductID;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Amend basket entry.
function reportAmendBasket(amendedProductID, updatedQuantity)
{
	var eventObj = new Object();
	eventObj.action = "amend";
	eventObj.productID = amendedProductID;
	eventObj.newQuantity = updatedQuantity;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Remove basket entry.
function reportRemoveBasketItem(removedProductID)
{
	var eventObj = new Object();
	eventObj.action = "remove";
	eventObj.productID = removedProductID;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Basket total.
function reportBasketTotal(basketTotalVal, basketCurrency)
{
	var eventObj = new Object();
	eventObj.action = "basketTotal";
	eventObj.totalValue = basketTotalVal;
	eventObj.currency = basketCurrency;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Basket Purchased.
function reportPurchase(orderNum, basketTotalVal, basketCurrency)
{
	var eventObj = new Object();
	eventObj.action = "purchase";
	eventObj.orderNumber = orderNum;
	eventObj.totalValue = basketTotalVal;
	eventObj.currency = basketCurrency;
	if(window.JDWevent)
		window.JDWevent(eventObj);
}

//Report 'To Follow' message displayed.
function reportToFollowMessage(productID, toFollowPeriod, value, currency)
{
	var targetObj = new Object();
	targetObj.name = "toFollowMessage";
	targetObj.id = productID + '_' + toFollowPeriod;
	targetObj.value = value + '|' + currency;
	targetObj.tagName = 'DIV';
	if(window.JDWclick)
		window.JDWclick(targetObj);
}

//Report substitute product suggested.
function reportSubstituteProductSuggested(originalProductID, value, currency, substituteProductID)
{
	var targetObj = new Object();
	targetObj.name = "substituteProductSuggested";
	targetObj.id = originalProductID + '_' + substituteProductID;
	targetObj.value = value + '|' + currency;
	targetObj.tagName = 'DIV';
	if(window.JDWclick)
		window.JDWclick(targetObj);
}

//Report that one of the alternative images on the product details page has been clicked.
function reportAltImageClick(productID, alternateImageID)
{
	var targetObj = new Object();
	targetObj.name = "alternativeProductDetailsImageClicked";
	targetObj.id = productID;
	targetObj.value = alternateImageID;
	targetObj.tagName = 'DIV';
	if(window.JDWclick)
		window.JDWclick(targetObj);
}

//Report that a product has been added to the wish-list.
function reportAddToWishlistClick(productID)
{
	var targetObj = new Object();
	targetObj.name = "addedToWishlist";
	targetObj.id = productID;
	if(window.JDWclick)
		window.JDWclick(targetObj);
}

//Report personal account protection page click.
function reportPAPPageClick(pageName)
{
	var targetObj = new Object();
	targetObj.id = "stid_paptrans_" + pageName;
	targetObj.name = "stid_paptrans";
	targetObj.value = pageName;
	targetObj.tagName = 'DIV';
	if(window.JDWclick)
		window.JDWclick(targetObj);
}


//Create a Celebrus target object
function createTargetObj(type, category, selection, remainder, state, href) {
	var targetObj = {};
	targetObj.tagName = "DIV";
	var args = Array.prototype.slice.call(arguments);
	var length = args.length;
	targetObj.id = "celid";
	for (var i=0; i<length-1; i++){
			var val = args[i];
			if (val != null) targetObj.id = targetObj.id + "_" + $.trim(val.toLowerCase());
	}
	targetObj.name	= $.trim(href);
	targetObj.href	= $.trim(href);
	targetObj.value	= $.trim(href);
	return targetObj;
}

//Report that a single select refinement group category has been clicked
function reportSingleSelectRefinementGroupCategoryClicked(link) {
	if(window.JDWclick) {	
		var $link = $(link);
		var selection = $.trim($link.clone().children().remove(".count").end().text()).replace(/[\n\r]+\-/g, "");
		var href = document.getElementById($link.attr('id')).href;	// non jQuery so that the absolute path is retrieved consistently
		if (selection != "clear") {
			var remainder = $link.clone().children(".count").text().replace(new RegExp("[()]","gi"), "");
			var category = $link.closest(".availableFiltersContainer").prev(".refinementHeader").children("span:first").text();
			if($link.closest("ul").hasClass("checkList"))
				var state = $link.hasClass("checked") ? "off" : "on";
			else
				var state = "on";
			window.JDWclick(createTargetObj('cmslhnr', category, selection, remainder, state, href));
		}
		else {
			if($link.parent().hasClass("refinementHeader"))
				reportRefinementGroupClearClicked(link);
			else
				reportSelectedFilterClearClicked(link);
		}
	}
}
//Report that a value has been selected from the product window Sort By list
function reportSortBySelected(selected) {
	if(window.JDWclick)
		var href = window.location.protocol + '//' + window.location.host + $(selected).attr('value');	// need to construct the url because the relative path is from a value attribute rather than href
		window.JDWclick(createTargetObj("cmssb", null, $(selected).find("option:selected").text(), null, "on", href));
}
//Report that a value has been selected from the product window Products Per Page list
function reportProductsPerPageSelected(selected) {
	if(window.JDWclick) {
		var href = window.location.protocol + '//' + window.location.host + $(selected).attr('value');
		var option = $(selected).find("option:selected").text().replace(" products", "");		
		window.JDWclick(createTargetObj("cmsppp", null, option, null, "on", href));
	}
}
//Report that a filtering group concertina has been clicked
function reportFilteringGroupConcertinaClicked(filterGroup) {
	if(window.JDWclick) {
		var $fg = $(filterGroup);
		window.JDWclick(createTargetObj("cmslhcon", $fg.text(), null, null, (!$fg.hasClass("active") ? "on" : "off"), null));
	}
}
//Report that a navigation page link has been clicked
function reportNavPageLinkClicked(link) {
	if(window.JDWclick) {
		var $link = $(link);
		var method = link.id.substring(link.id.indexOf("-") + 1);
		var pageno;
		var href = document.getElementById($link.attr('id')).href;
		if (!href) href=document.getElementById($link.parent().attr('id')).href; // mobile
		if(method === "Next" || method === "nextResults") {
			method = "next";
			pageno = $link.parent().siblings('span.current').next().children('a:first').text();
			(pageno=="" ? pageno="na" : false);	// mobile does not identify page numbers
		} else if(method === "Prev" || method === "previousResults") {
			method = "prev";
			pageno = $link.parent().siblings('span.current').prev().children('a:first').text();
			(pageno=="" ? pageno="na" : false);
		} else {
			pageno = method;
			method = "direct";
		}
		window.JDWclick(createTargetObj("cmspn", method, pageno, null, "on", href));
	}
}

//Report that a price slide change has been made
function reportPriceSliderChanged(values) {
	if(window.JDWclick)
		window.JDWclick(createTargetObj("cmslhnps", "priceslider", (values[0] + "-" + values[1]), "na", "on", null));
}

//Report that the clear all link has been clicked
function reportClearAllClicked(link) {
	if(window.JDWclick){
		var $link = $(link);
		var href = document.getElementById($link.attr('id')).href;
		window.JDWclick(createTargetObj("cmslhnca", "all", "clear", "na", "off", href));
	}
}

//Report that the clear link for a refinement group has been clicked
function reportRefinementGroupClearClicked(link) {
	if(window.JDWclick){
		var $link = $(link);
		var href = document.getElementById($link.attr('id')).href;
		window.JDWclick(createTargetObj("cmslhncg", $link.prev().text(), "clear", "na", "off", href));
	}
}

//Report that the clear link for a selected filter has been clicked
function reportSelectedFilterClearClicked(link) {
	if(window.JDWclick){
		var $link = $(link);
		var href = document.getElementById($link.attr('id')).href;
		window.JDWclick(createTargetObj("cmslhncp", 
				$(link).closest("li").text().replace(new RegExp("(clear)", "gi"), ""),
				"clear", "na", "off", href));
	}
}

//Report that refine search has been clicked
function reportRefineSearchClicked(selected) {
	if(window.JDWclick) {
		var href = window.location.protocol + '//' + window.location.host + $(selected).attr('value');
		window.JDWclick(createTargetObj("cmslhnsr", $(selected).find("option:first").text(), 
				$(selected).find("option:selected").text(), "na", "on", href));
	}
}

//Report that an autocomplete text box option has been selected
function reportTextChanged(text, id, name)
{
	var targetObj = new Object();
	targetObj.name = name;
	targetObj.id = id;
	targetObj.value = text;
	targetObj.tagName = 'input';
	targetObj.type = 'text';
	if(window.JDWtextchange)
		window.JDWtextchange(targetObj);
}/* complete : /javascript/common/celebrus/celebrusHelper.js*/


/* combine : /javascript/common/celebrus/celebrusEventWriter.js*/
/*
 * The following functions aid in the creation of Celebrus events.
 *
 */
//Function to set up object and pass it to the CSA
function celReportAddToBasket(addedProductID, addedValue, addedCurrency,
						displayName, skuNum, addedQuantity, valueIsPerItem)
{
	try {
		reportAddToBasket(addedProductID, addedValue, addedCurrency,
						displayName, skuNum, addedQuantity, valueIsPerItem);
	} catch (err) {
	}
}

//Failed to add to basket.
function celReportFailedToAddToBasket(addedProductID)
{
	try {
		reportFailedToAddToBasket(addedProductID);
	} catch (err) {
	}
}

//Amend basket entry.
function celReportAmendBasket(amendedProductID, updatedQuantity)
{
	try {
		reportAmendBasket(amendedProductID, updatedQuantity);
	} catch (err) {
	}
}

//Remove basket entry.
function celReportRemoveBasketItem(removedProductID)
{
	try {
		reportRemoveBasketItem(removedProductID);
	} catch (err) {
	}
}

//Basket total.
function celReportBasketTotal(basketTotalVal, basketCurrency)
{
	try {
		reportBasketTotal(basketTotalVal, basketCurrency);
	} catch (err) {
	}
}

//Basket purchased.
function celReportPurchase(orderNum, basketTotalVal, basketCurrency)
{
	try {
		reportPurchase(orderNum, basketTotalVal, basketCurrency);
	} catch (err) {
	}
}

//Report 'To Follow' message displayed.
function celReportToFollowMessage(productID, toFollowPeriod, value, currency)
{
	try {
		reportToFollowMessage(productID, toFollowPeriod, value, currency);
	} catch (err) {
	}
}

//Report substitute product suggested.
function celReportSubstituteProductSuggested(originalProductID, value, currency, substituteProductID)
{
	try {
		reportSubstituteProductSuggested(originalProductID, value, currency, substituteProductID);
	} catch (err) {
	}
}

//Report that one of the alternative images on the product details page has been clicked.
function celReportAltImageClick(productID, alternateImageID)
{
	try {
		reportAltImageClick(productID, alternateImageID);
	} catch (err) {
	}
}

//Report product added to wishlist.
function celReportAddToWishlist(productCode)
{
	try {
		reportAddToWishlistClick(productCode);
	} catch (err) {
	}
}

//Report personal account protection page click.
function celReportPAPPageClick(pageName)
{
	try {
		reportPAPPageClick(pageName);
	} catch (err) {
	}
}

//Report that a single select refinement group category has been clicked
function celReportSingleSelectRefinementGroupCategoryClicked(link) {
	try {
		reportSingleSelectRefinementGroupCategoryClicked(link);
	} catch (err) {
	}
}

//Report that a value has been selected from the product window Sort By list
function celReportSortBySelected(selected) {
	try {
		reportSortBySelected(selected);
	} catch (err) {
	}
}

//Report that a value has been selected from the product window Products Per Page list
function celReportProductsPerPageSelected(selected) {
	try {
		reportProductsPerPageSelected(selected);
	} catch (err) {
	}
}

//Report that a filtering group concertina has been clicked
function celReportFilteringGroupConcertinaClicked(filterGroup) {
	try {
		reportFilteringGroupConcertinaClicked(filterGroup);
	} catch (err) {
	}
}

//Report that a navigation page link has been clicked
function celReportNavPageLinkClicked(link) {
	try {
		reportNavPageLinkClicked(link);
	} catch (err) {
	}
}

//Report that a price slide change has been made
function celReportPriceSliderChanged(values) {
	try {
		reportPriceSliderChanged(values);
	} catch (err) {
	}
}

//Report that a price slide change has been made
function celReportClearAllClicked(link) {
	try {
		reportClearAllClicked(link);
	} catch (err) {
	}
}

//Report that the clear link for a particular refinement has been clicked
function celReportRefinementGroupClearClicked(link) {
	try {
		reportRefinementGroupClearClicked(link);
	} catch (err) {
	}
}

//Report that the clear link for a refinement group has been clicked
function celReportSelectedFilterClearClicked(link) {
	try {
		reportSelectedFilterClearClicked(link);
	} catch (err) {
	}
}

//Report that refine search has been clicked
function celReportRefineSearchClicked(selected) {
	try {
		reportRefineSearchClicked(selected);
	} catch (err) {
	}
}

//Report that an autocomplete text box option has been selected
function celReportTextChanged(text, id, name) {
	try {
		reportTextChanged(text, id, name);
	} catch (err) {
	}
}
/* complete : /javascript/common/celebrus/celebrusEventWriter.js*/


/* combine : /javascript/common/placeholders.jquery.min.js*/
/* Placeholders.js v3.0.2 */
(function(t){"use strict";function e(t,e,r){return t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):void 0}function r(t,e){var r,n;for(r=0,n=t.length;n>r;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move("character",e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){"use strict";function e(){}function r(){try{return document.activeElement}catch(t){}}function n(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(V);return(a||u)&&"true"===t.getAttribute(D)?(t.removeAttribute(D),t.value=t.value.replace(t.getAttribute(V),""),t.className=t.className.replace(R,""),n=t.getAttribute(F),parseInt(n,10)>=0&&(t.setAttribute("maxLength",n),t.removeAttribute(F)),r=t.getAttribute(P),r&&(t.type=r),!0):!1}function a(t){var e,r,n=t.getAttribute(V);return""===t.value&&n?(t.setAttribute(D,"true"),t.value=n,t.className+=" "+I,r=t.getAttribute(F),r||(t.setAttribute(F,t.maxLength),t.removeAttribute("maxLength")),e=t.getAttribute(P),e?t.type="text":"password"===t.type&&M.changeType(t,"text")&&t.setAttribute(P,"password"),!0):!1}function u(t,e){var r,n,a,u,i,l,o;if(t&&t.getAttribute(V))e(t);else for(a=t?t.getElementsByTagName("input"):b,u=t?t.getElementsByTagName("textarea"):f,r=a?a.length:0,n=u?u.length:0,o=0,l=r+n;l>o;o++)i=r>o?a[o]:u[o-r],e(i)}function i(t){u(t,n)}function l(t){u(t,a)}function o(t){return function(){m&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)?M.moveCaret(t,0):n(t)}}function c(t){return function(){a(t)}}function s(t){return function(e){return A=t.value,"true"===t.getAttribute(D)&&A===t.getAttribute(V)&&M.inArray(C,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function d(t){return function(){n(t,A),""===t.value&&(t.blur(),M.moveCaret(t,0))}}function g(t){return function(){t===r()&&t.value===t.getAttribute(V)&&"true"===t.getAttribute(D)&&M.moveCaret(t,0)}}function v(t){return function(){i(t)}}function p(t){t.form&&(T=t.form,"string"==typeof T&&(T=document.getElementById(T)),T.getAttribute(U)||(M.addEventListener(T,"submit",v(T)),T.setAttribute(U,"true"))),M.addEventListener(t,"focus",o(t)),M.addEventListener(t,"blur",c(t)),m&&(M.addEventListener(t,"keydown",s(t)),M.addEventListener(t,"keyup",d(t)),M.addEventListener(t,"click",g(t))),t.setAttribute(j,"true"),t.setAttribute(V,x),(m||t!==r())&&a(t)}var b,f,m,h,A,y,E,x,L,T,N,S,w,B=["text","search","url","tel","email","password","number","textarea"],C=[27,33,34,35,36,37,38,39,40,8,46],k="#ccc",I="placeholdersjs",R=RegExp("(?:^|\\s)"+I+"(?!\\S)"),V="data-placeholder-value",D="data-placeholder-active",P="data-placeholder-type",U="data-placeholder-submit",j="data-placeholder-bound",q="data-placeholder-focus",z="data-placeholder-live",F="data-placeholder-maxlength",G=document.createElement("input"),H=document.getElementsByTagName("head")[0],J=document.documentElement,K=t.Placeholders,M=K.Utils;if(K.nativeSupport=void 0!==G.placeholder,!K.nativeSupport){for(b=document.getElementsByTagName("input"),f=document.getElementsByTagName("textarea"),m="false"===J.getAttribute(q),h="false"!==J.getAttribute(z),y=document.createElement("style"),y.type="text/css",E=document.createTextNode("."+I+" { color:"+k+"; }"),y.styleSheet?y.styleSheet.cssText=E.nodeValue:y.appendChild(E),H.insertBefore(y,H.firstChild),w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x&&(x=x.nodeValue,x&&M.inArray(B,N.type)&&p(N));L=setInterval(function(){for(w=0,S=b.length+f.length;S>w;w++)N=b.length>w?b[w]:f[w-b.length],x=N.attributes.placeholder,x?(x=x.nodeValue,x&&M.inArray(B,N.type)&&(N.getAttribute(j)||p(N),(x!==N.getAttribute(V)||"password"===N.type&&!N.getAttribute(P))&&("password"===N.type&&!N.getAttribute(P)&&M.changeType(N,"text")&&N.setAttribute(P,"password"),N.value===N.getAttribute(V)&&(N.value=x),N.setAttribute(V,x)))):N.getAttribute(D)&&(n(N),N.removeAttribute(V));h||clearInterval(L)},100)}M.addEventListener(t,"beforeunload",function(){K.disable()}),K.disable=K.nativeSupport?e:i,K.enable=K.nativeSupport?e:l}(this);/* complete : /javascript/common/placeholders.jquery.min.js*/


