(function(c){function o(b,d){d=d==="x"?n.width():n.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function K(b){b=c.isFunction(b)?b.call(h):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(h);a.rel=a.rel||h.rel||"nofollow";a.href=a.href||c(h).attr("href");a.title=a.title||h.title}function Z(b){h=b;a=c.extend({},c(h).data(s));Y();if(a.rel!=="nofollow"){j=c(".cboxElement").filter(function(){return(c(this).data(s).rel||this.rel)===a.rel});g=j.index(h);if(g<0){j=j.add(h);g=j.length-1}}else{j=c(h);g=0}if(!q){A=q=l;L=h;try{L.blur()}catch(d){}c.event.trigger(ba);a.onOpen&&a.onOpen.call(h);r.css({opacity:parseFloat(a.opacity),cursor:a.overlayClose?"pointer":"auto"}).show();a.w=o(a.initialWidth,"x");a.h=o(a.initialHeight,"y");e.position(0);M&&n.bind("resize.cboxIE6 scroll.cboxIE6",function(){r.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll.cboxIE6")}N.add(E).add(F).add(t).add(O).hide();P.html(a.close).show();e.slideshow();e.load()}var s="colorbox",l=true,e,B=c.browser.msie&&!c.support.opacity,M=B&&c.browser.version<7,ba="cbox_open",I="cbox_load",Q="cbox_complete",r,k,x,p,R,S,T,U,j,n,m,J,G,O,N,t,F,E,P,y,z,u,v,h,L,g,a,q,A,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:l,scrolling:l,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:l,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:l,loop:l,slideshow:false,slideshowAuto:l,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,escKey:l,arrowKey:l};e=c.fn.colorbox=c.colorbox=function(b,d){var f=this;if(f.selector&&!f.length)return f;b=b||{};if(d)b.onComplete=d;if(!f.length||f.selector===undefined){f=c("<a/>");b.open=l}f.each(function(){c(this).data(s,c.extend({},c(this).data(s)||$,b)).addClass("cboxElement")});b.open&&Z(f[0]);return f};e.init=function(){function b(d){return c('<div id="cbox'+d+'"/>')}n=c(window);k=c('<div id="colorbox"/>');r=b("Overlay").hide();x=b("Wrapper");p=b("Content").append(m=b("LoadedContent").css({width:0,height:0}),G=b("LoadingOverlay").add(b("LoadingGraphic")),O=b("Title"),N=b("Current"),F=b("Next"),E=b("Previous"),t=b("Slideshow"),P=b("Close"));x.append(c("<div/>").append(b("TopLeft"),R=b("TopCenter"),b("TopRight")),c("<div/>").append(S=b("MiddleLeft"),p,T=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),U=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});J=c("<div id='cboxLoadingBay' style='position:absolute; width:9999px;'/>");c("body").prepend(r,k.append(x,J));if(B){k.addClass("cboxIE");M&&r.css("position","absolute")}p.children().hover(function(){c(this).addClass("hover")},function(){c(this).removeClass("hover")}).addClass("hover");y=R.height()+U.height()+p.outerHeight(l)-p.height();z=S.width()+T.width()+p.outerWidth(l)-p.width();u=m.outerHeight(l);v=m.outerWidth(l);k.css({"padding-bottom":y,"padding-right":z}).hide();F.click(e.next);E.click(e.prev);P.click(e.close);p.children().removeClass("hover");c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined"||d.ctrlKey||d.shiftKey||d.altKey)return l;else{Z(this);return false}});r.click(function(){a.overlayClose&&e.close()});c(document).bind("keydown",function(d){if(q&&a.escKey&&d.keyCode===27){d.preventDefault();e.close()}if(q&&a.arrowKey&&!A&&j.length>1)if(d.keyCode===37&&(g>0||a.loop)){d.preventDefault();E.click()}else if(d.keyCode===39&&(g<j.length-1||a.loop)){d.preventDefault();F.click()}})};e.remove=function(){k.add(r).remove();c(".cboxElement").removeData(s).removeClass("cboxElement")};e.position=function(b,d){function f(C){R[0].style.width=U[0].style.width=p[0].style.width=C.style.width;G[0].style.height=G[1].style.height=p[0].style.height=S[0].style.height=T[0].style.height=C.style.height}var i,w=Math.max(n.height()-a.h-u-y,0)/2+n.scrollTop(),H=Math.max(n.width()-a.w-v-z,0)/2+n.scrollLeft();i=k.width()===a.w+v&&k.height()===a.h+u?0:b;x[0].style.width=x[0].style.height="9999px";k.dequeue().animate({width:a.w+v,height:a.h+u,top:w,left:H},{duration:i,complete:function(){f(this);A=false;x[0].style.width=a.w+v+z+"px";x[0].style.height=a.h+u+y+"px";d&&d()},step:function(){f(this)}})};e.resize=function(b){if(q){b=b||{};if(b.width)a.w=o(b.width,"x")-v-z;if(b.innerWidth)a.w=o(b.innerWidth,"x");m.css({width:a.w});if(b.height)a.h=o(b.height,"y")-u-y;if(b.innerHeight)a.h=o(b.innerHeight,"y");if(!b.innerHeight&&!b.height){b=m.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}m.css({height:a.h});e.position(a.transition==="none"?0:a.speed)}};e.prep=function(b){function d(w){var H,C,V,W,D=j.length,X=a.loop;e.position(w,function(){function aa(){B&&k[0].style.removeAttribute("filter")}if(q){B&&f&&m.fadeIn(100);if(a.iframe)c("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(B?" allowtransparency='true'":"")+"/>").appendTo(m).attr({src:a.href,id:"cboxIframe",name:(new Date).getTime()});m.show();O.show().html(a.title);if(D>1){N.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,D)).show();F[X||g<D-1?"show":"hide"]().html(a.next);E[X||g>0?"show":"hide"]().html(a.previous);H=g>0?j[g-1]:j[D-1];V=g<D-1?j[g+1]:j[0];if(a.slideshow){t.show();g===D-1&&!X&&k.is(".cboxSlideshow_on")&&t.click()}if(a.preloading){W=c(V).data(s).href||V.href;C=c(H).data(s).href||H.href;if(K(W))c("<img/>")[0].src=W;if(K(C))c("<img/>")[0].src=C}}G.hide();a.transition==="fade"?k.fadeTo(i,1,function(){aa()}):aa();n.bind("resize.cbox",function(){e.position(0)});c.event.trigger(Q);a.onComplete&&a.onComplete.call(h)}})}if(q){var f,i=a.transition==="none"?0:a.speed;n.unbind("resize.cbox");m.remove();m=c('<div id="cboxLoadedContent"/>').html(b);m.hide().appendTo(J).css({width:function(){a.w=a.w||m.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?"auto":"hidden"}).css({height:function(){a.h=a.h||m.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});M&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition==="fade"?k.fadeTo(i,0,function(){d(0)}):d(i)}};e.load=function(){var b,d,f,i=e.prep;A=l;h=j[g];a=c.extend({},c(h).data(s));Y();c.event.trigger(I);a.onLoad&&a.onLoad.call(h);a.h=a.height?o(a.height,"y")-u-y:a.innerHeight?o(a.innerHeight,"y"):false;a.w=a.width?o(a.width,"x")-v-z:a.innerWidth?o(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=o(a.maxWidth,"x")-v-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=o(a.maxHeight,"y")-u-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;G.show();if(a.inline){c('<div id="cboxInlineTemp"/>').hide().insertBefore(c(b)[0]).bind(I+" cbox_cleanup",function(){c(this).replaceWith(m.children())});i(c(b))}else if(a.iframe)i(" ");else if(a.html)i(a.html);else if(K(b)){d=new Image;d.onload=function(){var w;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){f=function(){d.height-=d.height*w;d.width-=d.width*w};if(a.mw&&d.width>a.mw){w=(d.width-a.mw)/d.width;f()}if(a.mh&&d.height>a.mh){w=(d.height-a.mh)/d.height;f()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";i(d);j.length>1&&c(d).css({cursor:"pointer"}).click(e.next);if(B)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div>Request unsuccessful.</div>").appendTo(J).load(b,function(){i(this)})};e.next=function(){if(!A){g=g<j.length-1?g+1:0;e.load()}};e.prev=function(){if(!A){g=g>0?g-1:j.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(Q,function(){f=setTimeout(e.next,a.slideshowSpeed)}).bind(I,function(){clearTimeout(f)}).one("click",function(){d()});k.removeClass(i+"off").addClass(i+"on")}var d,f,i="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(f);k.removeClass(i+"off "+i+"on")});d=function(){clearTimeout(f);t.text(a.slideshowStart).unbind(Q+" "+I).one("click",function(){b();f=setTimeout(e.next,a.slideshowSpeed)});k.removeClass(i+"on").addClass(i+"off")};if(a.slideshow&&j.length>1)a.slideshowAuto?b():d()};e.close=function(){if(q){q=false;c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(h);n.unbind(".cbox .cboxIE6");k.add(r).stop().fadeTo("fast",0,function(){c("#colorbox iframe").attr("src","about:blank");m.remove();k.add(r).css({opacity:1,cursor:"auto"}).hide();try{L.focus()}catch(b){}setTimeout(function(){c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(h)},1)})}};e.element=function(){return c(h)};e.settings=$;c(e.init)})(jQuery);;(function(a){a.extend({noticeAdd:function(c){var f={inEffect:{opacity:"show"},inEffectDuration:600,stayTime:3000,text:"",stay:false,type:"notice"};var c,g,e,d,b;c=a.extend({},f,c);g=(!a(".notice-wrap").length)?a("<div></div>").addClass("notice-wrap").appendTo("body"):a(".notice-wrap");e=a("<div></div>").addClass("notice-item-wrapper");d=a("<div></div>").hide().addClass("notice-item "+c.type).appendTo(g).html("<p>"+c.text+"</p>").animate(c.inEffect,c.inEffectDuration).wrap(e);b=a("<div></div>").addClass("notice-item-close").prependTo(d).html("x").click(function(){a.noticeRemove(d)});if(navigator.userAgent.match(/MSIE 6/i)){g.css({top:document.documentElement.scrollTop})}if(!c.stay){setTimeout(function(){a.noticeRemove(d)},c.stayTime)}},noticeRemove:function(b){b.animate({opacity:"0"},600,function(){b.parent().animate({height:"0px"},300,function(){b.parent().remove()})})}})})(jQuery);;eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([3-9a-zB-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){6 Z(f,3){4 7=n;f=b(f);4 5=b(document.createElement(\'div\')).B(3.10).B((3.p)?3.11:\'\').B((3.C)?3.12:\'\').13(3.q).appendTo(f);a(!3.14)5.t();o 5.r();a(!3.C){f.hover(6(c){7.t(c)},6(){7.r()});a(!3.p){f.mousemove(6(c){a(5.D(\'N\')!==\'u\')7.E(c)})}}o{f.click(6(c){a(c.15===f.16(0)){a(5.D(\'N\')!==\'u\')7.r();o 7.t()}});b(v).mousedown(6(c){a(5.D(\'N\')!==\'u\'){4 17=(3.O)?b(c.15).parents(\'.5\').andSelf().filter(6(){d n===5.16(0)}).length:0;a(17===0)7.r()}})};b.18(7,{getVersion:6(){d[1,2,0]},getParent:6(){d f},getTooltip:6(){d 5},getPos:6(){d 5.i()},19:6(8,9){4 e=f.i();a(s 8==\'F\')8=G(8)+e.k;a(s 9==\'F\')9=G(9)+e.l;5.D({k:8,l:9});d 7},t:6(c){3.1a.m(7);7.E((3.p)?P:c);Q(3.1b){g\'H\':5.fadeIn(3.I);h;g\'1c\':5.slideDown(3.I,7.E);h;g\'1d\':3.1e.m(5,3.I);h;w:g\'u\':5.t();h};5.B(3.R);3.1f.m(7);d 7},r:6(){3.1g.m(7);Q(3.1h){g\'H\':5.fadeOut(3.J);h;g\'1c\':5.slideUp(3.J);h;g\'1d\':3.1i.m(5,3.J);h;w:g\'u\':5.r();h};5.removeClass(3.R);3.1j.m(7);d 7},update:6(q){5.13(q);3.q=q;d 7},1k:6(1l,K){3.1m.m(7);5.1k(1l,K,6(){3.1n.m(7)});d 7},L:6(8,9){4 1o=8+5.S();4 1p=9+5.T();4 1q=b(v).width()+b(v).scrollLeft();4 1r=b(v).height()+b(v).scrollTop();d[(1o>=1q),(1p>=1r)]},E:6(c){4 x=5.S();4 y=5.T();a(!c&&3.p){a(3.j.constructor==Array){8=G(3.j[0]);9=G(3.j[1])}o a(b(3.j).attr(\'nodeType\')===1){4 i=b(3.j).i();8=i.k;9=i.l}o{4 e=f.i();4 z=f.S();4 M=f.T();Q(3.j){g\'l\':4 8=e.k-(x/2)+(z/2);4 9=e.l-y;h;g\'bottom\':4 8=e.k-(x/2)+(z/2);4 9=e.l+M;h;g\'k\':4 8=e.k-x;4 9=e.l-(y/2)+(M/2);h;g\'right\':4 8=e.k+z;4 9=e.l-(y/2)+(M/2);h;w:g\'w\':4 8=(z/2)+e.k+20;4 9=e.l;h}}}o{4 8=c.pageX;4 9=c.pageY};a(s 3.j!=\'object\'){8=8+3.i[0];9=9+3.i[1];a(3.L){4 U=7.L(8,9);a(U[0])8=8-(x/2)-(2*3.i[0]);a(U[1])9=9-(y/2)-(2*3.i[1])}}o{a(s 3.j[0]=="F")8=1s(8);a(s 3.j[1]=="F")9=1s(9)};7.19(8,9);d 7}})};b.fn.V=6(3){4 W=b(n).eq(s 3==\'number\'?3:0).K("V");a(W)d W;4 X={q:\'A simple 5\',C:1t,O:1t,14:Y,j:\'w\',i:[0,0],L:Y,p:Y,1b:\'H\',I:1u,1e:P,1h:\'H\',J:1u,1i:P,10:\'5\',R:\'active\',11:\'p\',12:\'C\',focusClass:\'O\',1a:6(){},1f:6(){},1g:6(){},1j:6(){},1m:6(){},1n:6(){}};b.18(X,3);n.each(6(){4 el=new Z(b(n),X);b(n).K("V",el)});d n}})();',[],93,'|||conf|var|tooltip|function|self|posX|posY|if|jQuery|event|return|elemPos|elem|case|break|offset|position|left|top|call|this|else|fixed|content|hide|typeof|show|none|window|default|tooltipWidth|tooltipHeight|elemWidth||addClass|persistent|css|updatePos|string|parseInt|fade|showTime|hideTime|data|boundryCheck|elemHeight|display|focus|null|switch|activeClass|outerWidth|outerHeight|overflow|simpletip|api|defaultConf|true|Simpletip|baseClass|fixedClass|persistentClass|html|hidden|target|get|check|extend|setPos|onBeforeShow|showEffect|slide|custom|showCustom|onShow|onBeforeHide|hideEffect|hideCustom|onHide|load|uri|beforeContentLoad|onContentLoad|newX|newY|windowWidth|windowHeight|String|false|150'.split('|'),0,{}));
/*
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.08 (02-MAR-2010)
 * Requires jQuery v1.3.2 or later
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Authors: Dave Methvin and Mike Alsup
 */
;(function($){var style=document.createElement('div').style;var moz=style['MozBorderRadius']!==undefined;var webkit=style['WebkitBorderRadius']!==undefined;var radius=style['borderRadius']!==undefined||style['BorderRadius']!==undefined;var mode=document.documentMode||0;var noBottomFold=$.browser.msie&&(($.browser.version<8&&!mode)||mode<8);var expr=$.browser.msie&&(function(){var div=document.createElement('div');try{div.style.setExpression('width','0+0');div.style.removeExpression('width');}
catch(e){return false;}
return true;})();function sz(el,p){return parseInt($.css(el,p))||0;};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s;};function gpc(node){for(;node&&node.nodeName.toLowerCase()!='html';node=node.parentNode){var v=$.css(node,'backgroundColor');if(v=='rgba(0, 0, 0, 0)')
continue;if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2]);}
if(v&&v!='transparent')
return v;}
return'#ffffff';};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dogfold':case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevelfold':case'bevel':return i+1;}};$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options);});}
return this;}
return this.each(function(index){var $this=$(this);var o=[$this.attr($.fn.corner.defaults.metaAttr)||'',options||''].join(' ').toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;var fx=((o.match(re)||['round'])[0]);var fold=/dogfold|bevelfold/.test(o);var edges={T:0,B:1};var opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)
opts={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&fx=='round'&&(radius||moz||webkit)&&!cc&&!sc){if(opts.TL)
$this.css(radius?'border-top-left-radius':moz?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',width+'px');if(opts.TR)
$this.css(radius?'border-top-right-radius':moz?'-moz-border-radius-topright':'-webkit-border-top-right-radius',width+'px');if(opts.BL)
$this.css(radius?'border-bottom-left-radius':moz?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',width+'px');if(opts.BR)
$this.css(radius?'border-bottom-right-radius':moz?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',width+'px');return;}
var strip=document.createElement('div');$(strip).css({overflow:'hidden',height:'1px',minHeight:'1px',fontSize:'1px',backgroundColor:sc||'transparent',borderStyle:'solid'});var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$(this).outerHeight();for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)
ds.setExpression('width','this.parentNode.offsetWidth');else
ds.width='100%';}
else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"');}
else
ds.width='100%';}
else{ds.position='relative';ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild);}
if(fold&&$.support.boxModel){if(bot&&noBottomFold)continue;for(var c in opts){if(!opts[c])continue;if(bot&&(c=='TL'||c=='TR'))continue;if(!bot&&(c=='BL'||c=='BR'))continue;var common={position:'absolute',border:'none',margin:0,padding:0,overflow:'hidden',backgroundColor:strip.style.borderColor};var $horz=$('<div/>').css(common).css({width:width+'px',height:'1px'});switch(c){case'TL':$horz.css({bottom:0,left:0});break;case'TR':$horz.css({bottom:0,right:0});break;case'BL':$horz.css({top:0,left:0});break;case'BR':$horz.css({top:0,right:0});break;}
d.appendChild($horz[0]);var $vert=$('<div/>').css(common).css({top:0,bottom:0,width:'1px',height:width+'px'});switch(c){case'TL':$vert.css({left:width});break;case'TR':$vert.css({right:width});break;case'BL':$vert.css({left:width});break;case'BR':$vert.css({right:width});break;}
d.appendChild($vert[0]);}}}}});};$.fn.uncorner=function(){if(radius||moz||webkit)
this.css(radius?'border-radius':moz?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this;};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'};})(jQuery);;var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();;var image1=new Image();image1.src="/i/up_border.png";var image2=new Image();image2.src="/i/down_border.png";var image3=new Image();image3.src="/i/closedoor.png";if(swfobject.hasFlashPlayerVersion("8.0.0")){var fn=function(){var att={data:"/swf/home-withdirectlink.swf",width:"679",height:"339"};var par={menu:"true",quality:"high",wmode:"transparent"};var id="mainFlash";var myObject=swfobject.createSWF(att,par,id);};swfobject.addDomLoadEvent(fn);}
$(document).ready(function(){$("a[href^=http]").each(function(){if(this.href.indexOf(location.hostname)==-1){$(this).attr({target:"_blank"});}});$.fn.colorbox.settings.current="фото {current} из {total}";$.fn.colorbox.settings.previous="&larr;";$.fn.colorbox.settings.next="&rarr;";$.fn.colorbox.settings.close="X";$.fn.colorbox.settings.maxWidth="90%";$.fn.colorbox.settings.maxHeight="90%";$.fn.colorbox.settings.transition="none";$(".colorbox").colorbox();$('.opas').css("opacity","0.75");$(".itemDesc").corner("10px");$(".upakovList").corner("7px");});$(".validate").validate({focusInvalid:true,errorClass:"input_error"});function tip(id){$("#tip"+id).simpletip({onBeforeShow:function(){var op1=$('#opendoor'+id).css('opacity');this.update('<div id="info_box"><img id="inf_up_border" src="/i/up_border.png" width="158" height="10" class=png /><div id="info_text"><p></p></div><img id="inf_down_border" src="/i/down_border.png" width="158" height="23" class=png /></div>');if(op1==1){$("#info_box p").append("\u041E\u0442\u043A\u0440\u044B\u0442\u044C");}else{$("#info_box p").append("\u0417\u0430\u043A\u0440\u044B\u0442\u044C");}},position:[0,30],fixed:true,showTime:10});}
function tipFav(id){$("#tipFav"+id).simpletip({onBeforeShow:function(){var fav_img_elementi=$("#tipFav"+id).find("img").attr("src");this.update('<div id="info_box"><img id="inf_up_border" src="/i/up_border.png" width="158" height="10" class=png /><div id="info_text"><p></p></div><img id="inf_down_border" src="/i/down_border.png" width="158" height="23" class=png /></div>');if(fav_img_elementi.src='/i/fav-a.png')
{$("#info_box p").append("\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435");}else{$("#info_box p").append("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E");}},position:[0,30],fixed:true,showTime:10});}
function opendor(id){if($('#opendoor'+id)!=null){var op=$('#opendoor'+id).css('opacity');if(op==1){$('#opendoor1'+id).attr("src","/i/closedoor.png");$("#info_box p").html("\u0417\u0430\u043A\u0440\u044B\u0442\u044C");$('#opendoor'+id).stop().fadeTo(0,1).fadeTo(1000,0.1);}
else{$('#opendoor1'+id).attr("src","/i/opendoor.png");$("#info_box p").html("\u041E\u0442\u043A\u0440\u044B\u0442\u044C");$('#opendoor'+id).stop().fadeTo(0,0.1).fadeTo(1000,1);}}}
function RadioLite(it){if($("#variant")!=null){$("#variant :input").parent().removeClass("a");}
it.parentNode.className="a";}
function callbackfunction_AddIntoCart(responseJS){sended_request=false;if(typeof responseJS!='undefined'){if(typeof responseJS.cart!='undefined'){var little_cart=document.getElementById('little_cart');if(little_cart){var span=document.createElement("span");span.style.display='none';span.innerHTML="Stupid IE. "+responseJS.cart;runScripts(span.getElementsByTagName('SCRIPT'));little_cart.innerHTML=responseJS.cart;}else{alert('Ошибка! Краткая корзина не найдена');}}}}
function AddIntoCart(shop_path,item_id,item_count){if(document.variant){theGroup=document.variant.value;for(i=0;i<theGroup.length;i++){if(theGroup[i].checked){var item_id=theGroup[i].value;}}}
cmsrequest=shop_path+'cart/?ajax_add_item_id='+item_id+'&count='+item_count;sendRequest(cmsrequest,'get',callbackfunction_AddIntoCart);return false;}
function addtocart(id){AddIntoCart('/ru/catalog/',id,1);var img=jQuery('#opendoor'+id),pos=img.offset();var tr=jQuery('<div class="effect-transfer"/>').appendTo('body').append(img.clone()).css({top:pos.top,left:pos.left,height:img.outerHeight(),width:img.outerWidth()});var cart=jQuery('#little_cart #cart_ico'),pos=cart.offset();tr.animate({top:pos.top,left:pos.left,height:cart.outerHeight(),width:cart.outerWidth()},1000,function(){jQuery.noticeAdd({text:'<h5>\u041A\u043E\u0440\u0437\u0438\u043D\u0430</h5>\u0422\u043E\u0432\u0430\u0440 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443!<br /><a href="/ru/catalog/cart"><b>\u041F\u0435\u0440\u0435\u0439\u0442\u0438</b></a>&nbsp;&nbsp;\u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430.',stay:false,inEffectDuration:250,stayTime:4000});$(this).remove();});return!1;}
function callbackfunction_ToggleFav(responseJS){sended_request=false;if(typeof responseJS!='undefined'){if(typeof responseJS.result!='undefined'){var fav_result=responseJS.result;var fav_id=responseJS.id;var favs_count=responseJS.count;var fav_img_element=document.getElementById('add2fav'+fav_id);if(fav_img_element){if(fav_result==1){fav_img_element.src='/i/fav-a.png';$("#info_box p").html("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E");}else{fav_img_element.src='/i/fav-p.png';$("#info_box p").html("\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435");}}
var fav_info_element=document.getElementById('favs_counter');if(fav_info_element){fav_info_element.innerHTML=favs_count;}}}}
function toggle_fav(item_id,shop_path){cmsrequest=shop_path+'cart/?ajax_postpone_item_id='+item_id;sendRequest(cmsrequest,'get',callbackfunction_ToggleFav);return false;};function JsHttpRequest(){var t=this;t.onreadystatechange=null;t.readyState=0;t.responseText=null;t.responseXML=null;t.status=200;t.statusText="OK";t.responseJS=null;t.caching=false;t.loader=null;t.session_name="PHPSESSID";t._ldObj=null;t._reqHeaders=[];t._openArgs=null;t._errors={inv_form_el:'Invalid FORM element detected: name=%, tag=%',must_be_single_el:'If used, <form> must be a single HTML element in the list.',js_invalid:'JavaScript code generated by backend is invalid!\n%',url_too_long:'Cannot use so long query with GET request (URL is larger than % bytes)',unk_loader:'Unknown loader: %',no_loaders:'No loaders registered at all, please check JsHttpRequest.LOADERS array',no_loader_matched:'Cannot find a loader which may process the request. Notices are:\n%'}
t.abort=function(){with(this){if(_ldObj&&_ldObj.abort)_ldObj.abort();_cleanup();if(readyState==0){return;}
if(readyState==1&&!_ldObj){readyState=0;return;}
_changeReadyState(4,true);}}
t.open=function(method,url,asyncFlag,username,password){with(this){if(url.match(/^((\w+)\.)?(GET|POST)\s+(.*)/i)){this.loader=RegExp.$2?RegExp.$2:null;method=RegExp.$3;url=RegExp.$4;}
try{if(document.location.search.match(new RegExp('[&?]'+session_name+'=([^&?]*)'))||document.cookie.match(new RegExp('(?:;|^)\\s*'+session_name+'=([^;]*)'))){url+=(url.indexOf('?')>=0?'&':'?')+session_name+"="+this.escape(RegExp.$1);}}catch(e){}
_openArgs={method:(method||'').toUpperCase(),url:url,asyncFlag:asyncFlag,username:username!=null?username:'',password:password!=null?password:''}
_ldObj=null;_changeReadyState(1,true);return true;}}
t.send=function(content){if(!this.readyState){return;}
this._changeReadyState(1,true);this._ldObj=null;var queryText=[];var queryElem=[];if(!this._hash2query(content,null,queryText,queryElem))return;var hash=null;if(this.caching&&!queryElem.length){hash=this._openArgs.username+':'+this._openArgs.password+'@'+this._openArgs.url+'|'+queryText+"#"+this._openArgs.method;var cache=JsHttpRequest.CACHE[hash];if(cache){this._dataReady(cache[0],cache[1]);return false;}}
var loader=(this.loader||'').toLowerCase();if(loader&&!JsHttpRequest.LOADERS[loader])return this._error('unk_loader',loader);var errors=[];var lds=JsHttpRequest.LOADERS;for(var tryLoader in lds){var ldr=lds[tryLoader].loader;if(!ldr)continue;if(loader&&tryLoader!=loader)continue;var ldObj=new ldr(this);JsHttpRequest.extend(ldObj,this._openArgs);JsHttpRequest.extend(ldObj,{queryText:queryText.join('&'),queryElem:queryElem,id:(new Date().getTime())+""+JsHttpRequest.COUNT++,hash:hash,span:null});var error=ldObj.load();if(!error){this._ldObj=ldObj;JsHttpRequest.PENDING[ldObj.id]=this;return true;}
if(!loader){errors[errors.length]='- '+tryLoader.toUpperCase()+': '+this._l(error);}else{return this._error(error);}}
return tryLoader?this._error('no_loader_matched',errors.join('\n')):this._error('no_loaders');}
t.getAllResponseHeaders=function(){with(this){return _ldObj&&_ldObj.getAllResponseHeaders?_ldObj.getAllResponseHeaders():[];}}
t.getResponseHeader=function(label){with(this){return _ldObj&&_ldObj.getResponseHeader?_ldObj.getResponseHeader(label):null;}}
t.setRequestHeader=function(label,value){with(this){_reqHeaders[_reqHeaders.length]=[label,value];}}
t._dataReady=function(text,js){with(this){if(caching&&_ldObj)JsHttpRequest.CACHE[_ldObj.hash]=[text,js];responseText=responseXML=text;responseJS=js;if(js!==null){status=200;statusText="OK";}else{status=500;statusText="Internal Server Error";}
_changeReadyState(2);_changeReadyState(3);_changeReadyState(4);_cleanup();}}
t._l=function(args){var i=0,p=0,msg=this._errors[args[0]];while((p=msg.indexOf('%',p))>=0){var a=args[++i]+"";msg=msg.substring(0,p)+a+msg.substring(p+1,msg.length);p+=1+a.length;}
return msg;}
t._error=function(msg){msg=this._l(typeof(msg)=='string'?arguments:msg)
msg="JsHttpRequest: "+msg;if(!window.Error){throw msg;}else if((new Error(1,'test')).description=="test"){throw new Error(1,msg);}else{throw new Error(msg);}}
t._hash2query=function(content,prefix,queryText,queryElem){if(prefix==null)prefix="";if((''+typeof(content)).toLowerCase()=='object'){var formAdded=false;if(content&&content.parentNode&&content.parentNode.appendChild&&content.tagName&&content.tagName.toUpperCase()=='FORM'){content={form:content};}
for(var k in content){var v=content[k];if(v instanceof Function)continue;var curPrefix=prefix?prefix+'['+this.escape(k)+']':this.escape(k);var isFormElement=v&&v.parentNode&&v.parentNode.appendChild&&v.tagName;if(isFormElement){var tn=v.tagName.toUpperCase();if(tn=='FORM'){formAdded=true;}else if(tn=='INPUT'||tn=='TEXTAREA'||tn=='SELECT'){}else{return this._error('inv_form_el',(v.name||''),v.tagName);}
queryElem[queryElem.length]={name:curPrefix,e:v};}else if(v instanceof Object){this._hash2query(v,curPrefix,queryText,queryElem);}else{if(v===null)continue;if(v===true)v=1;if(v===false)v='';queryText[queryText.length]=curPrefix+"="+this.escape(''+v);}
if(formAdded&&queryElem.length>1){return this._error('must_be_single_el');}}}else{queryText[queryText.length]=content;}
return true;}
t._cleanup=function(){var ldObj=this._ldObj;if(!ldObj)return;JsHttpRequest.PENDING[ldObj.id]=false;var span=ldObj.span;if(!span)return;ldObj.span=null;var closure=function(){span.parentNode.removeChild(span);}
JsHttpRequest.setTimeout(closure,50);}
t._changeReadyState=function(s,reset){with(this){if(reset){status=statusText=responseJS=null;responseText='';}
readyState=s;if(onreadystatechange)onreadystatechange();}}
t.escape=function(s){return escape(s).replace(new RegExp('\\+','g'),'%2B');}}
JsHttpRequest.COUNT=0;JsHttpRequest.MAX_URL_LEN=2000;JsHttpRequest.CACHE={};JsHttpRequest.PENDING={};JsHttpRequest.LOADERS={};JsHttpRequest._dummy=function(){};JsHttpRequest.TIMEOUTS={s:window.setTimeout,c:window.clearTimeout};JsHttpRequest.setTimeout=function(func,dt){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.s;if(typeof(func)=="string"){id=window.JsHttpRequest_tmp(func,dt);}else{var id=null;var mediator=function(){func();delete JsHttpRequest.TIMEOUTS[id];}
id=window.JsHttpRequest_tmp(mediator,dt);JsHttpRequest.TIMEOUTS[id]=mediator;}
window.JsHttpRequest_tmp=null;return id;}
JsHttpRequest.clearTimeout=function(id){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.c;delete JsHttpRequest.TIMEOUTS[id];var r=window.JsHttpRequest_tmp(id);window.JsHttpRequest_tmp=null;return r;}
JsHttpRequest.query=function(url,content,onready,nocache){var req=new this();req.caching=!nocache;req.onreadystatechange=function(){if(req.readyState==4){onready(req.responseJS,req.responseText);}}
req.open(null,url,true);req.send(content);}
JsHttpRequest.dataReady=function(d){var th=this.PENDING[d.id];delete this.PENDING[d.id];if(th){th._dataReady(d.text,d.js);}else if(th!==false){throw"dataReady(): unknown pending id: "+d.id;}}
JsHttpRequest.extend=function(dest,src){for(var k in src)dest[k]=src[k];}
JsHttpRequest.LOADERS.xml={loader:function(req){JsHttpRequest.extend(req._errors,{xml_no:'Cannot use XMLHttpRequest or ActiveX loader: not supported',xml_no_diffdom:'Cannot use XMLHttpRequest to load data from different domain %',xml_no_headers:'Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported, needed to work with encodings correctly',xml_no_form_upl:'Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented'});this.load=function(){if(this.queryElem.length)return['xml_no_form_upl'];if(this.url.match(new RegExp('^([a-z]+://[^\\/]+)(.*)','i'))){if(RegExp.$1.toLowerCase()!=document.location.protocol+'//'+document.location.hostname.toLowerCase()){return['xml_no_diffdom',RegExp.$1];}}
var xr=null;if(window.XMLHttpRequest){try{xr=new XMLHttpRequest()}catch(e){}}else if(window.ActiveXObject){try{xr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}
if(!xr)try{xr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}}
if(!xr)return['xml_no'];var canSetHeaders=window.ActiveXObject||xr.setRequestHeader;if(!this.method)this.method=canSetHeaders&&this.queryText.length?'POST':'GET';if(this.method=='GET'){if(this.queryText)this.url+=(this.url.indexOf('?')>=0?'&':'?')+this.queryText;this.queryText='';if(this.url.length>JsHttpRequest.MAX_URL_LEN)return['url_too_long',JsHttpRequest.MAX_URL_LEN];}else if(this.method=='POST'&&!canSetHeaders){return['xml_no_headers'];}
this.url+=(this.url.indexOf('?')>=0?'&':'?')+'JsHttpRequest='+(req.caching?'0':this.id)+'-xml';var id=this.id;xr.onreadystatechange=function(){if(xr.readyState!=4)return;xr.onreadystatechange=JsHttpRequest._dummy;req.status=null;try{req.status=xr.status;req.responseText=xr.responseText;}catch(e){}
if(!req.status)return;try{eval('JsHttpRequest._tmp = function(id) { var d = '+req.responseText+'; d.id = id; JsHttpRequest.dataReady(d); }');}catch(e){return req._error('js_invalid',req.responseText)}
JsHttpRequest._tmp(id);JsHttpRequest._tmp=null;};xr.open(this.method,this.url,true,this.username,this.password);if(canSetHeaders){for(var i=0;i<req._reqHeaders.length;i++){xr.setRequestHeader(req._reqHeaders[i][0],req._reqHeaders[i][1]);}
xr.setRequestHeader('Content-Type','application/octet-stream');}
xr.send(this.queryText);this.span=null;this.xr=xr;return null;}
this.getAllResponseHeaders=function(){return this.xr.getAllResponseHeaders();}
this.getResponseHeader=function(label){return this.xr.getResponseHeader(label);}
this.abort=function(){this.xr.abort();this.xr=null;}}}
JsHttpRequest.LOADERS.script={loader:function(req){JsHttpRequest.extend(req._errors,{script_only_get:'Cannot use SCRIPT loader: it supports only GET method',script_no_form:'Cannot use SCRIPT loader: direct form elements using and uploading are not implemented'})
this.load=function(){if(this.queryText)this.url+=(this.url.indexOf('?')>=0?'&':'?')+this.queryText;this.url+=(this.url.indexOf('?')>=0?'&':'?')+'JsHttpRequest='+this.id+'-'+'script';this.queryText='';if(!this.method)this.method='GET';if(this.method!=='GET')return['script_only_get'];if(this.queryElem.length)return['script_no_form'];if(this.url.length>JsHttpRequest.MAX_URL_LEN)return['url_too_long',JsHttpRequest.MAX_URL_LEN];var th=this,d=document,s=null,b=d.body;if(!window.opera){this.span=s=d.createElement('SCRIPT');var closure=function(){s.language='JavaScript';if(s.setAttribute)s.setAttribute('src',th.url);else s.src=th.url;b.insertBefore(s,b.lastChild);}}else{this.span=s=d.createElement('SPAN');s.style.display='none';b.insertBefore(s,b.lastChild);s.innerHTML='Workaround for IE.<s'+'cript></'+'script>';var closure=function(){s=s.getElementsByTagName('SCRIPT')[0];s.language='JavaScript';if(s.setAttribute)s.setAttribute('src',th.url);else s.src=th.url;}}
JsHttpRequest.setTimeout(closure,10);return null;}}}
JsHttpRequest.LOADERS.form={loader:function(req){JsHttpRequest.extend(req._errors,{form_el_not_belong:'Element "%" does not belong to any form!',form_el_belong_diff:'Element "%" belongs to a different form. All elements must belong to the same form!',form_el_inv_enctype:'Attribute "enctype" of the form must be "%" (for IE), "%" given.'})
this.load=function(){var th=this;if(!th.method)th.method='POST';th.url+=(th.url.indexOf('?')>=0?'&':'?')+'JsHttpRequest='+th.id+'-'+'form';if(th.method=='GET'){if(th.queryText)th.url+=(th.url.indexOf('?')>=0?'&':'?')+th.queryText;if(th.url.length>JsHttpRequest.MAX_URL_LEN)return['url_too_long',JsHttpRequest.MAX_URL_LEN];var p=th.url.split('?',2);th.url=p[0];th.queryText=p[1]||'';}
var form=null;var wholeFormSending=false;if(th.queryElem.length){if(th.queryElem[0].e.tagName.toUpperCase()=='FORM'){form=th.queryElem[0].e;wholeFormSending=true;th.queryElem=[];}else{form=th.queryElem[0].e.form;for(var i=0;i<th.queryElem.length;i++){var e=th.queryElem[i].e;if(!e.form){return['form_el_not_belong',e.name];}
if(e.form!=form){return['form_el_belong_diff',e.name];}}}
if(th.method=='POST'){var need="multipart/form-data";var given=(form.attributes.encType&&form.attributes.encType.nodeValue)||(form.attributes.enctype&&form.attributes.enctype.value)||form.enctype;if(given!=need){return['form_el_inv_enctype',need,given];}}}
var d=form&&(form.ownerDocument||form.document)||document;var ifname='jshr_i_'+th.id;var s=th.span=d.createElement('DIV');s.style.position='absolute';s.style.display='none';s.style.visibility='hidden';s.innerHTML=(form?'':'<form'+(th.method=='POST'?' enctype="multipart/form-data" method="post"':'')+'></form>')+'<iframe name="'+ifname+'" id="'+ifname+'" style="width:0px; height:0px; overflow:hidden; border:none"></iframe>'
if(!form){form=th.span.firstChild;}
d.body.insertBefore(s,d.body.lastChild);var setAttributes=function(e,attr){var sv=[];var form=e;if(e.mergeAttributes){var form=d.createElement('form');form.mergeAttributes(e,false);}
for(var i=0;i<attr.length;i++){var k=attr[i][0],v=attr[i][1];sv[sv.length]=[k,form.getAttribute(k)];form.setAttribute(k,v);}
if(e.mergeAttributes){e.mergeAttributes(form,false);}
return sv;}
var closure=function(){top.JsHttpRequestGlobal=JsHttpRequest;var savedNames=[];if(!wholeFormSending){for(var i=0,n=form.elements.length;i<n;i++){savedNames[i]=form.elements[i].name;form.elements[i].name='';}}
var qt=th.queryText.split('&');for(var i=qt.length-1;i>=0;i--){var pair=qt[i].split('=',2);var e=d.createElement('INPUT');e.type='hidden';e.name=unescape(pair[0]);e.value=pair[1]!=null?unescape(pair[1]):'';form.appendChild(e);}
for(var i=0;i<th.queryElem.length;i++){th.queryElem[i].e.name=th.queryElem[i].name;}
var sv=setAttributes(form,[['action',th.url],['method',th.method],['onsubmit',null],['target',ifname]]);form.submit();setAttributes(form,sv);for(var i=0;i<qt.length;i++){form.lastChild.parentNode.removeChild(form.lastChild);}
if(!wholeFormSending){for(var i=0,n=form.elements.length;i<n;i++){form.elements[i].name=savedNames[i];}}}
JsHttpRequest.setTimeout(closure,100);return null;}}};if(typeof HostcmsEscape=='undefined')
{function HostcmsEscape(str)
{return encodeURIComponent(str);}}
document.onkeydown=DoKeyDown;function DoKeyDown(event)
{if(!document.getElementById)
{return;}
if(window.event)
{event=window.event;}
if(event.ctrlKey)
{var Element=null;switch(event.keyCode?event.keyCode:event.which?event.which:null)
{case 0x25:Element=document.getElementById('id_prev');break;case 0x27:Element=document.getElementById('id_next');break;}
if(Element&&Element.href)
{document.location=Element.href;}}}
function DisableTinyMCE()
{if(typeof tinyMCE!='undefined')
{textarea_array=document.getElementsByTagName("textarea");for(var i=0;i<textarea_array.length;i++)
{var elementId=textarea_array[i].id;if(tinyMCE.getInstanceById(elementId)!=null)
{textarea_array[i].disabled=true;tinyMCE.execCommand('mceRemoveControl',false,elementId);}}}}
function runScripts(scripts)
{if(!scripts)
{return false;}
for(var i=0;i<scripts.length;i++)
{var thisScript=scripts[i];var text;if(thisScript.src)
{var newScript=document.createElement("script");newScript.type=thisScript.type;newScript.language=thisScript.language;newScript.src=thisScript.src;document.getElementsByTagName('head')[0].appendChild(newScript);}
else if(text=(thisScript.text||thisScript.innerHTML))
{var text=(""+text).replace(/^\s*<!\-\-/,'').replace(/\-\->\s*$/,'');var newScript=document.createElement("script");newScript.setAttribute("type","text/javascript");newScript.text=text;var script_node=document.getElementsByTagName('head')[0].appendChild(newScript);}}}
function sendRequest(action,method,callback_function)
{var req=new JsHttpRequest();ShowLoadingScreen();req.onreadystatechange=function()
{if(req.readyState==4)
{HideLoadingScreen();if(typeof callback_function!='undefined')
{callback_function(req.responseJS);}
return true;}}
req.open(method,action,true);req.send(null);}
function AjaxSendForm(callback_function,AAdditionalParams,ButtonObject)
{var FormNode=ButtonObject.parentNode;while(FormNode.nodeName.toLowerCase()!='form')
{var FormNode=FormNode.parentNode;}
FormID=FormNode.id;var HiddenInput=document.getElementById(ButtonObject.name);if(null==HiddenInput&&undefined==HiddenInput||HiddenInput.type!='hidden')
{var ElementInput=document.createElement("input");ElementInput.setAttribute("type","hidden");ElementInput.setAttribute("id",ButtonObject.name);ElementInput.setAttribute("name",ButtonObject.name);var InputNode=FormNode.appendChild(ElementInput);}
if(typeof tinyMCE!='undefined')
{tinyMCE.triggerSave();}
var JsHttpRequestSendForm=new JsHttpRequest();JsHttpRequestSendForm.onreadystatechange=function()
{if(JsHttpRequestSendForm.readyState==4)
{HideLoadingScreen();if(typeof callback_function!='undefined')
{callback_function(JsHttpRequestSendForm.responseJS);}
return true;}}
var FormAction=FormNode.attributes['action'].value;var FormMethod=FormNode.getAttribute('method');FormAction+=(FormAction.indexOf('?')>=0?'&':'?')+AAdditionalParams;JsHttpRequestSendForm.open(FormMethod,FormAction,true);JsHttpRequestSendForm.send({query:FormNode});ShowLoadingScreen();return false;}
function ShowLoadingScreen()
{$("body").css("cursor","wait");var fade_div=$("#id_admin_forms_fade");if(fade_div.length==0)
{fade_div=$('<div></div>').appendTo(document.body).hide().attr('id',"id_admin_forms_fade").attr('className',"shadowed").applyShadow().css('z-index',"1500").css('position',"absolute").css('left',"50%").css('top',"50%").append('<img src="/hostcmsfiles/images/ajax_loader.gif" id="id_fade_div_img" />').css('width',"32");}
fade_div.show().css('top',($(window).height()-fade_div.outerHeight(true))/2+$(window).scrollTop()).css('left',($(window).width()-fade_div.outerWidth(true))/2+$(window).scrollLeft());}
function HideLoadingScreen()
{$("body").css("cursor","auto");$("#id_admin_forms_fade").css('display','none');}
function AddLoadFileField(container_id,inpit_prefix)
{cbItem=document.getElementById(container_id);if(cbItem)
{element_array=cbItem.getElementsByTagName("input");count_input=element_array.length;var ElementBr=document.createElement("br");cbItem.appendChild(ElementBr);var ElementInput=document.createElement("input");ElementInput.setAttribute("size","30");ElementInput.setAttribute("name",inpit_prefix+(count_input+1));ElementInput.setAttribute("type","file");ElementInput.setAttribute("title","Прикрепить файл");cbItem.appendChild(ElementInput);}}
function sendBackgroundRequest(action,method,callback_function)
{var req=new JsHttpRequest();req.onreadystatechange=function()
{if(req.readyState==4)
{if(typeof callback_function!='undefined')
{callback_function(req.responseJS);}
return true;}}
req.open(method,action,true);req.send(null);ShowLoadingScreen();};(function($){var cache=[];$.extend({preLoadImages:function()
{var args_len=arguments.length;for(var i=args_len;i--;)
{var cacheImage=document.createElement('img');cacheImage.src=arguments[i];cache.push(cacheImage);}}});$.preLoadImages("/hostcmsfiles/images/shadow-b.png","/hostcmsfiles/images/shadow-l.png","/hostcmsfiles/images/shadow-lb.png","/hostcmsfiles/images/shadow-lt.png","/hostcmsfiles/images/shadow-r.png","/hostcmsfiles/images/shadow-rb.png","/hostcmsfiles/images/shadow-rt.png","/hostcmsfiles/images/shadow-t.png","/hostcmsfiles/images/ajax_loader.gif");$.fn.extend({applyShadow:function()
{return this.each(function(index,object){var obj=$(object);$('<div>').attr("class",'tl').appendTo(obj);$('<div>').attr("class",'t').height(15).appendTo(obj);$('<div>').attr("class",'tr').appendTo(obj);$('<div>').attr("class",'l').width(17).appendTo(obj);$('<div>').attr("class",'r').width(17).appendTo(obj);$('<div>').attr("class",'bl').appendTo(obj);$('<div>').attr("class",'b').height(21).appendTo(obj);$('<div>').attr("class",'br').appendTo(obj);});}});})(jQuery)
function set_count_mod(input_id,step)
{var oCountMod=document.getElementById(input_id);if(!(iCurrCount=parseInt(oCountMod.value))){iCurrCount=0;}
if(!(iCurrCount<=0&&step<0)){oCountMod.value=iCurrCount+step;}}
function SlideWindow(windowId)
{var windowDiv=document.getElementById(windowId);if(windowDiv==undefined)
{return false;}
if(windowDiv.style.display=="block")
{HideWindow(windowId);}
else
{ShowWindow(windowId);}}
function deleteChildNodes(node_id)
{var node=document.getElementById(node_id);if(node!==undefined)
{if(node.hasChildNodes())
{while(node.firstChild)
{node.removeChild(node.firstChild);}}}}
function doSetLocation(shop_country_id,path)
{var req=new JsHttpRequest();ShowLoadingScreen();req.onreadystatechange=function()
{if(req.readyState==4)
{HideLoadingScreen();if(req.responseJS!=undefined)
{if(req.responseJS.result!=undefined)
{oSelect=document.getElementById(location_select_id);oSelect.options.length=0;oSelect.options[oSelect.options.length]=new Option(" ... ",0);for(var key in req.responseJS.result)
{oSelect.options[oSelect.options.length]=new Option(req.responseJS.result[key],key);if(key==2)
{oSelect.selectedIndex=oSelect.options.length-1;}}
doSetCity(oSelect.options[oSelect.selectedIndex].value,path);oCity=document.getElementById(city_select_id);oCity.options.length=0;oCity.options[oCity.options.length]=new Option(" ... ",0);oCityarea=document.getElementById(cityarea_select_id);oCityarea.options.length=0;oCityarea.options[oCityarea.options.length]=new Option(" ... ",0);}}
return true;}}
req.open('get',path+"?action=get_location&shop_country_id="+shop_country_id,true);req.send(null);}
function doSetCity(shop_location_id,path)
{var req=new JsHttpRequest();ShowLoadingScreen();req.onreadystatechange=function()
{if(req.readyState==4)
{HideLoadingScreen();if(req.responseJS!=undefined)
{if(req.responseJS.result!=undefined)
{oSelect=document.getElementById(city_select_id);oSelect.options.length=0;oSelect.options[oSelect.options.length]=new Option(" ... ",0);for(var key in req.responseJS.result)
{oSelect.options[oSelect.options.length]=new Option(req.responseJS.result[key],key);if(key==173)
{oSelect.selectedIndex=oSelect.options.length-1;}}
doSetCityArea(oSelect.options[oSelect.selectedIndex].value,path);oCityarea=document.getElementById(cityarea_select_id);oCityarea.options.length=0;oCityarea.options[oCityarea.options.length]=new Option(" ... ",0);}}
return true;}}
req.open('get',path+"?action=get_city&shop_location_id="+shop_location_id,true);req.send(null);}
function doSetCityArea(shop_city_id,path)
{var req=new JsHttpRequest();ShowLoadingScreen();req.onreadystatechange=function()
{if(req.readyState==4)
{HideLoadingScreen();if(req.responseJS!=undefined)
{if(req.responseJS.result!=undefined)
{oSelect=document.getElementById(cityarea_select_id);oSelect.options.length=0;oSelect.options[oSelect.options.length]=new Option(" ... ",0);for(var key in req.responseJS.result)
{oSelect.options[oSelect.options.length]=new Option(req.responseJS.result[key],key);}}}
return true;}}
req.open('get',path+"?action=get_cityarea&shop_city_id="+shop_city_id,true);req.send(null);}
function GetStyle(drag_object,axis)
{var str_value="";if(document.defaultView&&document.defaultView.getComputedStyle)
{var css=document.defaultView.getComputedStyle(drag_object,null);str_value=css?css.getPropertyValue(axis):null;}
else if(drag_object.currentStyle)
{str_value=drag_object.currentStyle[axis];if(str_value=='auto')
{if(axis=='top')
{str_value=drag_object.offsetTop;}
else
{str_value=drag_object.offsetLeft;}}}
return str_value;}
function Draggable(drag_object)
{var xDelta=0,yDelta=0,xStart=0,yStart=0;function EndDrag()
{document.onmouseup=null;document.onmousemove=null;}
function Drag(drag_event)
{drag_event=drag_event||window.event;xDelta=xStart-parseInt(drag_event.clientX);yDelta=yStart-parseInt(drag_event.clientY);xStart=parseInt(drag_event.clientX);yStart=parseInt(drag_event.clientY);drag_object.style.top=(parseInt(drag_object.style.top)-yDelta)+'px';drag_object.style.left=(parseInt(drag_object.style.left)-xDelta)+'px';}
function StartDrag(drag_event)
{drag_event=drag_event||window.event;xStart=parseInt(drag_event.clientX);yStart=parseInt(drag_event.clientY);drag_object.style.top=parseInt(GetStyle(drag_object,'top'))+'px';drag_object.style.left=parseInt(GetStyle(drag_object,'left'))+'px';document.onmouseup=EndDrag;document.onmousemove=Drag;return false;}
drag_object.onmousedown=StartDrag;}
function SetGradeMessage(message_id,grade_val)
{var req=new JsHttpRequest();ShowLoadingScreen();req.onreadystatechange=function()
{if(req.readyState==4)
{HideLoadingScreen();return true;}}
req.open('get',"./?action=set_message_grade&helpdesk_message_id="+message_id+"&grade="+grade_val,true);req.send(null);}
function ReNewCaptcha(captchaKey,captchaHeight)
{if(document.images['captcha']!=undefined)
{var antiCache=Math.floor(Math.random()*100000);document.images['captcha'].src="/captcha.php?get_captcha="+captchaKey+"&height="+captchaHeight+"&anc="+antiCache;}}
function ReNewCaptchaById(imageId,captchaKey,captchaHeight)
{var captchaObject=document.getElementById(imageId);if(null!=captchaObject&&undefined!==captchaObject)
{var antiCache=Math.floor(Math.random()*100000);captchaObject.src="/captcha.php?get_captcha="+captchaKey+"&height="+captchaHeight+"&anc="+antiCache;}}
function ShowHide(divId)
{var windowDiv=document.getElementById(divId);if(windowDiv==undefined)
{return false;}
if(windowDiv.style.display=="block")
{windowDiv.style.display='none';}
else
{windowDiv.style.display='block';}}
function callbackfunction_showFormAddItem(responseJS)
{if(typeof responseJS!='undefined')
{HideLoadingScreen();if(typeof responseJS.result!='undefined')
{html=responseJS.result;document.getElementById('AddItemForm').innerHTML=html;runScripts(document.getElementById('AddItemForm').getElementsByTagName('SCRIPT'));var div_id_message=document.getElementById('AddItemMessage');if(div_id_message)
{div_id_message.innerHTML='';}}}}
function callbackfunction_SendFormItem(responseJS)
{if(typeof responseJS!='undefined')
{if(responseJS.message!='undefined')
{var div_id_message=document.getElementById('AddItemMessage');if(div_id_message)
{div_id_message.innerHTML=responseJS.message;runScripts(div_id_message.getElementsByTagName('SCRIPT'));window.location.href=(window.location.href.indexOf('#')>=0?window.location.href:window.location.href+'#FocusAddItemMessage');}}}}
function ShowImgWindow(title,src,width,height)
{obj=window.open("","","scrollbars=0,dialog=0,minimizable=1,modal=1,width="+width+",height="+height+",resizable=0");obj.document.write("<html>");obj.document.write("<head>");obj.document.write("<title>"+title+"</title>");obj.document.write("</head>");obj.document.write("<body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>");obj.document.write("<img src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" />");obj.document.write("</body>");obj.document.write("</html>");obj.document.close();}
function getElementsByName_iefix(tag,name)
{var elem=document.getElementsByTagName(tag);var arr=new Array();var iarr=0;for(i=0;i<elem.length;i++)
{att=elem[i].getAttribute("name");if(att==name)
{arr[iarr]=elem[i];iarr++;}}
return arr;}
function changeHeightFloatBlockBorder(oBorder,iHeightAttribute,iStyleTop)
{var iElementHeight=0;for(i=0;i<oBorder.length;i++)
{iElementHeight=oBorder[i].parentNode.offsetHeight+iHeightAttribute;if(iElementHeight>0)
{oBorder[i].style.height=iElementHeight+'px';oBorder[i].style.top=iStyleTop+'px';}}}
function HideShow(id,id1)
{$("#"+id).css('display','none');$("#"+id1).css('display','block');}
function ShowForums(up,id,count)
{var down,up;if(up==0)
{down="none";up="";}
else
{down="";up="none";}
$("#down_"+id).css('display',down);$("#up_"+id).css('display',up);for(var i=1;i<=count;i++)
{$("#"+id+"_"+i).css('display',up);}}
