(function($){var methods={init:function(){var data=this.data('interestProfiler');if(!data){this.data('interestProfiler',{initialized:true})
this.interestProfiler('buttonState');this.find('div.question:first').addClass('selected');this.keydown(function(event){var key=event.which;if(key==38){this.interestProfiler('changeSelection',-1);}
else if(key==40){this.interestProfiler('changeSelection',1);}}).keypress(function(event){var key=event.which;if(key==13)
$('.navigation .next[disabled!=true]').click();else if(key==8)
$('.navigation .previous').click();else{if(!event.altKey&&!event.ctrlKey
&&!event.metaKey){var response=String.fromCharCode(key)
.toUpperCase();if(response=='?')
response='U';if(response=='L'||response=='U'
||response=='D')
var selected=$('.interest-profiler div.selected a.'
+response).click();}}}).focus();}
return this;},changeSelection:function(by){var selected=this.find('div.selected');var classes=selected.attr('class');var regex=/ question-(\d+) /;var match=regex.exec(classes);var number=Number(match[1]);var next=number+by;var nextElement=this.find('.question-'+next);if(nextElement.size()==1){selected.removeClass('selected');nextElement.addClass('selected');}
return this;},selectedNumber:function(){var selected=this.find('div.selected');var regex=/ question-(\d+) /;var classes=selected.attr('class');var match=regex.exec(selected.attr('class'));var number=Number(match[1]);return number;return this;},respond:function(num,response){var question=this.find('.question-'+num);var l=question.find('.L').removeClass('selected');var u=question.find('.U').removeClass('selected');var d=question.find('.D').removeClass('selected');if(response=='L')
l.addClass('selected');else if(response=='?')
u.addClass('selected');else if(response=='D')
d.addClass('selected');this.find('div.selected').removeClass('selected');this.find('.question-'+num).addClass('selected');this.interestProfiler('changeSelection',1);this.interestProfiler('buttonState');return this;},buttonState:function(){var answered=this.find('.question .selected').size();if(answered==12)
this.find('.navigation button').removeAttr('disabled');return this;}}
$.fn.interestProfiler=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist');}};})(jQuery);(function($){var allOptions=[['r','Realistic',114,82],['i','Investigative',105,73],['a','Artistic',97,65],['s','Social',115,83],['e','Enterprising',101,69],['c','Conventional',99,67]];var methods={init:function(){$(window).keydown(function(event){var key=event.which;if(key==37||key==39||key==38||key==40){var attrId=$(".hover").prop("id");if(attrId==null||attrId=='Undefined'){attrId='r';}else{for(var i=0;i<=allOptions.length;i++){$("#"+attrId).removeClass("hover");if(allOptions[i][0]==attrId){if(key==37||key==40){if(i-1<0){attrId=allOptions[allOptions.length-1][0];break;}else{attrId=allOptions[i-1][0];break;}}
if(key==39||key==38){if(i+1>=allOptions.length){attrId=allOptions[0][0];break;}else{attrId=allOptions[i+1][0];break;}}}}}
$("#"+attrId).addClass("hover").trigger('mouseover');}}).swipe({allowPageScroll:"auto",fingers:1,swipeLeft:function(a,b){var attrId=$(".hover").prop("id");if(attrId==null||attrId=='Undefined'){attrId='r';}else{for(var i=0;i<=allOptions.length;i++){$("#"+attrId).removeClass("hover");if(allOptions[i][0]==attrId){if(i-1<0){attrId=allOptions[allOptions.length-1][0];break;}else{attrId=allOptions[i-1][0];break;}}}}
$("#"+attrId).addClass("hover").trigger('mouseover');},swipeRight:function(a,b){var attrId=$(".hover").prop("id");if(attrId==null||attrId=='Undefined'){attrId='r';}else{for(var i=0;i<=allOptions.length;i++){$("#"+attrId).removeClass("hover");if(allOptions[i][0]==attrId){if(i+1>=allOptions.length){attrId=allOptions[0][0];break;}else{attrId=allOptions[i+1][0];break;}}}}
$("#"+attrId).addClass("hover").trigger('mouseover');}}).keypress(function(event){var key=event.which;for(var i=0;i<=allOptions.length;i++){if(key==allOptions[i][2]||key==allOptions[i][3]){$("#"+allOptions[i][0]).trigger('click');$(".hover").removeClass("hover");}}});return this;},data:function(){if(this){var data=this.data('quick');if(!data){data={selected:[]};this.data('quick',data);}
return data;}},riasecResults:function(){var selected=$(this).quick('data').selected;var next='quick/'+selected[1]+selected[2]+selected[3];window.location=next;},redoOptions:function(i1,s){var selected=$(this).quick('data').selected;var unavailable=[]
for(var i2=1;i2<=3;i2++){if(i2!=i1){unavailable.push(selected[i2]);}}
var mySelection=selected[i1];s.find('*').remove();if(mySelection==undefined){$('<option value="none">Choose One</option>').appendTo(s);}
for(var i3=0;i3<=allOptions.length-1;i3++){var letter=allOptions[i3][0];var text=allOptions[i3][1];if($.inArray(letter,unavailable)==-1){$('<option></option>').prop('value',letter).html(text).appendTo(s);}else{}}
if(!(mySelection==undefined)){s.find('option[value='+mySelection+']').prop("selected","true");}},getText:function(){var text="";if(methods.getPos(false)==1){text="This means that your primary interests lie in the <span class=\"bold\">"+$("#i1 :selected").text()+"</span> realm. The jobs selected for you will reflect this <span class=\"bold\">"+$("#i1 :selected").text()+"</span> theme.";}
if(methods.getPos(false)==2){text="This is your secondary interest. Jobs selected for you will reflect <span class=\"bold\">"+$("#i2 :selected").text()+"</span> interests in <span class=\"bold\">"+$("#i1 :selected").text()+"</span> environments.";}
if(methods.getPos(false)==3){text=$("#i3 :selected").text()+" is the final part of your theme code. Jobs selected for you will reflect <span class=\"bold\">"+$("#i2 :selected").text()+"</span> interests in <span class=\"bold\">"+$("#i1 :selected").text()+"</span> environments with <span class=\"bold\">"+$("#i3 :selected").text()+"</span> goals.";}
return text;},getPos:function(includeCurrent){if(typeof $("#i3").prop("disabled")!='undefined'&&$("#i3").prop("disabled")==false&&(includeCurrent||$("#i3").val()!="none")){return 3;}else if(typeof $("#i2").prop("disabled")!='undefined'&&$("#i2").prop("disabled")==false&&(includeCurrent||$("#i2").val()!="none")){return 2;}else{return 1;}},selectNext:function(current){var c=$(current);var index=Number(c.prop('id').charAt(1));$(".interest-"+index).removeClass('selected').removeClass('interest-'+index);var v=c.val();$("#quickassessment a#"+v).addClass('selected').addClass('interest-'+index);$("#selection-desc").html(methods.getText());var selected=$(this).quick('data').selected;selected[index]=v;if(v!="none"){for(var i=1;i<=3;i++){var s=$('#i'+i);if(i==index){s.find("option[value=none]").remove();}else{this.quick('redoOptions',i,s);if(i==index+1){s.removeAttr('disabled');}}}}}};$.fn.quick=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist');}};})(jQuery);(function($){$.fn.countCheckboxes=function(){var numSelected=0;$(":input[@type='checkbox']").click(function(){if(this.checked){if(numSelected>=4){this.checked=false;alert("You can only select up to four items for comparison. You must unselect an option before making another selection.");}else{numSelected++;}}else{numSelected--;}});}})(jQuery);(function($){$.fn.clearForms=function(){return this.each(function(){$(':input',this).each(function(){var type=this.type,tag=this.tagName.toLowerCase();if(type=='text'||type=='password'||tag=='textarea')
this.value='';else if(type=='checkbox'||type=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});});}})(jQuery);(function($){$.fn.clearNotices=function(){h2.clearNotices();if(this){this.find(".notices").html('');this.find(".error").removeClass("error");}
return this;};})(jQuery);var h2=(function($){var ratingFunctions=(function(){function _init(){$('.rating-option').each(function(pos,ele){$(ele).hover(function(){_lightStars(pos+1);},function(){_changeRating(_getCurrentRating(),false);});});_setCurrentRating($('#rating-options').find(".rating-option.selected").size());}
function _toggleBookmark(bookmark){var ele=$('#bookmark-holder');var bookmarked=ele.hasClass('bookmarked');if(bookmark!=bookmarked){if(bookmark){ele.fadeOut(500,function(){ele.addClass("bookmarked").fadeIn(500);});}else{ele.fadeOut(500,function(){ele.removeClass("bookmarked").fadeIn(500);});}}}
function _changeRating(rating,definitive){_modifyRatings(rating,'selected');_setCurrentRating(rating);if(definitive){var classes=$('#rating-container').prop('class').replace(/rating-\w+/,'rating-'+rating);$('#rating-container').fadeOut(500,function(){$(this).prop('class',classes).fadeIn(500);});}}
function _modifyRatings(rating,activeClass){$('#rating-options').find(".rating-option").each(function(i,ele){var jele=$(ele).removeClass('unselected').removeClass('selected').removeClass('lit');if((i+1)<=rating){jele.addClass(activeClass);}else{jele.addClass('unselected');}});}
function _lightStars(rating){_modifyRatings(rating,'lit');}
function _getCurrentRating(){return $('#rating-options').data('currentRating');}
function _setCurrentRating(rating){$('#rating-options').data({currentRating:rating});}
return{init:function(){_init();},toggleBookmark:function(bookmark){_toggleBookmark(bookmark);},changeRating:function(rating,definitive){_changeRating(rating,definitive);}};}());var wipFunctions=(function($){function _positionOf(ele){var pos=$(ele).find('.position').text();var posInt=parseInt(pos);return posInt-1;}
function _select(ele){$('.round').removeClass('selected')
$(ele).addClass('selected');}
function _active(a){if(a==null)
$("#rounds").toggleClass('active');else if(a)
$("#rounds").addClass('active');else
$("#rounds").removeClass('active');}
function _down(){var selected=_positionOf($('#rounds .selected'));if(selected<4){if($('#rounds').hasClass('active')){move(selected,selected+1);}else{_select($('#rounds .round:eq('+(selected+1)+')'))}}}
function _up(){var selected=_positionOf($('#rounds .selected'));if(selected>0){if($('#rounds').hasClass('active')){move(selected,selected-1);}else{_select($('#rounds .round:eq('+(selected-1)+')'))}}}
function _init(config){var selected=0
var isActive=false
if(config){if(config.active!=null){selected=config.active;isActive=true;}}
$("#work-importance-profiler").find(".round")
.draggable({handle:'.handle',containment:'#rounds',revert:'invalid',axis:'y',helper:'clone',start:function(event,ui){$(ui.helper).addClass('dragging');},stop:function(event,ui){$(ui.helper).removeClass('dragging');}})
.droppable({accept:".round",drop:function(event,ui){var from=_positionOf(ui.draggable);var to=_positionOf(this);move(from,to);}}).click(function(){_select(this);_active(true);});_select($('.round:eq('+selected+')'));_active(isActive);}
return{init:function(config){_init(config);},up:function(){_up();},down:function(){_down();}}})(jQuery);function _menuHoverOver(){$(this).find(".sub").stop().fadeTo(10,1).show();(function($){jQuery.fn.calcSubWidth=function(){rowWidth=0;$(this).find("ul").each(function(){rowWidth+=$(this).width();});};})(jQuery);if($(this).find(".row").length>0){var biggestRow=0;$(this).find(".row").each(function(){$(this).calcSubWidth();if(rowWidth>biggestRow){biggestRow=rowWidth;}});$(this).find(".sub").css({'width':biggestRow});$(this).find(".row:last").css({'margin':'0'});}else{$(this).calcSubWidth();$(this).find(".sub").css({'width':rowWidth});}
var header=$('#header');var sub=$(this).find(".sub");var rightMargin=($(window).width()-header.width())/2;var subOffset=sub.offset();var headerOffset=header.offset();var rightPos=0;if(subOffset&&headerOffset){rightPos=subOffset.left-headerOffset.left+sub.width()+40;}
var adjustment=header.width()-rightPos;if(rightMargin>Math.abs(adjustment)){adjustment=0;}
if(adjustment<0){$(this).find(".sub").css("margin-left",adjustment+"px");var arrow=$(this).find("span.toparrow");var left=parseInt(arrow.css("left").substring(0,arrow.css("left").indexOf("px")));arrow.css("left",(left+Math.abs(adjustment))+"px");}}
function _menuHoverOut(){$(this).find(".sub").stop().fadeTo(10,0,function(){$(this).hide();});}
return{openAuth:function(){$('#non-auth').hide();$('#auth').show();$('#lift__noticesContainer__').html('').remove().prependTo($("#modal").dialog({modal:true,width:496,draggable:false,beforeClose:function(event,ui){h2.closeModalById("#modal");}}).css("display","block"));$('#signin_name').focus();},openResume:function(){$('#lift__noticesContainer__').html('').remove().prependTo($("#resumemodal").dialog({modal:true,width:840,draggable:true,beforeClose:function(event,ui){h2.closeModalById("#resumemodal");}}).css("display","block"));$("input.date-input").each(function(item){$(this).datepicker('hide');});$("input:checkbox:first").focus();},openRegister:function(){$('#auth').tabs('select',1);this.openAuth();$('#username').focus();},openLogin:function(){$('#auth').tabs('select',0);this.openAuth();$('#signin_name').focus();},closeModal:function(){closeModalById("#modal");},closeModalById:function(modalId){$('#messages').append($('#lift__noticesContainer__').remove());$(modalId).clearNotices().dialog('destroy').clearForms();},clearNotices:function(){$('#lift__noticesContainer__').html('');},showLoadingImage:function(that){$(that).after($('<span></span>').addClass('loading-indicator').append($('<span>loading...</span>')));},hideLoadingImage:function(){$('.loading-indicator').remove();},wip:wipFunctions,ratings:ratingFunctions,addCommas:function(nStr)
{nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;},footerPush:function(bodyElement){var dbHeight=$(document.body).height()-$("#modal").height()-$("#tiptip_holder").height();if($(window).height()>dbHeight){if($.browser.msie){$(bodyElement).height($(bodyElement).height()+($(window).height()-$(document.body).height())-0);}else if($.browser.mozilla){$(bodyElement).height($(bodyElement).height()+($(window).height()-$(document.body).height())-17);}else if($.browser.safari){$(bodyElement).height($(bodyElement).height()+($(window).height()-dbHeight)-12);}else{$(bodyElement).height($(bodyElement).height()+($(window).height()-$(document.body).height())-0);};};if($.browser.opera){if(window.innerHeight>$(document.body).height()){$(bodyElement).height($(bodyElement).height()+(window.innerHeight-$(document.body).height())-0);};};},initMenu:function(){$("ul#menu-list li .sub").css({'opacity':'0'});$("ul#menu-list li").hoverIntent({sensitivity:2,interval:20,over:_menuHoverOver,timeout:100,out:_menuHoverOut});},openDropdown:function(cssId){$(cssId).slideDown("slow");},closeDropdown:function(cssId){$(cssId).slideUp("slow");},initJobToolsMenu:function(){$(".dropdown-trigger").click(function(){var content=$(this).parent().find("div.dropdown-content");var prev=$(document).data("resumeCurrentDropdownOpen");if(prev!=null&&(prev.attr("id")!=content.attr("id"))){h2.closeOpenJobTools(prev);}else if(prev!=null&&(prev.attr("id")==content.attr("id"))){return;}
content.slideToggle('slow');$(document).data("resumeCurrentDropdownOpen",content);$(this).mouseleave(function(){h2.initTimeOutForJobTools();}).mouseenter(function(){clearTimeout($(document).data("resumeTimerFunction"));$(document).removeData("resumeTimerFunction");});content.mouseleave(function(){h2.initTimeOutForJobTools();}).mouseenter(function(){clearTimeout($(document).data("resumeTimerFunction"));$(document).removeData("resumeTimerFunction");});});},initTimeOutForJobTools:function(){if($(document).data("resumeTimerFunction")){clearTimeout($(document).data("resumeTimerFunction"));$(document).removeData("resumeTimerFunction");}
var to=setTimeout("h2.closeOpenJobTools($(document).data('resumeCurrentDropdownOpen'));",1000)
$(document).data("resumeTimerFunction",to);},closeOpenJobTools:function(item){item.slideUp('slow');clearTimeout($(document).data("resumeTimerFunction"));$(document).removeData("resumeTimerFunction");$(document).removeData("resumeCurrentDropdownOpen");},initProfileDropdowns:function(){function upOrDown(container,onSlideDown){if(container.is(':visible'))
container.slideUp('slow');else{h2.hideProfileDropdowns();container.slideDown('slow');if(onSlideDown)
onSlideDown.call(container);}}
$("#bookmark").click(function(){h2.hideProfileDropdowns();});$("#print").click(function(){h2.hideProfileDropdowns();});$("#showemail").click(function(){upOrDown($("#mailer-container"));});$("#showrating").click(function(){upOrDown($("#rating-option-container"));});$("#bookmark-top-container.nouser").click(function(){upOrDown($('#bookmark-container'));});$("#showjournal").click(function(){upOrDown($("#journal-container"),function(){if($("#journal").val()!=-1){$("#journal-container .item-1").hide();}else{$("#journal-container .item-1").show();}});});$("#journal").change(function(){if($("#journal").val()!=-1){$("#journal-container .item-1").hide();}else{$("#journal-container .item-1").show();}});h2.ratings.init();},hideProfileDropdowns:function(){$('#actions .collapsible-profile-menu').slideUp("slow");},addToolTips:function(){var titles=$("[title]");titles.not("input").css("cursor","pointer").tipTip();titles.filter("p").addClass("defined");titles.filter("span").addClass("defined");titles.filter("input").tipTip({activation:"focus",defaultPosition:"right",attribute:"title"});titles.filter("textarea").tipTip({activation:"focus",defaultPosition:"right",attribute:"title"});},addDatePicker:function(){$("input.date-input").datepicker();},roundTables:function(){$('table:not(.noround)').each(function(item){var headRow=$(this).find("thead");if(headRow.find('th.top-right').length==0){headRow.find('th:last').addClass("top-right");}
if(headRow.find('th.top-left').length==0){var firstTh=headRow.find('th:first');firstTh.addClass("top-left");if(firstTh.find("input:hidden").length>0){firstTh.addClass("checkcol");}}
var lastRow=$(this).find('tbody').find('tr.last-row');lastRow.find('td:first').addClass("bottom-left");lastRow.find('td:last').addClass("bottom-right");$(this).wrap("<div class=\"data-table-wrapper\"/>");});}}})(jQuery);$(document).ready(function(){$('#auth').tabs();h2.roundTables();h2.initMenu();h2.addDatePicker();h2.addToolTips();});
