$(document).ready(function() {

	//
	if ($.browser.mozilla && $.browser.version <= "1.9" ){
		$('body').addClass('ff2');
	}

	//
	if ($.browser.mozilla && $.browser.version <= "1.9.1" ){
		$('.home #content dl:nth-child(even)').css({'width':'392px'});
		$('.home #content dl:nth-child(even) dd').css({'padding':'28px 10px 0 0'});
	}

	//
	if(window.opera){
		$('body').addClass('opera');
	}

	//
	if($.browser.safari){
		$('body').addClass('safari');
	}

	//
	$('a[rel=_blank]').click(function(){
		this.target = "_blank";
	});

	//
	$('input[type="text"]').each(function() {
		var defaultValue = this.value;
		$(this).focus(function() {
			if(this.value == defaultValue) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = defaultValue;
			}
		});
	});

	//
	Cufon.replace(
		'.content-top dl dt small, .home #sidebar dl dt, .sub #sidebar blockquote p.quote, .plain #sidebar blockquote p.quote',{
			fontFamily: 'MemphisLight'
		}
	);
	Cufon.replace(
		'.plain.one-column #content blockquote p.quote',{
			fontFamily: 'MemphisMedium'
		}
	);	
	
	
	Cufon.replace(
		'.sub #content ul#flowtabs li a',{
			hover: true,
			fontFamily: 'MemphisLight'
		}
	);
	Cufon.replace(
		'.content-top dl dt strong',{
			fontFamily: 'MemphisMedium'
		}
	);
	Cufon.replace(
		'.plain #content h3',{
			fontFamily: 'MemphisMedium'
		}
	);	
	Cufon.replace(
		'.plain.one-column #sidebar h3',{
			fontFamily: 'MemphisMedium'
		}
	);	
	Cufon.replace(
		'.plain #sidebar blockquote cite, .plain.one-column #content blockquote cite',{
			fontFamily: 'GothamMedium'
		}
	);	
	Cufon.replace(
		'#header div.h1 h1 a',{
			//fontSize: '23px',
			fontFamily: 'MemphisBold'
		}
	);
	Cufon.replace(
		'#header ul#navigation li a',{
			//fontSize: '14px',
			hover: true,
			fontFamily: 'GothamBook'
		}
	);
	Cufon.replace(
		'.plain.affiliates p.text-intro',{
			//fontSize: '14px',
			fontFamily: 'GothamBook'
		}
	);	
	Cufon.replace(
		'.home #content dl dd strong a',{
			//fontSize: '14px',
			hover: true,
			fontFamily: 'GothamMedium'
		}
	);
	Cufon.replace(
		'h2, .sub #sidebar blockquote cite, .ebk-buy #content h4',{
			fontFamily: 'GothamMedium'
		}
	);



$.easing.custom = function (x, t, b, c, d) {
    var s = 1.70158;
    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}

	$("#flowpanes")
		.scrollable({
			size: 1,

			speed: 1400,
			onSeek: function() {
				Cufon.replace(
					'.sub #content ul#flowtabs li a',{
						hover: true,
						fontFamily: 'MemphisLight'
					}
				);
			}
		})
		.circular()
		.navigator({
		navi: "#flowtabs",
		naviItem: 'a',
		activeClass: 'current'
	});

});