//mousewheel
(function(C){var A=["DOMMouseScroll","mousewheel"];C.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var D=A.length;D;){this.addEventListener(A[--D],B,false);}}else{this.onmousewheel=B;}},teardown:function(){if(this.removeEventListener){for(var D=A.length;D;){this.removeEventListener(A[--D],B,false);}}else{this.onmousewheel=null;}}};C.fn.extend({mousewheel:function(D){return D?this.bind("mousewheel",D):this.trigger("mousewheel");},unmousewheel:function(D){return this.unbind("mousewheel",D);}});function B(I){var G=I||window.event,F=[].slice.call(arguments,1),J=0,H=true,E=0,D=0;I=C.event.fix(G);I.type="mousewheel";if(I.wheelDelta){J=I.wheelDelta/120;}if(I.detail){J=-I.detail/3;}D=J;if(G.axis!==undefined&&G.axis===G.HORIZONTAL_AXIS){D=0;E=-1*J;}if(G.wheelDeltaY!==undefined){D=G.wheelDeltaY/120;}if(G.wheelDeltaX!==undefined){E=-1*G.wheelDeltaX/120;}F.unshift(I,J,E,D);return C.event.handle.apply(this,F);}})(jQuery);(function(A){A.fn.barAdjust=function(B){var B=A.extend({start:0,startLabel:"&pound;0",end:1500000,endLabel:"&pound;1.5m",value:32554.95,valueLabel:"&pound;32,554.95"},B);return this.each(function(){B.value=(B.value>B.end)?B.end:B.value;var G=A(this),C=A(".start",G),E=A(".end",G),H=A(".bar",G),L=A(".value",G),O=A(".middle",G);C.html(B.startLabel);E.html(B.endLabel);L.html(B.valueLabel);var M=C.width(),I=E.width(),F=900-(M+(M*0.075)+I+(I*0.075)),J=(B.value/B.end)*100,N=(100-J),D=(N/100)*F;O.css({width:F+"px"});H.css({width:J+"%"});var K=L.width()+28;if(D>K){L.css({left:(J)+"%"});}else{L.css({right:(D)+"px"});}});};})(jQuery);(function(A){A.fn.counter=function(B){return this.each(function(){var G=A(this),F=A("button.plus",G),E=A("button.minus",G),C=A(".label",G);display=A("input.counter_input",G);F.bind("click",function(){var H=parseInt(display.val(),10);(isNaN(H))?H=1:H=H;display.val(D(H+1));return false;});E.bind("click",function(){var H=parseInt(display.val(),10);(H<2||isNaN(H))?H=2:H=H;display.val(D(H-1));return false;});display.bind("keyup",function(){var H=parseInt(display.val(),10);(H<1||isNaN(H))?H=1:H=H;display.val(D(H));});function D(I){var H=(I==1)?"Bag":"Bags";C.html(H);return I;}});};})(jQuery);function openWindow(C,B,D,A){var D=D||480,A=A||640;window.open(B,C,"width="+A+",height="+D+",resizable=1,scrollbars=1,toolbar=0,status=0");}
//scrollpane
(function(a){a.jScrollPane={active:[]},a.fn.jScrollPane=function(b){b=a.extend({},a.fn.jScrollPane.defaults,b);var c=function(){return!1};return this.each(function(){var d=a(this),e=this,f=0,g,h,i,j=b.topCapHeight,k;if(a(this).parent().is(".jScrollPaneContainer")){k=a(this).parent(),f=b.maintainPosition?d.position().top:0;var l=a(this).parent();g=l.innerWidth(),h=l.outerHeight(),a(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown, >.jScrollCap",l).remove(),d.css({top:0})}else d.data("originalStyleTag",d.attr("style")),d.css("overflow","hidden"),this.originalPadding=d.css("paddingTop")+" "+d.css("paddingRight")+" "+d.css("paddingBottom")+" "+d.css("paddingLeft"),this.originalSidePaddingTotal=(parseInt(d.css("paddingLeft"))||0)+(parseInt(d.css("paddingRight"))||0),g=d.innerWidth(),h=d.innerHeight(),k=a("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:h+"px",width:g+"px"}),b.enableKeyboardNavigation&&k.attr("tabindex",b.tabIndex),d.wrap(k),k=d.parent(),a(document).bind("emchange",function(a,c,e){d.jScrollPane(b)});i=h;if(b.reinitialiseOnImageLoad){var m=a.data(e,"jScrollPaneImagesToLoad")||a("img",d),n=[];m.length&&m.each(function(c,f){a(this).bind("load readystatechange",function(){if(a.inArray(c,n)==-1){n.push(f),m=a.grep(m,function(a,b){return a!=f}),a.data(e,"jScrollPaneImagesToLoad",m);var g=a.extend(b,{reinitialiseOnImageLoad:!1});d.jScrollPane(g)}}).each(function(a,b){if(this.complete||this.complete===undefined)this.src=this.src})})}var o=this.originalSidePaddingTotal,p=g-b.scrollbarWidth-b.scrollbarMargin-o,q={height:"auto",width:p+"px"};b.scrollbarOnLeft?q.paddingLeft=b.scrollbarMargin+b.scrollbarWidth+"px":q.paddingRight=b.scrollbarMargin+"px",d.css(q);var r=d.outerHeight(),s=h/r,t=s<.99;k[t?"addClass":"removeClass"]("jScrollPaneScrollable");if(t){k.append(a("<div></div>").addClass("jScrollCap jScrollCapTop").css({height:b.topCapHeight}),a("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:b.scrollbarWidth+"px"}).append(a("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:b.scrollbarWidth+"px"}).append(a("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:b.scrollbarWidth+"px"}),a("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:b.scrollbarWidth+"px"}))),a("<div></div>").addClass("jScrollCap jScrollCapBottom").css({height:b.bottomCapHeight}));var u=a(">.jScrollPaneTrack",k),v=a(">.jScrollPaneTrack .jScrollPaneDrag",k),w,x=[],y,z=function(){(y>4||y%4==0)&&S(L+w*K),y++};b.enableKeyboardNavigation&&k.bind("keydown.jscrollpane",function(a){switch(a.keyCode){case 38:w=-1,y=0,z(),x[x.length]=setInterval(z,100);return!1;case 40:w=1,y=0,z(),x[x.length]=setInterval(z,100);return!1;case 33:case 34:return!1;default:}}).bind("keyup.jscrollpane",function(a){if(a.keyCode==38||a.keyCode==40){for(var b=0;b<x.length;b++)clearInterval(x[b]);return!1}});if(b.showArrows){var A,B,C=function(b){a("html").unbind("mouseup",C),A.removeClass("jScrollActiveArrowButton"),clearInterval(B)},D=function(){a("html").bind("mouseup",C),A.addClass("jScrollActiveArrowButton"),y=0,z(),B=setInterval(z,100)};k.append(a("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp",tabindex:-1}).css({width:b.scrollbarWidth+"px",top:b.topCapHeight+"px"}).html("Scroll up").bind("mousedown",function(){A=a(this),w=-1,D(),this.blur();return!1}).bind("click",c),a("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown",tabindex:-1}).css({width:b.scrollbarWidth+"px",bottom:b.bottomCapHeight+"px"}).html("Scroll down").bind("mousedown",function(){A=a(this),w=1,D(),this.blur();return!1}).bind("click",c));var E=a(">.jScrollArrowUp",k),F=a(">.jScrollArrowDown",k)}if(b.arrowSize)i=h-b.arrowSize-b.arrowSize,j+=b.arrowSize;else if(E){var G=E.height();b.arrowSize=G,i=h-G-F.height(),j+=G}i-=b.topCapHeight+b.bottomCapHeight,u.css({height:i+"px",top:j+"px"});var H=a(this).css({position:"absolute",overflow:"visible"}),I,J,K,L=0,M=s*h/2,N=function(a,b){var c=b=="X"?"Left":"Top";return a["page"+b]||a["client"+b]+(document.documentElement["scroll"+c]||document.body["scroll"+c])||0},O=function(){return!1},P=function(){be(),I=v.offset(!1),I.top-=L,J=i-v[0].offsetHeight,K=2*b.wheelSpeed*J/r},Q=function(b){P(),M=N(b,"Y")-L-I.top,a("html").bind("mouseup",R).bind("mousemove",T).bind("mouseleave",R),a.browser.msie&&a("html").bind("dragstart",O).bind("selectstart",O);return!1},R=function(){a("html").unbind("mouseup",R).unbind("mousemove",T),M=s*h/2,a.browser.msie&&a("html").unbind("dragstart",O).unbind("selectstart",O)},S=function(a){k.scrollTop(0),a=a<0?0:a>J?J:a,L=a,v.css({top:a+"px"});var c=a/J;d.data("jScrollPanePosition",(h-r)*-c),H.css({top:(h-r)*c+"px"}),d.trigger("scroll"),b.showArrows&&(E[a==0?"addClass":"removeClass"]("disabled"),F[a==J?"addClass":"removeClass"]("disabled"))},T=function(a){S(N(a,"Y")-I.top-M)},U=Math.max(Math.min(s*(h-b.arrowSize*2),b.dragMaxHeight),b.dragMinHeight);v.css({height:U+"px"}).bind("mousedown",Q);var V,W,X,Y=function(){(W>8||W%4==0)&&S(L-(L-X)/2),W++},Z=function(){clearInterval(V),a("html").unbind("mouseup",Z).unbind("mousemove",_)},_=function(a){X=N(a,"Y")-I.top-M},ba=function(b){P(),_(b),W=0,a("html").bind("mouseup",Z).bind("mousemove",_),V=setInterval(Y,100),Y();return!1};u.bind("mousedown",ba),k.bind("mousewheel",function(a,b){b=b||(a.wheelDelta?a.wheelDelta/120:a.detail?-a.detail/3:0),P(),be();var c=L;S(L-b*K);var d=c!=L;return!d});var bb,bc;function bd(){var a=(bb-L)/b.animateStep;a>1||a<-1?S(L+a):(S(bb),be())}var be=function(){bc&&(clearInterval(bc),delete bb)},bf=function(c,e){if(typeof c=="string"){try{$e=a(c,d)}catch(f){return}if(!$e.length)return;c=$e.offset().top-d.offset().top}be();var g=r-h;c=c>g?g:c,d.data("jScrollPaneMaxScroll",g);var i=c/g*J;e||!b.animateTo?S(i):(k.scrollTop(0),bb=i,bc=setInterval(bd,b.animateInterval))};d[0].scrollTo=bf,d[0].scrollBy=function(a){var b=-parseInt(H.css("top"))||0;bf(b+a)},P(),bf(-f,!0),a("*",this).bind("focus",function(c){var e=a(this),f=0,g=100;while(e[0]!=d[0]){f+=e.position().top,e=e.offsetParent();if(!(g--))return}var i=-parseInt(H.css("top"))||0,j=i+h,k=f>i&&f<j;if(!k){var l=f-b.scrollbarMargin;f>i&&(l+=a(this).height()+15+b.scrollbarMargin-h),bf(l)}}),b.observeHash&&(location.hash&&location.hash.length>1&&setTimeout(function(){bf(location.hash)},a.browser.safari?100:0),a(document).bind("click",function(c){$target=a(c.target);if($target.is("a")){var d=$target.attr("href");d&&d.substr(0,1)=="#"&&d.length>1&&setTimeout(function(){bf(d,!b.animateToInternalLinks)},a.browser.safari?100:0)}}));function bg(b){a(document).bind("mousemove.jScrollPaneDragging",bl),a(document).bind("mouseup.jScrollPaneDragging",bm)}var bh,bi;function bj(){direction=bh<0?-1:1,d[0].scrollBy(bh/2)}function bk(){bi&&(clearInterval(bi),bi=undefined)}function bl(a){var b=d.parent().offset().top,c=b+h,e=N(a,"Y");bh=e<b?e-b:e>c?e-c:0,bh==0?bk():bi||(bi=setInterval(bj,100))}function bm(b){a(document).unbind("mousemove.jScrollPaneDragging").unbind("mouseup.jScrollPaneDragging"),bk()}k.bind("mousedown.jScrollPane",bg),a.jScrollPane.active.push(d[0])}else d.css({height:h+"px",width:g-this.originalSidePaddingTotal+"px",padding:this.originalPadding}),d[0].scrollTo=d[0].scrollBy=function(){},d.parent().unbind("mousewheel").unbind("mousedown.jScrollPane").unbind("keydown.jscrollpane").unbind("keyup.jscrollpane")})},a.fn.jScrollPaneRemove=function(){a(this).each(function(){$this=a(this);var b=$this.parent();b.is(".jScrollPaneContainer")&&($this.css({top:"",height:"",width:"",padding:"",overflow:"",position:""}),$this.attr("style",$this.data("originalStyleTag")),b.after($this).remove())})},a.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:!1,arrowSize:0,animateTo:!1,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:!0,scrollbarOnLeft:!1,reinitialiseOnImageLoad:!1,tabIndex:0,enableKeyboardNavigation:!0,animateToInternalLinks:!1,topCapHeight:0,bottomCapHeight:0,observeHash:!0},a(window).bind("unload",function(){var b=a.jScrollPane.active;for(var c=0;c<b.length;c++)b[c].scrollTo=b[c].scrollBy=null})})(jQuery);
//==============================================================================================
// Marquee
(function(a){a.fn.marquee=function(b){function f(){var b=c.length,d=null,g=null,h={},i=[],j=!1;while(b--)d=c[b],g=a(d),h=g.data("marqueeState"),g.data("paused")!==!0?(d[h.axis]+=h.scrollamount*h.dir,j=h.dir==-1?d[h.axis]<=e(h.dir*-1,d,h):d[h.axis]>=e(h.dir*-1,d,h),h.behavior=="scroll"&&h.last==d[h.axis]||h.behavior=="alternate"&&j&&h.last!=-1||h.behavior=="slide"&&j&&h.last!=-1?(h.behavior=="alternate"&&(h.dir*=-1),h.last=-1,g.trigger("stop"),h.loops--,h.loops===0?(h.behavior!="slide"?d[h.axis]=e(h.dir,d,h):d[h.axis]=e(h.dir*-1,d,h),g.trigger("end")):(i.push(d),g.trigger("start"),d[h.axis]=e(h.dir,d,h))):i.push(d),h.last=d[h.axis],g.data("marqueeState",h)):i.push(d);c=i,c.length&&setTimeout(f,25)}function e(a,b,c){var d=c.behavior,e=c.width,f=c.dir,g=0;d=="alternate"?g=a==1?b[c.widthAxis]-e*2:e:d=="slide"?a==-1?g=f==-1?b[c.widthAxis]:e:g=f==-1?b[c.widthAxis]-e*2:0:g=a==-1?b[c.widthAxis]:0;return g}var c=[],d=this.length;this.each(function(g){var h=a(this),i=h.attr("width")||h.width(),j=h.attr("height")||h.height(),k=h.after("<div "+(b?'class="'+b+'" ':"")+'style="display: block-inline; width: '+i+"px; height: "+j+'px; overflow: hidden;"><div style="float: left; white-space: nowrap;">'+h.html()+"</div></div>").next(),l=k.get(0),m=0,n=(h.attr("direction")||"left").toLowerCase(),o={dir:/down|right/.test(n)?-1:1,axis:/left|right/.test(n)?"scrollLeft":"scrollTop",widthAxis:/left|right/.test(n)?"scrollWidth":"scrollHeight",last:-1,loops:h.attr("loop")||-1,scrollamount:h.attr("scrollamount")||this.scrollAmount||2,behavior:(h.attr("behavior")||"scroll").toLowerCase(),width:/left|right/.test(n)?i:j};h.attr("loop")==-1&&o.behavior=="slide"&&(o.loops=1),h.remove(),/left|right/.test(n)?k.find("> div").css("padding","0 "+i+"px"):k.find("> div").css("padding",j+"px 0"),k.bind("stop",function(){k.data("paused",!0)}).bind("pause",function(){k.data("paused",!0)}).bind("start",function(){k.data("paused",!1)}).bind("unpause",function(){k.data("paused",!1)}).data("marqueeState",o),c.push(l),l[o.axis]=e(o.dir,l,o),k.trigger("start"),g+1==d&&f()});return a(c)}})(jQuery);

