// Copyright (c) 2010 Atlassian Software 
var JQ13;var SHERPA_COOKIE_NAME="SherpaStateCon3";var SHERPA_TRACKING_URL="";var SHERPA_PRODUCTION=true;var SHERPA_APP_PREFIX="";var SHERPA_USER_NAME="#user-menu-link > span > span";AJS.$(document).ready(function(c){var a;var e;var b;if(SHERPA_PRODUCTION){SHERPA_TRACKING_URL="http://www.atlassian.com/sandbox/confluence.jsp";SHERPA_APP_PREFIX="";a="/min";e="-min"}else{SHERPA_TRACKING_URL="http://atlassiansherpa.appspot.com";SHERPA_APP_PREFIX="/confluence";a="/dev";e=""}var d;d=AJS.$("#sherpa-insertion");if(0<d.length){b=d.attr("src");sherpa_js_host_arr=b.split("/");b=sherpa_js_host_arr[0]+"//"+sherpa_js_host_arr[2]}if((jQuery.browser.msie&&(jQuery.browser.version<=7))||(jQuery.browser.opera)){}else{sherpa_import_css(b+"/static/css/confluence_sandbox/jquery-ui-1.7.2.custom.css");sherpa_import_css(b+"/static/css/sherpa.css");sherpa_import_js(b+"/static/js/jquery-1.3.2.min.js","jQuery",function(){sherpa_import_js(b+"/static/js/jquery-ui-1.7.2.custom.min.js","jQuery.ui",function(){sherpa_import_js(b+"/static/js/jquery.cookie.min.js","jQuery.cookie",function(){JQ13=jQuery.noConflict(true);sherpa_import_js(b+"/static/js"+a+"/confluence_create_login"+e+".js","create_login_story",function(){sherpa_import_js(b+"/static/js"+a+"/confluence_documentation_story"+e+".js","confluence_documentation_story",function(){sherpa_import_js(b+"/static/js"+a+"/confluence_collaborative_intranet"+e+".js","collaborative_intranet_story",function(){sherpa_import_js(b+"/static/js"+a+"/sherpa"+e+".js","Sherpa",function(){if(self==top){if(!this.JSON){sherpa_import_js(b+"/static/js/json2.min.js","JSON",function(){load_sherpa()})}else{load_sherpa()}}})})})})})})})}});function load_sherpa(){var e=new Date();var h=e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+"."+e.getMilliseconds();console.log("SHERPA:  start="+h);var g=new Stories();if(0<JQ13("#signup-link").length){SHERPA=new Sherpa();SHERPA.load_state();g.story_array.push(create_login_story());SHERPA.create_ui(g);if(-1==SHERPA.state.current_story_id){SHERPA.display_story(0);SHERPA.state.visible=false;SHERPA.toggle()}}else{g.story_array.push(collaborative_intranet_story());g.story_array.push(confluence_documentation_story());SHERPA=new Sherpa();SHERPA.load_state();SHERPA.create_ui(g);var c=gup("story");var b=gup("section");if((undefined!=c)&&(""!=c)){if(SHERPA.state.current_story_index!=c){SHERPA.reset_state();SHERPA.state.current_story_index=c;if((undefined!=b)&&(""!=b)){SHERPA.state.current_section_index=b}SHERPA.state.visible=true;SHERPA.save_state();start_tutorial()}}else{if((undefined==JQ13.cookie(SHERPA_COOKIE_NAME+"show_welcome"))||("false"==JQ13.cookie(SHERPA_COOKIE_NAME+"show_welcome"))){fake_welcome_screen(true)}}var a;a="<li class='normal ajs-menu-item'><a href='#' class='browse trigger ajs-menu-title' id='help-menu-link'><span><span>Help</span></span></a><div class='ajs-drop-down hidden' id='help-menu-items' style=''><ul class='section-global first' id='help-menu-link-global'>";a=a+"<li><a title='Welcome Screen' style='border-top:1px solid #CCCCEE;' class='user-item' href='#' id='welcome-screen-directory-link' onclick=''><span>Confluence Help</span></a></li>";a=a+"<li class=''><a title='Welcome Screen' style='border-top:1px solid #CCCCEE;' class='user-item' href='#' id='tour-screen-directory-link' onclick=''><span>Tours</span></a></li>";for(var f=0;f<SHERPA.stories.story_array.length;f++){a=a+"<li class=''><a class='sherpa-story-link user-item' id='sherpa-story-"+f+"' name='"+f+"' >";a=a+"<span>&nbsp;&nbsp;&nbsp;"+SHERPA.stories.story_array[f].story_name+"</span>";a=a+"</a></li>"}a=a+"<li><a title='Hide Help' style='border-top:1px solid #CCCCEE;' class='user-item' href='#' id='hide-help-hide-link' onclick=''><span>";if(SHERPA.state.visible){a=a+"Hide Interactive Guide"}else{a=a+"Show Interactive Guide"}"</span></a></li>";"</ul></div></li>";JQ13("#header-menu-bar").prepend(a);JQ13("#help-menu-link").parent().mouseenter(function(){JQ13(this).addClass("opened");JQ13("#help-menu-items").removeClass("hidden");if(SHERPA.state.visible){JQ13("#hide-help-hide-link")[0].innerHTML="<span>Hide Interactive Tour</span>"}else{JQ13("#hide-help-hide-link")[0].innerHTML="<span>Show Interactive Tour</span>"}});JQ13("#help-menu-link").parent().mouseleave(function(){JQ13(this).removeClass("opened");JQ13("#help-menu-items").addClass("hidden")});JQ13("#help-menu-link-global>li").mouseenter(function(){JQ13(this).addClass("active")});JQ13("#help-menu-link-global>li").mouseleave(function(){JQ13(this).removeClass("active")});JQ13("#welcome-screen-directory-link").click(function(i){i.preventDefault();JQ13("#help-menu-link").removeClass("opened");JQ13("#help-menu-items").addClass("hidden");SHERPA.hide("fake_welcome_screen(false)");return false});JQ13("#tour-screen-directory-link").click(function(i){i.preventDefault();JQ13("#help-menu-link").removeClass("opened");JQ13("#help-menu-items").addClass("hidden");SHERPA.hide("fake_welcome_screen(true);");return false});JQ13("#hide-help-hide-link").click(function(i){JQ13("#help-menu-link").removeClass("opened");JQ13("#help-menu-items").addClass("hidden");if(SHERPA.state.visible){this.innerHTML="<span>Show Interactive Tour</span>"}else{this.innerHTML="<span>Hide Interactive Tour</span>"}SHERPA.toggle()});JQ13(".sherpa-story-link").click(function(i){i.preventDefault();JQ13("#help-menu-link").removeClass("opened");JQ13("#help-menu-items").addClass("hidden");var j=JQ13(this).attr("name");if(j!=SHERPA.state.current_story_index){set_sherpa_index(j);SHERPA.hide("start_tutorial()")}else{SHERPA.show()}return false})}var d=new Date();h=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+"."+d.getMilliseconds();console.log("SHERPA:  end="+h);console.log("SHERPA:  Processing Time="+(d.getTime()-e.getTime()))}function fake_welcome_screen(d){SHERPA.hide_dialogs();if(JQ13("#welcome_screen").length>0){if(d){JQ13("#welcome_screen").bind("dialogopen",function(f,g){JQ13("#embed").hide();JQ13("#video").hide();JQ13("#tutorial_tutorial").fadeIn("slow")})}JQ13("#welcome_screen").dialog("open")}else{var e=JQ13("<div></div>").attr("id","welcome_screen");e.attr("class","welcome-screen");e.attr("title","Atlassian Assistant");JQ13("body").append(e);var a="<div id='help'><ul id='tutorials'><li id='support_img'><img src='http://atlassiansherpa.appspot.com/static/images/video.png'/></li><li><div id='video_tutorials'>Video Tutorials</div></li><li><div id='video_tutorials_instructions'>Get a quick overview of Confluence.</div></li><li><div id='video_tutorials_learn' onclick='showVideo()'>< Learn more</div></li></ul><ul id='tutorials'><li id='support_img'><img src='http://atlassiansherpa.appspot.com/static/images/help.png'/></li><li><div id='support'>Interactive Tour</div></li><li><div id='support_instructions'>These simple step by step tutorials will help you learn how to use Confluence.</div></li><li><div id='support_learn' onclick='show_tutorial()'>< Learn more</div></li></ul></div><div id='embed'><object id='ep_player' name='ep_player' height='391' width='640' data='http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fpehi5oiz02l2%2Fconfig.xml'  type='application/x-shockwave-flash'><param name='movie'  value='http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fpehi5oiz02l2%2Fconfig.xml'/><param name='AllowScriptAccess'  value='always'/><param name='allowfullscreen'  value='true'/><embed src='http://cdn.episodic.com/player/EpisodicPlayer.swf?config=http%3A%2F%2Fcdn.episodic.com%2Fshows%2F13%2Fpehi5oiz02l2%2Fconfig.xml'  type='application/x-shockwave-flash'  allowfullscreen='true'  AllowScriptAccess='always'  width='640' height='391' id='ep_player' name='ep_player'/><a href='http://analytics.episodic.com/download/epehi5oiz02l2/f20/welcome-to-confluence.mp4'><img src='http://content1.episodic.com/assets/480/a107470.jpg'  height='360' width='640' border='0'/></a></object></div><div id='tutorial_tutorial'><center><img src='http://atlassiansherpa.appspot.com/static/images/confluence_sherpa_tilted.png'/><div id='tutorial_intro'><div id='welcome'>Confluence Interactive Tour</div><div id='welcome2' style='padding-left:200px;text-align:left;'>Which tutorial interests you?<br>";for(var c=0;c<SHERPA.stories.story_array.length;c++){var b="  ";a=a+"<input type='radio' "+b+" name='radio' id='radio' value='"+c+"' onclick='set_sherpa_index("+c+");'>&nbsp;&nbsp;"+SHERPA.stories.story_array[c].story_name+"<br>"}a=a+"</div><div id='play_movie'><center><a href='#' onclick='start_tutorial()' style='border:0;'><img src='http://atlassiansherpa.appspot.com/static/images/button.png'  style='border:0;'/></a></center></center></div><div id='video'><img src='http://www.atlassian.com/software/confluence/images/screenshot_main.png'/><div id='welcome'>Welcome to Confluence</div><div id='welcome2'>The best way to get to know Confluence is to see it in action.</div><div id='welcome3'>If you are new to Confluence, watch this Getting Started<br/>video to see how easy it is to start collaborating.</div><div id='play_movie'><a href='#' onclick='showVideo()' style='border:0;'><img src='http://atlassiansherpa.appspot.com/static/images/button.png'  style='border:0;'/></a></div></div><div id='hide_dialog'>&nbsp;&nbsp;<input type='checkbox' id='hide_dialog_checkbox' onchange='hide_dialog(this.checked)'>&nbsp;&nbsp;Don't show me this dialog</div>";e.append(a);if(d){JQ13("#welcome_screen").dialog({resizable:false,minHeight:480,height:480,minWidth:840,width:840,autoOpen:true,modal:true,draggable:false,dialogClass:"welcome-screen",open:function(f,g){JQ13("#embed").hide();JQ13("#video").hide();JQ13("#tutorial_tutorial").fadeIn("slow")}})}else{JQ13("#welcome_screen").dialog({resizable:false,minHeight:480,height:480,minWidth:840,width:840,autoOpen:true,modal:true,draggable:false,dialogClass:"welcome-screen"})}}}function showVideo(){JQ13("#tutorial_tutorial").fadeOut("slow");JQ13("#video").fadeOut("slow",function(){JQ13("#embed").fadeIn("slow")})}function show_tutorial(){JQ13("#embed").hide();JQ13("#video").hide();JQ13("#tutorial_tutorial").fadeIn("slow")}function hide_dialog(a){JQ13("#welcome_screen").dialog("close");JQ13.cookie(SHERPA_COOKIE_NAME+"show_welcome",a,{path:"/",expires:30})}function start_tutorial(){hide_dialog("true");SHERPA.display_story(SHERPA.state.current_story_index);SHERPA.show()}function set_sherpa_index(a){SHERPA.reset_state();SHERPA.state.current_story_index=a;SHERPA.save_state()}function sherpa_import_js(e,a,d){if(JQ13){JQ13.getScript(e,d)}else{if(jQuery&&jQuery.getScript){jQuery.getScript(e,d)}else{var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",e);var b=document.getElementsByTagName("head")[0];if(b){b.appendChild(c)}else{document.body.appendChild(c)}if(d){wait_for_script_load(a,d)}}}}function sherpa_import_css(b,a,e){var d=document.createElement("link");d.setAttribute("rel","stylesheet");d.setAttribute("type","text/css");d.setAttribute("media","screen");d.setAttribute("href",b);if(e){wait_for_script_load(a,e)}var c=document.getElementsByTagName("head")[0];if(c){c.appendChild(d)}else{document.body.appendChild(d)}}var SHERPA_WAIT_TRIES=0;function wait_for_script_load(look_for,callback){var interval=setInterval(function(){SHERPA_WAIT_TRIES=SHERPA_WAIT_TRIES+1;if(SHERPA_WAIT_TRIES<5000){if(eval("typeof "+look_for)!="undefined"){clearInterval(interval);callback()}}else{clearInterval(interval)}},50)}function gup(b){b=b.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+b+"=([^&#]*)";var d=new RegExp(a);var c=d.exec(window.location.href);if(c==null){return""}else{return c[1]}};
