PageSourceSearch

http://www.kuzpark.ru/kuzpark/ecob/js/x.js

js kuzpark.ru collected 2026-10-04 13:23:33 UTC 87,313 bytes, 1,537 lines download raw bytes

1
2//flipNavmenu
3(function($) {
4	
5	$.fn.flipNav = function(options) {
6
7		options = $.extend({
8			speed : 150
9		}, options);
10	
11		return this.each(function() {
12					
13			var nav = $(this),
14				lis = $('li', nav),
15				anchors = $('a', lis),
16				spanHeight;
17
18			$.each(anchors, function() {
19				var a = $(this);
20					if(a.attr('class')!=="current"){
21					val = a.text();
22
23				a.html('<span>' + val + '</span><span>' + val + '</span>')
24				 .parent('li')
25					.height(a.children('span:first').outerHeight())
26				 .end()
27				 .children('span:first')
28					.css('marginTop', 0) // strange for IE
29			}});	
30
31			spanHeight = lis.eq(0).height();
32			
33			lis.hover(function() {
34				$(this).find('span:first').animate({
35					marginTop : '-' + spanHeight
36				}, { duration: options.speed, queue : false });
37			}, function() {
38				$(this).find('span:first').animate({
39					marginTop : 0
40				}, { duration: options.speed, queue: false });
41			});
42
43		}); // end each
44	
45	}
46	
47})(jQuery);
48/*
49* Placeholder plugin for jQuery
50* ---
51* Copyright 2010, Daniel Stocks (http://webcloud.se)
52* Released under the MIT, BSD, and GPL Licenses.
53*/
54
55(function(b){function d(a){this.input=a;a.attr("type")=="password"&&this.handlePassword();b(a[0].form).submit(function(){if(a.hasClass("placeholder")&&a[0].value==a.attr("placeholder"))a[0].value=""})}d.prototype={show:function(a){if(this.input[0].value===""||a&&this.valueIsPlaceholder()){if(this.isPassword)try{this.input[0].setAttribute("type","text")}catch(b){this.input.before(this.fakePassword.show()).hide()}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},
56hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")&&(this.input.removeClass("placeholder"),this.input[0].value="",this.isPassword)){try{this.input[0].setAttribute("type","password")}catch(a){}this.input.show();this.input[0].focus()}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var a=this.input;a.attr("realType","password");this.isPassword=!0;if(b.browser.msie&&a[0].outerHTML){var c=b(a[0].outerHTML.replace(/type=(['"])?password\1/gi,
57"type=$1text$1"));this.fakePassword=c.val(a.attr("placeholder")).addClass("placeholder").focus(function(){a.trigger("focus");b(this).hide()});b(a[0].form).submit(function(){c.remove();a.show()})}}};var e=!!("placeholder"in document.createElement("input"));b.fn.placeholder=function(){return e?this:this.each(function(){var a=b(this),c=new d(a);c.show(!0);a.focus(function(){c.hide()});a.blur(function(){c.show(!1)});b.browser.msie&&(b(window).load(function(){a.val()&&a.removeClass("placeholder");c.show(!0)}),
58a.focus(function(){if(this.value==""){var a=this.createTextRange();a.collapse(!0);a.moveStart("character",0);a.select()}}))})}})(jQuery);
59
60
61/*!
62 * jCarousel - Riding carousels with jQuery
63 *   http://sorgalla.com/jcarousel/
64 *
65 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
66 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
67 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
68 *
69 * Built on top of the jQuery library
70 *   http://jquery.com
71 *
72 * Inspired by the "Carousel Component" by Bill Scott
73 *   http://billwscott.com/carousel/
74 */
75
76(function(g){var q={vertical:!1,rtl:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click", buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},m=!1;g(window).bind("load.jcarousel",function(){m=!0});g.jcarousel=function(a,c){this.options=g.extend({},q,c||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===void 0)this.options.rtl=(g(a).attr("dir")||g("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical? this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){g(a).removeClass(d[f]);b=d[f];break}a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"?(this.list=g(a),this.clip=this.list.parents(".jcarousel-clip"),this.container=this.list.parents(".jcarousel-container")):(this.container=g(a),this.list=this.container.find("ul,ol").eq(0),this.clip=this.container.find(".jcarousel-clip"));if(this.clip.size()===0)this.clip= this.list.wrap("<div></div>").parent();if(this.container.size()===0)this.container=this.clip.wrap("<div></div>").parent();b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.buttonPrev=g(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=g(this.options.buttonPrevHTML).appendTo(this.container);this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext= g(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=g(this.options.buttonNextHTML).appendTo(this.container);this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"}); !this.options.vertical&&this.options.rtl&&this.container.addClass("jcarou
76sel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null,b=this.list.children("li"),e=this;if(b.size()>0){var h=0,i=this.options.offset;b.each(function(){e.format(this,i++);h+=e.dimension(this,j)});this.list.css(this.wh,h+100+"px");if(!c||c.size===void 0)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display", "block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.resizeTimer&&clearTimeout(e.resizeTimer);e.resizeTimer=setTimeout(function(){e.reload()},100)};this.options.initCallback!==null&&this.options.initCallback(this,"init");!m&&g.browser.safari?(this.buttons(!1,!1),g(window).bind("load.jcarousel",function(){e.setup()})):this.setup()};var f=g.jcarousel;f.fn=f.prototype={jcarousel:"0.2.8"};f.fn.extend=f.extend=g.extend;f.fn.extend({setup:function(){this.prevLast= this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(a,!1);g(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize);this.options.setupCallback!==null&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt, "0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this, c);f+1<a.first&&(d=b)});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,!1)},lock:function(){this.locked=!0;this.buttons()},unlock:function(){this.locked=!1;this.buttons()},size:function(a){if(a!==void 0)this.options.size=a,this.locked||this.buttons();return this.options.size},has:function(a,c){if(c===void 0||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return!1}return!0}, get:function(a){return g(">.jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,p=g(c);if(b.length===0)for(var j,e=f.intval(a),b=this.create(a);;){if(j=this.get(--e),e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}else d=this.dimension(b);p.get(0).nodeName.toUpperCase()=="LI"?(b.replaceWith(p),b=p):b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);p=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible): null;d=this.dimension(b,p)-d;a>0&&a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,f.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(c.length&&!(a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,f.intval(this.list.css(this.wh))-b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(!1): this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(!0):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!this.locked&&!this.animating&&this.tail){this.pauseAuto();var c=f.intval(this.list.css(this.lt)), c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){!this.locked&&!this.animating&&(this.pauseAuto(),this.animate(this.pos(a),c))},pos:function(a,c){var b=f.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;this.options.wrap!="circular"&&(a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a);for(var d=this.first>a,g=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(g): this.get(this.last),e=d?g:g-1,h=null,i=0,k=!1,l=0;d?--e>=a:++e<a;){h=this.get(e);k=!h.length;if(h.length===0&&(h=this.create(e).addClass(this.className("jcarousel-item-placeholder")),j[d?"before":"after"](h),this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)));j=h;l=this.dimension(h);k&&(i+=l);if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<= this.options.size)))b=d?b+l:b-l}for(var g=this.clipping(),m=[],o=0,n=0,j=this.get(a-1),e=a;++o;){h=this.get(e);k=!h.length;if(h.length===0){h=this.create(e).addClass(this.className("jcarousel-item-placeholder"));if(j.length===0)this.list.prepend(h);else j[d?"before":"after"](h);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)))}j=h;l=this.dimension(h);if(l===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting..."); this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size?m.push(h):k&&(i+=l);n+=l;if(n>=g)break;e++}for(h=0;h<m.length;h++)m[h].remove();i>0&&(this.list.css(this.wh,this.dimension(this.list)+i+"px"),d&&(b-=i,this.list.css(this.lt,f.intval(this.list.css(this.lt))-i+"px")));i=a+o-1;if(this.options.wrap!="circular"&&this.options.size&&i>this.options.size)i=this.options.size;if(e>i){o=0;e=i;for(n=0;++o;){h=this.get(e--);if(!h.length)break;n+=this.dimension(h);if(n>=g)break}}e=i-o+ 1;this.options.wrap!="circular"&&e<1&&(e=1);if(this.inTail&&d)b+=this.tail,this.inTail=!1;this.tail=null;if(this.options.wrap!="circular"&&i==this.options.size&&i-o+1>=1&&(d=f.intval(this.get(i).css(!this.options.vertical?"marginRight":"marginBottom")),n-d>g))this.tail=n-g-d;if(c&&a===this.options.size&&this.tail)b-=this.tail,this.inTail=!0;for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=i;return b},animate:function(a,c){if(!this.locked&& !this.animating){this.animating=!0;var b=this,d=function(){b.animating=!1;a===0&&b.list.css(b.lt,0);!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail)&&b.startAuto();b.buttons();b.notify("onAfterAnimation");if(b.options.wrap=="circular"&&b.options.size!==null)for(var c=b.prevFirst;c<=b.prevLast;c++)c!==null&&!(c>=b.first&&c<=b.last)&&(c<1||c>b.options.size)&&b.remove(c)}; this.notify("onBeforeAnimation");if(!this.options.animation||c===!1)this.list.css(this.lt,a+"px"),d();else{var f=!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},d={duration:this.options.animation,easing:this.options.easing,complete:d};
76if(g.isFunction(this.options.animationStepCallback))d.step=this.options.animationStepCallback;this.list.animate(f,d)}}},startAuto:function(a){if(a!==void 0)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();if(this.timer===null){this.autoStopped= !1;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){if(this.timer!==null)window.clearTimeout(this.timer),this.timer=null},buttons:function(a,c){if(a==null&&(a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size),!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&& this.last>=this.options.size))a=this.tail!==null&&!this.inTail;if(c==null&&(c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1),!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1))c=this.tail!==null&&this.inTail;var b=this;this.buttonNext.size()>0?(this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext),a&&this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext), this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?!1:!0),this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)):this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);this.buttonPrev.size()>0?(this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev), c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?!1:!0),this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)):this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,null,c);this.buttonNextState= a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);this.prevFirst!==this.first&&(this.callback("itemFirstInCallback",a,c,this.first),this.callback("itemFirstOutCallback",a,c,this.prevFirst));this.prevLast!==this.last&&(this.callback("itemLastInCallback",a,c,this.last),this.callback("itemLastOutCallback",a,c,this.prevLast));this.callback("itemVisibleInCallback",a,c,this.first,this.last,this.prevFirst, this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var h=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(g.isFunction(h)){var i=this;if(d===void 0)h(i,b,c);else if(f===void 0)this.get(d).each(function(){h(i,this,d,b,c)});else for(var a=function(a){i.get(a).each(function(){h(i,this,a,b,c)})},k=d;k<=f;k++)k!== null&&!(k>=j&&k<=e)&&a(k)}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){for(var a=g(a),b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical?"-horizontal":"-vertical")}, dimension:function(a,c){var b=g(a);if(c==null)return!this.options.vertical?b.outerWidth(!0)||f.intval(this.options.itemFallbackDimension):b.outerHeight(!0)||f.intval(this.options.itemFallbackDimension);else{var d=!this.options.vertical?c-f.intval(b.css("marginLeft"))-f.intval(b.css("marginRight")):c-f.intval(b.css("marginTop"))-f.intval(b.css("marginBottom"));g(b).css(this.wh,d+"px");return this.dimension(b)}},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-f.intval(this.clip.css("borderLeftWidth"))- f.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-f.intval(this.clip.css("borderTopWidth"))-f.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});f.extend({defaults:function(a){return g.extend(q,a||{})},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a},windowLoaded:function(){m=!0}});
76g.fn.jcarousel=function(a){if(typeof a=="string"){var c=g(this).data("jcarousel"),b=Array.prototype.slice.call(arguments, 1);return c[a].apply(c,b)}else return this.each(function(){var b=g(this).data("jcarousel");b?(a&&g.extend(b.options,a),b.reload()):g(this).data("jcarousel",new f(this,a))})}})(jQuery);
77
78
79/**
80 * --------------------------------------------------------------------
81 * jQuery customfileinput plugin
82 * Author: Scott Jehl, [email protected]
83 * Copyright (c) 2009 Filament Group 
84 * licensed under MIT (filamentgroup.com/examples/mit-license.txt)
85 * --------------------------------------------------------------------
86 */
87 
88(function($) {
89$.fn.customFileInput = function(){
90	return $(this).each(function(){
91	//apply events and styles for file input element
92	var fileInput = $(this)
93		.addClass('customfile-input') //add class for CSS
94		.mouseover(function(){ upload.addClass('customfile-hover'); })
95		.mouseout(function(){ upload.removeClass('customfile-hover'); })
96		.focus(function(){
97			upload.addClass('customfile-focus'); 
98			fileInput.data('val', fileInput.val());
99		})
100		.blur(function(){ 
101			upload.removeClass('customfile-focus');
102			$(this).trigger('checkChange');
103		 })
104		 .bind('disable',function(){
105		 	fileInput.attr('disabled',true);
106			upload.addClass('customfile-disabled');
107		})
108		.bind('enable',function(){
109			fileInput.removeAttr('disabled');
110			upload.removeClass('customfile-disabled');
111		})
112		.bind('checkChange', function(){
113			if(fileInput.val() && fileInput.val() != fileInput.data('val')){
114				fileInput.trigger('change');
115			}
116		})
117		.bind('change',function(){
118			//get file name
119			var fileName = $(this).val().split(/\\/).pop();
120			//get file extension
121			var fileExt = 'customfile-ext-' + fileName.split('.').pop().toLowerCase();
122			//update the feedback
123			uploadFeedback
124				.text(fileName) //set feedback text to filename
125				.removeClass(uploadFeedback.data('fileExt') || '') //remove any existing file extension class
126				.addClass(fileExt) //add file extension class
127				.data('fileExt', fileExt) //store file extension for class removal on next change
128				.addClass('customfile-feedback-populated'); //add class to show populated state
129			//change text of button	
130			uploadButton.text('Change');	
131		})
132		.click(function(){ //for IE and Opera, make sure change fires after choosing a file, using an async callback
133			fileInput.data('val', fileInput.val());
134			setTimeout(function(){
135				fileInput.trigger('checkChange');
136			},100);
137		});
138		
139	//create custom control container
140	var upload = $('<div class="customfile"></div>');
141	//create custom control button
142	var uploadButton = $('<span class="customfile-button" aria-hidden="true">Browse</span>').appendTo(upload);
143	//create custom control feedback
144	var uploadFeedback = $('<span class="customfile-feedback" aria-hidden="true">Íè÷åãî íå âûáðàíî</span>').appendTo(upload);
145	
146	//match disabled state
147	if(fileInput.is('[disabled]')){
148		fileInput.trigger('disable');
149	}
150		
151	
152	//on mousemove, keep file input under the cursor to steal click
153	upload
154		.mousemove(function(e){
155			fileInput.css({
156				'left': e.pageX - upload.offset().left - fileInput.outerWidth() + 20, //position right side 20px right of cursor X)
157				'top': 0
158			});	
159		})
160		.insertAfter(fileInput); //insert after the input
161	
162	fileInput.appendTo(upload);
163		
164	});
165};
166})(jQuery);
167
168/**
169 * jquery.simpletip 1.3.1. A simple tooltip plugin
170 * 
171 * Copyright (c) 2009 Craig Thompson
172 * http://craigsworks.com
173 *
174 * Licensed under GPLv3
175 * http://www.opensource.org/licenses/gpl-3.0.html
176 *
177 * Launch  : February 2009
178 * Version : 1.3.1
179 * Released: February 5, 2009 - 11:04am
180 */
181eval(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()});
181a(!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,{}))
182
183/*!
184 * jQuery Form Plugin
185 * version: 2.83 (11-JUL-2011)
186 * @requires jQuery v1.3.2 or later
187 *
188 * Examples and documentation at: http://malsup.com/jquery/form/
189 * Dual licensed under the MIT and GPL licenses:
190 *   http://www.opensource.org/licenses/mit-license.php
191 *   http://www.gnu.org/licenses/gpl.html
192 */
193;(function($) {
194
195/*
196	Usage Note:
197	-----------
198	Do not use both ajaxSubmit and ajaxForm on the same form.  These
199	functions are intended to be exclusive.  Use ajaxSubmit if you want
200	to bind your own submit handler to the form.  For example,
201
202	$(document).ready(function() {
203		$('#myForm').bind('submit', function(e) {
204			e.preventDefault(); // <-- important
205			$(this).ajaxSubmit({
206				target: '#output'
207			});
208		});
209	});
210
211	Use ajaxForm when you want the plugin to manage all the event binding
212	for you.  For example,
213
214	$(document).ready(function() {
215		$('#myForm').ajaxForm({
216			target: '#output'
217		});
218	});
219
220	When using ajaxForm, the ajaxSubmit function will be invoked for you
221	at the appropriate time.
222*/
223
224/**
225 * ajaxSubmit() provides a mechanism for immediately submitting
226 * an HTML form using AJAX.
227 */
228$.fn.ajaxSubmit = function(options) {
229	// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
230	if (!this.length) {
231		log('ajaxSubmit: skipping submit process - no element selected');
232		return this;
233	}
234	
235	var method, action, url, $form = this;
236
237	if (typeof options == 'function') {
238		options = { success: options };
239	}
240
241	method = this.attr('method');
242	action = this.attr('action');
243	url = (typeof action === 'string') ? $.trim(action) : '';
244	url = url || window.location.href || '';
245	if (url) {
246		// clean url (don't include hash vaue)
247		url = (url.match(/^([^#]+)/)||[])[1];
248	}
249
250	options = $.extend(true, {
251		url:  url,
252		success: $.ajaxSettings.success,
253		type: method || 'GET',
254		iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
255	}, options);
256
257	// hook for manipulating the form data before it is extracted;
258	// convenient for use with rich editors like tinyMCE or FCKEditor
259	var veto = {};
260	this.trigger('form-pre-serialize', [this, options, veto]);
261	if (veto.veto) {
262		log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
263		return this;
264	}
265
266	// provide opportunity to alter form data before it is serialized
267	if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
268		log('ajaxSubmit: submit aborted via beforeSerialize callback');
269		return this;
270	}
271
272	var n,v,a = this.formToArray(options.semantic);
273	if (options.data) {
274		options.extraData = options.data;
275		for (n in options.data) {
276			if(options.data[n] instanceof Array) {
277				for (var k in options.data[n]) {
278					a.push( { name: n, value: options.data[n][k] } );
279				}
280			}
281			else {
282				v = options.data[n];
283				v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
284				a.push( { name: n, value: v } );
285			}
286		}
287	}
288
289	// give pre-submit callback an opportunity to abort the submit
290	if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
291		log('ajaxSubmit: submit aborted via beforeSubmit callback');
292		return this;
293	}
294
295	// fire vetoable 'validate' event
296	this.trigger('form-submit-validate', [a, this, options, veto]);
297	if (veto.veto) {
298		log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
299		return this;
300	}
301
302	var q = $.param(a);
303
304	if (options.type.toUpperCase() == 'GET') {
305		options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
306		options.data = null;  // data is null for 'get'
307	}
308	else {
309		options.data = q; // data is the query string for 'post'
310	}
311
312	var callbacks = [];
313	if (options.resetForm) {
314		callbacks.push(function() { $form.resetForm(); });
315	}
316	if (options.clearForm) {
317		callbacks.push(function() { $form.clearForm(); });
318	}
319
320	// perform a load on the target only if dataType is not provided
321	if (!options.dataType && options.target) {
322		var oldSuccess = options.success || function(){};
323		callbacks.push(function(data) {
324			var fn = options.replaceTarget ? 'replaceWith' : 'html';
325			$(options.target)[fn](data).each(oldSuccess, arguments);
326		});
327	}
328	else if (options.success) {
329		callbacks.push(options.success);
330	}
331
332	options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
333		var context = options.context || options;   // jQuery 1.4+ supports scope context 
334		for (var i=0, max=callbacks.length; i < max; i++) {
335			callbacks[i].apply(context, [data, status, xhr || $form, $form]);
336		}
337	};
338
339	// are there files to upload?
340	var fileInputs = $('input:file', this).length > 0;
341	var mp = 'multipart/form-data';
342	var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
343
344	// options.iframe allows user to force iframe mode
345	// 06-NOV-09: now defaulting to iframe mode if file input is detected
346   if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
347	   // hack to fix Safari hang (thanks to Tim Molendijk for this)
348	   // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
349	   if (options.closeKeepAlive) {
350		   $.get(options.closeKeepAlive, function() { fileUpload(a); });
351		}
352	   else {
353		   fileUpload(a);
354		}
355   }
356   else {
357		// IE7 massage (see issue 57)
358		if ($.browser.msie && method == 'get') { 
359			var ieMeth = $form[0].getAttribute('method');
360			if (typeof ieMeth === 'string')
361				options.type = ieMeth;
362		}
363		$.ajax(options);
364   }
365
366	// fire 'notify' event
367	this.trigger('form-submit-notify', [this, options]);
368	return this;
369
370
371	// private function for handling file uploads (hat tip to YAHOO!)
372	function fileUpload(a) {
373		var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
374        var useProp = !!$.fn.prop;
375
376        if (a) {
377        	// ensure that every serialized input is still enabled
378          	for (i=0; i < a.length; i++) {
379                el = $(form[a[i].name]);
380                el[ useProp ? 'prop' : 'attr' ]('disabled', false);
381          	}
382        }
383
384		if ($(':input[name=submit],:input[id=submit]', form).length) {
385			// if there is an input with a name or id of 'submit' then we won't be
386			// able to invoke the submit fn on the form (at least not x-browser)
387			alert('Error: Form elements must not have name or id of "submit".');
388			return;
389		}
390		
391		s = $.extend(true, {}, $.ajaxSettings, options);
392		s.context = s.context || s;
393		id = 'jqFormIO' + (new Date().getTime());
394		if (s.iframeTarget) {
395			$io = $(s.iframeTarget);
396			n = $io.attr('name');
397			if (n == null)
398			 	$io.attr('name', id);
399			else
400				id = n;
401		}
402		else {
403			$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
404			$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
405		}
406		io = $io[0];
407
408
409		xhr = { // mock object
410			aborted: 0,
411			responseText: null,
412			responseXML: null,
413			status: 0,
414			statusText: 'n/a',
415			getAllResponseHeaders: function() {},
416			getResponseHeader: function() {},
417			setRequestHeader: function() {},
418			abort: function(status) {
419				var e = (status === 'timeout' ? 'timeout' : 'aborted');
420				log('aborting upload... ' + e);
421				this.aborted = 1;
422				$io.attr('src', s.iframeSrc); // abort op in progress
423				xhr.error = e;
424				s.error && s.error.call(s.context, xhr, e, status);
425				g && $.event.trigger("ajaxError", [xhr, s, e]);
426				s.complete && s.complete.call(s.context, xhr, e);
427			}
428		};
429
430		g = s.global;
431		// trigger ajax global events so that activity/block indicators work like normal
432		if (g && ! $.active++) {
433			$.event.trigger("ajaxStart");
434		}
435		if (g) {
436			$.event.trigger("ajaxSend", [xhr, s]);
437		}
438
439		if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
440			if (s.global) {
441				$.active--;
442			}
443			return;
444		}
445		if (xhr.aborted) {
446			return;
447		}
448
449		// add submitting element to data if we know it
450		sub = form.clk;
451		if (sub) {
452			n = sub.name;
453			if (n && !sub.disabled) {
454				s.extraData = s.extraData || {};
455				s.extraData[n] = sub.value;
456				if (sub.type == "image") {
457					s.extraData[n+'.x'] = form.clk_x;
458					s.extraData[n+'.y'] = form.clk_y;
459				}
460			}
461		}
462		
463		var CLIENT_TIMEOUT_ABORT = 1;
464		var SERVER_ABORT = 2;
465
466		function getDoc(frame) {
467			var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
468			return doc;
469		}
470		
471		// take a breath so that pending repaints get some cpu time before the upload starts
472		function doSubmit() {
473			// make sure form attrs are set
474			var t = $form.attr('target'), a = $form.attr('action');
475
476			// update form attrs in IE friendly way
477			form.setAttribute('target',id);
478			if (!method) {
479				form.setAttribute('method', 'POST');
480			}
481			if (a != s.url) {
482				form.setAttribute('action', s.url);
483			}
484
485			// ie borks in some cases when setting encoding
486			if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
487				$form.attr({
488					encoding: 'multipart/form-data',
489					enctype:  'multipart/form-data'
490				});
491			}
492
493			// support timout
494			if (s.timeout) {
495				timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
496			}
497			
498			// look for server aborts
499			function checkState() {
500				try {
501					var state = getDoc(io).readyState;
502					log('state = ' + state);
503					if (state.toLowerCase() == 'uninitialized')
504						setTimeout(checkState,50);
505				}
506				catch(e) {
507					log('Server abort: ' , e, ' (', e.name, ')');
508					cb(SERVER_ABORT);
509					timeoutHandle && clearTimeout(timeoutHandle);
510					timeoutHandle = undefined;
511				}
512			}
513
514			// add "extra" data to form if provided in options
515			var extraInputs = [];
516			try {
517				if (s.extraData) {
518					for (var n in s.extraData) {
519						extraInputs.push(
520							$('<input type="hidden" name="'+n+'" />').attr('value',s.extraData[n])
521								.appendTo(form)[0]);
522					}
523				}
524
525				if (!s.iframeTarget) {
526					// add iframe to doc and submit the form
527					$io.appendTo('body');
528	                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
529				}
530				setTimeout(checkState,15);
531				form.submit();
532			}
533			finally {
534				// reset attrs and remove "extra" input elements
535				form.setAttribute('action',a);
536				if(t) {
537					form.setAttribute('target', t);
538				} else {
539					$form.removeAttr('target');
540				}
541				$(extraInputs).remove();
542			}
543		}
544
545		if (s.forceSync) {
546			doSubmit();
547		}
548		else {
549			setTimeout(doSubmit, 10); // this lets dom updates render
550		}
551
552		var data, doc, domCheckCount = 50, callbackProcessed;
553
554		function cb(e) {
555			if (xhr.aborted || callbackProcessed) {
556				return;
557			}
558			try {
559				doc = getDoc(io);
560			}
561			catch(ex) {
562				log('cannot access response document: ', ex);
563				e = SERVER_ABORT;
564			}
565			if (e === CLIENT_TIMEOUT_ABORT && xhr) {
566				xhr.abort('timeout');
567				return;
568			}
569			else if (e == SERVER_ABORT && xhr) {
570				xhr.abort('server abort');
571				return;
572			}
573
574			if (!doc || doc.location.href == s.iframeSrc) {
575				// response not received yet
576				if (!timedOut)
577					return;
578			}
579            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
580
581			var status = 'success', errMsg;
582			try {
583				if (timedOut) {
584					throw 'timeout';
585				}
586
587				var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
588				log('isXml='+isXml);
589				if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
590					if (--domCheckCount) {
591						// in some browsers (Opera) the iframe DOM is not always traversable when
592						// the onload callback fires, so we loop a bit to accommodate
593						log('requeing onLoad callback, DOM not available');
594						setTimeout(cb, 250);
595						return;
596					}
597					// let this fall through because server response could be an empty document
598					//log('Could not access iframe DOM after mutiple tries.');
599					//throw 'DOMException: not available';
600				}
601
602				//log('response detected');
603                var docRoot = doc.body ? doc.body : doc.documentElement;
604                xhr.responseText = docRoot ? docRoot.innerHTML : null;
605				xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
606				if (isXml)
607					s.dataType = 'xml';
608				xhr.getResponseHeader = function(header){
609					var headers = {'content-type': s.dataType};
610					return headers[header];
611				};
612                // support for XHR 'status' & 'statusText' emulation :
613                if (docRoot) {
614                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
615                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
616                }
617
618				var dt = s.dataType || '';
619				var scr = /(json|script|text)/.test(dt.toLowerCase());
620				if (scr || s.textarea) {
621					// see if user embedded response in textarea
622					var ta = doc.getElementsByTagName('textarea')[0];
623					if (ta) {
624						xhr.responseText = ta.value;
625                        // support for XHR 'status' & 'statusText' emulation :
626                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
627                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
628					}
629					else if (scr) {
630						// account for browsers injecting pre around json response
631						var pre = doc.getElementsByTagName('pre')[0];
632						var b = doc.getElementsByTagName('body')[0];
633						if (pre) {
634							xhr.responseText = pre.textContent ? pre.textContent : pre.innerHTML;
635						}
636						else if (b) {
637							xhr.responseText = b.innerHTML;
638						}
639					}
640				}
641				else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
642					xhr.responseXML = toXml(xhr.responseText);
643				}
644
645                try {
646                    data = httpData(xhr, s.dataType, s);
647                }
648                catch (e) {
649                    status = 'parsererror';
650                    xhr.error = errMsg = (e || status);
651                }
652			}
653			catch (e) {
654				log('error caught: ',e);
655				status = 'error';
656                xhr.error = errMsg = (e || status);
657			}
658
659			if (xhr.aborted) {
660				log('upload aborted');
661				status = null;
662			}
663
664            if (xhr.status) { // we've set xhr.status
665                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
666            }
667
668			// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
669			if (status === 'success') {
670				s.success && s.success.call(s.context, data, 'success', xhr);
671				g && $.event.trigger("ajaxSuccess", [xhr, s]);
672			}
673            else if (status) {
674				if (errMsg == undefined)
675					errMsg = xhr.statusText;
676				s.error && s.error.call(s.context, xhr, status, errMsg);
677				g && $.event.trigger("ajaxError", [xhr, s, errMsg]);
678            }
679
680			g && $.event.trigger("ajaxComplete", [xhr, s]);
681
682			if (g && ! --$.active) {
683				$.event.trigger("ajaxStop");
684			}
685
686			s.complete && s.complete.call(s.context, xhr, status);
687
688			callbackProcessed = true;
689			if (s.timeout)
690				clearTimeout(timeoutHandle);
691
692			// clean up
693			setTimeout(function() {
694				if (!s.iframeTarget)
695					$io.remove();
696				xhr.responseXML = null;
697			}, 100);
698		}
699
700		var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
701			if (window.ActiveXObject) {
702				doc = new ActiveXObject('Microsoft.XMLDOM');
703				doc.async = 'false';
704				doc.loadXML(s);
705			}
706			else {
707				doc = (new DOMParser()).parseFromString(s, 'text/xml');
708			}
709			return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
710		};
711		var parseJSON = $.parseJSON || function(s) {
712			return window['eval']('(' + s + ')');
713		};
714
715		var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
716
717			var ct = xhr.getResponseHeader('content-type') || '',
718				xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
719				data = xml ? xhr.responseXML : xhr.responseText;
720
721			if (xml && data.documentElement.nodeName === 'parsererror') {
722				$.error && $.error('parsererror');
723			}
724			if (s && s.dataFilter) {
725				data = s.dataFilter(data, type);
726			}
727			if (typeof data === 'string') {
728				if (type === 'json' || !type && ct.indexOf('json') >= 0) {
729					data = parseJSON(data);
730				} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
731					$.globalEval(data);
732				}
733			}
734			return data;
735		};
736	}
737};
738
739/**
740 * ajaxForm() provides a mechanism for fully automating form submission.
741 *
742 * The advantages of using this method instead of ajaxSubmit() are:
743 *
744 * 1: This method will include coordinates for <input type="image" /> elements (if the element
745 *	is used to submit the form).
746 * 2. This method will include the submit element's name/value data (for the element that was
747 *	used to submit the form).
748 * 3. This method binds the submit() method to the form for you.
749 *
750 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
751 * passes the options argument along after properly binding events for submit elements and
752 * the form itself.
753 */
754$.fn.ajaxForm = function(options) {
755	// in jQuery 1.3+ we can fix mistakes with the ready state
756	if (this.length === 0) {
757		var o = { s: this.selector, c: this.context };
758		if (!$.isReady && o.s) {
759			log('DOM not ready, queuing ajaxForm');
760			$(function() {
761				$(o.s,o.c).ajaxForm(options);
762			});
763			return this;
764		}
765		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
766		log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
767		return this;
768	}
769
770	return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
771		if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
772			e.preventDefault();
773			$(this).ajaxSubmit(options);
774		}
775	}).bind('click.form-plugin', function(e) {
776		var target = e.target;
777		var $el = $(target);
778		if (!($el.is(":submit,input:image"))) {
779			// is this a child element of the submit el?  (ex: a span within a button)
780			var t = $el.closest(':submit');
781			if (t.length == 0) {
782				return;
783			}
784			target = t[0];
785		}
786		var form = this;
787		form.clk = target;
788		if (target.type == 'image') {
789			if (e.offsetX != undefined) {
790				form.clk_x = e.offsetX;
791				form.clk_y = e.offsetY;
792			} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
793				var offset = $el.offset();
794				form.clk_x = e.pageX - offset.left;
795				form.clk_y = e.pageY - offset.top;
796			} else {
797				form.clk_x = e.pageX - target.offsetLeft;
798				form.clk_y = e.pageY - target.offsetTop;
799			}
800		}
801		// clear form vars
802		setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
803	});
804};
805
806// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
807$.fn.ajaxFormUnbind = function() {
808	return this.unbind('submit.form-plugin click.form-plugin');
809};
810
811/**
812 * formToArray() gathers form element data into an array of objects that can
813 * be passed to any of the following ajax functions: $.get, $.post, or load.
814 * Each object in the array has both a 'name' and 'value' property.  An example of
815 * an array for a simple login form might be:
816 *
817 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
818 *
819 * It is this array that is passed to pre-submit callback functions provided to the
820 * ajaxSubmit() and ajaxForm() methods.
821 */
822$.fn.formToArray = function(semantic) {
823	var a = [];
824	if (this.length === 0) {
825		return a;
826	}
827
828	var form = this[0];
829	var els = semantic ? form.getElementsByTagName('*') : form.elements;
830	if (!els) {
831		return a;
832	}
833
834	var i,j,n,v,el,max,jmax;
835	for(i=0, max=els.length; i < max; i++) {
836		el = els[i];
837		n = el.name;
838		if (!n) {
839			continue;
840		}
841
842		if (semantic && form.clk && el.type == "image") {
843			// handle image inputs on the fly when semantic == true
844			if(!el.disabled && form.clk == el) {
845				a.push({name: n, value: $(el).val()});
846				a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
847			}
848			continue;
849		}
850
851		v = $.fieldValue(el, true);
852		if (v && v.constructor == Array) {
853			for(j=0, jmax=v.length; j < jmax; j++) {
854				a.push({name: n, value: v[j]});
855			}
856		}
857		else if (v !== null && typeof v != 'undefined') {
858			a.push({name: n, value: v});
859		}
860	}
861
862	if (!semantic && form.clk) {
863		// input type=='image' are not found in elements array! handle it here
864		var $input = $(form.clk), input = $input[0];
865		n = input.name;
866		if (n && !input.disabled && input.type == 'image') {
867			a.push({name: n, value: $input.val()});
868			a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
869		}
870	}
871	return a;
872};
873
874/**
875 * Serializes form data into a 'submittable' string. This method will return a string
876 * in the format: name1=value1&amp;name2=value2
877 */
878$.fn.formSerialize = function(semantic) {
879	//hand off to jQuery.param for proper encoding
880	return $.param(this.formToArray(semantic));
881};
882
883/**
884 * Serializes all field elements in the jQuery object into a query string.
885 * This method will return a string in the format: name1=value1&amp;name2=value2
886 */
887$.fn.fieldSerialize = function(successful) {
888	var a = [];
889	this.each(function() {
890		var n = this.name;
891		if (!n) {
892			return;
893		}
894		var v = $.fieldValue(this, successful);
895		if (v && v.constructor == Array) {
896			for (var i=0,max=v.length; i < max; i++) {
897				a.push({name: n, value: v[i]});
898			}
899		}
900		else if (v !== null && typeof v != 'undefined') {
901			a.push({name: this.name, value: v});
902		}
903	});
904	//hand off to jQuery.param for proper encoding
905	return $.param(a);
906};
907
908/**
909 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
910 *
911 *  <form><fieldset>
912 *	  <input name="A" type="text" />
913 *	  <input name="A" type="text" />
914 *	  <input name="B" type="checkbox" value="B1" />
915 *	  <input name="B" type="checkbox" value="B2"/>
916 *	  <input name="C" type="radio" value="C1" />
917 *	  <input name="C" type="radio" value="C2" />
918 *  </fieldset></form>
919 *
920 *  var v = $(':text').fieldValue();
921 *  // if no values are entered into the text inputs
922 *  v == ['','']
923 *  // if values entered into the text inputs are 'foo' and 'bar'
924 *  v == ['foo','bar']
925 *
926 *  var v = $(':checkbox').fieldValue();
927 *  // if neither checkbox is checked
928 *  v === undefined
929 *  // if both checkboxes are checked
930 *  v == ['B1', 'B2']
931 *
932 *  var v = $(':radio').fieldValue();
933 *  // if neither radio is checked
934 *  v === undefined
935 *  // if first radio is checked
936 *  v == ['C1']
937 *
938 * The successful argument controls whether or not the field element must be 'successful'
939 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
940 * The default value of the successful argument is true.  If this value is false the value(s)
941 * for each element is returned.
942 *
943 * Note: This method *always* returns an array.  If no valid value can be determined the
944 *	   array will be empty, otherwise it will contain one or more values.
945 */
946$.fn.fieldValue = function(successful) {
947	for (var val=[], i=0, max=this.length; i < max; i++) {
948		var el = this[i];
949		var v = $.fieldValue(el, successful);
950		if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
951			continue;
952		}
953		v.constructor == Array ? $.merge(val, v) : val.push(v);
954	}
955	return val;
956};
957
958/**
959 * Returns the value of the field element.
960 */
961$.fieldValue = function(el, successful) {
962	var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
963	if (successful === undefined) {
964		successful = true;
965	}
966
967	if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
968		(t == 'checkbox' || t == 'radio') && !el.checked ||
969		(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
970		tag == 'select' && el.selectedIndex == -1)) {
971			return null;
972	}
973
974	if (tag == 'select') {
975		var index = el.selectedIndex;
976		if (index < 0) {
977			return null;
978		}
979		var a = [], ops = el.options;
980		var one = (t == 'select-one');
981		var max = (one ? index+1 : ops.length);
982		for(var i=(one ? index : 0); i < max; i++) {
983			var op = ops[i];
984			if (op.selected) {
985				var v = op.value;
986				if (!v) { // extra pain for IE...
987					v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
988				}
989				if (one) {
990					return v;
991				}
992				a.push(v);
993			}
994		}
995		return a;
996	}
997	return $(el).val();
998};
999
1000/**
1001 * Clears the form data.  Takes the following actions on the form's input fields:
1002 *  - input text fields will have their 'value' property set to the empty string
1003 *  - select elements will have their 'selectedIndex' property set to -1
1004 *  - checkbox and radio inputs will have their 'checked' property set to false
1005 *  - inputs of type submit, button, reset, and hidden will *not* be effected
1006 *  - button elements will *not* be effected
1007 */
1008$.fn.clearForm = function() {
1009	return this.each(function() {
1010		$('input,select,textarea', this).clearFields();
1011	});
1012};
1013
1014/**
1015 * Clears the selected form elements.
1016 */
1017$.fn.clearFields = $.fn.clearInputs = function() {
1018	var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
1019	return this.each(function() {
1020		var t = this.type, tag = this.tagName.toLowerCase();
1021		if (re.test(t) || tag == 'textarea') {
1022			this.value = '';
1023		}
1024		else if (t == 'checkbox' || t == 'radio') {
1025			this.checked = false;
1026		}
1027		else if (tag == 'select') {
1028			this.selectedIndex = -1;
1029		}
1030	});
1031};
1032
1033/**
1034 * Resets the form data.  Causes all form elements to be reset to their original value.
1035 */
1036$.fn.resetForm = function() {
1037	return this.each(function() {
1038		// guard against an input with the name of 'reset'
1039		// note that IE reports the reset function as an 'object'
1040		if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
1041			this.reset();
1042		}
1043	});
1044};
1045
1046/**
1047 * Enables or disables any matching elements.
1048 */
1049$.fn.enable = function(b) {
1050	if (b === undefined) {
1051		b = true;
1052	}
1053	return this.each(function() {
1054		this.disabled = !b;
1055	});
1056};
1057
1058/**
1059 * Checks/unchecks any matching checkboxes or radio buttons and
1060 * selects/deselects and matching option elements.
1061 */
1062$.fn.selected = function(select) {
1063	if (select === undefined) {
1064		select = true;
1065	}
1066	return this.each(function() {
1067		var t = this.type;
1068		if (t == 'checkbox' || t == 'radio') {
1069			this.checked = select;
1070		}
1071		else if (this.tagName.toLowerCase() == 'option') {
1072			var $sel = $(this).parent('select');
1073			if (select && $sel[0] && $sel[0].type == 'select-one') {
1074				// deselect all other options
1075				$sel.find('option').selected(false);
1076			}
1077			this.selected = select;
1078		}
1079	});
1080};
1081
1082// helper fn for console logging
1083function log() {
1084	var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
1085	if (window.console && window.console.log) {
1086		window.console.log(msg);
1087	}
1088	else if (window.opera && window.opera.postError) {
1089		window.opera.postError(msg);
1090	}
1091};
1092
1093})(jQuery);
1094
1095//maphilight//
1096(function(F){var B,C,I,L,K,H,E,G,A,J;B=document.namespaces;has_canvas=!!document.createElement("canvas").getContext;if(!(has_canvas||B)){F.fn.maphilight=function(){return this};return }if(has_canvas){E=function(M){return Math.max(0,Math.min(parseInt(M,16),255))};G=function(M,N){return"rgba("+E(M.substr(0,2))+","+E(M.substr(2,2))+","+E(M.substr(4,2))+","+N+")"};C=function(M){var N=F('<canvas style="width:'+M.width+"px;height:"+M.height+'px;"></canvas>').get(0);N.getContext("2d").clearRect(0,0,N.width,N.height);return N};I=function(P,M,S,O,N){var R,Q=P.getContext("2d");Q.beginPath();if(M=="rect"){Q.rect(S[0],S[1],S[2]-S[0],S[3]-S[1])}else{if(M=="poly"){Q.moveTo(S[0],S[1]);for(R=2;R<S.length;R+=2){Q.lineTo(S[R],S[R+1])}}else{if(M=="circ"){Q.arc(S[0],S[1],S[2],0,Math.PI*2,false)}}}Q.closePath();if(O.fill){Q.fillStyle=G(O.fillColor,O.fillOpacity);Q.fill()}if(O.stroke){Q.strokeStyle=G(O.strokeColor,O.strokeOpacity);Q.lineWidth=O.strokeWidth;Q.stroke()}if(O.fade){F(P).css("opacity",0).animate({opacity:1},100)}};L=function(M){M.getContext("2d").clearRect(0,0,M.width,M.height)}}else{C=function(M){return F('<var style="zoom:1;overflow:hidden;display:block;width:'+M.width+"px;height:"+M.height+'px;"></var>').get(0)};I=function(N,Q,R,U,M){var S,T,O,P;S='<v:fill color="#'+U.fillColor+'" opacity="'+(U.fill?U.fillOpacity:0)+'" />';T=(U.stroke?'strokeweight="'+U.strokeWidth+'" stroked="t" strokecolor="#'+U.strokeColor+'"':'stroked="f"');O='<v:stroke opacity="'+U.strokeOpacity+'"/>';if(Q=="rect"){P=F('<v:rect name="'+M+'" filled="t" '+T+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+R[0]+"px;top:"+R[1]+"px;width:"+(R[2]-R[0])+"px;height:"+(R[3]-R[1])+'px;"></v:rect>')}else{if(Q=="poly"){P=F('<v:shape name="'+M+'" filled="t" '+T+' coordorigin="0,0" coordsize="'+N.width+","+N.height+'" path="m '+R[0]+","+R[1]+" l "+R.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+N.width+"px;height:"+N.height+'px;"></v:shape>')}else{if(Q=="circ"){P=F('<v:oval name="'+M+'" filled="t" '+T+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(R[0]-R[2])+"px;top:"+(R[1]-R[2])+"px;width:"+(R[2]*2)+"px;height:"+(R[2]*2)+'px;"></v:oval>')}}}P.get(0).innerHTML=S+O;F(N).append(P)};L=function(M){F(M).find("[name=highlighted]").remove()}}K=function(N){var M,O=N.getAttribute("coords").split(",");for(M=0;M<O.length;M++){O[M]=parseFloat(O[M])}return[N.getAttribute("shape").toLowerCase().substr(0,4),O]};J=function(O,N){var M=F(O);return F.extend({},N,F.metadata?M.metadata():false,M.data("maphilight"))};A=function(M){if(!M.complete){return false}
1096if(typeof M.naturalWidth!="undefined"&&M.naturalWidth==0){return false}return true};H={position:"absolute",left:0,top:0,padding:0,border:0};var D=false;F.fn.maphilight=function(O){O=F.extend({},F.fn.maphilight.defaults,O);if(!has_canvas&&F.browser.msie&&!D){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var N=document.createStyleSheet();var M=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"];F.each(M,function(){N.addRule("v\\:"+this,"behavior: url(#default#VML); antialias:true")});D=true}return this.each(function(){var U,R,Y,Q,T,V,X,S,W;U=F(this);if(!A(this)){return window.setTimeout(function(){U.maphilight(O)},200)}Y=F.extend({},O,F.metadata?U.metadata():false,U.data("maphilight"));W=U.get(0).getAttribute("usemap");Q=F('map[name="'+W.substr(1)+'"]');if(!(U.is("img")&&W&&Q.size()>0)){return }if(U.hasClass("maphilighted")){var P=U.parent();U.insertBefore(P);P.remove();F(Q).unbind(".maphilight").find("area[coords]").unbind(".maphilight")}R=F("<div></div>").css({display:"block",background:'url("'+this.src+'")',position:"relative",padding:0,width:this.width,height:this.height});if(Y.wrapClass){if(Y.wrapClass===true){R.addClass(F(this).attr("class"))}else{R.addClass(Y.wrapClass)}}U.before(R).css("opacity",0).css(H).remove();if(F.browser.msie){U.css("filter","Alpha(opacity=0)")}R.append(U);T=C(this);F(T).css(H);T.height=this.height;T.width=this.width;X=function(c){var a,b;b=J(this,Y);if(!b.neverOn&&!b.alwaysOn){a=K(this);I(T,a[0],a[1],b,"highlighted");if(b.groupBy){var Z;if(/^[a-zA-Z][-a-zA-Z]+$/.test(b.groupBy)){Z=Q.find("area["+b.groupBy+'="'+F(this).attr(b.groupBy)+'"]')}else{Z=Q.find(b.groupBy)}var d=this;Z.each(function(){if(this!=d){var f=J(this,Y);if(!f.neverOn&&!f.alwaysOn){var e=K(this);I(T,e[0],e[1],f,"highlighted")}}})}if(!has_canvas){F(T).append("<v:rect></v:rect>")}}};F(Q).bind("alwaysOn.maphilight",function(){if(V){L(V)}if(!has_canvas){F(T).empty()}F(Q).find("area[coords]").each(function(){var Z,a;a=J(this,Y);if(a.alwaysOn){if(!V&&has_canvas){V=C(U.get());F(V).css(H);V.width=U.width();V.height=U.height();U.before(V)}a.fade=a.alwaysOnFade;Z=K(this);if(has_canvas){I(V,Z[0],Z[1],a,"")}else{I(T,Z[0],Z[1],a,"")}}})});F(Q).trigger("alwaysOn.maphilight").find("area[coords]").bind("mouseover.maphilight",X).bind("mouseout.maphilight",function(Z){L(T)});U.before(T);U.addClass("maphilighted")})};F.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:0.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false,neverOn:false,groupBy:false,wrapClass:true}})(jQuery);
1097
1098/*! fancyBox v2.0.4 fancyapps.com | fancyapps.com/fancybox/#license */
1099(function(u,q,e){var l=e(u),r=e(q),a=e.fancybox=function(){a.open.apply(this,arguments)},s=!1,t=null;e.extend(a,{version:"2.0.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:200,minHeight:200,maxWidth:9999,maxHeight:9999,autoSize:!0,fitToView:!0,aspectRatio:!1,topRatio:0.5,fixed:!e.browser.msie||6<e.browser.version||!q.documentElement.hasOwnProperty("ontouchstart"),scrolling:"auto",wrapCSS:"fancybox-default",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,
1100playSpeed:3E3,modal:!1,loop:!0,ajax:{},keys:{next:[13,32,34,39,40],prev:[8,33,37,38],close:[27]},tpl:{wrap:'<div class="fancybox-wrap"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0" '+(e.browser.msie?'allowtransparency="true""':"")+' scrolling="{scrolling}" src="{href}"></iframe>',swf:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',
1101error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<div title="Close" class="fancybox-item fancybox-close"></div>',next:'<a title="Next" class="fancybox-item fancybox-next"><span></span></a>',prev:'<a title="Previous" class="fancybox-item fancybox-prev"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",
1102nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{curs
1102or:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,wrap:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){e.isArray(b)||(b=[b]);if(b.length)a.close(!0),
1103a.opts=e.extend(!0,{},a.defaults,c),a.group=b,a._start(a.opts.index||0)},cancel:function(){if(!(a.coming&&!1===a.trigger("onCancel"))&&(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload))a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null},close:function(b){a.cancel();if(a.current&&!1!==a.trigger("beforeClose"))a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(e(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened=
1104!1,e(".fancybox-item").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]())},play:function(b){var c=function(){clearTimeout(a.player.timer)},d=function(){c();if(a.current&&a.player.isActive)a.player.timer=setTimeout(a.next,a.current.playSpeed)},g=function(){c();e("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])g();else if(a.current&&(a.current.loop||a.current.index<
1105a.group.length-1))a.player.isActive=!0,e("body").bind({"afterShow.player onUpdate.player":d,"onCancel.player beforeClose.player":g,"beforeLoad.player":c}),d(),a.trigger("onPlayStart")},next:function(){a.current&&a.jumpto(a.current.index+1)},prev:function(){a.current&&a.jumpto(a.current.index-1)},jumpto:function(b){a.current&&(b=parseInt(b,10),1<a.group.length&&a.current.loop&&(b>=a.group.length?b=0:0>b&&(b=a.group.length-1)),"undefined"!==typeof a.group[b]&&(a.cancel(),a._start(b)))},reposition:function(b){a.isOpen&&
1106a.wrap.css(a._getPosition(b))},update:function(){a.isOpen&&(s||(t=setInterval(function(){if(s&&(s=!1,clearTimeout(t),a.current)){if(a.current.autoSize)a.inner.height("auto"),a.current.height=a.inner.height();a._setDimension();a.current.canGrow&&a.inner.height("auto");a.reposition();a.trigger("onUpdate")}},100)),s=!0)},toggle:function(){if(a.isOpen)a.current.fitToView=!a.current.fitToView,a.update()},hideLoading:function(){e("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();e('<div id="fancybox-loading"></div>').click(a.cancel).appendTo("body")},
1107getViewport:function(){return{x:l.scrollLeft(),y:l.scrollTop(),w:l.width(),h:l.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");r.unbind(".fb");l.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(l.bind("resize.fb, orientationchange.fb",a.update),c&&r.bind("keydown.fb",function(b){var g;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&0>e.inArray(b.target.tagName.toLowerCase(),["input","textarea","select","button"]))g=b.keyCode,-1<e.inArray(g,c.close)?(a.close(),b.preventDefault()):
1108-1<e.inArray(g,c.next)?(a.next(),b.preventDefault()):-1<e.inArray(g,c.prev)&&(a.prev(),b.preventDefault())}),e.fn.mousewheel&&b.mouseWheel&&1<a.group.length&&a.wrap.bind("mousewheel.fb",function(b,c){var f=e(b.target).get(0);if(0===f.clientHeight||f.scrollHeight===f.clientHeight)b.preventDefault(),a[0<c?"prev":"next"]()}))},trigger:function(b){var c,d=a[-1<e.inArray(b,["onCancel","beforeLoad","afterLoad"])?"coming":"current"];if(d){e.isFunction(d[b])&&(c=d[b].apply(d,Array.prototype.slice.call(arguments,
11091)));if(!1===c)return!1;d.helpers&&e.each(d.helpers,function(c,f){if(f&&"undefined"!==typeof a.helpers[c]&&e.isFunction(a.helpers[c][b]))a.helpers[c][b](f,d)});e.event.trigger(b+".fb")}},isImage:function(a){return a&&a.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)},isSWF:function(a){return a&&a.match(/\.(swf)(.*)?$/i)},_start:function(b){var c={},d=a.group[b]||null,g,f,k;if("object"===typeof d&&(d.nodeType||d instanceof e))g=!0,e.metadata&&(c=e(d).metadata());c=e.extend(!0,{},a.opts,{index:b,element:d},
1110e.isPlainObject(d)?d:c);e.each(["href","title","content","type"],function(b,f){c[f]=a.opts[f]||g&&e(d).attr(f)||c[f]||null});if("number"===typeof c.margin)c.margin=[c.margin,c.margin,c.margin,c.margin];c.modal&&e.extend(!0,c,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{css:{curs
1110or:"auto"},closeClick:!1}}});a.coming=c;if(!1===a.trigger("beforeLoad"))a.coming=null;else{f=c.type;b=c.href;if(!f)g&&(k=e(d).data("fancybox-type"),!k&&d.className&&(f=(k=d.className.match(/fancybox\.(\w+)/))?
1111k[1]:null)),!f&&b&&(a.isImage(b)?f="image":a.isSWF(b)?f="swf":b.match(/^#/)&&(f="inline")),f||(f=g?"inline":"html"),c.type=f;"inline"===f||"html"===f?(c.content=c.content||("inline"===f&&b?e(b):d),c.content.length||(f=null)):(c.href=b||d,c.href||(f=null));c.group=a.group;"image"===f?a._loadImage():"ajax"===f?a._loadAjax():f?a._afterLoad():a._error("type")}},_error:function(b){e.extend(a.coming,{type:"html",autoSize:!0,minHeight:"0",hasError:b,content:a.coming.tpl.error});a._afterLoad()},_loadImage:function(){a.imgPreload=
1112new Image;a.imgPreload.onload=function(){this.onload=this.onerror=null;a.coming.width=this.width;a.coming.height=this.height;a._afterLoad()};a.imgPreload.onerror=function(){this.onload=this.onerror=null;a._error("image")};a.imgPreload.src=a.coming.href;a.imgPreload.complete||a.showLoading()},_loadAjax:function(){a.showLoading();a.ajaxLoad=e.ajax(e.extend({},a.coming.ajax,{url:a.coming.href,error:function(b,c){"abort"!==c?a._error("ajax",b):a.hideLoading()},success:function(b,c){if("success"===c)a.coming.content=
1113b,a._afterLoad()}}))},_preload:function(){var b=a.group,c=a.current.index,d=function(b){if(b&&a.isImage(b))(new Image).src=b};1<b.length&&(d(e(b[c+1]||b[0]).attr("href")),d(e(b[c-1]||b[b.length-1]).attr("href")))},_afterLoad:function(){a.hideLoading();!a.coming||!1===a.trigger("afterLoad",a.current)?a.coming=!1:(a.isOpened?(e(".fancybox-item").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.prevMethod]()):(e(".fancybox-wrap").stop().trigger("onReset").remove(),
1114a.trigger("afterClose")),a.unbindEvents(),a.isOpen=!1,a.current=a.coming,a.coming=!1,a.wrap=e(a.current.tpl.wrap).addClass("fancybox-tmp "+a.current.wrapCSS).appendTo("body"),a.outer=e(".fancybox-outer",a.wrap).css("padding",a.current.padding+"px"),a.inner=e(".fancybox-inner",a.wrap),a._setContent(),a.trigger("beforeShow"),a._setDimension(),a.wrap.hide().removeClass("fancybox-tmp"),a.bindEvents(),a._preload(),a.transitions[a.isOpened?a.current.nextMethod:a.current.openMethod]())},_setContent:function(){var b,
1115c,d=a.current,g=d.type;switch(g){case "inline":case "ajax":case "html":b=d.content;"inline"===g&&b instanceof e&&(b=b.show().detach(),b.parent().hasClass("fancybox-inner")&&b.parents(".fancybox-wrap").trigger("onReset").remove(),e(a.wrap).bind("onReset",function(){b.appendTo("body").hide()}));if(d.autoSize)c=e('<div class="fancybox-tmp"></div>').appendTo(e("body")).append(b),d.width=c.outerWidth(),d.height=c.outerHeight(!0),b=c.contents().detach(),c.remove();break;case "image":b=d.tpl.image.replace("{href}",
1116d.href);d.aspectRatio=!0;break;case "swf":b=d.tpl.swf.replace(/\{width\}/g,d.width).replace(/\{height\}/g,d.height).replace(/\{href\}/g,d.href);break;case "iframe":b=d.tpl.iframe.replace("{href}",d.href).replace("{scrolling}",d.scrolling).replace("{rnd}",(new Date).getTime())}if(-1<e.inArray(g,["image","swf","iframe"]))d.autoSize=!1,d.scrolling=!1;a.inner.append(b)},_setDimension:function(){var b=a.wrap,c=a.outer,d=a.inner,g=a.current,f=a.getViewport(),k=g.margin,i=2*g.padding,h=g.width+i,j=g.height+
1117i,l=g.width/g.height,o=g.maxWidth,m=g.maxHeight,n=g.minWidth,p=g.minHeight;f.w-=k[1]+k[3];f.h-=k[0]+k[2];-1<h.toString().indexOf("%")&&(h=f.w*parseFloat(h)/100);-1<j.toString().indexOf("%")&&(j=f.h*parseFloat(j)/100);g.fitToView&&(o=Math.min(f.w,o),m=Math.min(f.h,m));n=Math.min(h,n);p=Math.min(h,p);o=Math.max(n,o);m=Math.max(p,m);g.aspectRatio?(h>o&&(h=o,j=(h-i)/l+i),j>m&&(j=m,h=(j-i)*l+i),h<n&&(h=n,j=(h-i)/l+i),j<p&&(j=p,h=(j-i)*l+i)):(h=Math.max(n,Math.min(h,o)),j=Math.max(p,Math.min(j,m)));h=Math.round(h);
1118j=Math.round(j);e(b.add(c).add(d)).width("auto").height("auto");d.width(h-i).height(j-i);b.width(h);k=b.height();if(h>o||k>m)for(;(h>o||k>m)&&h>n&&k>p;)j-=10,g.aspectRatio?(h=Math.round((j-i)*l+i),h<n&&(h=n,j=(h-i)/l+i)):h-=10,d.width(h-i).height(j-i),b.width(h),k=b.height();g.dim={width:h,height:k};g.canGrow=g.autoSize&&j>p&&j<m;g.canShrink=!1;g.canExpand=!1;if(h-i<g.width||j-i<g.height)g.canExpand=!0;else if((h>f.w||k>f.h)&&h>n&&j>p)g.canShrink=!0;b=k-i;a.innerSpace=b-d.height();a.outerSpace=b-
1119c.height()},_getPosition:function(b){var c=a.current,d=a.getViewport(),e=c.margin,f=a.wrap.width()+e[1]+e[3],k=a.wrap.height()+e[0]+e[2],i={position:"absolute",top:e[0]+d.y,left:e[3]+d.x};if(c.fixed&&(!b||!1===b[0])&&k<=d.h&&f<=d.w)i={position:"fixed",top:e[0],left:e[3]};i.top=Math.ceil(Math.max(i.top,i.top+(d.h-k)*c.topRatio))+"px";i.left=Math.ceil(Math.max(i.left,i.left+0.5*(d.w-f)))+"px";return i},_afterZoomIn:function(){var b=a.current;a.isOpen=a.isOpened=!0;a.wrap.addClass("fancybox-opened").css("overflow",
1120"visible");a.update();a.inner.css("overflow","auto"===b.scrolling?"auto":"yes"===b.scrolling?"scroll":"hidden");if(b.closeClick||b.nextClick)a.inner.css("cursor","pointer").bind("click.fb",b.nextClick?a.next:a.close);b.closeBtn&&e(b.tpl.closeBtn).appendTo(a.wrap).bind("click.fb",a.close);b.arrows&&1<a.group.length&&((b.loop||0<b.index)&&e(b.tpl.prev).appendTo(a.wrap).bind("click.fb",a.prev),(b.loop||b.index<a.group.length-1)&&e(b.tpl.next).appendTo(a.wrap).bind("click.fb",a.next));a.trigger("afterShow");
1121if(a.opts.autoPlay&&!a.player.isActive)a.opts.autoPlay=!1,a.play()},_afterZoomOut:function(){a.trigger("afterClose");a.wrap.trigger("onReset").remove();e.extend(a,{group:{},opts:{},current:null,isOpened:!1,isOpen:!1,wrap:null,outer:null,inner:null})}});a.transitions={getOrigPosition:function(){var b=a.current.element,c={},d=50,g=50,f;b&&b.nodeName&&e(b).is(":visible")?(f=e(b).find("img:first"),f.length?(c=f.offset(),d=f.outerWidth(),g=f.outerHeight()):c=e(b).offset()):(b=a.getViewport(),c.top=b.y+
11220.5*(b.h-g),c.left=b.x+0.5*(b.w-d));return c={top:Math.ceil(c.top)+"px",left:Math.ceil(c.left)+"px",width:Math.ceil(d)+"px",height:Math.ceil(g)+"px"}},step:function(b,c){var d,e,f;if("width"===c.prop||"height"===c.prop)e=f=Math.ceil(b-2*a.current.padding),"height"===c.prop&&(d=(b-c.start)/(c.end-c.start),c.start>c.end&&(d=1-d),e-=a.innerSpace*d,f-=a.outerSpace*d),a.inner[c.prop](e),a.outer[c.prop](f)},zoomIn:function(){var b=a.wrap,c=a.current,d,g;d=c.dim;if("elastic"===c.openEffect){g=e.extend({},
1123d,a._getPosition(!0));delete g.position;d=this.getOrigPosition();if(c.openOpacity)d.opacity=0,g.opacity=1;b.css(d).show().animate(g,{duration:c.openSpeed,easing:c.openEasing,step:this.step,complete:a._afterZoomIn})}else b.css(e.extend({},d,a._getPosition())),"fade"===c.openEffect?b.fadeIn(c.openSpeed,a._afterZoomIn):(b.show(),a._afterZoomIn())},zoomOut:function(){var b=a.wrap,c=a.current,d;if("elastic"===c.closeEffect){"fixed"===b.css("position")&&b.css(a._getPosition(!0));d=this.getOrigPosition();
1124if(c.closeOpacity)d.opacity=0;b.animate(d,{duration:c.closeSpeed,easing:c.closeEasing,step:this.step,complete:a._afterZoomOut})}else b.fadeOut("fade"===c.closeEffect?c.closeSpeed:0,a._afterZoomOut)},changeIn:function(){var b=a.wrap,c=a.current,d;"elastic"===c.nextEffect?(d=a._getPosition(!0),d.opacity=0,d.top=parseInt(d.top,10)-200+"px",b.css(d).show().animate({opacity:1,top:"+=200px"},{duration:c.nextSpeed,complete:a._afterZoomIn})):(b.css(a._getPosition()),"fade"===c.nextEffect?b.hide().fadeIn(c.nextSpeed,
1125a._afterZoomIn):(b.show(),a._afterZoomIn()))},changeOut:function(){var b=a.wrap,c=a.current,d=function(){e(this).trigger("onReset").remove()};b.removeClass("fancybox-opened");"elastic"===c.prevEffect?b.animate({opacity:0,top:"+=200px"},{duration:c.prevSpeed,complete:d}):b.fadeOut("fade"===c.prevEffect?c.prevSpeed:0,d)}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width(0).height(0);e.browser.msie?(a=Math.max(q.documentElement.scrollWidth,q.body.scrollWidth),c=Math.max(q.documentElement.offsetWidth,
1126q.body.offsetWidth),a=a<c?l.width():a):a=r.width();this.overlay.width(a).height(r.height())},beforeShow:function(b){if(!this.overlay)this.overlay=e('<div id="fancybox-overlay"></div>').css(b.css||{background:"black"}).appendTo("body"),this.update(),b.closeClick&&this.overlay.bind("click.fb",a.close),l.bind("resize.fb",e.proxy(this.update,this)),this.overlay.fadeTo(b.speedIn||"fast",b.opacity||1)},onUpdate:function(){this.update()},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||
1127"fast",function(){e(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c;if(c=a.current.title)c=e('<div class="fancybox-title fancybox-title-'+b.type+'-wrap">'+c+"</div>").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner('<span class="child"></span>'),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.outer)}};e.fn.fancybox=function(b){function c(b){var c=[],i,h=this.rel;
1128if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey)b.preventDefault(),b=e(this).data("fancybox-group"),"undefined"!==typeof b?i=b?"data-fancybox-group":!1:h&&""!==h&&"nofollow"!==h&&(b=h,i="rel"),i&&(c=g.length?e(g).filter("["+i+'="'+b+'"]'):e("["+i+'="'+b+'"]')),c.length?(d.index=c.index(this),a.open(c.get(),d)):a.open(this,d)}var d=b||{},g=this.selector||"";g?r.undelegate(g,"click.fb-start").delegate(g,"click.fb-start",c):e(this).unbind("click.fb-start").bind("click.fb-start",c);return this}})(window,
1129document,jQuery);
1130
1131//button navigation///////////////////////////////////////////////////////////////////////////////////////////////////////        
1132    document.onkeydown = NavigateThrough;
1133    function NavigateThrough (event)
1134    {
1135    if (!document.getElementById) return;
1136    if (window.event) event = window.event;
1137	if (event.ctrlKey)
1138	    {
1139		var link = null;
1140		var href = null;
1141		switch (event.keyCode ? event.keyCode : event.which ? event.which : null)
1142		    {
1143			case 0x25:
1144				link = document.getElementById ('prev');
1145				break;
1146			case 0x27:
1147				link = document.getElementById ('next');
1148				break;
1149		    }
1150        if (link) document.location = link.href;
1151	    }
1152    }
1153
1154
1155$(function(){
1156
1157        $('.all_websites').hover(
1158        function(){
1159            $('.all_websites_content').css('visibility','visible');
1160        },
1161        function(){
1162            $('.all_websites_content').css('visibility','hidden')
1163        })
1164        
1165        $('.regions_map').maphilight({stroke: false, fillOpacity:0.2})
1166        
1167        //tabs init
1168	$('ul.tabs').delegate('li', 'click', function() {
1169		if ($(this).hasClass('link')) {
1170			location.href = $(this).find('a').attr('href')
1171			return false;
1172		}
1173                if($(this).hasClass('current')){
1174                    location.href = $(this).parents('.tabs_conteiner').find('div.box').eq($(this).index()).find('.last:last p a').attr('href')
1175                }
1176		$(this).addClass('current').siblings().removeClass('current')
1177		.parents('.tabs_conteiner').find('div.box').hide().eq($(this).index()).show();
1178                $(this).parents('.tabs_conteiner').find('div.box').eq($(this).index()).find('.js-img64x64').attr('style','').imgHW();
1179        })
1180        $('.tabs_conteiner .box:first').addClass('visible');
1181        $('ul.tabs li:first').addClass('current');
1182	
1183        //flipNavmenu init				
1184	$('#navigation ul:first').flipNav();
1185					
1186        //rubricatormenu init                                
1187        $('#rubricator li').has('ul').addClass('hasChild').hover(function(){
1188                $(this).find('>ul').stop(true, true).show();
1189        }, function(){
1190                $(this).find('>ul').stop(true, true).hide();
1191        });
1192				   
1193	//customfileinput init				
1194        $('#file').customFileInput();	
1195
1196	//customselect init				
1197        if (!$.browser.opera) {
1198            $('select.select').each(function(){
1199                var title = $(this).attr('title');
1200                if( $('option:selected', this).val() != ''  ) title = $('option:selected',this).text();
1201                $(this)
1202                    .css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
1203                    .after('<span class="select">' + title + '</span>')
1204                    .change(function(){
1205                        if ($(this).find('option:selected').text()=='Âûáåðèòå ðóáðèêó')
1206                        {
1207                            $(this).next().css('color','#999')
1208                        }
1209                        else
1210                        {
1211                            $(this).next().css('color','#000')
1212                        }
1213                            val = $('option:selected',this).text();
1214                            $(this).next().text(val);
1215                    })
1216            });
1217        };
1218	
1219	//innergallery init
1220	$('#gallery li').click(function(){
1221		var bigpic = $(this).find('img').attr("src"),
1222                    dwnld_link = $(this).find('img').attr("alt")
1223                    $('.download').show()
1224                    if ($('.fancybox').length == 0) {
1225                    $('#photo_conteiner img').wrap('<a class="fancybox" href=""></a>')
1226                    }
1227		if ($(this).is(".active")) { 
1228			return false;
1229		} else {                        
1230			$('#photo_conteiner img').attr({ src: bigpic});
1231                        $('.fancybox').attr('href', bigpic) 
1232			$('#gallery li').removeClass('active'); 
1233			$(this).addClass('active')
1234                        $('.download>a').attr('href', dwnld_link)
1235		}  
1236		return false;
1237	});
1238        
1239        $('#photo_conteiner').delegate(".fancybox","click",function(){
1240            $.fancybox(this,{
1241                type:'image'
1242            });
1243            return false
1244        })
1245        
1246        //jcarousel init
1247	if ($('#gallery').length){
1248		$('#gallery').jcarousel();
1249	}
1250        
1251        if($('.carousel').length){
1252            $('.carousel').jcarousel({
1253                wrap:"circular"
1254            });
1255        }
1256	
1257	//placeholder init
1258        swaps = [];
1259        $(".placeholder").each(function(i){
1260                swaps[i] = $(this).val();
1261                $(this).focusin(function(){
1262                        if ($(this).val() == swaps[i]) {
1263                                $(this).val("").css('color','#000')
1264                        }
1265                }).focusout(function(){
1266                        if ($.trim($(this).val()) == "") {
1267                                $(this).val(swaps[i]).css('color','#999')
1268                        }
1269                });
1270        });
1271		
1272        /* simpletip init */
1273        $('.orglink').each(function(){
1274            if ($(this).parents('td').find('.desc').text()!= '' && $(this).parents('td').find('.desc').text()!= ' '){
1275                $(this).simpletip({content: $(this).parents('td').find('.desc').text(), fixed: false })
1276            }
1277        });
1278        $('#article a[title!=""]').each(function(){
1279            $(this).simpletip({content: $(this).attr('title'), fixed: false });
1280            $(this).removeAttr('title');
1281        })
1282        
1283        if ($('.attach_link').length){
1284		$('.attach_link > a').fancybox();
1285	}
1286	
1287        //decorate
1288        $('.grid_embracer').wrap('<div class="gridwraper"></div>')
1289        $('#ecomaps li:last').width(290);
1290	$('.js-ooptobj-block').each(function(){
1291		var amount = $(this).find('.js-ooptobj').size();
1292		var around = Math.ceil(amount/2);
1293		$(this).find('.js-ooptobj:lt(' + around + ')').wrapAll('<div class="leftwrap"></div>');
1294		$(this).find('.js-ooptobj:gt(' + around + ')').add($(this).find('.js-ooptobj:eq(' + around + ')')).wrapAll('<div class="rightwrap"></div>');
1295	})
1296	
1297	//vote init
1298	$('.vote a').click(function() {
1299		if ($(this).parent().hasClass('vote-disabled')) {
1300			$('.vote-message').html('Èçâèíèòå, âû óæå ãîëîñîâàëè').fadeIn('slow').delay(2000).fadeOut('slow');
1301			return false;
1302		}
1303		var url = $(this).attr('href');
1304		$.ajax({
1305			type: "POST",
1306			url: url,
1307			cache: false,
1308			success: function(data) {
1309				var votes = eval("(" + data + ")");
1310				$('#votes-id').text(votes.OBJECT_RATING_COUNT);
1311				$('.positive').text(votes.RATING_UP_PERCENT);
1312				$('.negative').text(votes.RATING_DOWN_PERCENT);
1313				$('.vote-message').html('Ñïàñèáî, âàø ãîëîñ ïðèíÿò').fadeIn('slow').delay(2000).fadeOut('slow');
1314			}
1315		});
1316		return false;
1317	}); 
1318	
1319	//bottomblockheight init
1320	$('#bottom').each(function() {
1321		var blocks = $(this).find('.b_block');
1322		var b1 = blocks.first();
1323		var b2 = blocks.eq(1);
1324		var b3 = blocks.eq(2);
1325		var max = b1.height();
1326		if (max < b2.height()) max = b2.height();
1327		if (max < b3.height()) max = b3.height();
1328		b1.height(max);
1329		b2.height(max);
1330		b3.height(max);                                    
1331	}); 
1332		
1333	$('#article').each(function(){
1334		$(this).find('table').each(function(){
1335			twidth = $(this).width();
1336			if (twidth > $('#article').width()){
1337				$(this).css({'font-size':'9px', 'padding':'5px'});
1338				if ($(this).width() > $('#article').width()){
1339					$(this).wrap('div class="twrap"/>');
1340				}
1341			}
1342		})
1343	})
1344	
1345	// login by 'return'
1346	$('.userbox-popup form').keypress(function(e) {
1347		if(e.keyCode == 13) {
1348			$('.userbox-popup .button').trigger('click');
1349		}
1350	});	
1351	
1352	$('.gotop').click(function() {
1353		$("html").scrollTop(0);
1354		return false;
1355	});
1356	
1357	$('input[placeholder], textarea[placeholder]').placeholder();
1358
1359	$('.reply-a').live('click',function() {
1360		var commentId = $(this).attr('href').slice(1);
1361		$('#csendn').remove();
1362		var csend = $('#add_comment').clone();
1363		csend.attr('id','csendn');
1364		$(this).parent().after(csend);	
1365		$('#csendn .upcomment').val(commentId);
1366		$('[tagData]',$('#csendn')).cascade().bindHtml(true);
1367		$('#csendn textarea').keydown(function(e) {
1368			if (e.ctrlKey && e.keyCode == 13) {
1369				$('#csendn .button').trigger('click');
1370			}
1371		}); 
1372		return false;
1373	});
1374	$('.reply-ah').live('click', function() {
1375		$('#csendn').remove();
1376		var csend = $('add_comment').clone();
1377		csend.attr('id','csendn');
1378		$(this).parent().parent().after(csend);	
1379		$('[tagData]',$('#csendn')).cascade().bindHtml(true);			  		
1380		return false;
1381	});
1382	$('.reply-ah').trigger('click');
1383    
1384    $('#text').keydown(function(e) {
1385		if (e.ctrlKey && e.keyCode == 13) {
1386			$('#add_comment .button').trigger('click');
1387		}
1388	});    
1389        
1390});
1391		
1392$(document).ready(function(){
1393    $('.js-gallery-cover').each(function(){
1394        var jsGN = $(this).find('.js-gallery-name');
1395        $(jsGN).addClass('hide');
1396        $(this).hover(
1397            function() {
1398                $(jsGN).removeClass('hide');
1399            },
1400            function() {
1401                $(jsGN).addClass('hide');
1402            }
1403        );
1404    });
1405}); 
1406	
1407
1408jQuery(document).ready(function() {
1409        jQuery('.fancybox').fancybox({
1410        type: "image"
1411    });
1412});
1413jQuery(document).ready(function() {
1414    jQuery('.b-a-list').jcarousel({
1415    vertical:true,
1416    scroll:1
1417    });
1418});
1419
1420(function($){
1421    $.fn.imgHW = function(opt) {
1422        var defaults = {
1423            height: $(this).parents('div').height(),
1424            width: $(this).parents('div').width(),
1425            margin: 'inner'
1426        };
1427        var options = $.extend(defaults, opt);
1428        return this.each(function() {
1429            var h = $(this).height();
1430            var w = $(this).width();
1431            if(options.margin =='outer') {
1432                if (h > w) {
1433                    $(this).height(options.height);
1434                    var tW = $(this).width();
1435                    if( tW > options.width) {
1436                        $(this).attr('style','');
1437                        $(this).width(options.width);
1438                        var tH = $(this).height();
1439                        var margin = (options.height - tH)/2;
1440                        $(this).css('margin-top', margin);      
1441                    }
1442                    var margin = (options.width - tW)/2;
1443                    $(this).css('margin-left', margin);
1444                } else {
1445                    $(this).width(options.width);
1446                    var tH = $(this).height();
1447                    if( tH > options.height) {
1448                        $(this).attr('style','');
1449                        $(this).height(options.height);
1450                        var tW = $(this).width();
1451                        var margin = (options.width - tW)/2;
1452                        $(this).css('margin-left', margin);      
1453                    } else {                    
1454                        var margin = (options.height - tH)/2;
1455                        $(this).css('margin-top', margin);
1456                    }
1457                }
1458            } else {
1459                if (h > w) {
1460                    $(this).width(options.width);
1461                    var tH = $(this).height();
1462                    if( tH < options.height) {
1463                        $(this).attr('style','');
1464                        $(this).height(options.height);
1465                        var tw = $(this).width();
1466                        var margin = (tw - options.width)/2;
1467                        $(this).css('margin-left', -margin);
1468                    } else {
1469                    var margin = (tH - options.height)/2;
1470                    $(this).css('margin-top', -margin);
1471                    }
1472                } 
1473                else {
1474                    $(this).height(options.height);                
1475                    var tw = $(this).width();
1476                    if(tw < options.width) {
1477                        $(this).attr('style','');
1478                        $(this).width(options.width);
1479                        var tH = $(this).height();
1480                        var margin = (tH - options.height)/2;
1481                        $(this).css('margin-top', -margin);
1482                    } else {
1483                        var margin = (tw - options.width)/2;
1484                        $(this).css('margin-left', -margin);
1485                    }
1486                }
1487            }
1488            $(this).show();
1489        });
1490    }
1491})(jQuery);
1492
1493
1494
1495jQuery(document).ready(function() {
1496    var ig_d=$('.b-a-list li').find('img:first').attr("src");
1497    $('.photo-conteiner img').attr({ src: ig_d});
1498    $('.photo-conteiner a.fancybox').attr({ href: ig_d});
1499    var state=$('.b-a-list li').find('img:first').attr("title");
1500    $('.state-box').text(state);
1501    $('.b-a-list li:first').addClass('active');
1502    $('.b-a-list li').click(function(){
1503        var bigpic = $(this).find('img').attr("src"),
1504        state=$(this).find('img').attr("title")
1505        dwnld_link = $(this).find('img').attr("alt")
1506        $('.download').show()
1507        if ($('.fancybox').length == 0) {
1508        $('.photo-conteiner img').wrap('<a class="fancybox" href=""></a>')
1509        }
1510        if ($(this).is(".active")) {
1511            return false;
1512        } else {
1513        $('.photo-conteiner img').attr({ src: bigpic}).attr('style','').imgHW({height:350, width: 480, margin: 'outer'});
1514        $('.fancybox').attr('href', bigpic)
1515        $('.b-a-list li').removeClass('active');
1516        $(this).addClass('active')
1517        $('.download>a').attr('href', dwnld_link)
1518        $('.state-box').text(state)
1519        }
1520        return false;
1521    });
1522    
1523    $('.js-img90X120, .js-img100x100, .js-img165x245, .js-img95x145,  .js-img160x214, .js-img350x480, .js-img60x60, .js-img40x40, .js-img64x64, .js-img290x290, .js-img180x180').hide();    
1524    $(window).load(function() {
1525        $('.js-img350x480').imgHW({height:350, width: 480, margin: 'outer'});
1526        $('.js-img90X120').imgHW({height:90, width: 122});
1527        $('.js-img160x214').imgHW({height:160, width: 214});
1528        $('.js-img60x60').imgHW({height:60, width: 60});
1529        $('.js-img40x40').imgHW({height:40, width: 40});
1530        $('.js-img64x64').imgHW({height:64, width: 64});
1531        $('.js-img290x290').imgHW({height:290, width:290});        
1532        $('.js-img180x180').imgHW({height:180, width:180});    
1533        $('.js-img100x100').imgHW({height:100, width:100});      
1534        $('.js-img165x245').imgHW({height:165, width:245});       
1535        $('.js-img95x145').imgHW({height:95, width:145});       
1536    });
1537});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.