$(function()
{
	$("#expBtn-open").click(flyoutOpen);
	$("#expBtn-close").click(flyoutClose);
	//$("#expBtn-open .flyout-trigger, #expBtn-open .flyout-content").click(flyoutOver);
	$("#expHolder").stop().animate({width:34}, {duration:"slow", easing:"swing"});
				
	if (typeof Cufon != 'undefined') { // in case called without cufon
		Cufon.replace('h1', {
			fontFamily: 'clearface',
			color: '#647814'
		});
		/*Cufon.replace('.rockwell,.widgetTitle', {
			fontFamily: 'Rockwell Extra Bold'
		});*/
		Cufon.replace('.clearface, .searchListingsTitle, .widget-title', {
			fontFamily: 'clearface'
		});
		// line height adjustment hack for IE
		/*if ( $.browser.msie ) {
			Cufon.now();
			$('h1').each(function(){
				var $this = $(this);
				var fontSize = parseInt($this.css('font-size'));
				var lineHeight = parseInt($this.css('line-height'));
				var newFontSize = Math.round( (fontSize + lineHeight)/2 );
				$this.css('font-size',newFontSize + 'px');
			});
		} else {
			Cufon.replace('#sv-topNav-lvl2 .lvl1Link', {
				fontFamily: 'clearface'
			});
		}*/
		// you can't set the main nav to use this font since line-height can't be adjusted in IE
	}
});

function flyoutOpen()
	{
		// $("#expHolder").show();
		//$("#expHolder").stop().css({background: 'url(/includes/images/shell/btn_experience.png) top left no-repeat'}, "slow");
		$("#expHolder").stop().animate({width:910, height:650}, "slow");
		$("#expBtn-close").show();
		
		//$("#expBtn-open").stop().animate({right:1090}, "slow");
		//$("#sv-mainContainer").not(":has(.flyout-overlay)").append("<div class=\"flyout-overlay\"></div>");
		//$(".flyout-overlay").css({opacity: 0, display: "block", height: $("body").height()}).stop().fadeTo("normal", 0.65);
	}
function flyoutClose()
	{
		//$("#expHolder").stop().css({background: 'url(/includes/images/shell/btn_experience_closed.png) top left no-repeat'}, "slow");
		$("#expBtn-close").hide();
		$("#expHolder").stop().animate({width:0, height:0}, "slow");
		// $("#expHolder").hide();
		
		//$("#expBtn-open").stop().animate({right:0}, "slow");
		//$(".flyout-overlay").stop().fadeTo("normal", 0, function(){$(".flyout-overlay").remove()});
	}
