/*!
 * (v) Compact labels plugin
 * Takes one option: labelOpacity [default: true] set to false to disable label opacity change on empty input focus
 */
(function($){$.fn.compactize=function(options){var defaults={labelOpacity:true};options=$.extend(defaults,options);return this.each(function(){var label=$(this),input=$('#'+label.attr('for'));input.focus(function(){if(options.labelOpacity){if(input.val()===''){label.css('opacity','0.5');}}else{label.hide();}});if(options.labelOpacity){input.keydown(function(){label.hide();label.css('opacity',1);});} input.blur(function(){if(input.val()===''){label.show();} if(options.labelOpacity){label.css('opacity',1);}});window.setTimeout(function(){label.toggle(input.val()==='');},50);});};})(jQuery);

/*!
 * (v) hrefID jQuery extention
 * returns a valid #hash string from link href attribute in Internet Explorer
 */
(function($){$.fn.extend({hrefId:function(){return $(this).attr('href').substr($(this).attr('href').indexOf('#'));}});})(jQuery);
/**
 * SimpleFlame Content rotator
 * Version 0.2 (28.04.2009)
 * Possible effects to use :
 *  - if UI effects have been added: 'blind', 'bounce', 'clip', 'drop', 'explode', 'fold', 'highlight', 'puff', 'pulsate', 'scale', 'shake', 'size', 'slide', 'transfer'
 *  - basic effects from jQuery: fadeIn, fadeOut, show, hide, slideUp, slideDown
 */
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}('(5(){6 9=5(R,h){2.3={\'d\':\'z\',\'c\':\'M\',\'S\':1e,\'l\':p,\'t\':\'1r\',\'17\':{},\'C\':\'19\',\'m\':\'1k\',\'Q\':{},\'H\':\'19\'};7.1m(2.3,h);2.$g=7(R);2.12()};9.j.12=5(){2.$g.o(\'w-b\');2.$x=7(\'<1l Z="w-1j" />\');2.$g.1n(2.$x);2.$x.I(2.$g);2.$s=7(\'<1o Z="w-s" />\');2.$x.I(2.$s);2.$b=2.$g.1q(2.3.d);2.$e=2.$b.v(2.$b.1p(\'.\'+2.3.c));8(2.$e<0){2.$e=0}6 4=2;2.$b.o(\'w-d\').X(5(v,d){6 q=7(\'<z><a 1s="#">\'+1c(v+1,10)+\'</a></z>\');4.$s.I(q);q.U(\'a\').G(\'d\',d).1h(\'1g\',{4:4},4.q)});2.y(2.$e,p);8(2.3.l){2.l()}};9.j.q=5(D){D.1d();6 4=D.G.4;4.P();4.$O=p;6 k=4.$b.v(7(2).G(\'d\'));4.y(k)};9.j.y=5(k){6 11=1I[1]||14;6 c=2.3.c;6 i=2.$b.L(2.$e);6 f=2.$b.L(k);6 E=5(){i.N(c)};6 A=5(){f.o(c).Y(\'16\',10)};6 J=[\'1H\',\'1G\',\'1K\',\'1N\',\'1M\',\'1t\',\'1L\',\'1J\',\'1E\',\'1F\',\'1w\',\'1v\',\'1u\',\'1y\'];8(11===p){i.N(c).F();f.o(c).B()}n{8(7.1a(2.3.m,J)>-1){i.F(2.3.m,2.3.Q,2.3.H,E)}n 8(7.13(i[2.3.m])){i[2.3.m](2.3.H,E)}n{15"1b F 18"}f.Y(\'16\',1C);8(7.1a(2.3.t,J)>-1){f.B(2.3.t,2.3.17,2.3.C,A)}n 8(7.13(f[2.3.t])){f[2.3.t](2.3.C,A)}n{15"1b B 18"}}2.$s.U(\'a\').N(\'M\').L(k).o(\'M\');2.$e=k};9.j.l=5(){2.$O=14;6 4=2;2.$g.1A(5(){4.P()});2.$g.1B(5(){4.K()});2.K()};9.j.K=5(){8(2.$O===p){V}6 4=2;2.$T=W.1D(5(){6 u=4.$e+1;8(u===4.$b.1z){u=0}4.y(u)},2.3.S)};9.j.P=5(){8(2.3.l){W.1x(2.$T)}};7.1f.9=5(h){h=h||{};V 2.X(5(){6 r=1i 9(2,h)})}})();',62,112,'||this|settings|self|function|var|jQuery|if|sfRotator||items|activeClass|item|current|newItem|container|options|oldItem|prototype|position|autorotate|effectOut|else|addClass|true|trigger||controls|effectIn|next|index|sf|wrapper|activate|li|onShow|show|speedIn|event|onHide|hide|data|speedOut|append|effects|startAutorotate|eq|active|removeClass|rotationTerminated|stopAutorotate|optionsOut|el|duration|rotationInterval|find|return|window|each|css|class||instant|build|isFunction|false|throw|zIndex|optionsIn|transition|normal|inArray|Unsupported|parseInt|preventDefault|10000|fn|click|bind|new|rotator|fadeOut|div|extend|before|ul|filter|children|fadeIn|href|fold|slide|size|shake|clearInterval|transfer|length|mouseenter|mouseleave|100|setInterval|pulsate|scale|bounce|blind|arguments|puff|clip|highlight|explode|drop'.split('|'),0,{}));
/*!
 * (v) Equal Height plugin v. 1.11
 */
