
(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={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]};})(jQuery);(function($){var Menu=function(el,settings){var $menu=$(el);var $container=$(settings.container);var menuLeftOffset=$menu.offset().left;var menuTopOffset=$menu.offset().top;var showInner=function(){var self=this;var $parent=$(this).parent();var $inner=$(this).children('div');this.position=function()
{var vertical=false;for(var i=0;i<settings.vertical.length;i++)
{if($inner.is(settings.vertical[i]))
{vertical=true;if(($inner.width()+$(self).offset().left)>$container.width()+$container.offset().left)
{$inner.css({left:$(self).width()-$inner.width()-1});}
else
{$inner.css({left:-1});}}}
if(!vertical)
{for(var i=0;i<settings.horizontal.length;i++)
{if($inner.is(settings.horizontal[i]))
{if(($inner.width()+$(self).width()+$(self).offset().left)>$container.width()+$container.offset().left)
{$inner.css({left:-($inner.width()+settings.rightOffset-1),top:0});}
else
{$inner.css({left:$parent.width()+settings.leftOffset,top:0});}}}}
if(settings.iframe)
{$inner.bgiframe();}};if(typeof this.timer!='undefined'&&typeof this.$inner!='undefined')
{clearTimeout(this.timer);}
else
{self.$inner=$inner;this.timer=false;this.resized=false;var width=self.$inner.width();$inner.children('ul').children('li').each(function(){$(this).width(width);});this.position();$inner.mousemove(function(){showInner.apply(self)});}
if(typeof this.resized=='undefined'||this.resized){this.resized=false;this.position();}
$(self).addClass('opened');if(settings.showAnimation&&!$.browser.msie)
{this.$inner.slideDown(settings.showAnimation);}
else
{this.$inner.show();}};var hideInner=function()
{var self=this;var $inner=this.$inner;if(!$inner)
return;var hide=function()
{if(settings.hideAnimation&&!$.browser.msie)
{$inner.slideUp(settings.hideAnimation,function(){if($(self).hasClass('opened')&&!$inner.is(":visible"))
{$(self).removeClass('opened');}});}
else
{$inner.hide();$(self).removeClass('opened');}};this.timer=setTimeout(hide,settings.hideTimeout);};$('li:has(ul)',$menu).mousemove(showInner).mouseout(hideInner);$(window).resize(function(){$('li:has(ul)',$menu).each(function(){this.resized=true;});});};$.extend($.fn,{menu:function(settings){var settings=$.extend({showAnimation:false,hideAnimation:100,hideTimeout:100,container:'body',horizontal:[],vertical:[],relatived:true,rightOffset:1,leftOffset:0,iframe:false},settings);return $(this).each(function(){new Menu(this,settings);});}});$.fn.Menu=$.fn.menu;var Banners=function(el,settings){var $item=$(el);var resetTimeout=function()
{var self=this;if(typeof this.timer!='undefined'&&this.timer)
{clearTimeout(this.timer);}};var expandItem=function()
{var self=this;if(settings.animation.isAnimated)
{if((typeof settings.animation.height!='undefined')&&(typeof settings.animation.marginTop!='undefined'))
{$(self).animate({height:settings.animation.height[1],marginTop:settings.animation.marginTop[1]},100,function(){$(self).addClass(settings.cssActive);});}
else if((typeof settings.animation.width!='undefined')&&(typeof settings.animation.marginLeft!='undefined'))
{$(self).animate({width:settings.animation.width[1],marginLeft:settings.animation.marginLeft[1]},100,function(){$(self).addClass(settings.cssActive);});}}
else
{$(self).addClass(settings.cssActive);}
$('*',$(self)).mousemove(function(){resetTimeout.apply(self)});};var shrinkItem=function()
{var self=this;var hide=function()
{if(settings.animation.isAnimated)
{if((typeof settings.animation.height!='undefined')&&(typeof settings.animation.marginTop!='undefined'))
{$(self).animate({height:settings.animation.height[0],marginTop:settings.animation.marginTop[0]},100,function(){$(self).removeClass(settings.cssActive);});}
else if((typeof settings.animation.width!='undefined')&&(typeof settings.animation.marginLeft!='undefined'))
{$(self).animate({width:settings.animation.width[0],marginLeft:settings.animation.marginLeft[0]},100,function(){$(self).removeClass(settings.cssActive);});}}
else
{$(self).removeClass(settings.cssActive);}
resetTimeout();};this.timer=setTimeout(hide,settings.hideTimeout);};($item).mouseover(expandItem).mouseout(shrinkItem);};$.extend($.fn,{banners:function(settings){var settings=$.extend({animation:{isAnimated:false},hideTimeout:100,cssActive:"hover"},settings);return $(this).each(function(){new Banners(this,settings);});}});$.fn.Banners=$.fn.banners;var Langs=function(el,settings){var $item=$(el);$item.hover(function(){$(this).addClass('arr-hover')},function(){$(this).removeClass('arr-hover')});var resetTimeout=function()
{var self=this;if(typeof this.timer!='undefined'&&this.timer)
{clearTimeout(this.timer);this.timer=false;}};var showLangs=function()
{var self=this;resetTimeout.apply(self);if(settings.animation.isAnimated)
{$(self).parents('li.langs').map(function(){$(this).addClass(settings.openedCss);});}
else
{$(self).parents('li.langs').map(function(){$(this).addClass(settings.openedCss);});}};var hideLangs=function()
{var self=this;var hide=function()
{if(settings.animation.isAnimated)
{$(self).parents('li.langs').map(function(){$(this).removeClass(settings.openedCss);});}
else
{$(self).parents('li.langs').map(function(){$(this).removeClass(settings.openedCss);});}};this.timer=setTimeout(hide,settings.hideTimeout);};var _hideLangs=function()
{hideLangs.apply($item[0]);};var _resetTimeout=function()
{resetTimeout.apply($item[0])};$item.mouseover(showLangs).mouseout(hideLangs);$item.parents('li.langs').find('div.select').mouseover(_resetTimeout).mouseout(_hideLangs);};$.extend($.fn,{langs:function(settings){var settings=$.extend({animation:{isAnimated:false,showAnimation:100,hideAnimation:100},hideTimeout:100,openedCss:"langsOpen"},settings);return $(this).each(function(){new Langs(this,settings);});}});$.fn.Langs=$.fn.langs;var Categories=function(el,settings){var $item=$(el);$item.hover(function(){$(this).addClass('arr-hover')},function(){$(this).removeClass('arr-hover')});var resetTimeout=function()
{var self=this;if(typeof this.timer!='undefined'&&this.timer)
{clearTimeout(this.timer);this.timer=false;}};var showCategories=function()
{var self=this;resetTimeout.apply(self);if(settings.animation.isAnimated)
{$(self).parents('li.categories').map(function(){$(this).addClass(settings.openedCss);});}
else
{$(self).parents('li.categories').map(function(){$(this).addClass(settings.openedCss);});}};var hideCategories=function()
{var self=this;var hide=function()
{if(settings.animation.isAnimated)
{$(self).parents('li.categories').map(function(){$(this).removeClass(settings.openedCss);});}
else
{$(self).parents('li.categories').map(function(){$(this).removeClass(settings.openedCss);});}};this.timer=setTimeout(hide,settings.hideTimeout);};var _hideCategories=function()
{hideCategories.apply($item[0]);};var _resetTimeout=function()
{resetTimeout.apply($item[0])};$item.mouseover(showCategories).mouseout(hideCategories);$item.parents('li.categories').find('div.select').mouseover(_resetTimeout).mouseout(_hideCategories);};$.extend($.fn,{categories:function(settings){var settings=$.extend({animation:{isAnimated:false,showAnimation:100,hideAnimation:100},hideTimeout:100,openedCss:"categoriesOpen"},settings);return $(this).each(function(){new Categories(this,settings);});}});$.fn.Categories=$.fn.categories;var defInputs=function(el,settings){var $item=$(el);var onFocus=function()
{var self=this;var value=$(self).val();var alt=$(self).attr("alt");if(value==alt)
{$(self).val('').removeClass(settings.css);}};var onBlur=function()
{var self=this;var value=$(self).val();var alt=$(self).attr("alt");if(!value)
{$(self).val(alt).addClass(settings.css);}};$item.focus(onFocus).blur(onBlur);}
$.extend($.fn,{definputs:function(settings){var settings=$.extend({css:"txtDefault"},settings);return $(this).each(function(){new defInputs(this,settings);});}});$.fn.defInputs=$.fn.definputs;var quickForms=function(el)
{var $item=$(el);var inp=$item.find('input[type="text"]').filter(':first');var onSubmit=function()
{var value=$(inp).val();var alt=$(inp).attr("alt");if(!value||(value==alt))
{$(inp).focus();return false;}}
var button=$item.find('a[rel="submit"]').filter(':first');if($(button).length)
{var onClick=function()
{var self=this;var f=$(self).parents('form').filter(':first');$(f).submit();return false;};$(button).click(onClick);}
$item.submit(onSubmit);}
$.extend($.fn,{quick_forms:function(){return $(this).each(function(){new quickForms(this);});}});$.fn.quickForms=$.fn.quick_forms;var fieldErr=function(el,settings){var $item=$(el);switch($item.get(0).tagName.toLowerCase())
{case'a':{var onClose=function()
{var self=this;var err=$(self).parents('li.errorMsgContainer:visible').filter(':first');if($(err).length)
{var f=$(self).parents('form').filter(':first');f.find(':input').each(function(){$(this).keyup();});err.slideToggle("fast");}
else
{var success=$(self).parents('li.successMsgContainer:visible').filter(':first');if($(success).length)
{success.slideToggle("fast");}}
return false;};$item.click(onClose);break;}
default:{var onKeyUp=function()
{var self=this;$(self).animate({'backgroundColor':settings.backgroundColor,'borderBottomColor':settings.borderColor,'borderLeftColor':settings.borderColor,'borderRightColor':settings.borderColor,'borderTopColor':settings.borderColor},1000,function(){$(self).parents('li.err').removeClass('err');});};$item.keyup(onKeyUp);}}}
$.extend($.fn,{field_err:function(settings){var settings=$.extend({backgroundColor:"#fff",borderColor:"#8299B3"},settings);return $(this).each(function(){new fieldErr(this,settings);});}});$.fn.fieldErr=$.fn.field_err;var formActions=function(el,settings){var $item=$(el);var onClick=function()
{var self=this;var rel=$(self).attr("rel");var f=$(self).parents('form').filter(':first');switch(rel)
{case"submit":{f.submit();break;}
case"clear":{f.find(':input').each(function(){switch(this.type){case'password':case'select-multiple':case'select-one':case'text':case'textarea':$(this).val('');break;case'checkbox':case'radio':this.checked=false;}});var close=f.find('li.errorMsgContainer a.close').filter(':first');if(close)
{close.click();}
break;}}
return false;};$item.click(onClick);}
$.extend($.fn,{form_actions:function(settings){var settings=$.extend({},settings);return $(this).each(function(){new formActions(this,settings);});}});$.fn.formActions=$.fn.form_actions;})(jQuery);jQuery(document).ready(function(){$('div.menu').menu({container:'#main_menu',showAnimation:100,hideAnimation:100,horizontal:['.level3'],vertical:['.level2']});$('div.bannerBox a.item').banners({animation:{isAnimated:true,height:["110px","123px"],marginTop:["13px","0px"]}});$('div.banners a.item').banners({animation:{isAnimated:true,width:["217px","229px"],marginLeft:["12px","0px"]}});$('ul.top-menu li.langs span.arr').langs({openedCss:'langsOpen'});$('ul.categories-menu li.categories span.arr').categories({openedCss:'langsOpen categoriesOpen'});$('form input.txtDefault').defInputs({});$('form.quick').quickForms();$('form fieldset ul li.err input').fieldErr({});$('form fieldset ul li.err textarea').fieldErr({});$('form fieldset ul li.errorMsgContainer a.close').fieldErr({});$('form fieldset ul li.successMsgContainer a.close').fieldErr({});$('form fieldset ul li.buttons a[rel]').formActions({});});
