// Our Studio section - Teachers page if (jQuery('#staffColRight').length > 0) { function studioStaffAjax(id) { jQuery.getJSON( "/scripts/php/ajax_fields.php", {"table": "staff", "id": id, "studio": currStudio}, function (data) { var contentStr = "", img = ""; if (data.length > 0) { img = "/images/studios/"+currStudio+"/staff/" + data[0].id + "_m." + data[0].ext; // Add a bunch of if statements to handle empty entries contentStr = ""; if( data[0].ext != "" ) contentStr += "
";
if( data[0].title != "" ) contentStr += "" + data[0].title + "
";
if( data[0].email != "" ) contentStr += "Email";
contentStr += "
" + data[0].description + "
"; } jQuery("#staffAjaxContent").html(contentStr); jQuery("#staffColRight").animate({"height":jQuery("#staffAjaxContent").height()}, function(){ jQuery("#staffAjaxWrap").animate({"left":"0"}); }); } ); } jQuery("#staffHolder a").click(function () { var _this = this; jQuery("#staffAjaxWrap").animate({"left": "-294px"}, function () { studioStaffAjax(jQuery(_this).attr("href").slice(1)); }); jQuery("#staffHolder a.curr").removeClass("curr"); jQuery(this).addClass("curr"); return false; }); // Pull hash from URL var hashVal = window.location.hash; var selectTxt=(hashVal)?":eq("+hashVal.substr(1)+")":":first"; jQuery("#staffHolder a"+selectTxt).click(); var staffTempHeight=jQuery("#staffHolder div.staffWrap:first").height(); jQuery("#staffHolderWrap").animate({"height":staffTempHeight}); // Control functionality // Move left and right jQuery("#staffColLeft a.left").click(function(){ if(jQuery("#staffCtrlNum a.curr").prev().length) jQuery("#staffCtrlNum a.curr").prev().click(); return false; }); jQuery("#staffColLeft a.right").click(function(){ if(jQuery("#staffCtrlNum a.curr").next().length) jQuery("#staffCtrlNum a.curr").next().click(); return false; }); var slideUpdateImgW=jQuery("#staffColLeft").width(); var slideUpdateImgM=parseInt(jQuery("#staffHolder div.staffWrap").css("margin-right")); var numSliderLinks = jQuery("#staffHolder div.staffWrap").length, cont = ''; for (var i = 1;i<=numSliderLinks;i++) cont+=''+i+''; jQuery("#staffCtrlNum").html(cont); jQuery('#staffCtrlNum a:first').addClass('curr'); jQuery("#staffCtrlNum a").click(function(){ // switch all tabs off jQuery("#staffCtrlNum a.curr").removeClass("curr"); // switch this tab on jQuery(this).addClass("curr"); var thisIndexNum = jQuery("#staffCtrlNum a").index(this); var offsetNumber= -1*(parseInt(slideUpdateImgW*thisIndexNum)+parseInt(slideUpdateImgM*thisIndexNum)); var staffTempHeight=jQuery("#staffHolder div.staffWrap:eq("+thisIndexNum+")").height(); jQuery("#staffHolderWrap").animate({"height":staffTempHeight},function(){ jQuery("#staffHolder").animate({"left":offsetNumber+"px"}); }); return false; }); }