(function($){$.fn.equalHeights=function(){$(window).resize($.proxy(function(){var tallest=0;$(this).css('min-height',0);$(this).each(function(){if($(this).outerHeight()>tallest){tallest=$(this).outerHeight();}});$(this).each(function(){var padding=$(this).outerHeight()-$(this).height();var height=tallest-padding;$(this).css({'min-height':height});if($.browser.msie&&parseInt($.browser.version,10)==6)$(this).height(height);});},this)).triggerHandler('resize');return this;};})(jQuery);

/*!
 * Scripts
 *
 */
jQuery(function($) {
 
	var Engine = {
		utils : {
			links : function(){
				$('a[rel*=external]').click(function(e){
					e.preventDefault();
					window.open($(this).attr('href'));						  
				});
			},
			mails : function(){
				$('a[href^=mailto:]').each(function(){
					var mail = $(this).attr('href').replace('mailto:','');
					var replaced = mail.replace('/at/','@');
					$(this).attr('href','mailto:'+replaced);
					if($(this).text() == mail) {
						$(this).text(replaced);
					}
				});
			},
			labels : function(){
				$('#footer input').each(function(){
					if($(this).val() !== '') $(this).parent().prevAll('label:first').css('margin-top','-10001px');
				}).focus(function(){
					$(this).parent().prevAll('label:first').css('margin-top','-10001px');
				}).blur(function(){
					if($(this).val() === '') $(this).parent().prevAll('label:first').css('margin-top','0');
				});
				$('form.contact-a input').each(function(){
					if($(this).val() !== '') $(this).prevAll('label:first').css('margin-top','-10001px');
				}).focus(function(){
					$(this).prevAll('label:first').css('margin-top','-10001px');
				}).blur(function(){
					if($(this).val() === '') $(this).prevAll('label:first').css('margin-top','0');
				});
				$('form.contact-a textarea').each(function(){
					if($(this).val() !== '') $(this).prevAll('label:first').css('margin-top','-10001px');
				}).focus(function(){
					$(this).prevAll('label:first').css('margin-top','-10001px');
				}).blur(function(){
					if($(this).val() === '') $(this).prevAll('label:first').css('margin-top','0');
				});
			},
			rotator : function(){
				$('#featured-ul').sfRotator();
			},
			heights : function(){
				$('div.triple-a div.one, div.triple-a div.two, div.triple-a div.three').equalHeights();
				$('div.triple-b div.one, div.triple-b div.two, div.triple-b div.three').equalHeights();
			}
		},
		
		tweaks : {
			socialNavTweak : function(){
				jQuery("li#social a:first").hide();	
			}	,
			
			footerCopyright : function(){
				var currentTime = new Date()
     			var month = currentTime.getMonth() + 1
     			var day = currentTime.getDate()
				var year = currentTime.getFullYear()
     			
				
				$("span.year").text(year);
	
			}
		}
	};

	Engine.utils.links();
	Engine.utils.mails();
	Engine.utils.labels();
	Engine.utils.rotator();
	Engine.utils.heights();
	
	Engine.tweaks.socialNavTweak();
	Engine.tweaks.footerCopyright();
});

$(document).ready(function($) {
       if(typeof(isie) == 'undefined') {
	       $('#accordion dd').hide();
	       $('#accordion dt a').click(function(){
	               $('#accordion dd').slideUp();
	               $(this).parent().next().slideDown();
	               return false;
	       });
	       $('#accordion dd:eq(0)').slideDown();

	       $('#side_accordion dd').hide();
	       $('#side_accordion dt a').click(function(){
	               $('#side_accordion dd').slideUp();
	               $(this).parent().next().slideDown();
	               return false;
	       });
	       $('#side_accordion dd:eq(0)').slideDown();
	}
	else
	{
	       $('#accordion dd').hide();
	       $('#accordion dt a').click(function(){
	               $('#accordion dd').hide();
	               $(this).parent().next().show();
	               return false;
	       });
	       $('#accordion dd:eq(0)').show();

	       $('#side_accordion dd').hide();
	       $('#side_accordion dt a').click(function(){
	               $('#side_accordion dd').slideUp();
	               $(this).parent().next().slideDown();
	               return false;
	       });
	       $('#side_accordion dd:eq(0)').slideDown();

	}
	;
});


