var JSON;JSON||(JSON={});
(function(){function c(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=f[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function a(c,e){var d,f,m,p,q=h,n,j=e[c];if(j&&"object"===typeof j&&"function"===typeof j.toJSON)return j.toJSON(c);"function"===typeof i&&(j=i.call(e,c,j));switch(typeof j){case "string":return b(j);case "number":return isFinite(j)?""+j:"null";case "boolean":case "null":return""+j;
case "object":if(!j)return"null";h+=g;n=[];if("[object Array]"===Object.prototype.toString.apply(j)){p=j.length;for(d=0;d<p;d+=1)n[d]=a(d,j)||"null";m=0===n.length?"[]":h?"[\n"+h+n.join(",\n"+h)+"\n"+q+"]":"["+n.join(",")+"]";h=q;return m}if(i&&"object"===typeof i){p=i.length;for(d=0;d<p;d+=1)"string"===typeof i[d]&&(f=i[d],(m=a(f,j))&&n.push(b(f)+(h?": ":":")+m))}else for(f in j)Object.prototype.hasOwnProperty.call(j,f)&&(m=a(f,j))&&n.push(b(f)+(h?": ":":")+m);m=0===n.length?"{}":h?"{\n"+h+n.join(",\n"+
h)+"\n"+q+"}":"{"+n.join(",")+"}";h=q;return m}}if("function"!==typeof Date.prototype.toJSON)Date.prototype.toJSON=function(){return isFinite(this.valueOf())?b(this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z"):null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return b(this.valueOf())};var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,g,f={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;JSON.stringify=function(b,c,e){var d;g=h="";if("number"===typeof e)for(d=0;d<e;d+=1)g+=" ";else"string"===typeof e&&(g=e);if((i=c)&&"function"!==typeof c&&("object"!==typeof c||"number"!==typeof c.length))throw Error("JSON.stringify");return a("",{"":b})};if("function"!==typeof JSON.parse)JSON.parse=
function(a,b){function c(a,e){var d,h,g=a[e];if(g&&"object"===typeof g)for(d in g)Object.prototype.hasOwnProperty.call(g,d)&&(h=c(g,d),void 0!==h?g[d]=h:delete g[d]);return b.call(a,e,g)}var e,a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,
"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");}})();jQuery.noConflict();
jQuery.cookie=function(c,b,a){if("undefined"!=typeof b){a=a||{};if(null===b)b="",a.expires=-1;var d="";if(a.expires&&("number"==typeof a.expires||a.expires.toUTCString))"number"==typeof a.expires?(d=new Date,d.setTime(d.getTime()+864E5*a.expires)):d=a.expires,d="; expires="+d.toUTCString();var e=a.path?"; path="+a.path:"",h=a.domain?"; domain="+a.domain:"",a=a.secure?"; secure":"";document.cookie=[c,"=",encodeURIComponent(b),d,e,h,a].join("")}else{b=null;if(document.cookie&&""!=document.cookie){a=
document.cookie.split(";");for(d=0;d<a.length;d++)if(e=jQuery.trim(a[d]),e.substring(0,c.length+1)==c+"="){b=decodeURIComponent(e.substring(c.length+1));break}}return b}};
(function(c,b,a){function d(){g=b[f](function(){e.each(function(){var a=c(this),b=a.width(),e=a.height(),d=c.data(this,l);if(b!==d.w||e!==d.h)a.trigger(i,[d.w=b,d.h=e])});d()},h[o])}var e=c([]),h=c.resize=c.extend(c.resize,{}),g,f="setTimeout",i="resize",l=i+"-special-event",o="delay";h[o]=250;h.throttleWindow=!0;c.event.special[i]={setup:function(){if(!h.throttleWindow&&this[f])return!1;var a=c(this);e=e.add(a);c.data(this,l,{w:a.width(),h:a.height()});1===e.length&&d()},teardown:function(){if(!h.throttleWindow&&
this[f])return!1;var a=c(this);e=e.not(a);a.removeData(l);e.length||clearTimeout(g)},add:function(b){function e(b,h,g){var f=c(this),i=c.data(this,l);i.w=h!==a?h:f.width();i.h=g!==a?g:f.height();d.apply(this,arguments)}if(!h.throttleWindow&&this[f])return!1;var d;if(c.isFunction(b))return d=b,e;d=b.handler;b.handler=e}}})(jQuery,this);
(function(c,b){var a=c.jQuery||c.Cowboy||(c.Cowboy={}),d;a.throttle=d=function(c,d,g,f){function i(){function a(){o=+new Date;g.apply(m,q)}function i(){l=b}var m=this,p=+new Date-o,q=arguments;f&&!l&&a();l&&clearTimeout(l);f===b&&p>c?a():!0!==d&&(l=setTimeout(f?i:a,f===b?c-p:c))}var l,o=0;"boolean"!==typeof d&&(f=g,g=d,d=b);if(a.guid)i.guid=g.guid=g.guid||a.guid++;return i};a.debounce=function(a,c,g){return g===b?d(a,c,!1):d(a,g,!1!==c)}})(this);function $c(c,b){return function(){c(b)}}
var Platform=function(){var c={options:{},storage:{},forgets:[],autoloads:[],effects:{animate:{show:function(b,a){b.animate(a.animate,{duration:a.duration,complete:a.complete})},hide:function(b,a){c.effects.animate.show(b,a)}},fade:{show:function(b,a){b.fadeIn({duration:a.duration,complete:a.complete})},hide:function(b,a){b.fadeOut({duration:a.duration,complete:a.complete})}},slide:{show:function(b,a){b.slideDown({duration:a.duration,complete:a.complete})},hide:function(b,a){b.slideUp({duration:a.duration,
complete:a.complete})}},upslide:{show:function(b,a){var d=c.effects._utils.wrap(b);"none"==b.css("display")&&(d.$animation.css({marginTop:-b.outerHeight(),opacity:0}),b.show());d.$animation.animate({marginTop:0,opacity:1},{duration:a.duration,queue:!0,complete:a.complete})},hide:function(b,a){c.effects._utils.wrap(b).$animation.animate({marginTop:-b.outerHeight(),opacity:0},{duration:a.duration,queue:!0,complete:a.complete})}},rightslide:{show:function(){},hide:function(){}},_utils:{wrap:function(b){if(b.parent().hasClass("sb-animation"))return{$animation:b.parent(),
$animationWrapper:b.parent().parent()};if(b.hasClass("sb-animation-wrapper"))return{$animation:b.children(),$animationWrapper:b};var a={};a.$animation=b.wrapAll('<div class="sb-animation" />').parent();a.$animationWrapper=a.$animation.wrap('<div class="sb-animation-wrapper" />').parent();a.$animationWrapper.css({overflow:"hidden"});return a}}},persist:function(){var b=jQuery.extend(!0,{},c.storage);if(0!==c.forgets.length)for(var a=0;a<c.forgets.length;a++)void 0!==b[c.forgets[a][0]]&&void 0!==b[c.forgets[a][0]][c.forgets[a][1]]&&
(b[c.forgets[a][0]][c.forgets[a][1]]=void 0);jQuery.cookie("platform_storage_"+c.options.skin,JSON.stringify(b),{expires:10,path:"/"})},forget:function(b,a){c.forgets.push([b,a])},optionsFor:function(b,a,d){void 0===c.options[b]&&(c.options[b]={});return jQuery.extend(!0,a,c.options[b],d)},setOption:function(b,a,d){void 0===c.options[b]&&(c.options[b]={});c.options[b][a]=d},show:function(b,a){a=c.optionsFor("show",{type:"fade",duration:250,complete:function(){},stop:!1},a);a.stop&&b.stop(!0,!0);if("string"!=
typeof a.type)a.animate=a.type,a.type="animate";void 0!==a.queue?c.options.animation&&"none"!==a.type?a.queue.queue(function(d){a.complete=d;c.effects[a.type].show(b,a)}):(b.show(),a.queue.queue(function(a){a()})):c.options.animation&&"none"!==a.type?c.effects[a.type].show(b,a):b.show()},hide:function(b,a){a=c.optionsFor("hide",{type:"fade",duration:250,complete:function(){},stop:!1},a);a.stop&&b.stop(!0,!0);if("string"!=typeof a.type)a.animate=a.type,a.type="animate";void 0!==a.queue?c.options.animation&&
"none"!==a.type?a.queue.queue(function(d){a.complete=d;c.effects[a.type].hide(b,a)}):(b.hide(),a.queue.queue(function(a){a()})):c.options.animation&&"none"!==a.type?c.effects[a.type].hide(b,a):b.hide()},sequence:function(b,a){for(var a=jQuery.extend({queue:c.queue()},a),d=b.length,e=0;e<d;e++)jQuery.isArray(b[e])&&b[e][1].stop(!0,!0);for(e=0;e<d;e++)jQuery.isArray(b[e])?(b[e][2].queue=a.queue,b[e][2].stop=!0,c[b[e][0]](b[e][1],b[e][2])):a.queue.queue(b[e])},queue:function(){return jQuery("<div />")},
autoload:function(b){c.autoloads.push(b)},image:function(b){b.queue.queue(function(a){var c=new Image;c.onload=a;c.src=b.url})}};return{init:function(b){c.options=jQuery.extend({animation:!0,skin:window.skinName},c.options,b);c.storage=JSON.parse(jQuery.cookie("platform_storage_"+c.options.skin));if(!c.storage)c.storage={}},deactivate:function(b){for(var a in b)"0"==b[a]&&(Platform[a]=function(){})},module:function(b){b(jQuery,Platform,c)},ready:function(b){var a=b.length,d=c.autoloads.length;jQuery(document).ready(function(){for(var e=
0;e<a;e++)b[e]();for(e=0;e<d;e++)c.autoloads[e]()})},debug:function(){if(void 0===console)window.console={log:function(b){alert(b)}};console.log("STORAGE:");console.log(c.storage)},getCore:function(){return c}}}();
Platform.module(function(c,b,a){var d=function(b,c){0<c.length&&(c.stop(!0,!0),a.show(c,{type:"fade",duration:250}))},e=function(b,c){0<c.length&&a.hide(c,{type:"fade",duration:250})};Platform.dropdowns=function(){c("[data-dropdown]").each(function(){var a=c(this),b=a.children(":eq(1)");b.hide();b.addClass("sb-dropdown-off");-1!==a.attr("data-dropdown").indexOf("click")?a.click(function(f){f.preventDefault();b.is(":visible")||(d(a,b,{}),f.stopPropagation(),c(document).bind("click",function(d){d.preventDefault();
!c(d.target).is(b)&&!c(d.target).parentsUntil(b).parent().is("ul")&&(c(document).unbind("click"),e(a,b,{}))}))}):a.hover(function(){d(a,b,{})},function(){e(a,b,{})})})};a.autoload(Platform.dropdowns)});
Platform.prototypeExtension=function(){Element.addMethods({platformTooltip:function(c,b){var b=Object.extend({template:new Template("<div class='ipsTooltip ptTooltip' id='#{id}' style='display: none'><div class='ipsTooltip_inner'>#{content}</div></div>"),position:"auto",content:$(c).readAttribute("data-tooltip"),animate:!0,overrideBrowser:!0,delay:0.4},b),a=function(){if(!b.delay||b._still_going){var a=$(c).identify();$(a+"_tooltip")||$(document.body).insert({bottom:b.template.evaluate({id:a+"_tooltip",
content:b.content(c)})});b.overrideBrowser&&$(c).hasAttribute("title")&&$(c).writeAttribute("data-title",$(c).readAttribute("title")).writeAttribute("title",!1);var d=$(a+"_tooltip").setStyle({position:"absolute"}),g=$(c).getLayout(),f=$(c).cumulativeOffset(),a=$(a+"_tooltip").getDimensions(),i=$(document.body).getLayout();if("auto"==b.position)b.position=0>f.left+g.get("width")/2-a.width/2?"right":f.left+a.width/2>i.get("width")?"left":"top";Debug.write(a);switch(b.position){case "top":$(d).setStyle({top:f.top-
a.height-1+"px",left:f.left+g.get("width")/2-a.width/2+"px"}).addClassName("top");break;case "bottom":$(d).setStyle({top:f.top+g.get("height")+1+"px",left:f.left+g.get("width")/2-a.width/2+"px"}).addClassName("bottom");break;case "left":$(d).setStyle({top:f.top-g.get("height")/2+"px",left:f.left-a.width-3+"px"}).addClassName("left");break;case "right":$(d).setStyle({top:f.top+g.get("height")/2-a.height/2+"px",left:f.left+g.get("width")+"px"}).addClassName("right")}b.animate?new Effect.Appear($(d),
{duration:0.3,queue:"end"}):$(d).show()}},d=function(){var a=$(c).identify();$(a+"_tooltip")&&(b.animate?new Effect.Fade($(a+"_tooltip"),{duration:0.2,queue:"end"}):$(a+"_tooltip").hide())};$(c).observe("mouseenter",function(c){b.delay?(b._still_going=!0,a.delay(b.delay,c)):a(c)}).observe("click",function(){b._still_going=!1;d()}).observe("mouseleave",function(){b._still_going=!1;d()})}})};
Platform.module(function(c,b,a){b.tooltips=function(){var b={};if(c("body").hasClass("feature-excerpts_as_tooltip-on")&&0!==c(".ptExcerpt").length)b.excerpt={elements:"#categories .tpAvatarFrame ",content:function(a){return c(a).parents(".col_c_post:first").find(".ptExcerpt li").html()}};b.stdWithImage={elements:"[data-tip] > img",content:function(a){return c(a).parent().attr("data-tip")}};b=a.optionsFor("tooltips",{rules:b});for(k in b.rules)$$(b.rules[k].elements).invoke("platformTooltip",{position:"right",
content:b.rules[k].content})};a.autoload(b.prototypeExtension);a.autoload(b.tooltips)});
Platform.module(function(c,b,a){var d={none:{before:function(){return function(){}},after:function(){return function(){}}}},e=function(b){a.storage.style=b;a.persist();c("link[title][rel~=stylesheet], style[title]").each(function(){var a=c(this);a.attr("title")==b?(a.prop("disabled",!1),a.attr("disabled",!1)):(a.prop("disabled",!0),a.attr("disabled",!0))})};Platform.defineStyleTransition=function(a,b){d[a]=b};Platform.styles=function(b){var b=a.optionsFor("stylePicker",{transition:"none",transitionOptions:{}},
b),g,f,i=d[b.transition].before(b.transitionOptions),l=d[b.transition].after(b.transitionOptions);c("link[title][rel~=stylesheet], style[title]").each(function(){var a=c(this);void 0===g&&-1!==a.attr("rel").indexOf("alt")&&(g=a.attr("title"));if(!1===a.prop("disabled")||!1===a.attr("disabled"))f=a.attr("title")});if(void 0!==a.storage.style&&a.storage.style!=f)f=a.storage.style,e(a.storage.style);c(window).load(function(){e(a.storage.style)});void 0!==f&&c("[data-target-style="+f+"]").addClass("active");
var o=a.queue();c("[data-target-style]").click(function(a){a.preventDefault();f=c(this).attr("data-target-style");c("[data-target-style]").removeClass("active");a=c(this);a.addClass("active");i(o,a);o.queue(function(a){e(f);a()});l(o,a)})};a.autoload(Platform.styles)});
Platform.prototypeExtension=function(){Element.addMethods({platformTooltip:function(c,b){var b=Object.extend({template:new Template("<div class='ipsTooltip ptTooltip' id='#{id}' style='display: none'><div class='ipsTooltip_inner'>#{content}</div></div>"),position:"auto",content:$(c).readAttribute("data-tooltip"),animate:!0,overrideBrowser:!0,delay:0.4},b),a=function(){if(!b.delay||b._still_going){var a=$(c).identify();$(a+"_tooltip")||$(document.body).insert({bottom:b.template.evaluate({id:a+"_tooltip",
content:b.content(c)})});b.overrideBrowser&&$(c).hasAttribute("title")&&$(c).writeAttribute("data-title",$(c).readAttribute("title")).writeAttribute("title",!1);var d=$(a+"_tooltip").setStyle({position:"absolute"}),g=$(c).getLayout(),f=$(c).cumulativeOffset(),a=$(a+"_tooltip").getDimensions(),i=$(document.body).getLayout();if("auto"==b.position)b.position=0>f.left+g.get("width")/2-a.width/2?"right":f.left+a.width/2>i.get("width")?"left":"top";Debug.write(a);switch(b.position){case "top":$(d).setStyle({top:f.top-
a.height-1+"px",left:f.left+g.get("width")/2-a.width/2+"px"}).addClassName("top");break;case "bottom":$(d).setStyle({top:f.top+g.get("height")+1+"px",left:f.left+g.get("width")/2-a.width/2+"px"}).addClassName("bottom");break;case "left":$(d).setStyle({top:f.top-g.get("height")/2+"px",left:f.left-a.width-3+"px"}).addClassName("left");break;case "right":$(d).setStyle({top:f.top+g.get("height")/2-a.height/2+"px",left:f.left+g.get("width")+"px"}).addClassName("right")}b.animate?new Effect.Appear($(d),
{duration:0.3,queue:"end"}):$(d).show()}},d=function(){var a=$(c).identify();$(a+"_tooltip")&&(b.animate?new Effect.Fade($(a+"_tooltip"),{duration:0.2,queue:"end"}):$(a+"_tooltip").hide())};$(c).observe("mouseenter",function(c){b.delay?(b._still_going=!0,a.delay(b.delay,c)):a(c)}).observe("click",function(){b._still_going=!1;d()}).observe("mouseleave",function(){b._still_going=!1;d()})}})};
Platform.module(function(c,b,a){b.tooltips=function(){var b={};if(c("body").hasClass("feature-excerpts_as_tooltip-on")&&0!==c(".ptExcerpt").length)b.excerpt={elements:"#categories .tpAvatarFrame ",content:function(a){return c(a).parents(".col_c_post:first").find(".ptExcerpt li").html()}};b.stdWithImage={elements:"[data-tip] > img",content:function(a){return c(a).parent().attr("data-tip")}};b=a.optionsFor("tooltips",{rules:b});for(k in b.rules)$$(b.rules[k].elements).invoke("platformTooltip",{position:"right",
content:b.rules[k].content})};a.autoload(b.prototypeExtension);a.autoload(b.tooltips)});



window.skinName = "velvet"; window.skinBaseUrl = "http://www.skinbox.net/dev32/public/style_images/surface";

Platform.backgroundPicker = function(){};



Platform.init();

Platform.ready([]);



