﻿$(document).ready(function(){

	$('input.search').labelify({text: "label"});

	$('.email').emailLinks();
	/*
	$('a', '#top-menu li.notSelected').hover(function(){
		
		$(this).parent().parent().addClass('active');
		
		if($(this).parent().parent().next('li').hasClass('active'))
			$(this).parent().parent().next('li').addClass('notActive');
			
	},function(){
		$(this).parent().parent().removeClass('active');
		if($(this).parent().parent().next('li').hasClass('active'))
			$(this).parent().parent().next('li').removeClass('notActive');	
	});
	*/
	$('.paging a[disabled]').addClass('disabled');
});

jQuery.fn.flowScroll = function() 
{
	this.find("a[href^=#]").click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
		    && location.hostname == this.hostname) {
		      var $target = $(this.hash);
		      $target = $target.length && $target 
		      || $('[name=' + this.hash.slice(1) +']');
		      if ($target.length) {
		        var targetOffset = $target.offset().top - 94;
		        $('html,body')
		        .animate({scrollTop: targetOffset},{duration: 600, easing:'easeInSine'});
		       return false;
		      }
		    }
	     });
}

jQuery.fn.emailLinks = function()
{
    	try{
		var sEmail = this.text();
		sEmail = sEmail.replace("[at]","@").toLowerCase();
		this.hide();
		this.after('<a href="mailto:' + sEmail + '">' + sEmail + '</a>');
		this.remove();

	}
	catch(e){ }

}
