/*!
 * 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);
/*!
 * 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);
/* 
 * No Spam
 * Copyright (c) 2008 Mike Branski (www.leftrightdesigns.com) - GPL
 */
jQuery.fn.nospam=function(a){a=jQuery.extend({replaceText:false,filterLevel:'normal'},a);return this.each(function(){e=null;if(a.filterLevel=='low'){if($(this).is('a[rel]')){e=$(this).attr('rel').replace('//','@').replace(/\//g,'.')}else{e=$(this).text().replace('//','@').replace(/\//g,'.')}}else{if($(this).is('a[rel]')){e=$(this).attr('rel').split('').reverse().join('').replace('//','@').replace(/\//g,'.')}else{e=$(this).text().split('').reverse().join('').replace('//','@').replace(/\//g,'.')}}if(e){if($(this).is('a[rel]')){$(this).attr('href','mailto:'+e);if(a.replaceText){$(this).text(e)}}else{$(this).text(e)}}})};
/*!
 * (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);
// secure $ jQuery alias
/*******************************************************************************************/	
// jquery.event.hover.js - rev 5 
// Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
// Liscensed under the MIT License (MIT-LICENSE.txt)
// http://www.opensource.org/licenses/mit-license.php
// Created: 2008-06-02 | Updated: 2008-07-30
/*******************************************************************************************/

//	USE THESE PROPERTIES TO CUSTOMIZE SETTINGS...

//	$.event.special.hover.delay = 100; 
//	Defines the delay (msec) while mouse is inside the element before checking the speed

//	$.event.special.hover.speed = 100; 
//	Defines the maximum speed (px/sec) the mouse may be moving to trigger the hover event

// save the old jquery "hover" method
(function($){$.fn._hover=$.fn.hover;$.fn.hover=function(fn1,fn2,fn3){if(fn3)this.bind('hoverstart',fn1);if(fn2)this.bind('hoverend',fn3?fn3:fn2);return!fn1?this.trigger('hover'):this.bind('hover',fn3?fn2:fn1)};var hover=$.event.special.hover={delay:100,speed:100,setup:function(data){data=$.extend({speed:hover.speed,delay:hover.delay,hovered:0},data||{});$.event.add(this,"mouseenter mouseleave",hoverHandler,data)},teardown:function(){$.event.remove(this,"mouseenter mouseleave",hoverHandler)}};function hoverHandler(event){var data=event.data||event;switch(event.type){case'mouseenter':data.dist2=0;data.event=event;event.type="hoverstart";if($.event.handle.call(this,event)!==false){data.elem=this;$.event.add(this,"mousemove",hoverHandler,data);data.timer=setTimeout(compare,data.delay)}break;case'mousemove':data.dist2+=Math.pow(event.pageX-data.event.pageX,2)+Math.pow(event.pageY-data.event.pageY,2);data.event=event;break;case'mouseleave':clearTimeout(data.timer);if(data.hovered){event.type="hoverend";$.event.handle.call(this,event);data.hovered--}else $.event.remove(data.elem,"mousemove",hoverHandler);break;default:if(data.dist2<=Math.pow(data.speed*(data.delay/1e3),2)){$.event.remove(data.elem,"mousemove",hoverHandler);data.event.type="hover";if($.event.handle.call(data.elem,data.event)!==false)data.hovered++}else data.timer=setTimeout(compare,data.delay);data.dist2=0;break}function compare(){hoverHandler(data)}}})(jQuery);
/*!
 * Scripts
 */
jQuery(function($) {
	var Engine = {
		utils : {
			links : function(){
				$('a[rel*=external]').click(function(e){
					e.preventDefault();
					window.open($(this).attr('href'));						  
				});
			},
			mails : function(){
				$('span.email').nospam({
					replaceText: true,
					filterLevel: 'low'
				});
				$('td.email').nospam({
					replaceText: true,
					filterLevel: 'low'
				});
			},
			labels : function(){
				$('#newsletter 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');
				});
				$('#searchbox 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.form-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.form-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');
				});
				$('form.form-d 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');
				});
				$('form.accordion-form 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');
				});
				$('#nav 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');
				});
			},
			overeffect : function(){

			},
			heights : function(){
				$('div.cols-a > div').equalHeights();
				$('div.cols-c > div').equalHeights();
				$('div.cols-d > div').equalHeights();
				$('div.double-d > div').equalHeights();
				$('div.double-m > div').equalHeights();
				$('form.triple-a fieldset > div').equalHeights();
			}
		}
	};

	Engine.utils.links();
	Engine.utils.mails();
	Engine.utils.labels();
	Engine.utils.overeffect();
	Engine.utils.heights();
});

/*!*/

