/* jquery easing compatibility */
jQuery.extend( jQuery.easing, {	easeIn: function (x, t, b, c, d) { return jQuery.easing.easeInQuad(x, t, b, c, d);},
	easeOut: function (x, t, b, c, d) { return jQuery.easing.easeOutQuad(x, t, b, c, d);}, easeInOut: function (x, t, b, c, d) {
		return jQuery.easing.easeInOutQuad(x, t, b, c, d);}, expoin: function(x, t, b, c, d) { return jQuery.easing.easeInExpo(x, t, b, c, d);
	}, expoout: function(x, t, b, c, d) {	return jQuery.easing.easeOutExpo(x, t, b, c, d);}, expoinout: function(x, t, b, c, d) {
		return jQuery.easing.easeInOutExpo(x, t, b, c, d);}, bouncein: function(x, t, b, c, d) { return jQuery.easing.easeInBounce(x, t, b, c, d);
	},	bounceout: function(x, t, b, c, d) { return jQuery.easing.easeOutBounce(x, t, b, c, d);},
	bounceinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBounce(x, t, b, c, d);},
	elasin: function(x, t, b, c, d) {	return jQuery.easing.easeInElastic(x, t, b, c, d);},	elasout: function(x, t, b, c, d) {
		return jQuery.easing.easeOutElastic(x, t, b, c, d);},	elasinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutElastic(x, t, b, c, d);
	}, backin: function(x, t, b, c, d) { return jQuery.easing.easeInBack(x, t, b, c, d);}, backout: function(x, t, b, c, d) {
		return jQuery.easing.easeOutBack(x, t, b, c, d);},	backinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBack(x, t, b, c, d);}
});
/* Sexy Alert Box */
jQuery(document).ready(function(a){Sexy.initialize()});jQuery.bind=function(b,c){var a=Array.prototype.slice.call(arguments,2);return function(){var d=[this].concat(a,jQuery.makeArray(arguments));return c.apply(b,d)}};jQuery.fn.delay=function(b,a){return this.each(function(){setTimeout(a,b)})};jQuery.fn.extend({$chain:[],chain:function(a){this.$chain.push(a);return this},callChain:function(a){return(this.$chain.length)?this.$chain.pop().apply(a,arguments):false},clearChain:function(){this.$chain.empty();return this}});(function(a){Sexy={getOptions:function(){return{name:"SexyAlertBox",zIndex:65555,onReturn:false,onReturnFunction:function(b){},BoxStyles:{width:500},OverlayStyles:{backgroundColor:"#000",opacity:0.7},showDuration:200,closeDuration:100,moveDuration:500,onCloseComplete:a.bind(this,function(){this.options.onReturnFunction(this.options.onReturn)})}},initialize:function(b){this.i=0;this.options=a.extend(this.getOptions(),b);a("body").append('<div id="BoxOverlay"></div><div id="'+this.options.name+'-Box"><div id="'+this.options.name+'-InBox"><div id="'+this.options.name+'-BoxContent"><div id="'+this.options.name+'-BoxContenedor"></div></div></div></div>');this.Content=a("#"+this.options.name+"-BoxContenedor");this.Contenedor=a("#"+this.options.name+"-BoxContent");this.InBox=a("#"+this.options.name+"-InBox");this.Box=a("#"+this.options.name+"-Box");a("#BoxOverlay").css({position:"absolute",top:0,left:0,opacity:this.options.OverlayStyles.opacity,backgroundColor:this.options.OverlayStyles.backgroundColor,"z-index":this.options.zIndex,height:a(document).height(),width:a(document).width()}).hide();this.Box.css({display:"none",position:"absolute",top:0,left:0,"z-index":this.options.zIndex+2,width:this.options.BoxStyles.width+"px"});this.preloadImages();a(window).bind("resize",a.bind(this,function(){if(this.options.display==1){a("#BoxOverlay").css({height:0,width:0});a("#BoxOverlay").css({height:a(document).height(),width:a(document).width()});this.replaceBox()}}));this.Box.bind("keydown",a.bind(this,function(d,c){if(c.keyCode==27){this.options.onReturn=false;this.display(0)}}));a(window).bind("scroll",a.bind(this,function(){this.replaceBox()}))},replaceBox:function(){if(this.options.display==1){this.Box.stop();this.Box.animate({left:((a(document).width()-this.options.BoxStyles.width)/2),top:(a(document).scrollTop()+(a(window).height()-this.Box.outerHeight())/2)},{duration:this.options.moveDuration,easing:"easeOutBack"});a(this).delay(this.options.moveDuration,a.bind(this,function(){a("#BoxAlertBtnOk").focus();a("#BoxPromptInput").focus();a("#BoxConfirmBtnOk").focus()}))}},display:function(b){if(this.options.display==0&&b!=0||b==1){if(!a.support.maxHeight){a("embed, object, select").css({visibility:"hidden"})}this.togFlashObjects("hidden");this.options.display=1;a("#BoxOverlay").stop();a("#BoxOverlay").fadeIn(this.options.showDuration,a.bind(this,function(){this.Box.css({display:"block",left:((a(document).width()-this.options.BoxStyles.width)/2)});this.replaceBox()}))}else{this.Box.css({display:"none",top:0});this.options.display=0;a(this).delay(500,a.bind(this,this.queue));a(this.Content).empty();this.Content.removeClass();if(this.i==1){a("#BoxOverlay").stop();a("#BoxOverlay").fadeOut(this.options.closeDuration,a.bind(this,function(){a("#BoxOverlay").hide();if(!a.support.maxHeight){a("embed, object, select").css({visibility:"visible"})}this.togFlashObjects("visible");this.options.onCloseComplete.call()}))}}},messageBox:function(d,e,c,b){a(this).chain(function(){c=a.extend({textBoxBtnOk:"OK",textBoxBtnCancel:"Cancelar",textBoxInputPrompt:null,password:false,onComplete:function(f){}},c||{});this.options.onReturnFunction=c.onComplete;this.Content.append('<div id="'+this.options.name+'-Buttons"></div>');if(d=="alert"||d=="info"||d=="error"){a("#"+this.options.name+"-Buttons").append('<input id="BoxAlertBtnOk" type="submit" />');a("#BoxAlertBtnOk").val(c.textBoxBtnOk).css({width:90});a("#BoxAlertBtnOk").bind("click",a.bind(this,function(){this.options.onReturn=true;this.display(0)}));if(d=="alert"){clase="BoxAlert"}else{if(d=="error"){clase="BoxError"}else{if(d=="info"){clase="BoxInfo"}}}this.Content.addClass(clase).prepend(e);this.display(1)}else{if(d=="confirm"){a("#"+this.options.name+"-Buttons").append('<input id="BoxConfirmBtnOk" type="submit" /> <input id="BoxConfirmBtnCancel" type="submit" />');a("#BoxConfirmBtnOk").val(c.textBoxBtnOk).css({width:90});a("#BoxConfirmBtnCancel").val(c.textBoxBtnCancel).css({width:90});a("#BoxConfirmBtnOk").bind("click",a.bind(this,function(){this.options.onReturn=true;this.display(0)}));a("#BoxConfirmBtnCancel").bind("click",a.bind(this,function(){this.options.onReturn=false;this.display(0)}));this.Content.addClass("BoxConfirm").prepend(e);this.display(1)}else{if(d=="prompt"){if(bas==2){a("#"+this.options.name+"-Buttons").append('<input id="BoxPromptBtnOk" type="submit" /> <input id="BoxPromptBtnCancel" type="submit" />');a("#BoxPromptBtnOk").val(c.textBoxBtnOk).css({width:90});a("#BoxPromptBtnCancel").val(c.textBoxBtnCancel).css({width:90});d=c.password?"password":"text";this.Content.prepend('<p><label for="BoxMailInputTo">Кому (электронный адрес)</label><br/><input id="BoxMailInputTo" type="text" size="40" maxlength="40" /></p>');this.Content.prepend('<p><label for="BoxMailInputName">От кого</label><br/><input id="BoxMailInputName" type="text" size="40" maxlength="40" /></p>');this.Content.prepend('<p><input id="BoxMailInputUrl" type="hidden" value="qwertyui" /></p>');a("#BoxMailInputUrl").val(c.input);a("#BoxMailInputName").val(c.input);a("#BoxMailInputTo").val(c.input);a("#BoxPromptBtnOk").bind("click",a.bind(this,function(){this.options.onReturn="&name="+a("#BoxMailInputName").val()+"&mail="+a("#BoxMailInputTo").val()+"&url="+window.location;this.display(0)}));a("#BoxPromptBtnCancel").bind("click",a.bind(this,function(){this.options.onReturn=false;this.display(0)}));this.Content.addClass("BoxPrompt").prepend(e+"<br />");this.display(1)}else{a("#"+this.options.name+"-Buttons").append('<input id="BoxPromptBtnOk" type="submit" /> <input id="BoxPromptBtnCancel" type="submit" />');a("#BoxPromptBtnOk").val(c.textBoxBtnOk).css({width:90});a("#BoxPromptBtnCancel").val(c.textBoxBtnCancel).css({width:90});d=c.password?"password":"text";this.Content.prepend('<p><label for="BoxTextareaInput">Текст сообщения</label><br/><textarea id="BoxTextareaInput" cols="40" rows="5"></textarea></p>');this.Content.prepend('<p><label for="BoxPromptInputTema">Тема</label><br/><input id="BoxPromptInputTema" type="text" size="40" maxlength="40" /></p>');this.Content.prepend('<p><label for="BoxPromptInputMail">Ваш электронный адрес</label><br/><input id="BoxPromptInputMail" type="text" size="40" maxlength="40" /></p>');this.Content.prepend('<p><label for="BoxPromptInputName">Ваше Имя</label><br/><input id="BoxPromptInputName" type="text" size="40" maxlength="40" /></p>');a("#BoxPromptInputName").val(c.input);a("#BoxPromptInputMail").val(c.input);a("#BoxPromptInputTema").val(c.input);a("#BoxTextareaInput").val(c.input);a("#BoxPromptBtnOk").bind("click",a.bind(this,function(){this.options.onReturn="&name="+a("#BoxPromptInputName").val()+"&mail="+a("#BoxPromptInputMail").val()+"&tema="+a("#BoxPromptInputTema").val()+"&feed="+a("#BoxTextareaInput").val();this.display(0)}));a("#BoxPromptBtnCancel").bind("click",a.bind(this,function(){this.options.onReturn=false;this.display(0)}));this.Content.addClass("BoxPrompt").prepend(e+"<br />");this.display(1)}}else{this.options.onReturn=false;this.display(0)}}}});this.i++;if(this.i==1){a(this).callChain(this)}},queue:function(){this.i--;a(this).callChain(this)},chk:function(b){return !!(b||b===0)},togFlashObjects:function(c){var b=new Array("embed","iframe","object");for(y=0;y<b.length;y++){var d=document.getElementsByTagName(b[y]);for(i=0;i<d.length;i++){d[i].style.visibility=c}}},preloadImages:function(){var b=new Array(2);b[0]=new Image();b[1]=new Image();b[2]=new Image();b[0].src=this.Box.css("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1");b[1].src=this.InBox.css("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1");b[2].src=this.Contenedor.css("background-image").replace(new RegExp("url\\('?([^']*)'?\\)","gi"),"$1")},alert:function(c,b){this.messageBox("alert",c,b)},info:function(c,b){this.messageBox("info",c,b)},error:function(c,b){this.messageBox("error",c,b)},confirm:function(c,b){this.messageBox("confirm",c,b)},prompt:function(d,b,c){this.messageBox("prompt",d,c,b)}}})(jQuery);
/* lavalamp menu */
(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);
/* BackgroundColor js-css */
(function(d){d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(f,e){d.fx.step[e]=function(g){if(g.state==0){g.start=c(g.elem,e);g.end=b(g.end)}g.elem.style[e]="rgb("+[Math.max(Math.min(parseInt((g.pos*(g.end[0]-g.start[0]))+g.start[0]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[1]-g.start[1]))+g.start[1]),255),0),Math.max(Math.min(parseInt((g.pos*(g.end[2]-g.start[2]))+g.start[2]),255),0)].join(",")+")"}});function b(f){var e;if(f&&f.constructor==Array&&f.length==3){return f}if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return[parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55]}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}return a[d.trim(f).toLowerCase()]}function c(g,e){var f;do{f=d.curCSS(g,e);if(f!=""&&f!="transparent"||d.nodeName(g,"body")){break}e="backgroundColor"}while(g=g.parentNode);return b(f)}var a={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);
/* tooltip */
this.tooltip = function(){	
		xOffset = 45;	yOffset = 10;		
	jQuery("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		jQuery("body").append("<div id='tooltip'><div class='t1'><div class='t2'><div class='t3'></div></div></div><div class='c1'><div class='c2'><div class='c3'>"+ this.t +"</div></div></div><div class='b1'><div class='b2'><div class='b3'></div></div></div></div>");
		jQuery("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		jQuery("#tooltip").remove();
    });	
	jQuery("a.tooltip").mousemove(function(e){
		jQuery("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
jQuery(document).ready(function($){
	tooltip();
});