(function($){
	
	$.fn.gallery=function(opts){
		
		var opts=$.extend({
			random:false,
			autoPlay:true,
			autoPlayInterval:4000
		},opts),
		
		animating=false;
		
		return this.each(function(){
			var _this=$(this),
			imgs=$("img",this),
			tnHolder=$("<div class='thumbnailHolder'></div>"),
			tnInner=$("<div class='thumbnailInner'></div>"),
			lgeHolder=$("<div class='viewScreen'></div>"),
			fixer=$("<div class='fixer'></div>"),
			fig=$("<div class='figure'></div>"),
			tN=imgs.length,
			autoPlayInt=null,
			pausePlaying=false;
			
			//-------------------------SETUP
			_this.empty().append(lgeHolder).append(tnHolder.append(tnInner)).addClass("activated")
			.prependTo("#content")
			.bind("mouseenter",function(){
				pausePlaying=true;
			})
			.bind("mouseleave",function(){
				pausePlaying=false;
			});
			
			imgs.each(function(i,el){
			  var _el=$(el),desc=_el.attr("alt");
			  
			  _el=fig.clone().wrapInner(_el);_el.append("<span></span>").append("<p>"+desc+"</p>");
			  _el.clone().appendTo(tnInner).removeClass("figure").addClass("thumbnail");
			  _el.clone().appendTo(lgeHolder).wrap(fixer.clone());
			});
			
			imgs.remove();
			$("div.fixer:eq(0)",lgeHolder).addClass("active").siblings().hide();
			$("div.thumbnail:eq(0)",tnInner).addClass("active");
			tnInner.jScrollPane();
			
			//start autoplay
			if(opts.autoPlay){
				autoPlayInt=setInterval(function(){
					if(!pausePlaying){
						autoPlay();	
					}
				},opts.autoPlayInterval);
			}
			
			
			//-------------------------EVENTS
			tnInner.delegate("div.thumbnail","click",function(e){
			  e.preventDefault();
				var ind=$(this).index();
				animate(ind);
			});
			
			//-------------------------CORE FUNCTIONS
			function animate(index){
				var currentIndex=$('.active',tnInner).index();
				if(!animating && currentIndex!==index){
					animating=true;
					$('.active',lgeHolder).removeClass("active").find("p").slideUp().end().fadeOut(function(){
					  $(this).find("p").slideDown();
					});
					
					$("div.thumbnail",tnHolder).removeClass("active")
					.filter(':eq('+index+')').addClass("active");
					
					$("div.fixer",lgeHolder).filter(':eq('+index+')').addClass("active").fadeIn(function(){
					  animating=false;
					});
				}
			}
			
			function autoPlay(){
			  var currentIndex=$('.active',tnInner).index();
			  var nextIndex=currentIndex+1;
			  if(nextIndex>(tN-1)){
					nextIndex=0;
				}
				if(nextIndex<0){
					nextIndex=tN-1;
				}
				
				tnInner[0].scrollTo("div.thumbnail:eq("+nextIndex+")");
				animate(nextIndex);
			}	
		});
	}
	

	
})(jQuery);
(function($){
  $.fn.boxes=function(opts){
    var opts=$.extend({
			random:false,
			autoPlay:true,
			autoPlayInterval:4000,
			staggeringInterval:70,
			moreImagesUrl:"http://www.mechatherm.com/sitemap/randomImagesFromGallery",
			reloadInterval:8000
		},opts),
		MAP={1:{1:"0,0",2:"0,432",3:"0,648",4:"138,432",5:"207,864",6:"207,756",7:"207,648"},2:{1:"0,540",2:"138,324",3:"0,0",4:"0,324",5:"207,0",6:"207,108",7:"207,216"},3:{1:"0,540",2:"138,324",3:"69,0",4:"0,324",5:"0,216",6:"0,0",7:"0,108"},4:{1:"0,0",2:"138,432",3:"69,648",4:"0,432",5:"0,756",6:"0,648",7:"0,864"},5:{1:"0,0",2:"138,756",3:"69,432",4:"0,756",5:"0,432",6:"0,540",7:"0,648"},6:{1:"0,540",2:"0,0",3:"69,216",4:"138,0",5:"0,216",6:"0,432",7:"0,324"},7:{1:"0,540",2:"138,0",3:"0,216",4:"0,0",5:"207,324",6:"207,432",7:"207,216"},8:{1:"0,0",2:"138,756",3:"0,432",4:"0,756",5:"207,432",6:"207,648",7:"207,540"},9:{1:"0,324",2:"0,756",3:"0,0",4:"138,756",5:"207,0",6:"207,108",7:"207,216"},10:{1:"0,216",2:"0,0",3:"0,648",4:"138,0",5:"207,864",6:"207,648",7:"207,756"},11:{1:"0,216",2:"138,0",3:"69,648",4:"0,0",5:"0,756",6:"0,648",7:"0,864"},12:{1:"0,324",2:"0,756",3:"69,0",4:"138,756",5:"0,0",6:"0,108",7:"0,216"}},
		animating=false;
    
    return this.each(function(){
      var _this=$(this),
			boxes=$("img",this),
			autoPlayInt=null,
			pausePlaying=false,
			reloadQ=[];
			
			//INIT
			positionBoxes(MAP[Math.floor(Math.random()*12)+1]);
			
			//start autoplay
			if(opts.autoPlay){
				autoPlayInt=setInterval(function(){
					if(!pausePlaying){
						autoPlay();	
					}
				},opts.autoPlayInterval);
				
				_this.bind("mouseenter",function(){
					pausePlaying=true;
				})
				.bind("mouseleave",function(){
					pausePlaying=false;
				});
				
			}
			
			//fetch new images
			setInterval(function(){
			  if(reloadQ.length<1){
			    $.getJSON(opts.moreImagesUrl,function(data){
			      var cnt=data.length;
  			    $(data).each(function(i,img){
  			      var im=new Image();
      				$(im).attr("src",img).load(function(){
      				  reloadQ.push(img);
      				});
  			    });  			    
  			  });
			  }
			  
			},opts.reloadInterval);
			
			function autoPlay(){
			  var rand=Math.floor(Math.random()*12);
			  animate(rand+1);
			}
			
			function animate(index){
			  if(!animating){
			    animating=true;
			     var layout=MAP[index] || false;
    			  if(layout){
    			    hideBoxes().done(function(){
    			      positionBoxes(layout).done(function(){
    			        showBoxes().done(function(){
      			        animating=false;
      			      });
    			      });
    			    });
  			    }
			  }			  
			}
			
			function hideBoxes(){
		    var dfd=$.Deferred();
		    boxes.each(function(i,el){
		      $(this).delay(i*opts.staggeringInterval).animate({opacity:0},"slow",function(){
		        if((i+1)==boxes.length){
		          dfd.resolve();
		        }
		      });
		    });
		    return dfd;
		  }
		  
		  function positionBoxes(layout){
		    var dfd=$.Deferred();
		    boxes.each(function(i,el){
		      var dec=layout[i+1].split(",");
		      $(this).css({"top":dec[0]+"px","left":dec[1]+"px"});
	        if((i+1)==boxes.length){
	          dfd.resolve();
	        }
		    });
		    //check if there are new images in the reload queue
		    if(reloadQ.length){
		      boxes.each(function(i,el){
			      $(this).attr("src",reloadQ[i]);
			      reloadQ.splice(0,1);
			    });
		    }
		    return dfd;
		  }
		  
		  function showBoxes(){
		    var dfd=$.Deferred();
		    boxes.each(function(i,el){
		      $(this).delay(i*opts.staggeringInterval).animate({opacity:1},"slow",function(){
		        if((i+1)==boxes.length){
		          dfd.resolve();
		        }
		      });
		    });
		    return dfd;
		  }
			
			
			
			
    });
    
  };
})(jQuery);

