// Start: innerfade
(function($) {

$.fn.innerfade = function(options) {

	this.each(function(){ 	
		
		var settings = {
			animationtype: 'fade',
			speed: 'normal',
			timeout: 2000,
			type: 'sequence',
			containerheight: 'auto',
			runningclass: 'innerfade'
		};
		
		if(options)
			$.extend(settings, options);
		
		var elements = $(this).children();
	
		if (elements.length > 1) {
		
			$(this).css('position', 'relative');
	
			$(this).css('height', settings.containerheight);
			$(this).addClass(settings.runningclass);
			
			for ( var i = 0; i < elements.length; i++ ) {
				$(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute');
				$(elements[i]).hide();
			};
		
			if ( settings.type == 'sequence' ) {
				setTimeout(function(){
					$.innerfade.next(elements, settings, 1, 0);
				}, settings.timeout);
				$(elements[0]).show();
			} else if ( settings.type == 'random' ) {
				setTimeout(function(){
					do { current = Math.floor ( Math.random ( ) * ( elements.length ) ); } while ( current == 0 )
					$.innerfade.next(elements, settings, current, 0);
				}, settings.timeout);
				$(elements[0]).show();
			}	else {
				alert('type must either be \'sequence\' or \'random\'');
			}
			
		}
		
	});
};


$.innerfade = function() {}
$.innerfade.next = function (elements, settings, current, last) {

	if ( settings.animationtype == 'slide' ) {
		$(elements[last]).slideUp(settings.speed, $(elements[current]).slideDown(settings.speed));
	} else if ( settings.animationtype == 'fade' ) {
		$(elements[last]).fadeOut(settings.speed);
		$(elements[current]).fadeIn(settings.speed);
	} else {
		alert('animationtype must either be \'slide\' or \'fade\'');
	};
	
	if ( settings.type == 'sequence' ) {
		if ( ( current + 1 ) < elements.length ) {
			current = current + 1;
			last = current - 1;
		} else {
			current = 0;
			last = elements.length - 1;
		};
	}	else if ( settings.type == 'random' ) {
		last = current;
		while (	current == last ) {
			current = Math.floor ( Math.random ( ) * ( elements.length ) );
		};
	}	else {
		alert('type must either be \'sequence\' or \'random\'');
	};
	setTimeout((function(){$.innerfade.next(elements, settings, current, last);}), settings.timeout);
};
})(jQuery);
// End: innerfade

// Start: Fade
 $(document).ready(
				function(){
					
					$('ul#feature').innerfade({
						speed: 'slow',
						timeout: 3000,
						type: 'sequence',
						containerheight: '156px'
					});
					$('.right').innerfade({
						speed: 'slow',
						timeout: 4000,
						type: 'sequence',
						containerheight: '250px'
					});					
					
			});
 // End: Fade
 
// Start: fxscrollto
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.10.X({m:7(d,6,3){o=4.d(d);C 9.12(\'L\',7(){v 4.K.m(9,o,6,3)})},14:7(d,6,3){C 9.19(7(){4(\'a[@O*="#"]\',9).17(7(e){E=9.O.16(\'#\');4(\'#\'+E[1]).m(d,6,3);C J})})}});4.K.m=7(e,o,6,3){q z=9;z.o=o;z.e=e;z.6=/S|Q/.Z(6)?6:J;z.3=3;p=4.I.11(e);s=4.I.T();z.M=7(){U(z.A);z.A=V;4.W(z.e,\'L\')};z.t=(v G).F();s.h=s.h>s.H?(s.h-s.H):s.h;s.w=s.w>s.N?(s.w-s.N):s.w;z.g=p.y>s.h?s.h:p.y;z.j=p.x>s.w?s.w:p.x;z.8=s.t;z.b=s.l;z.D=7(){q t=(v G).F();q n=t-z.t;q p=n/z.o.i;f(t>=z.o.i+z.t){z.M();1a(7(){z.B(z.g,z.j)},13)}c{f(!z.6||z.6==\'S\'){f(!4.3||!4.3[z.3]){r=((-k.P(p*k.R)/2)+0.5)*(z.g-z.8)+z.8}c{r=4.3[z.3](p,n,z.8,(z.g-z.8),z.o.i)}}c{r=z.8}f(!z.6||z.6==\'Q\'){f(!4.3||!4.3[z.3]){u=((-k.P(p*k.R)/2)+0.5)*(z.j-z.b)+z.b}c{u=4.3[z.3](p,n,z.b,(z.j-z.b),z.o.i)}}c{u=z.b}z.B(r,u)}};z.B=7(t,l){18.15(l,t)};z.A=Y(7(){z.D()},13)};',62,73,'|||easing|jQuery||axis|function|startTop|this||startLeft|else|speed||if|endTop||duration|endLeft|Math||ScrollTo||||var|st|||sl|new|||||timer|scroll|return|step|parts|getTime|Date|ih|iUtil|false|fx|interfaceFX|clear|iw|href|cos|horizontal|PI|vertical|getScroll|clearInterval|null|dequeue|extend|setInterval|test|fn|getPosition|queue||ScrollToAnchors|scrollTo|split|click|window|each|setTimeout'.split('|'),0,{}))
// End: fxscrollto
// Start: iutil
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9.J={1C:6(e){4 x=0;4 y=0;4 7=e.Y;4 12=1H;c(9(e).8(\'A\')==\'T\'){4 N=7.B;4 Q=7.z;12=1f;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\'}4 3=e;R(3){x+=3.1h+(3.O&&!9.1m.1i?d(3.O.17)||0:0);y+=3.1n+(3.O&&!9.1m.1i?d(3.O.18)||0:0);3=3.1t}3=e;R(3&&3.1e&&3.1e.16()!=\'f\'){x-=3.u||0;y-=3.F||0;3=3.1D}c(12==1f){7.A=\'T\';7.z=Q;7.B=N}a{x:x,y:y}},1B:6(3){4 x=0,y=0;R(3){x+=3.1h||0;y+=3.1n||0;3=3.1t}a{x:x,y:y}},1s:6(e){4 w=9.8(e,\'1E\');4 h=9.8(e,\'1G\');4 o=0;4 q=0;4 7=e.Y;c(9(e).8(\'A\')!=\'T\'){o=e.V;q=e.U}p{4 N=7.B;4 Q=7.z;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\';o=e.V;q=e.U;7.A=\'T\';7.z=Q;7.B=N}a{w:w,h:h,o:o,q:q}},1F:6(3){a{o:3.V||0,q:3.U||0}},1I:6(e){4 h,w,C;c(e){w=e.I;h=e.G}p{C=5.j;w=1c.14||P.14||(C&&C.I)||5.f.I;h=1c.10||P.10||(C&&C.G)||5.f.G}a{w:w,h:h}},1p:6(e){4 t=0,l=0,w=0,h=0,s=0,E=0;c(e&&e.1u.16()!=\'f\'){t=e.F;l=e.u;w=e.15;h=e.W;s=0;E=0}p{c(5.j){t=5.j.F;l=5.j.u;w=5.j.15;h=5.j.W}p c(5.f){t=5.f.F;l=5.f.u;w=5.f.15;h=5.f.W}s=P.14||5.j.I||5.f.I||0;E=P.10||5.j.G||5.f.G||0}a{t:t,l:l,w:w,h:h,s:s,E:E}},1v:6(e,D){4 3=9(e);4 t=3.8(\'1w\')||\'\';4 r=3.8(\'1x\')||\'\';4 b=3.8(\'1A\')||\'\';4 l=3.8(\'1z\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},1y:6(e,D){4 3=9(e);4 t=3.8(\'1J\')||\'\';4 r=3.8(\'1M\')||\'\';4 b=3.8(\'27\')||\'\';4 l=3.8(\'28\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},26:6(e,D){4 3=9(e);4 t=3.8(\'18\')||\'\';4 r=3.8(\'22\')||\'\';4 b=3.8(\'23\')||\'\';4 l=3.8(\'17\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)||0};p a{t:t,r:r,b:b,l:l}},2e:6(L){4 x=L.2d||(L.2b+(5.j.u||5.f.u))||0;4 y=L.2c||(L.29+(5.j.F||5.f.F))||0;a{x:x,y:y}},X:6(g,13){13(g);g=g.1O;R(g){9.J.X(g,13);g=g.1L}},1N:6(g){9.J.X(g,6(3){19(4 Z 1T 3){c(1Z 3[Z]===\'6\'){3[Z]=1a}}})},1X:6(3,H){4 k=9.J.1p();4 11=9.J.1s(3);c(!H||H==\'1W\')9(3).8({1U:k.t+((1g.1o(k.h,k.E)-k.t-11.q)/2)+\'1j\'});c(!H||H==\'20\')9(3).8({1Y:k.l+((1g.1o(k.w,k.s)-k.l-11.o)/2)+\'1j\'})},2f:6(3,1l){4 1k=9(\'25[@M*="S"]\',3||5),S;1k.24(6(){S=K.M;K.M=1l;K.Y.2a="21:1R.1P.1V(M=\'"+S+"\')"})}};[].1b||(1S.1Q.1b=6(v,n){n=(n==1a)?0:n;4 m=K.1K;19(4 i=n;i<m;i++)c(K[i]==v)a i;a-1});',62,140,'|||el|var|document|function|es|css|jQuery|return||if|parseInt||body|nodeEl|||documentElement|clientScroll||||wb|else|hb||iw||scrollLeft|||||position|display|visibility|de|toInteger|ih|scrollTop|clientHeight|axis|clientWidth|iUtil|this|event|src|oldVisibility|currentStyle|self|oldPosition|while|png|none|offsetHeight|offsetWidth|scrollHeight|traverseDOM|style|attr|innerHeight|windowSize|restoreStyles|func|innerWidth|scrollWidth|toLowerCase|borderLeftWidth|borderTopWidth|for|null|indexOf|window|absolute|tagName|true|Math|offsetLeft|opera|px|images|emptyGIF|browser|offsetTop|max|getScroll|block|hidden|getSize|offsetParent|nodeName|getMargins|marginTop|marginRight|getPadding|marginLeft|marginBottom|getPositionLite|getPosition|parentNode|width|getSizeLite|height|false|getClient|paddingTop|length|nextSibling|paddingRight|purgeEvents|firstChild|Microsoft|prototype|DXImageTransform|Array|in|top|AlphaImageLoader|vertically|centerEl|left|typeof|horizontally|progid|borderRightWidth|borderBottomWidth|each|img|getBorder|paddingBottom|paddingLeft|clientY|filter|clientX|pageY|pageX|getPointer|fixPNG'.split('|'),0,{}))
// End: iutil
// Start: gbhall scroll
 $(document).ready(
				function(){
							$("body").ScrollToAnchors(800)
						});
// End: gbhall scroll

// Start: show gbh_cu
$(document).ready(function() {
						   
						   
						   
						   		$('#name').focus(function(){
						    	$("#name").addClass("inputSelected")
														});
								$('#name').blur(function(){
						    	$("#name").removeClass("inputSelected")
														});
                                $('#email').focus(function(){
						    	$("#email").addClass("inputSelected")
														});
								$('#email').blur(function(){
						    	$("#email").removeClass("inputSelected")
														});
								
								///Info
								$('#info').hide();
								
/*											$('#show_info').mouseover(function(){
			$("#show_info").fadeTo("fast", 0.7);
			});
			$('#show_info').mouseout(function(){
			$("#show_info").fadeTo("fast", 1.0);
			});
			$('#hide_info').mouseover(function(){
			$("#hide_info").fadeTo("fast", 0.7);
			});
			$('#hide_info').mouseout(function(){
			$("#hide_info").fadeTo("fast", 1.0);
			});	*/
								
$('#show_info').click(function(){	
$('#show_info').hide();	
$('#hide_info').show();
$('#feature').slideToggle("500", function() {
      $('#info').fadeIn('slow');	  
	  });		
			});
$('#hide_info').click(function(){	
$('#show_info').show();	
$('#hide_info').hide();
$('#info').slideToggle("500", function() {
      $('#feature').fadeIn('slow');	  
	  });		
			});
								
							

								
								
														
	$('#nameLoading').hide();
	$('#name').blur(function(){
	  $('#nameResult').hide();
	  $('#nameLoading').show();
      $.post("contact_query.php", {
        name: $('#name').val()
      }, 
	  function(response){
        $('#nameResult').fadeOut(); 		
        setTimeout("gbhallContact('nameResult', '"+escape(response)+"')", 400);
      });
    	return false;
	});
});

function gbhallContact(id, response) {
  $('#nameLoading').hide();
  $('#'+id).html(unescape(response));
  $('#'+id).fadeIn();
} 
//End: show gbh_cu
 $(document).ready(function(){
							$('#c').click(function(){
						    	$("#c").addClass("mousedown")
						});	});		
 
 
//NAV

			$(document).ready(function(){
							$('#b').mousedown(function(){
						    	$("#b a").addClass("click")
						});	
							
							$('#b').mouseup(function(){
						    	$("#b a").removeClass("click")
						});
							
														$('#a').mousedown(function(){
						    	$("#a a").addClass("click")
						});	
							
							$('#a').mouseup(function(){
						    	$("#a a").removeClass("click")
						});
							
							
							
							
							
							
							
		/*								$('.left a').mouseover(function(){
			$(".left a").fadeTo("fast", 0.7);
			});
			$('.left a').mouseout(function(){
			$(".left a").fadeTo("fast", 1.0);
			});*/
							
							
							});		
			
		
		
		



