$().ready(function() {
					
	$('ul.sf-menu').superfish();
		
	
	$("table.rate tr:even").addClass('even');
	


 $('table.rate').each(function(key, el) { var trs = $(el).find('tr'); if (trs.length > 2) { trs.filter(':odd').addClass('odd'); } })

	/*........... @ right-col dividers ...........*/

	$('#navigation li:last-child,body#ezbank #leftCol ul#ez-services li:last-child').addClass('last');
	$('#navigation li ul li:last-child').addClass('last');
	
	$('table.rate tr th:first-child').addClass('first');
	$('table.rate tr th:last-child').addClass('last');
	
	$('#content #leftCol ul#articleList li:first-child').addClass('first');
	$('#profile table tr:last-child').addClass('last');
	$('#first table tr:first-child, #second table tr:first-child').addClass('first');
	$('table.app tr:last-child').addClass('last');

	
	//cufon
	
/*	Cufon.replace('ul#navigation li ul li a',{
				  fontFamily: 'Droid Serif'
				  });

	Cufon.replace('ul#navigation li a',{
				  
				  fontFamily: 'Droid Serif'
					
				  });
	*/
	

	
	Cufon.replace('#leftCol h1, #news-articles h1,#footer h1',{ fontFamily: 'Droid Serif' });
	/*Cufon.replace('#news-articles h2',{ fontFamily: 'Droid Sans' });*/
	
	
	
	$('.textField').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});




	
	//set the link
	$('#top-link').topLink({
		min: 400,
		fadeSpeed: 500
	});
	//smoothscroll
	$('#top-link').click(function(e) {
		e.preventDefault();
		$.scrollTo(0,300);
	});

	
	Cufon.now(); //ie
	
	
	$(function () {
                        var tabContainers = $('div.tabs > div');
                        tabContainers.hide().filter(':first').show();
                        
                        $('div.tabs ul.tabNavigation a').click(function () {
                                tabContainers.hide();
                                tabContainers.filter(this.hash).show();
                                $('div.tabs ul.tabNavigation a').removeClass('selected');
                                $(this).addClass('selected');
                                return false;
                        }).filter(':first').click();
                });
	
	
		
 });



//plugin
jQuery.fn.topLink = function(settings) {
	settings = jQuery.extend({
		min: 1,
		fadeSpeed: 200
	}, settings);
	return this.each(function() {
		//listen for scroll
		var el = $(this);
		el.hide(); //in case the user forgot
		$(window).scroll(function() {
			if($(window).scrollTop() >= settings.min)
			{
				el.fadeIn(settings.fadeSpeed);
			}
			else
			{
				el.fadeOut(settings.fadeSpeed);
			}
		});
	});
};


$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};