(function($){
   $.fn.convertToTable=function(opts){
      
      return this.each(function(){
        var _this=$(this),ul=_this.find("ul"),lis=ul.find("li"),temp=[];
        lis.each(function(){
          temp.push("<td>"+$(this).html()+"</td>");
        });
        _this.html("<table width='100%'><tr>"+temp.join("")+"</tr></table>")
      });
    };
})(jQuery);

$(function(){
  $("marquee.marqueefy").marquee('pointer').mouseover(function () {
		  $(this).trigger('stop');
		}).mouseout(function () {
		  $(this).trigger('start');
		});
	$("#gallery").gallery({autoPlay:true});
	$("#homePageGallery").boxes({autoPlay:true,autoPlayInterval:6000});
	$("#homepage #contactLink").convertToTable();
	$("div.filelock a").click(function(){
	  $(this).blur().slideUp().next().slideDown();
	  return false;
	});
	$("div.filelock form").submit(function(){
	  var _this=$(this),
	  url=_this.attr("action"),
	  sendData=_this.serializeArray(),
	  button=_this.find("button");
	  
	  button.attr("disabled","disabled").html("Sending... Please Wait..");
	  $.ajax({
	    url:url,
	    type:"POST",
	    data:sendData,
	    success:function(data){
	      button.html("Request Sent...");
	      _this[0].reset();
	      setTimeout(function(){
	        button.html("Send request again...").attr("disabled","");
	      },3000);
	    },
	    error:function(){
	      button.html("Error in submission...");
	      setTimeout(function(){
	        button.html("Send request again...").attr("disabled","");
	      },2000);
	    }
	  });
	  return false;
	});
});
