// JavaScript Document
swfobject.embedSWF(pathToSWF, "flashBanner", "900", "325", "9.0.0", "flash/expressInstall.swf", {imageLoc:imageLoc}, {wmode:"transparent"});
$(document).ready(function(){
	$id = $.getQueryString({id:"id", defaultvalue:"1"}) -1;					   
/*	$.extend($.fn.jScrollPane.defaults, {showArrows:true, scrollbarWidth:14});*/	
$(".ajaxLinks").find("a:not(.modallink)").click(function(e){ e.preventDefault(); onAjaxClick.apply($(this), [$(".ajaxPanel")]);});
	if($(".default").length == 0){$(".ajaxLinks").find("a:eq("+$id+")").click();};
	/*$(".scroll").jScrollPane();*/
});

function onAjaxClick(target){
	$url = $(this).attr("href");
	$(".ajaxLinks").find("a").removeClass("active");
	$(this).addClass("active");
	$(target).fadeOut(200, function(){
		$(".default", target).remove();							
		attachProgressBar.apply($(this));							
		$(this).load($url, function(){
			removeProgressBar.apply($(this));						
			$(this).hide();
			$(this).fadeIn(200);
			eventHookUp();
			sIFR.doReplacement();
		});
	});
}

function eventHookUp(){
	/*$(".scroll").jScrollPane();*/
	$(".subContent").hide();
	$(".ajaxContentWrapper .rhsSubNav").find("a:not(.truelink)").click(function(e){ 
		e.preventDefault();
		target = $(this).attr("rel");
		$(".ajaxContentWrapper").find("a.active").removeClass("active");
		$(this).addClass("active");
		if($(".subContent:visible").length != 0){
			$(".subContent:visible").fadeOut(200, function(){
				$(this).removeClass("current");
				$("#" + target).fadeIn(200);
				sIFR.doReplacement();
				$("#" + target).addClass("current");
				if(typeof($imgs) != "undefined"){
					if(typeof(eval("$imgs." + target)) != "undefined"){createCarousel(eval("$imgs." + target))};
				}
			});
		}else{
			$("#" + target).fadeIn(200);
			sIFR.doReplacement();
			$("#" + target).addClass("current");
				if(typeof($imgs) != "undefined"){
					if(typeof(eval("$imgs." + target)) != "undefined"){createCarousel(eval("$imgs." + target))};
				}
		};
	});	
	$(".rhsSubNav").find("a:first").click();
};



function attachProgressBar(){
	$(this).parent(".ajaxPanelWrapper").find(".loader").show();
}

function removeProgressBar(){
	$(this).parent(".ajaxPanelWrapper").find(".loader").hide();
}


	



