jQuery.noConflict();jQuery(document).ready(function(){});var initMenus=function(){jQuery("#toolbar ul.sf-menu").superfish({pathClass:"current"})};var showFeedbackDialog=function(){$feedbackDialog.show();$feedbackDialog.dialog("open")};var submitFeedback=function(){if(!jQuery("#feedbackContent").val()){alert("Please enter some feedback first.")}else{var formData=jQuery("#feedbackForm").serialize();jQuery.post("/index.cfm?event=feedback.comment",formData,feedbackCallback)}};var feedbackCallback=function(data){jQuery("#message").html(data);jQuery("#message").addClass("notification");showMessage();$feedbackDialog.dialog("close")};var initNotifications=function(){jQuery(".notification a.dismiss").click(function(){jQuery(this).parent(".notification").hide()})};var showMessage=function(dismissAction){jQuery("div#message").show();if(dismissAction=="click"){jQuery("div#message").click(function(){hideMessage()})}else{fadeMessage()}};var fadeMessage=function(){jQuery("div#message").fadeOut(8000,hideMessage)};var hideMessage=function(){jQuery("div#message").hide()};var initToolTips=function(){jQuery("a.whatsThis").tooltip({showURL:false})};var initDraggableSidebar=function(){if(jQuery.browser.msie&&jQuery.browser.version.substr(0,1)==6){jQuery("#privacyForm").css("cursor","move");jQuery("#rightColumnSmall").draggable()}};var testLink=function(elementId){var el=document.getElementById(elementId?elementId:"linkURL");window.open(el.value,"_blank")};var checkSignUp=function(){var submitButton=document.getElementById("sub");submitButton.style.disabled="true";var m2Obj=new m2();var urlField=document.getElementById("portfolioURL");var validateMessage=document.getElementById("validateMessage");validateMessage.style.display="none";if(validateURL()){if(m2Obj.checkURL(portfolioURL=urlField.value)==0){document.getElementById("signUpForm").submit()}else{validateMessage.style.display="block";validateMessage.innerHTML="Sorry, that URL is already taken.  Please try another.";submitButton.style.disabled="false"}}return false};var validateURL=function(){var validateMessage=document.getElementById("validateMessage");var urlField=document.getElementById("portfolioURL");var urlValue=urlField.value;urlField.value=urlValue.replace(/[^A-Za-z0-9-]/g,"");if(urlValue.length<5){validateMessage.style.display="block";validateMessage.innerHTML="The URL you have provided is too short";return false}else{if(urlValue.length>20){validateMessage.style.display="block";validateMessage.innerHTML="The URL you have provided is too long";return false}else{validateMessage.style.display="none";return true}}};var getUrlSuggestions=function(fn,ln){if(fn||ln){var suggestionsArray=[];suggestionsArray.push(fn+"-"+ln);suggestionsArray.push(fn+ln);suggestionsArray.push(fn.substr(0,1)+ln);suggestionsArray.push(fn+ln.substr(0,1));var retStr="<ul>";for(var i=0;i<suggestionsArray.length;i++){retStr+="<li onclick=\"fillURL('"+suggestionsArray[i]+"');validateURL()\">"+suggestionsArray[i]+' <img src="/images/struct/button_use.png" alt="use"></li>'}retStr+="</ul>";var msg=document.getElementById("validateMessage");msg.style.display="none";return retStr}else{return""}};var fillURL=function(theURL){document.getElementById("portfolioURL").value=theURL};var onUrlError=function(statusCode,message,firstname,lastname){var fn=document.getElementById("firstname").value;var ln=document.getElementById("lastname").value;var msg=document.getElementById("validateMessage");if(fn.length&&ln.length){msg.style.display="";msg.innerHTML="Sorry, we could not find URL suggestions for your name"}};var validateTitleLength=function(object){var titleWarning=jQuery("#titleWarning")};var saveDescription=function(shortlong){if(shortlong=="short"){var shortDescriptionText=jQuery("#shortDescriptionText");if(shortDescriptionText.val().length>profileConfig.shortDescMaxLen){$("#descriptionShortDialog").dialog("open");return false}}else{if(shortlong=="long"){var longDescriptionText=jQuery("#longDescriptionText");if(longDescriptionText.val().length>profileConfig.longLen){$("#longDescriptionText").trigger("paste");document.dialogShownCount=1;$("#descriptionLongDialog").dialog("open");return false}}}ColdFusion.Ajax.submitForm(shortlong+"DescriptionForm","/index.cfm?event=showcaseEdit.saveDescriptionsAJAX",saveDescriptionCallback);return false};function saveDescriptionCallback(jsonres){var res=eval("("+jsonres+")");if(typeof (res.SHORTDESCRIPTION)!="undefined"){jQuery("#profile #shortDescriptionContent").text(res.SHORTDESCRIPTION);if(res.SHORTDESCRIPTION.length>0){jQuery("#shortDescriptionContent")[0].innerHTML=res.SHORTDESCRIPTION}else{jQuery("#shortDescriptionContent")[0].innerHTML=profileConfig.shortDefault}editDescriptionToggle("short")}else{if(typeof (res.LONGDESCRIPTION)!="undefined"){if(res.LONGDESCRIPTION.length){jQuery("#longDescriptionContent")[0].innerHTML=res.LONGDESCRIPTION.replace(/(\r\n|[\r\n])/g,"<br />")}else{jQuery("#longDescriptionContent").text(profileConfig.longDefault)}jQuery("#longDescriptionContent").removeClass("notification");jQuery("#longDescriptionText").val(res.LONGDESCRIPTION);editDescriptionToggle("long")}}}var onDescriptionHover=function(){jQuery("#viewlongDescriptionContainer, #viewshortDescriptionContainer").hover(function(){jQuery(this).addClass("editable");jQuery(this).find(".editToolbar").show()},function(){jQuery(this).removeClass("editable");jQuery(this).find(".editToolbar").hide()})};var editDescriptionToggle=function(shortlong,iscancel){jQuery("#edit"+shortlong+"DescriptionContainer").toggle();jQuery("#view"+shortlong+"DescriptionContainer").toggle();if(jQuery("#edit"+shortlong+"DescriptionContainer")[0].style.display!="none"){jQuery("#view"+shortlong+"DescriptionText").focus()}else{if(iscancel==true){if(shortlong=="short"&&jQuery("#shortDescriptionText")[0].value.length){jQuery("#shortDescriptionText")[0].value=jQuery("#shortDescriptionContent")[0].innerHTML}}}return false};var initSearch=function(){jQuery("#searchButton").toggle(function(){jQuery("#searchBar").slideDown("slow");jQuery("#searchBar").next().attr("style","margin-top:36px")},function(){jQuery("#searchBar").slideUp("slow");jQuery("#searchBar").next().removeAttr("style")});var defaultSearchBoxText="Search for...";jQuery("#searchQuery").focus(function(){var $searchField=jQuery("#searchQuery");if($searchField.val()==defaultSearchBoxText){$searchField.val("");$searchField.attr("style","color: black")}});jQuery("#searchQuery").blur(function(){var $searchField=jQuery("#searchQuery");if($searchField.val()==""){$searchField.val(defaultSearchBoxText);$searchField.attr("style","color: silver")}})};var intfAlert=function(title,text){var $alertElement=jQuery("<div></div>").html("<p>"+text+"</p>").dialog({autoOpen:true,title:title,buttons:{Ok:function(){jQuery(this).dialog("close")}},modal:true})};var intfFlashMsg=function(title,text,timeout,showCloseButton){if(typeof (showCloseButton)=="undefined"){showCloseButton=true}if(parseFloat(timeout)!=timeout){timeout=3000}var options={autoOpen:true,title:title,modal:true,open:function(event,ui){setTimeout("jQuery('#intfAlert').dialog('close');",timeout)},hide:"fade"};if(showCloseButton){options.buttons={Dismiss:function(){jQuery(this).dialog("close")}}}var $alertElement=jQuery('<div id="intfAlert"></div>').html("<p>"+text+"</p>").dialog(options)};var intfConfirm=function(text,onOk,onCancel){var $alertElement=jQuery("<div></div>").html("<p>"+text+"</p>").dialog({autoOpen:true,title:"Confirm:",buttons:{Cancel:function(){onCancel();jQuery(this).dialog("close")},Ok:function(){onOk();jQuery(this).dialog("close")}},modal:true})};var deleteFriend=function(id,choice){var msg=confirm("Do you want to permanently delete this contact?");if(msg==true){link={event:"showcaseEdit.deleteFriend",pid:id};jQuery.getJSON("/index.cfm",link,callbackFriendRequest)}};var callbackFriendRequest=function(res){var el=document.getElementById("friendThumbContainer_"+res.ACTIONONPID);if(el&&el.parentNode){el.parentNode.removeChild(el)}};
