$(document).ready(function(){$(".sharing").append('<div class="share-section addthis_toolbox addthis_default_style addthis_32x32_style" addthis:title="My Infographic Resume" addthis:description="Check out my infographic resume created via Vizualize.me. Create yours with one click."><h2>Share on social networks</h2><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_linkedin"></a><a class="addthis_button_email"></a><a class="addthis_button_compact"></a><a class="addthis_button_google_plusone" g:plusone:count="false" href="#"></a></div>');$("nav span.btn").click(function(){var currentLink=$(this).children(':first');var menu=$(this).next();if(!currentLink.hasClass('active')){if(menu.is(':visible')){menu.css('display','none');currentLink.removeClass('active');$(this).parent().removeClass('active');}else{menu.fadeIn(1000);menu.css('display','block');currentLink.addClass('active');$(this).parent().addClass('active');}}else{menu.css('display','none');currentLink.removeClass('active');$(this).parent().removeClass('active');};});});Object.size=function(obj){var size=0,key;for(key in obj){if(obj.hasOwnProperty(key)){size++;}}
return size;};var Viz={};(function(){function V(){}
V.version="0.0.1";V.widgets={};V.eventBus={channels:{},listen:function(event,callback){if(!this.channels[event]){this.channels[event]={sequence:0,listeners:{}};}
var channel=this.channels[event],id=channel.sequence;channel.listeners[id]=callback;channel.sequence+=1;return id;},unlisten:function(event,listener_id){this.channels[event].listeners[listener_id]=null;delete this.channels[event].listeners[listener_id];},shout:function(source,event,args){if(!this.channels[event]){return;}
var id,listeners=this.channels[event].listeners;for(id in listeners){if(listeners.hasOwnProperty(id)){listeners[id](source,args);}}}};V.cache={default_expiry:60*5,list:{},now:function(){return Math.round((new Date()).getTime()/1000);},put:function(key,data,expiry){var expires=expiry||this.default_expiry;this.list[key]={payload:data,expires:this.now()+expires};},get:function(key){if(this.list.hasOwnProperty(key)){if((this.now()-this.list[key].expires)<=0){return this.list[key].payload;}}
return null;},remove:function(key){var result;if(this.list.hasOwnProperty(key)){result=this.list[key];delete this.list[key];}
return result;},exists:function(key){if(typeof key!=="string"){var result=true,item;for(item in key){if(key.hasOwnProperty(item)){result=result&&this.exists(key[item]);}}
return result;}else{return this.list.hasOwnProperty(key);}},isExpired:function(key){if(this.list.hasOwnProperty(key)){if((this.now()-this.list[key].expires)<=0){return false;}}
return true;}};V.dataStream={what_url_map:{"self_viz_data":"/user/data","dashboard_stats":"/ajax/dashboard/quick","dashboard_referral":"/ajax/dashboard/referral","dashboard_industry":"/ajax/dashboard/industry","dashboard_hits_30":"/ajax/dashboard/hits?days_back=30","dashboard_hits_14":"/ajax/dashboard/hits?days_back=14","dashboard_hits_7":"/ajax/dashboard/hits?days_back=7"},queue:{},bind:function(what,url){var old=null;if(this.what_url_map.hasOwnProperty(what)){old=this.what_url_map[what];}
this.what_url_map[what]=url;return old;},unbind:function(what){var result;if(this.what_url_map.hasOwnProperty(what)){result=this.what_url_map[what];delete this.what_url_map[what];Viz.cache.remove(result);}
return result;},request:function(source,what,options,callback){var opt=options||{},url=this.what_url_map.hasOwnProperty(what)?this.what_url_map[what]:null,ignoreCache=opt.ignoreCache||false;if(!url){throw"Data Stream Request failed: No url mapped for name '"+what+"'";}
if(!ignoreCache){var cached=Viz.cache.get(url);if(cached&&callback){callback(source,true,Viz.clone(cached));return;}}
if(Object.size(this.queue)===0){Viz.eventBus.shout(source,"viz.dataStream.queue_started",null);}
if(this.queue.hasOwnProperty(url)){this.queue[url].push({source:source,callback:callback});return;}else{this.queue[url]=[{source:source,callback:callback}];}
$.ajax({type:'GET',url:url,success:function(resp){if(!resp){return;}
var queue=Viz.dataStream.queue;if(queue.hasOwnProperty(url)){Viz.cache.put(url,resp);var i;for(i=0;i<queue[url].length;++i){if(queue[url][i].callback){queue[url][i].callback(queue[url][i].source,true,Viz.clone(resp));}}}
Viz.eventBus.shout(source,"viz.dataStream.recieved",{what:what});},error:function(jqXHR,textStatus,errorThrown){var queue=Viz.dataStream.queue;var i;for(i=0;i<queue[url].length;++i){if(queue[url][i].callback){queue[url][i].callback(queue[url][i].source,false,{code:jqXHR.status,message:textStatus});}}
Viz.eventBus.shout(source,"viz.dataStream.error",{code:jqXHR.status,message:textStatus});},complete:function(jqXHR,textStatus){var queue=Viz.dataStream.queue;delete queue[url];if(Object.size(queue)===0){Viz.eventBus.shout(source,"viz.dataStream.queue_empty",null);}}});}};V.widget={list:{},queue:{},fetch:function(url,callback,options){var opt=options||{},cb=callback,ignoreCache=opt.ignoreCache||false;if(!ignoreCache){var cached=Viz.cache.get(url);if(cached&&callback){callback(url);return;}}
var fetchCallback=function(url,callback){Viz.cache.put(url,"Loaded JS");var queue=Viz.widget.queue;delete queue[url];if(Object.size(queue)===0){Viz.eventBus.shout(null,"kore.widget.queue.empty",null);}
if(callback){callback(url);}};if(typeof url==="string"){if(Object.size(this.queue)===0){Viz.eventBus.shout(null,"kore.widget.queue.started",null);}
if(this.queue.hasOwnProperty(url)){this.queue[url].push({source:null,callback:callback});return;}else{this.queue[url]=[{source:null,callback:callback}];}
var scriptTag=document.createElement('script');scriptTag.src=url;scriptTag.onreadystatechange=function(){if(this.readyState==='complete'||this.readyState==='loaded'){this.onreadystatechange=null;fetchCallback(scriptTag.src,cb);}};scriptTag.onload=function(){fetchCallback(scriptTag.src,cb);};var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(scriptTag,s);}else{var i;for(i in url){if(url.hasOwnProperty(i)){this.fetch(url[i],cb);}}}},register:function(name,dependencies,createWidgetFn){if(arguments.length===2){createWidgetFn=dependencies;dependencies=null;}
var result=(this.list.hasOwnProperty(name))?this.list[name].create:null;this.list[name]={dependencies:dependencies,create:createWidgetFn};return result;},create:function(name,options,parent){var i,errors=[];if(!this.list.hasOwnProperty(name)){throw name+" does not exist";}
var widget=this.list[name];if(widget.dependencies){for(i=0;i<widget.dependencies.length;++i){if(!Viz.widget.exists(widget.dependencies[i])){errors.push(widget.dependencies[i]);}}
if(errors.length>0){throw"Widget dependency check failed: "+errors.join();}}
var result=widget.create(options);if(options&&options.hasOwnProperty("id")){result.id=options.id;}
if(options&&options.hasOwnProperty("className")){result.className=options["className"];}
result.typeOf=name;if(parent){result.parent=parent;}
return result;},exists:function(name){if(typeof name!=="string"){var result=true,item;for(item in name){if(name.hasOwnProperty(item)){result=result&&this.exists(name[item]);}}
return result;}else{return this.list.hasOwnProperty(name);}}};V.preloadImage=function(image){if(typeof image!=="string"){for(item in image){if(image.hasOwnProperty(item)){this.preloadImage(image[item]);}}}else{var img=new Image();img.src=image;}};function oralize(array,key,outputkey,func){func=func||function(a,b){return a+b;};outputkey=outputkey||'norm';var i=0,quantity=0;if(typeof array[i]==='object'){for(i=0;i<array.length;++i){quantity=(typeof array[i][key]==='undefined'||array[i][key]===null)?quantity:func(quantity,array[i][key]);}
for(i=0;i<array.length;++i){array[i][outputkey]=(typeof array[i][key]==='undefined'||array[i][key]===null)?0:array[i][key]/quantity;}}else{for(i=0;i<array.length;++i){quantity=(array[i]===null)?quantity:func(quantity,array[i]);}
for(i=0;i<array.length;++i){array[i]=(array[i]===null)?0:array[i]/quantity;}}}
V.normalize=function(array,key,outputkey){oralize(array,key,outputkey);return array;};V.abnormalize=function(array,key,outputkey){outputkey=outputkey||'abnorm';oralize(array,key,outputkey,Math.max);return array;};V.stripHidden=function(data){var i=0,result=[];for(i=0;i<data.length;++i){if(data[i].is_visible){result.push(data[i]);}}
return result;};V.clone=function(obj){if(obj===null||typeof(obj)!=='object'){return obj;}
var key={},temp=obj.constructor();for(key in obj){if(obj.hasOwnProperty(key)){temp[key]=this.clone(obj[key]);}}
return temp;};V.limit=function(array,limit){array.splice(limit,array.length-limit);return array;};V.randomSample=function(array,size){size=size||array.length;var result=[];var i;for(i=0;i<size;i++){var random=Math.floor(Math.random()*(size-1));if(typeof array==='string'){result+=array.charAt(random);}else{result.push(array[random]);}}};V.createTag=function(tag,identifier){var newTag=document.createElement(tag),id=identifier||null;if(id){newTag.setAttribute('id',id);}
return newTag;};V.getPageY=function(dom){console.log(dom.offsetTop);return dom.offsetTop+(dom.offsetParent?this.getPageY(dom.offsetParent):0);};V.getPageX=function(dom){return dom.offsetLeft+(dom.offsetParent?this.getPageX(dom.offsetParent):0);};V.isTooLight=function(hexcolor){if(hexcolor[0]==="#"){hexcolor=hexcolor.slice(1);}
var r=parseInt(hexcolor.substr(0,2),16);var g=parseInt(hexcolor.substr(2,2),16);var b=parseInt(hexcolor.substr(4,2),16);var yiq=((r*299)+(g*587)+(b*114))/1000;return yiq>=128;};V.hexColor=function(color){var t=document.createElement('div');t.style.display='none';t.style.color=color;document.body.appendChild(t);var style=window.getComputedStyle(t,null);var colorValue=style.getPropertyCSSValue('color').getRGBColorValue();document.body.removeChild(t);var hex=function(x){return('0'+parseInt(x,10).toString(16)).slice(-2);};var hexString='#'+hex(colorValue.red.cssText)+hex(colorValue.green.cssText)+hex(colorValue.blue.cssText);return hexString;};V.lightenColor=function(col,amt){col=V.hexColor(col);if(col[0]==="#"){col=col.slice(1);}
var num=parseInt(col,16);var r=(num>>16)+amt;r=Math.min(255,Math.max(0,r));var b=((num>>8)&0x00FF)+amt;b=Math.min(255,Math.max(0,b));var g=(num&0x0000FF)+amt;g=Math.min(255,Math.max(0,g));return"#"+(g|(b<<8)|(r<<16)).toString(16);};V.guid=function(){var S4=function(){return(((1+Math.random())*0x10000)|0).toString(16).substring(1);};return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());};V.clamp=function(min,max,value){return Math.min(max,Math.max(min,value));}
V.snapTo=function(rounding,value){var remainder=value%rounding;return(remainder<(rounding/2))?value-remainder:value+(rounding-remainder);}
V.jsonSerialize=function(o){if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};Viz=V;}());﻿
var customizedColors;var customizedFonts;var myPicker;var template="temp1";var saveStatus=[];var isSaved=true;var noticeStrFinal="";var vizData={};var currentUsername="";var backgroundImage="";var swatches={"CMYK":["#fef200","#fff","#000","#ed008c","#00adef","#BBCB5F","#fef200"],"Lola":["#007EFF","#FFFFFF","#313843","#DD0083","#313843","#C1B79F","#F9E5E4"],"Symphony":["#fff","#CFBE27","#3B2D38","#CFBE27","#F27435","#F02475","#BCBDAC"],"Grasshopper":["#ffffff","#ffffff","#B0C087","#FAAF40","#775961","#559FC7","#000"],"Tango":["#009989","#CE1836","#F9F3DB","#009989","#A3A948","#EDB92E","#F9F3DB"],"Honeybear":["#665C49","#FFC7C7","#A69785","#FFC7C7","#665C49","#A69785","#B8FAFF"],};try{Typekit.load();}catch(e){}
function bindTips(){drawTip("#editProfile","Edit your profile","top center","bottom center",'mouseenter','mouseleave unfocus click','ui-dark',false,false,'#tip_profile',true);drawTip("#theme-btn","Change your theme","top center","bottom center",'mouseenter','mouseleave unfocus click','ui-dark',false,false,'#tip_themes',true);drawTip("#cust-btn","Personalize your infographic","top center","bottom center",'mouseenter','mouseleave unfocus click','ui-dark',false,false,'#tip_background, #tip_fonts, #tip_colors',true);drawTip(".nav-share","Share your viz when you are happy with it!","top center","bottom center",'mouseenter','mouseleave unfocus click','ui-dark',false,false,'#tip_share',true);$('#tip_profile').click(function(e){$('#editProfile').qtip('hide');$('#profile-btn').trigger('click');$('#editProfile').addClass('active');$("#dialog_profile").dialog("open");});$('#tip_themes').click(function(e){$('#theme-btn').qtip('hide');$('#theme-btn').trigger('click');});$('#tip_colors, #tip_fonts, #tip_background').click(function(e){$('#bg-btn').qtip('hide');$('#cust-btn').trigger('click');});$('#tip_share').click(function(e){$('.nav-share').qtip('hide');$('.nav-share').trigger('click');});}
$(document).ready(function(){bindTips();if($.getUrlVar()==="linkedin_user_exists"){$.jnotify("The LinkedIn user you tried to import from already exists in the system. Please try a different LinkedIn account.","warning",true);};if($.getUrlVar()==="linkedin_permission"){$.jnotify("LinkedIn integration failed. Please try again.","warning",true);};$("#Photo_Gallery").dialog({autoOpen:false,modal:true,minWidth:600,minHeight:470,maxWidth:600,maxHeight:470,draggable:false});$("#Display_Links").dialog({autoOpen:false,modal:true,minWidth:600,minHeight:470,maxWidth:600,maxHeight:470,draggable:false});$("#customize-bar input:not([type='file'], .ui-widget)").change(function(){isSaved=false;$("#customize-save").css('background','#EA088C');drawSaveTip($("a#save_btn"),"Would you like to save your changes?","top center","bottom center");});$(".tab-content").hide();$("#cust-profile").show();var closeCustomize=function(){$('#customize-bar').hide("slide",{direction:"left"},1000);$('#customize-save').hide("slide",{direction:"left"},1000);$('#wrapper').animate({"left":"0px"},1000,function(){$('#customize-bar-out').show("slide",{direction:"left"},250);});};var openCustomize=function(){$('#customize-bar-out').hide("slide",{direction:"left"},250);$('#customize-bar').show("slide",{direction:"left"},1000);$('#customize-save').show("slide",{direction:"left"},1000);$('#wrapper').animate({"left":"318px"},1000);};$("#handlebar").click(closeCustomize);($("#customize-bar-out")||$("#handlebar-out")).click(openCustomize);if(isOwnViz){$('#customize-bar-out').show();setTimeout(openCustomize,1500);}
$("ul.tabs li").click(function(){$("a","ul.tabs li").removeClass("active");$("a",this).addClass("active");$(".tab-content").hide();var activeTab=$(this).find("a").attr("href");$(activeTab).fadeIn();if(!isSaved){drawSaveTip($("a#save_btn"),"Don't forget to apply your changes!","top center","bottom center");}
return false;});$("a#prevPage").hide();drawTooltip($('#nextpage'),"more themes to choose from");$('#prevPage').click(function(e){e.preventDefault();var current=$(this).parent().next().children(".current");if(current.prev().length!=0){$("a#nextPage").show();current.removeClass("current");current.hide();current.prev().addClass("current");current.prev().show();if(current.prev().prev().length==0){$("a#prevPage").hide();}}else{$("a#prevPage").hide();}});$('#nextPage').click(function(e){e.preventDefault();var current=$(this).parent().prev().children(".current");if(current.next().length!=0){$("a#prevPage").show();current.removeClass("current");current.hide();current.next().addClass("current");current.next().show();if(current.next().next().length==0){$("a#nextPage").hide();}}else{$("a#nextPage").hide();}});$('#want_portfolio').click(function(e){e.preventDefault();track('portfolio','name');$('#want_portfolio_msg').html("<p class='small'>Thanks for your interest, we'll let you soon know when this feature is available.</p>");$(this).removeClass('pink');$(this).addClass('grey');$(this).html("Coming Soon");});$('#want_print').click(function(e){e.preventDefault();track('print','name');$('#want_print_msg').html("<p class='small'>Thanks for your interest, we'll let you know when this feature is available.</p>");$(this).removeClass('pink');$(this).addClass('grey');$(this).html("Coming Soon");});$('#cbxTiled').click(function(){$('#wrapper').css('background-repeat',this.checked?'repeat':'no-repeat');});$('#removeImage').click(function(){removeBackground();});$('#uploadImage').ajaxForm({dataType:'json',success:function(responseJson){if(responseJson&&responseJson.status==="Success"&&responseJson.path){var currentDate=new Date();backgroundImage=responseJson.path;changeBackground(responseJson.path+"?d="+currentDate.getTime(),$("#cbxTiled").is(':checked'));$("#customize-save").css('background','#EA088C');drawSaveTip($("a#save_btn"),"Would you like to save your changes?","top center","bottom center");isSaved=false;}}});$('#color_bg').change(function(){var selectedColor=$(this).val();$('#wrapper').css('background-color',"#"+selectedColor);});if(vizOptions.options.background){var path;var color;var tiled=false;if(vizOptions.options.background.path){path=vizOptions.options.background.path;backgroundImage=path;}
if(vizOptions.options.background.color){var element=document.getElementById('color_bg');color=vizOptions.options.background.color;$('#wrapper').css('background-color',color);if(element){var myPicker=new jscolor.color(document.getElementById('color_bg'),{});myPicker.fromString(color);}}
tiled=vizOptions.options.background.isTiled;$('#cbxTiled').prop("checked",tiled);if(path){changeBackground(path,tiled);}}
else{$('#cbxTiled').attr('checked',true);}
$("a[href*=http]").each(function(){if(this.href.indexOf(location.hostname)===-1){$(this).click(function(){window.open(this.href);return false;});}});if(vizOptions&&vizOptions.options&&vizOptions.options.template){template=vizOptions.options.template.toString();}
$(".closeBtn").click(function(){if($(this).hasClass("sharing")){$("#sharing").fadeOut(500);}else if($(this).hasClass("customize")){$("#customize").fadeOut(500);}else{$("#premium").fadeOut(500);}});{if(vizOptions&&vizOptions.options&&vizOptions.options.sections){customizedSections=vizOptions.options.sections;}else{customizedSections={"skills":true,"recommendations":true,"languages":true,"interests":true,"myStats":true,"awards":true};}
var skills=$("#section-skills");skills.prop("checked",customizedSections.skills);skills.click(function(){var isSkillsEnabled=$("#section-skills").prop("checked");customizedSections.skills=isSkillsEnabled;generateViz();});var skills=$("#section-interests");skills.prop("checked",customizedSections.interests);skills.click(function(){var isInterestEnabled=$("#section-interests").prop("checked");customizedSections.interests=isInterestEnabled;generateViz();});var rec=$("#section-recommendation");rec.prop("checked",customizedSections.recommendations);rec.click(function(){var isRecEnabled=$("#section-recommendation").prop("checked");customizedSections.recommendations=isRecEnabled;generateViz();});var lang=$("#section-languages");lang.prop("checked",customizedSections.languages);lang.click(function(){var isLanguageEnabled=$("#section-languages").prop("checked");customizedSections.languages=isLanguageEnabled;generateViz();});var stat=$("#section-mystats");stat.prop("checked",customizedSections.myStats);stat.click(function(){customizedSections.myStats=$("#section-mystats").prop("checked");generateViz();});var award=$("#section-awards");award.prop("checked",customizedSections.awards);award.click(function(){customizedSections.awards=$("#section-awards").prop("checked");generateViz();});}
$.each(swatches,function(swatchName,swatchColors){$('#color-theme-container').append('<span class="color-theme-item" title="'+swatchName+'"><table class="swatch-table"><tr><td><p>'+swatchName+'</p></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table></span>');var $swatchArea=$('#color-theme-container span').last();$swatchArea.find('td').each(function(i,elm){$(this).css("background-color",swatchColors[i]);});$('#color-theme-picker').append('<option class="color-theme-option" value="'+swatchName+'"><span>'+swatchName+'</span></option>');});$('.color-theme-item').click(function(){customizedColors=swatches[$(this).attr("title")];updateColorSelection(customizedColors);generateViz();});$('#color-theme-picker').change(function(){customizedColors=swatches[$(this).val()];updateColorSelection(customizedColors);generateViz();});if(vizOptions&&vizOptions.options&&vizOptions.options.colours){customizedColors=vizOptions.options.colours;}else{customizedColors=executeFunctionByName(template+".getDefaultColors",window);}
$('.color').change(function(){var selectedColor=$(this).val();if(selectedColor){var colorIndex=parseInt(this.id.charAt(this.id.length-1),10);if(customizedColors){customizedColors[colorIndex]="#"+selectedColor;generateViz();setUserContactInfo();}}});$('.page li, .swatch-table').mouseenter(function(e){$(this).find('p').fadeIn(200);});$('.page li, .swatch-table').mouseleave(function(e){$(this).find('p').fadeOut(200);});if(vizOptions&&vizOptions.options&&vizOptions.options.fonts){customizedFonts=vizOptions.options.fonts;}else{customizedFonts=executeFunctionByName(template+".getDefaultFonts",window);}
var onFontDrawerClick=function(e){e.preventDefault();var current=$(this).parent().next();current.find("ul").slideToggle();current.siblings("dd").each(function(){$(this).find("ul").hide();if($(this).prev().find("a").hasClass('selectorup')){$(this).prev().find("a").removeClass('selectorup');$(this).prev().find("a").addClass('selectordown');}});$(this).toggleClass('selectorup');$(this).toggleClass('selectordown');};$(".dropdown dt a").click(onFontDrawerClick);$(".fontSelection").click(onFontDrawerClick);updateFontSelection(customizedFonts);$("ul.fontselector li").click(function(e){e.preventDefault();if($(this).parent("#ulname").length){customizedFonts[0]=$(this).find("a").attr("value");}else if($(this).parent("#ultitles").length){customizedFonts[1]=$(this).find("a").attr("value");}else if($(this).parent("#ullabels").length){customizedFonts[2]=$(this).find("a").attr("value");}
updateFontSelection(customizedFonts);$(this).parent().slideToggle();$("#customize-save").css('background','#EA088C');drawSaveTip($("a#save_btn"),"Would you like to save your changes?","top center","bottom center");isSaved=false;generateViz();$("#linkMe").css("font-family",customizedFonts[1]);});if(isSignedIn&&isOwnViz){var noticeStr="";if(vizDataRaw.counts&&vizDataRaw.counts.months_total_work<=0){noticeStr+="<a class=\"linkedinExt\" href=\"http://www.linkedin.com/profile/edit-skills\" target=\"_blank\">Work Experience</a> ";}
if(vizDataRaw.counts&&vizDataRaw.counts.months_total_education<=0){noticeStr+="<a class=\"linkedinExt\" href=\"http://www.linkedin.com/profile/edit-education\" target=\"_blank\">Work Experience</a> ";}
if(vizDataRaw.skills&&vizDataRaw.skills.length===0){noticeStr+="<a class=\"linkedinExt\" href=\"http://www.linkedin.com/profile/edit-skills\" target=\"_blank\">Skills</a> ";}}
if(vizOptions){if(!vizOptions.has_email&&isSignedIn&&isOwnViz){showEmail();}
if(!vizOptions.isActivated){var emailStr=vizOptions.firstName+", please check your email to activate your account. <a href=\"#\">Resend email</a>";}
setDialogs();setUsernameLogic();setEmailLogic();generateViz();setUserContactInfo();}
setDefaultSettings();});function initWizard(){drawWizardTip($("#handlebar"),"Customize your viz here. You can minimize this tab when you are done.","left center","right center","");drawWizardTip($(".nav-share"),"Share your viz when you are happy with it!","top center","bottom center","");drawWizardTip($("#custom-save"),"Don't forget to save your changes.","bottom center","top center","");};function showEmail(isInstant){if(!isInstant){$('#modal-glass').fadeIn();$('#modal-box').fadeIn();}else{$('#modal-glass').fadeIn();$('#modal-box').fadeIn();}}
function hideModal(newUsername){$("#modal-glass, #modal-box").hide('slow',function(){if(!$.browser.mozilla||($.browser.mozilla&&$.browser.version>="2.0.1")){location.pathname="/myviz";}else{}});$("#profile_email, #profile_username").qtip('hide');}
function changeBackground(backgroundurl,isTiled){$('#wrapper').css('background-image',"url("+backgroundurl+")");if(isTiled){$('#wrapper').css('background-repeat','repeat');}
else
{$('#wrapper').css('background-repeat','no-repeat');}}
function generateViz(){$('#infographic').empty();if(vizDataRaw.user_info&&(vizDataRaw.user_info.first_name+vizDataRaw.user_info.last_name).length>0){$('#blankViz').hide();executeFunctionByName(template+".generate",window);}else{$('#blankViz').show();}
$('#vizlinks').hide();setUserContactInfo();}
function templateChange(name){$("#customize-save").css('background','#EA088C');drawSaveTip($("a#save_btn"),"Would you like to save your changes?","top center","bottom center");isSaved=false;template=name;customizedFonts=null;generateViz();setDefaultSettings();}
function saveSVG(status){var data=$("#infographic").html();data=data.replace(" xlink="," xmlns:xlink=");if(data.indexOf("xmlns:xlink=\"http://www.w3.org/1999/xlink\"")===-1){data=data.replace("<svg ","<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");}
match=data.match(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g);if(match.length>1){data=data.replace("xmlns=\"http://www.w3.org/2000/svg\"","");}
data=data.replace(" href"," xlink:href");data=data.replace("<desc>Created with Rapha\u00ebl</desc>","");$.ajax({type:'PUT',url:'/user/svg',data:formatXml(data),success:function(resp){saveStatus.push(resp.status==="Success");}});}
function saveAll(){$("#customize-save").css('background','#333');var isTiled=$("#cbxTiled").is(':checked');var isSkillsEnabled=$("#section-skills").prop("checked");var json={"template":template,"colours":customizedColors,"fonts":customizedFonts,"sections":customizedSections,"background":{"path":backgroundImage,"isTiled":isTiled,"color":"#"+$('#color_bg').val()}};$.ajax({type:'PUT',url:'/user/option',data:jsonSerialize(json),beforeSend:showLoadingImage,success:function(resp){saveStatus.push(resp.status==="Success");displaySaveStatus();isSaved=true;},error:function(jqXHR,textStatus,errorThrown){$.jnotify("Sorry there was an error while saving your changes. "+textStatus,"error",1000);hideLoadingImage();}}).success(hideLoadingImage);}
function showLoadingImage(){$('#save-buttons').hide();$('#customize-save').append('<div id="loading-image" style="text-align:center;"><img src="/media/img/ajax-loader.gif" alt="Loading..." /></div>');}
function hideLoadingImage(){$('#save-buttons').show();$('#loading-image').remove();}
function removeBackground(){if(backgroundImage){changeBackground("",false);backgroundImage=null;}}
function setDefaultSettings(){updateColorSelection(customizedColors);updateFontSelection(customizedFonts);}
function updateColorSelection(colors){if(colors){for(var i=0;i<colors.length;i++){var element=document.getElementById("color_"+i);if(element==null)
continue;myPicker=new jscolor.color(element,{})
myPicker.fromString(colors[i]);}}}
function updateFontSelection(fonts){if(fonts){var name=$('#ulname li a[value="'+customizedFonts[0]+'"]');var title=$('#ultitles li a[value="'+customizedFonts[1]+'"]');var label=$('#ullabels li a[value="'+customizedFonts[2]+'"]');name.parent().siblings().removeClass("currentfont");title.parent().siblings().removeClass("currentfont");label.parent().siblings().removeClass("currentfont");name.parent().addClass("currentfont");title.parent().addClass("currentfont");label.parent().addClass("currentfont");$("#namePlaceholder").html(name.parent().clone(false).html());$("#titlePlaceholder").html(title.parent().clone(false).html());$("#labelPlaceholder").html(label.parent().clone(false).html());}}
function saveCustomization(){saveAll();}
function displaySaveStatus(){if(saveStatus&&saveStatus.length==1){if(saveStatus[0]){$("#save-msg").fadeIn().fadeOut(2000);$.jnotify("Your changes have been successfully saved.","success",3000);}
else{$.jnotify("Sorry an error occurred while making your changes.","error",3000);}
saveStatus=[];}}
function setUserContactInfo(){$("#linkMe").css("font-family",customizedFonts[1]);$("#linkMe").css("font-size",35);$("#linkMe").css("color",customizedColors[1]);$("#vizlinks").css("background-color",customizedColors[2]);$("#vizlinks").css("font-family",customizedFonts[1]);$("a.footer-link").css("color",customizedColors[1]);$("a.footer-link").css("font-family",customizedFonts[1]);$("#vizlinks").css("background-color",customizedColors[2]);setMyLinks();}
function getUrlItem(typeId){if(vizDataRaw.urls&&vizDataRaw.urls.length>0){for(var i=0;i<vizDataRaw.urls.length;i++){if(vizDataRaw.urls[i].type_id==typeId){return vizDataRaw.urls[i];}}}
return null;}
function getUserData(){$.ajax({type:'GET',url:'/user/data',success:function(resp){vizDataRaw=resp;}});}
function setMyLinks(){$("#divSocialLinks").html("");$("#divOtherLinks").html("");$("#divPersonalLinks").html("");if(vizDataRaw.urls&&vizDataRaw.urls.length>0){var urls=clone(vizDataRaw.urls);var image;for(var i=0;i<urls.length;i++){image="";var url=urls[i].url;if(url&&url.length>3&&url.substring(0,4)!="http"){url="http://"+url;}
switch(urls[i].type_id){case 7:image="linkedin.png";break;case 6:image="twitter.png";break;case 5:image="facebook.png";break;case 4:image="rss.png";break;case 3:image="blog.png";break;case 5:image="facebook.png";break;case 1:image="personal.png";break;case 2:image="company.png";break;case 0:if($("#divOtherLinks").html().length>0)
$("#divOtherLinks").append(" || ");var item='<a target="_blank" class="footer-link" href="'+url+'" style="font-family:'+customizedFonts[2]+'; color:'+customizedColors[0]+'">'+urls[i].name+'</a>';$("#divOtherLinks").append(item);break;default:break;}
if(image&&image.length>0){var item='<a target="_blank" href="'+url+'"><img class="linkimg" alt="'+urls[i].name+'" title="'+urls[i].name+'"src="/media/img/socialicons/'+image+'"/></a>';if(urls[i].type_id==1||urls[i].type_id==2)
$("#divPersonalLinks").append(item);else
$("#divSocialLinks").append(item);}}
$('#vizlinks').show();}}
function sortLinks(a,b){return a.type_id-b.type_id;}
function customize(){$("#custom").show();$(custom).fadeTo("slow",1)
$("#custom").css({top:50});$("#custom").css({left:500});$(sharing).fadeTo("slow",0,closeSharePanel())}
function closeCustomPanel(){$("#custom").hide();}
function share(){$("#sharing").show();$(sharing).fadeTo("slow",1)
$("#sharing").css({top:50});$("#sharing").css({left:500});$(custom).fadeTo("slow",0,closeCustomPanel())}
$(function dragDrop(){$(".toolpanel").draggable({containment:"#wrapper",scroll:true});$(".toolpanel").draggable({handle:'#toolnav'});});function switchTemplates(){$("#customarrow").css({left:120});$('#colors').hide();$('#fonts').hide();$('#fonts').hide();$('#templates').show();}
function switchColors(){$("#customarrow").css({left:180});$('#templates').hide();$('#fonts').hide();$('#colors').show();}
function switchFonts(){$("#customarrow").css({left:230});$('#templates').hide();$('#colors').hide();$('#fonts').show();}
function displayNotice(notice,type){$.jnotify(notice,type,true);}
function closeGallery(){$("#Photo_Gallery").hide();}
var phrase={'username':"Username",'email':"Email"};function validateProfile(form){var is_valid=true;if(form.email.value===""){drawTip($(form.email),"<span class='tip-small'>Please enter an email.</span>","center left","center right",false,'focusin','ui-dark',true,true);is_valid=false;}
if(form.username.value===""){drawTip($(form.username),"<span class='tip-small'>Please enter a username.</span>","center left","center right",false,'focusin','ui-dark',true,true);is_valid=false;}
if(is_valid){if(!Viz.cache.get("profile")){Viz.cache.put("profile",true,5);ajaxEmail(form);}}
return false;}
function ajaxEmail(form){$.ajax({type:'PUT',url:'/user/email',data:form.email.value,success:function(resp){if(!resp){return;}
if(resp.code===200){ajaxUsername(form);}else{if(window.hasOwnProperty("console")){console.log("Email error: "+resp.message);}
$.jnotify("Something went wrong with saving your email :( "+resp.message,"error",3000);}},error:function(jqXHR,textStatus,errorThrown){if(window.hasOwnProperty("console")){console.log(jqXHR);}
$.jnotify("Something went wrong with saving your email :( Server Error","error",3000);}});return false;};function ajaxUsername(form){$.ajax({type:'PUT',url:'/user/username',data:form.username.value,success:function(resp){if(!resp){return;}
if(resp.code===200){hideModal(form.username.value);}else{if(window.hasOwnProperty("console")){console.log("Username error: "+resp.message);}
$.jnotify("Something went wrong with saving your email :( "+resp.message,"error",3000);}},error:function(jqXHR,textStatus,errorThrown){if(window.hasOwnProperty("console")){console.log(jqXHR);}
$.jnotify("Something went wrong with saving your email :( Server Error","error",3000);}});return false;};function setUsernameLogic(){var element=$('#profile_username');var url=function(value){return'/ajax/username?username='+escape(value);};var success=function(resp,value){var style=(resp&&resp.code===200)?"color:Green":"color:Red";var available=(resp&&resp.code===200)?"available.":"not available.";drawTip("#profile_username","<span class='tip-small'>http://vizualize.me/<span class='italics'>"+value+"</span> is <span style='"+style+"'>"+available+"</span></span>","center left","center right",'focusin',false,'ui-dark',true,false);};attachKeyUpAjax(element,url,success);}
function setEmailLogic(){var element=$('#profile_email');var url=function(value){return'/ajax/email?email='+escape(value);};var success=function(resp,value){var style=(resp&&resp.code===200)?"color:Green":"color:Red";var used=(resp&&resp.code===200)?"free to use.":"taken or invalid.";drawTip("#profile_email","<span class='tip-small'><span class='italics'>"+value+"</span> is <span style='"+style+"'>"+used+"</span></span>","center left","center right",'focusin',false,'ui-dark',true,false);};attachKeyUpAjax(element,url,success);}﻿
var globalListTextSize=40;var dialogs={}
$(document).ready(function(){$("#ul-Recommendations").sortable();$("#ul-Recommendations").disableSelection();$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();setDialogs();if(!vizDataRaw.user_info.first_name||!vizDataRaw.user_info.last_name||!vizDataRaw.user_info.title){$("#edit-content-nav > li:not(#editProfile)").css("color","#bbb");}else{$("#editProfile").qtip('hide');bindAllDialogs();};$('#uCategory').change(function(){var category=$('select#uCategory option:selected').val();if(category&&category==0){$("#divName").show('slow');}
else{$("#divName").hide();}});$('#mCategory').change(function(){var category=$('select#mCategory option:selected').val();if(category&&category.length>0){if(category==0){$("#divLabel").show();$("#divStat").show();$("#divUnit").show();}
else if(category==1){$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();}
else{$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();}}
else{$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();}});var isCurrent=$("input#wIsCurrent");isCurrent.click(function(){var isCurrentChecked=$("input#wIsCurrent").prop("checked");if(isCurrentChecked){removeWorkEndDate();}
else{addWorkEndDate();}});bindLists();setUserNameLogic();hideCreateForm();setAddNewItems();setCancelActions();setValidations();for(var i=new Date().getFullYear();i>=1950;i--){$('#wStartYear').append($('<option />').val(i).html(i));$('#wEndYear').append($('<option />').val(i).html(i));$('#eStartYear').append($('<option />').val(i).html(i));$('#mYear').append($('<option />').val(i).html(i));}
var endYear=new Date().getFullYear()+10;for(var i=endYear;i>=1950;i--){$('#eEndYear').append($('<option />').val(i).html(i));}});function setAddNewItems(){$("a#addNewWork").click(function(){$('div#newWork').show('slow');resetWork();setAddNewButton("#wSave");});$("a#addNewEdu").click(function(){$('div#newEdu').show('slow');resetEducation();setAddNewButton("#eSave");});$("a#addNewSkill").click(function(){$('div#newSkill').show('slow');resetSkills();setAddNewButton("#sSave");});$("a#addNewLanguage").click(function(){$('div#newLanguage').show('slow');resetLanguage();setAddNewButton("#lSave");});$("a#addNewInterest").click(function(){$('div#newInterest').show('slow');resetInterest();setAddNewButton("#iSave");});$("a#addNewLink").click(function(){$('div#newLink').show('slow');resetLink();setAddNewButton("#uSave");});$("a#addNewStat").click(function(){$('div#newStat').show('slow');resetStat();setAddNewButton("#mSave");$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();});$("a#addNewAward").click(function(){$('div#newAward').show('slow');resetAward();setAddNewButton("#aSave");});}
function setAddNewButton(id){$(id).attr('value',"");$(id+" > span").text("Add");$(id).removeClass("edit-save");$(id).addClass("edit-add");}
function setCancelActions(){$("a#wCancel").click(function(){$('div#newWork').hide();resetWork();});$("a#eCancel").click(function(){$('div#newEdu').hide();resetEducation();});$("a#sCancel").click(function(){$('div#newSkill').hide();resetSkills();});$("a#lCancel").click(function(){$('div#newLanguage').hide();resetLanguage();});$("a#iCancel").click(function(){$('div#newInterest').hide();resetInterest();});$("a#pCancel").click(function(){bindProfile();$('#dialog_profile').dialog('close');});$("a#uCancel").click(function(){$('div#newLink').hide();resetLink();});$("a#aCancel").click(function(){resetAward();});$("a#rCancel").click(function(){bindRecommendations();$('#dialog_Recommendations').dialog('close');});$("a#mCancel").click(function(){$('div#newStat').hide();resetStat();});$("a#aCancel").click(function(){$('div#newAward').hide();resetAward();});}
function setValidations(){$.validator.addMethod("dateRange",function(){var sMonth=$('select#wStartMonth option:selected').val();var sYear=$('select#wStartYear option:selected').val();var eMonth=$('select#wEndMonth option:selected').val();var eYear=$('select#wEndYear option:selected').val();var sDate=new Date(eYear,eMonth-1,1);var eDate=new Date(sYear,sMonth-1,1);return(sDate>eDate);},"Start Date cannot be greater than the End Date.");$.validator.addMethod("dateRangeEdu",function(){var sMonth=$('select#eStartMonth option:selected').val();var sYear=$('select#eStartYear option:selected').val();var eMonth=$('select#eEndMonth option:selected').val();var eYear=$('select#eEndYear option:selected').val();var sDate=new Date(eYear,eMonth-1,1);var eDate=new Date(sYear,sMonth-1,1);return(sDate>eDate);},"Start Date cannot be greater than the End Date.");$.validator.addMethod("requiredUrlName",function(){var category=$('select#uCategory option:selected').val();if(category&&category==0){var name=$("input#uName").val();if(name&&name.length>0)
return true;else
return false;}
return true;},"The field is required.");$.validator.addMethod("requiredStatLabel",function(){var category=$('select#mCategory option:selected').val();if(category&&category==0){var name=$("input#mLabel").val();if(name&&name.length>0)
return true;else
return false;}
return true;},"The field is required.");$.validator.addMethod("requiredStat",function(){var category=$('select#mCategory option:selected').val();if(category&&(category==0)){var stat=$("input#mStat").val();if(stat&&stat.length>0)
return true;else
return false;}
return true;},"The field is required.");$("#workForm").validate();$("#educationForm").validate();$("#skillsForm").validate();$("#languagesForm").validate();$("#interestsForm").validate();$("#profileForm").validate();$("#linksForm").validate();$("#awardsForm").validate();$("#statsForm").validate();}
function hideCreateForm(){hideNewWork();hideNewEdu();hideNewSkill();hideNewLanguage();hideNewLink();hideNewInterest();hideNewStat();hideNewAward();}
function bindLists(){bindEducation();bindPositions();bindSkills();bindLanguages();bindInterests();bindProfile();bindLinks();bindAwards();bindRecommendations();bindStats();}
function showDialog(elementName){var mWidth;elementName=="dialog_Portfolio"?mWidth=640:mWidth=420;$("#"+elementName).dialog({autoOpen:false,modal:true,minWidth:mWidth,draggable:true});}
function hideNewWork(){$('div#newWork').hide();}
function hideNewEdu(){$('div#newEdu').hide();}
function hideNewSkill(){$('div#newSkill').hide();}
function hideNewLanguage(){$('div#newLanguage').hide();}
function hideNewLink(){$('div#newLink').hide();}
function hideNewInterest(){$('div#newInterest').hide();}
function hideNewStat(){$('div#newStat').hide();}
function hideNewAward(){$('div#newAward').hide();}
function bindRecommendations(){$("ul#ul-Recommendations").empty();if(vizDataRaw.recommendations&&vizDataRaw.recommendations.length>0){$.each(vizDataRaw.recommendations,function(i,rec){var displayText=rec.content.recommendationText;$("ul#ul-Recommendations").append('<li id='+rec.id+' class=""><span class="ui-icon ui-icon-arrowthick-2-n-s"></span><span>'+trucateText(displayText,globalListTextSize)+'</span></li>');});}}
function saveRecommendations(){var sortedRec=[];$.each($("ul#ul-Recommendations li"),function(i,rec){var id=$(rec).attr('id');var itemIndex=findItemInArray(vizDataRaw.recommendations,id);if(itemIndex>=0){sortedRec.push(vizDataRaw.recommendations[itemIndex]);}});if(sortedRec&&sortedRec.length>0){vizDataRaw.recommendations=sortedRec;saveChanges([generateViz,bindRecommendations],"#recSubmit");}}
function bindAwards(){$("ul#ul-Awards").empty();if(vizDataRaw.awards){$.each(vizDataRaw.awards,function(i,award){var displayText=award.name;$("ul#ul-Awards").append('<li><span>'+trucateText(displayText,globalListTextSize)+'</span><a href="#" id='+award.id+' class=\'edit-delete\' onclick=deleteAward('+award.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadAward('+award.id+')><span>Edit</span></a></li>');});}}
function addEditAward(){if($("#awardsForm").valid()){var id=$("#aSave").attr('value');if(id){editAward(id);}
else
addAward();}}
function addAward(){var awardJson=getAward();if(awardJson){vizDataRaw.awards.push(awardJson);saveChanges([resetAward,generateViz,bindAwards,hideNewAward],"#awardSubmit");}}
function editAward(id){if(id){var itemIndex=findItemInArray(vizDataRaw.awards,id);if(itemIndex>=0){var awardToChange=vizDataRaw.awards[itemIndex];var changedAward=getAward();awardToChange.name=changedAward.name;awardToChange.weight=changedAward.weight;if(changedAward.awarded_date)
awardToChange.awarded_date=changedAward.awarded_date;awardToChange.is_bound=false;saveChanges([resetAward,generateViz,bindAwards,hideNewAward],"#awardSubmit");}}}
function deleteAward(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.awards,id);if(itemIndex>=0){vizDataRaw.awards.splice(itemIndex,1);saveChanges([generateViz,bindAwards]);}}}}
function getAward(){var awardJson={};var name=$("input#aName").val();awardJson.name=name;awardJson.weight=$("select#mWeight").val();var year=$("select#mYear").val();if(year&&year.length>0){awardJson.awarded_date=getUnixTimeStamp(year,1);}
awardJson.is_bound=false;return awardJson;}
function loadAward(id){$('div#newAward').show('slow');var validator=$("#awardsForm").validate();validator.resetForm();$("#aSave").removeClass("edit-add");$("#aSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.awards,id);if(itemIndex>=0){var awardItem=vizDataRaw.awards[itemIndex];$("input#aName").val(awardItem.name);$("#aSave > span").text("Save");$("select#mWeight").val(awardItem.weight);var awardYear="";if(awardItem.awarded_date){awardYear=getDateFromString(awardItem.awarded_date).getFullYear();}
$("select#mYear").val(awardYear);$("#aSave").attr('value',id);}}}
function resetAward(){var validator=$("#awardsForm").validate();validator.resetForm();$("input#aName").val("");$("select#mWeight").val("");$("select#mYear").val("");$("#aSave").attr('value',"");}
function bindLinks(){$("ul#ul-Links").empty();if(vizDataRaw.urls&&vizDataRaw.urls.length>0){$.each(vizDataRaw.urls,function(i,url){var displayText=url.name+" : "+url.url;$("ul#ul-Links").append('<li><span>'+trucateText(displayText,globalListTextSize)+'</span><a href="#" id='+url.id+' class=\'edit-delete\' onclick=deleteLink('+url.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadLink('+url.id+')><span>Edit</span></a></li>');});$('#vizlinks').show();}}
function addEditLink(){if($("#linksForm").valid()){var id=$("#uSave").attr('value');if(id){editLink(id);}
else
addLink();}}
function addLink(){var linkJson=getLink();if(linkJson){vizDataRaw.urls.push(linkJson);saveChanges([resetLink,setMyLinks,bindLinks,hideNewLink],"#linkSubmit");}}
function editLink(id){if(id){var itemIndex=findItemInArray(vizDataRaw.urls,id);if(itemIndex>=0){var linkToChange=vizDataRaw.urls[itemIndex];var changedLink=getLink();linkToChange.name=changedLink.name;linkToChange.url=changedLink.url;linkToChange.type_id=changedLink.type_id;linkToChange.is_bound=false;saveChanges([resetLink,setMyLinks,bindLinks,hideNewLink],"#linkSubmit");}}}
function deleteLink(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.urls,id);if(itemIndex>=0){vizDataRaw.urls.splice(itemIndex,1);saveChanges([setMyLinks,bindLinks]);}}}}
function getLink(){var linkJson={};var name=$("input#uName").val();linkJson.url=$("input#uUrl").val();linkJson.type_id=$('select#uCategory option:selected').val();if(linkJson.type_id!=0)
linkJson.name=$('select#uCategory option:selected').text();else
linkJson.name=name;return linkJson;}
function loadLink(id){$('div#newLink').show('slow');var validator=$("#linksForm").validate();$("#uSave").removeClass("edit-add");$("#uSave").addClass("edit-save");validator.resetForm();if(id){var itemIndex=findItemInArray(vizDataRaw.urls,id);if(itemIndex>=0){var linkItem=vizDataRaw.urls[itemIndex];$("input#uUrl").val(linkItem.url);$("select#uCategory").val(linkItem.type_id);if(linkItem.type_id==0){$("div#divName").show();$("input#uName").val(linkItem.name);}
else
$("div#divName").hide();$("input#uUrl").val(linkItem.url);$("#uSave > span").text("Save");$("#uSave").attr('value',id);}}}
function resetLink(){var validator=$("#linksForm").validate();validator.resetForm();$("input#uName").val("");$("input#uUrl").val("");$('select#uCategory').val("");$("#uSave").attr('value',"");}
function bindProfile(){var profile=vizDataRaw.user_info;$("input#pTitle").val(profile.title);$("input#pfname").val(profile.first_name);$("input#plname").val(profile.last_name);if(profile.username){$('#urlName').val(profile.username);$('#urlNameText').html(profile.username);}
if(profile.location)
$("input#pLocation").val(profile.location);$("textarea#pSummary").val(profile.summary);}
function saveProfile(){if($("#profileForm").valid()){var profile=vizDataRaw.user_info;profile.title=$("input#pTitle").val();profile.first_name=$("input#pfname").val();profile.last_name=$("input#plname").val();profile.location=$("input#pLocation").val();profile.summary=$("textarea#pSummary").val();saveChanges([generateViz],"#profileSubmit");if($('#urlName').val()!=profile.username){saveUserName();};bindAllDialogs();}}
function saveUserName(){$.ajax({type:'PUT',url:'/user/username',data:$('#urlName').val(),success:function(resp){if(resp.status==="Success"){currentUsername=$('#urlName').val();location.pathname="/myviz";}
else{$.jnotify("Sorry there was an error while saving your customized url. "+resp.message,"error",1000);}},error:function(jqXHR,textStatus,errorThrown){$.jnotify("Sorry there was an error while saving your customized url. "+textStatus,"error",1000);}});}
function addEditWork(){if($("#workForm").valid()){var id=$("#wSave").attr('value');if(id){editWork(id);}
else
addWork();}}
function addWork(){var workJson=getWork();if(workJson){vizDataRaw.timeline_work.push(workJson);vizDataRaw.timeline_work.sort(compare);vizDataRaw.timeline_work.reverse();saveChanges([generateViz,resetWork,bindPositions,hideNewWork],"#workSubmit");}}
function editWork(id){if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_work,id);if(itemIndex>=0){var workToChange=vizDataRaw.timeline_work[itemIndex];var changedWork=getWork();workToChange.company=changedWork.company;workToChange.position=changedWork.position;workToChange.start_date=changedWork.start_date;workToChange.end_date=changedWork.end_date;workToChange.summary=changedWork.summary;workToChange.is_current=changedWork.is_current;workToChange.location=changedWork.location;workToChange.is_bound=false;saveChanges([generateViz,resetWork,bindPositions,hideNewWork],"#workSubmit");}}}
function deleteWork(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_work,id);if(itemIndex>=0){vizDataRaw.timeline_work.splice(itemIndex,1);saveChanges([generateViz,bindPositions]);}}}}
function getWork(){var workJson={};var title=$("input#wTitle").val();var company=$("input#wCompany").val();var location=$("input#wLocation").val();var sMonth=$('select#wStartMonth option:selected').val();var sYear=$('select#wStartYear option:selected').val();var eMonth=$('select#wEndMonth option:selected').val();var eYear=$('select#wEndYear option:selected').val();var summary=$("textarea#wSummary").val();workJson.company=company;workJson.position=title;workJson.start_date=getUnixTimeStamp(sYear,sMonth);if($("input#wIsCurrent").prop("checked")){workJson.end_date=null;workJson.is_current=true;}
else{var day=daysInMonth(eMonth-1,eYear);workJson.end_date=getUnixTimeStamp(eYear,eMonth,day);workJson.is_current=false;}
workJson.summary=summary;workJson.location=location;return workJson;}
function loadWork(id){$('div#newWork').show('slow');var validator=$("#workForm").validate();validator.resetForm();$("#wSave").removeClass("edit-add");$("#wSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_work,id);if(itemIndex>=0){var workItem=vizDataRaw.timeline_work[itemIndex];$("input#wTitle").val(workItem.position);$("input#wCompany").val(workItem.company);$("input#wLocation").val(workItem.location);$('select#wStartYear').val(getDateFromString(workItem.start_date).getFullYear());$('select#wStartMonth').val(getDateFromString(workItem.start_date).getMonth()+1);var isCurrent=$("#wIsCurrent");isCurrent.prop("checked",workItem.is_current);if(workItem.is_current){removeWorkEndDate();}
else{removeWorkEndDate();addWorkEndDate();$('select#wEndYear').val(getDateFromString(workItem.end_date).getFullYear());$('select#wEndMonth').val(getDateFromString(workItem.end_date).getMonth()+1);}
$("textarea#wSummary").val(workItem.summary);$("#wSave > span").text("Save");$("#wSave").attr("value",id);}}}
function resetWork(){var validator=$("#workForm").validate();validator.resetForm();$("input#wTitle").val("");$("input#wCompany").val("");$('select#wStartYear').val("");$('select#wStartMonth').val("");$('select#wEndYear').val("");$('select#wEndMonth').val("");$("input#wLocation").val("");$("textarea#wSummary").val("");$("#wSave").attr('value',"");var isCurrent=$("#wIsCurrent");isCurrent.prop("checked",false);removeWorkEndDate();addWorkEndDate();}
function bindPositions(){$("ul#ul-work").empty();if(vizDataRaw.timeline_work&&vizDataRaw.timeline_work.length>0){$.each(vizDataRaw.timeline_work,function(i,work){var displayText=work.position+" @ "+work.company;$("ul#ul-work").append('<li><span>'+trucateText(displayText,globalListTextSize)+'</span><a href="#" id='+work.id+' class=\'edit-delete\' onclick=deleteWork('+work.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadWork('+work.id+')><span>Edit</span></a></li>');});}}
function addWorkEndDate(){$("select#wEndMonth").addClass("required");$("select#wEndYear").addClass("required");$("select#wEndYear").addClass("dateRange");$("div#wDivEndMonth").show();$("div#wDivEndYear").show();}
function removeWorkEndDate(){$("select#wEndMonth").removeClass("required");$("select#wEndYear").removeClass("required");$("select#wEndYear").removeClass("dateRange");$("div#wDivEndMonth").hide();$("div#wDivEndYear").hide();}
function addEditEducation(){if($("#educationForm").valid()){var id=$("#eSave").attr('value');if(id){editEducation(id);}
else
addEducation();}}
function addEducation(){var eduJson=getEducation();if(eduJson){vizDataRaw.timeline_education.push(eduJson);vizDataRaw.timeline_education.sort(compare);vizDataRaw.timeline_education.reverse();saveChanges([resetEducation,generateViz,bindEducation,hideNewEdu],"#educationSubmit");}}
function editEducation(id){if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_education,id);if(itemIndex>=0){var eduToChange=vizDataRaw.timeline_education[itemIndex];var changedEdu=getEducation();eduToChange.degree=changedEdu.degree;eduToChange.discipline=changedEdu.discipline;eduToChange.school=changedEdu.school;eduToChange.start_date=changedEdu.start_date;eduToChange.end_date=changedEdu.end_date;eduToChange.activities=changedEdu.activities;eduToChange.is_current=changedEdu.is_current;eduToChange.location=changedEdu.location;eduToChange.is_bound=false;saveChanges([resetEducation,generateViz,bindEducation,hideNewEdu],"#educationSubmit");}}}
function deleteEducation(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_education,id);if(itemIndex>=0){vizDataRaw.timeline_education.splice(itemIndex,1);saveChanges([generateViz,bindEducation]);}}}}
function getEducation(){var eduJson={};var school=$("input#eSchool").val();var degree=$("input#eDegree").val();var program=$("input#eProgram").val();var location=$("input#eLocation").val();var sMonth=$('select#eStartMonth option:selected').val();var sYear=$('select#eStartYear option:selected').val();var eMonth=$('select#eEndMonth option:selected').val();var eYear=$('select#eEndYear option:selected').val();var activities=$("textarea#eSummary").val();eduJson.school=school;eduJson.degree=degree;eduJson.discipline=program;eduJson.start_date=getUnixTimeStamp(sYear,sMonth);var day=daysInMonth(eMonth-1,eYear);eduJson.end_date=getUnixTimeStamp(eYear,eMonth,day);eduJson.activities=activities;eduJson.location=location;eduJson.is_current=false;return eduJson;}
function loadEducation(id){$('div#newEdu').show('slow');var validator=$("#educationForm").validate();validator.resetForm();$("#eSave").removeClass("edit-add");$("#eSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.timeline_education,id);if(itemIndex>=0){var eduItem=vizDataRaw.timeline_education[itemIndex];$("input#eSchool").val(eduItem.school);$("input#eDegree").val(eduItem.degree);$("input#eProgram").val(eduItem.discipline);$("input#eLocation").val(eduItem.location);$('select#eStartYear').val(getDateFromString(eduItem.start_date).getFullYear());$('select#eStartMonth').val(getDateFromString(eduItem.start_date).getMonth()+1);$('select#eEndYear').val(getDateFromString(eduItem.end_date).getFullYear());$('select#eEndMonth').val(getDateFromString(eduItem.end_date).getMonth()+1);$("textarea#eSummary").val(eduItem.activities);$("#eSave > span").text("Save");$("#eSave").attr('value',id);}}}
function resetEducation(){var validator=$("#educationForm").validate();validator.resetForm();$("input#eSchool").val("");$("input#eDegree").val("");$("input#eProgram").val("");$("input#eLocation").val("");$('select#eStartYear').val("");$('select#eStartMonth').val("");$('select#eEndYear').val("");$('select#eEndMonth').val("");$("textarea#eSummary").val("");$("#eSave").attr('value',"");}
function bindEducation(){$("ul#ul-Education").empty();if(vizDataRaw.timeline_education&&vizDataRaw.timeline_education.length>0){$.each(vizDataRaw.timeline_education,function(i,edu){var displayText="";if(edu.degree)
displayText=displayText+edu.degree+" : ";displayText=displayText+edu.school;$("ul#ul-Education").append('<li><span>'+trucateText(displayText,globalListTextSize)+'</span><a href="#" id='+edu.id+' class=\'edit-delete\' onclick=deleteEducation('+edu.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadEducation('+edu.id+')><span>Edit</span></a></li>');});}}
function addEditSkill(){if($("#skillsForm").valid()){var id=$("#sSave").attr('value');if(id){editSkill(id);}
else
addSkill();}}
function addSkill(){var skillJson=getSkill();if(skillJson){vizDataRaw.skills.push(skillJson);saveChanges([resetSkills,generateViz,bindSkills,hideNewSkill],"#skillSubmit");}}
function editSkill(id){if(id){var itemIndex=findItemInArray(vizDataRaw.skills,id);if(itemIndex>=0){var skillToChange=vizDataRaw.skills[itemIndex];var changedSkill=getSkill();skillToChange.name=changedSkill.name;skillToChange.years=changedSkill.years;skillToChange.proficiency_id=changedSkill.proficiency_id;skillToChange.is_bound=false;$("#sSave").attr("value",id);$("#sSave > span").text("Save");saveChanges([resetSkills,generateViz,bindSkills,hideNewSkill],"#skillSubmit");}}}
function deleteSkill(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.skills,id);if(itemIndex>=0){vizDataRaw.skills.splice(itemIndex,1);saveChanges([generateViz,bindSkills]);}}}}
function getSkill(){var skillJson={};var name=$("input#sName").val();var years=$("select#sYears").val();var prof=$("select#sProf").val();skillJson.name=name;skillJson.years=years;skillJson.proficiency_id=prof;return skillJson;}
function loadSkill(id){$('div#newSkill').show('slow');var validator=$("#skillsForm").validate();validator.resetForm();$("#sSave").removeClass("edit-add");$("#sSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.skills,id);if(itemIndex>=0){var skillItem=vizDataRaw.skills[itemIndex];$("input#sName").val(skillItem.name);$("select#sYears").val(skillItem.years);$("select#sProf").val(skillItem.proficiency_id);$("#sSave > span").text("Save");$("#sSave").attr('value',id);}}}
function resetSkills(){var validator=$("#skillsForm").validate();validator.resetForm();$("input#sName").val("");$("select#sYears").val("");$("select#sProf").val("");$("#sSave").attr('value',"");}
function bindSkills(){$("ul#ul-Skills").empty();if(vizDataRaw.skills&&vizDataRaw.skills.length>0){$.each(vizDataRaw.skills,function(i,skill){$("ul#ul-Skills").append('<li><span>'+trucateText(skill.name,globalListTextSize)+'</span><a href="#" id='+skill.id+' class=\'edit-delete\' onclick=deleteSkill('+skill.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadSkill('+skill.id+')><span>Edit</span></a></li>');});if(vizDataRaw.skills.length>=5){$('div#divNewSkillButton').hide();}
else{$('div#divNewSkillButton').show();}}}
function findItemInArray(list,id){var itemIndex=-1;for(var i=0;i<list.length;i++){if(list[i].id&&list[i].id==id){itemIndex=i;break;}}
return itemIndex;}
function saveChanges(funcArray,element,dataToSave){var saveData=dataToSave||vizDataRaw;$.ajax({type:'PUT',url:'/user/data',data:jsonSerialize(saveData),success:function(resp){if(resp.status==='Success'){$.ajax({type:'GET',url:'/user/data',beforeSend:showEditLoadingImage(element),statusCode:{500:function(){$.jnotify("Sorry an error occurred while processing your request.","error",300);}},success:function(resp){vizDataRaw=resp;if(funcArray){$.each(funcArray,function(i,func){func.call();});}
$.jnotify("Your changes have been successfully saved.","success",300);},error:function(jqXHR,textStatus,errorThrown){$.jnotify("Sorry there was an error while saving your changes. "+textStatus,"error",1000);hideEditLoadingImage(element);}}).success(hideEditLoadingImage(element));}
else
$.jnotify("Sorry an error occurred while making your changes.","error",300);},error:function(jqXHR,textStatus,errorThrown){$.jnotify("Sorry there was an error while saving your changes. "+textStatus,"error",1000);}});}
function bindLanguages(){$("ul#ul-Language").empty();if(vizDataRaw.languages&&vizDataRaw.languages.length>0){$.each(vizDataRaw.languages,function(i,language){var languageText=language.name+" : "+language.proficiency;$("ul#ul-Language").append('<li><span>'+trucateText(languageText,28)+'</span><a href="#" id='+language.id+' class=\'edit-delete\' onclick=deleteLanguage('+language.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadLanguage('+language.id+')><span>Edit</span></a></li>');});}}
function addEditLanguage(){if($("#languagesForm").valid()){var id=$("#lSave").attr('value');if(id){editLanguage(id);}
else
addLanguage();}}
function addLanguage(){var languageJson=getLanguage();if(languageJson){vizDataRaw.languages.push(languageJson);saveChanges([resetLanguage,generateViz,bindLanguages,hideNewLanguage],"#languageSubmit");}}
function editLanguage(id){if(id){var itemIndex=findItemInArray(vizDataRaw.languages,id);if(itemIndex>=0){var languageToChange=vizDataRaw.languages[itemIndex];var changedLanguage=getLanguage();languageToChange.name=changedLanguage.name;languageToChange.proficiency_id=changedLanguage.proficiency_id;languageToChange.is_bound=false;saveChanges([resetLanguage,generateViz,bindLanguages,hideNewLanguage],"#languageSubmit");}}}
function deleteLanguage(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.languages,id);if(itemIndex>=0){vizDataRaw.languages.splice(itemIndex,1);saveChanges([generateViz,bindLanguages]);}}}}
function getLanguage(){var languageJson={};var name=$("input#lName").val();var prof=$("select#lProf").val();languageJson.name=name;languageJson.proficiency_id=prof;return languageJson;}
function loadLanguage(id){$('div#newLanguage').show('slow');var validator=$("#languagesForm").validate();validator.resetForm();$("#lSave").removeClass("edit-add");$("#lSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.languages,id);if(itemIndex>=0){var languageItem=vizDataRaw.languages[itemIndex];$("input#lName").val(languageItem.name);$("select#lProf").val(languageItem.proficiency_id);$("#lSave > span").text("Save");$("#lSave").attr('value',id);}}}
function resetLanguage(){var validator=$("#languagesForm").validate();validator.resetForm();$("input#lName").val("");$("select#lProf").val("");$("#lSave").attr('value',"");}
function bindInterests(){$("ul#ul-Interest").empty();if(vizDataRaw.interests&&vizDataRaw.interests.length>0){$.each(vizDataRaw.interests,function(i,interest){$("ul#ul-Interest").append('<li><span>'+trucateText(interest.name,globalListTextSize)+'</span><a href="#" id='+interest.id+' class=\'edit-delete\' onclick=deleteInterest('+interest.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadInterest('+interest.id+')><span>Edit</span></a></li>');});if(vizDataRaw.interests.length>=6){$('div#divNewInterestButton').hide();}
else{$('div#divNewInterestButton').show();}}}
function addEditInterest(){if($("#interestsForm").valid()){var id=$("#iSave").attr('value');if(id){editInterest(id);}
else
addInterest();}}
function addInterest(){var interestJson=getInterest();if(interestJson){vizDataRaw.interests.push(interestJson);saveChanges([resetInterest,generateViz,bindInterests,hideNewInterest],"#interestSubmit");}}
function editInterest(id){if(id){var itemIndex=findItemInArray(vizDataRaw.interests,id);if(itemIndex>=0){var interestToChange=vizDataRaw.interests[itemIndex];var changedInterest=getInterest();interestToChange.name=changedInterest.name;interestToChange.weight=changedInterest.weight;interestToChange.is_bound=false;saveChanges([resetInterest,generateViz,bindInterests,hideNewInterest],"#interestSubmit");}}}
function deleteInterest(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.interests,id);if(itemIndex>=0){vizDataRaw.interests.splice(itemIndex,1);saveChanges([generateViz,bindInterests]);}}}}
function getInterest(){var interestJson={};var name=$("input#iName").val();interestJson.name=name;interestJson.weight=$("select#iWeight").val();return interestJson;}
function loadInterest(id){$('div#newInterest').show('slow');var validator=$("#interestsForm").validate();validator.resetForm();$("#iSave").removeClass("edit-add");$("#iSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.interests,id);if(itemIndex>=0){var interestItem=vizDataRaw.interests[itemIndex];$("input#iName").val(interestItem.name);$("select#iWeight").val(interestItem.weight);$("#iSave > span").text("Save");$("#iSave").attr('value',id);}}}
function resetInterest(){var validator=$("#interestsForm").validate();validator.resetForm();$("input#iName").val("");$("select#iWeight").val("");$("#iSave").attr('value',"");$("#iSave > span").text("Add");$("#iSave").removeClass("edit-save");$("#iSave").addClass("edit-add");}
function bindStats(){$("ul#ul-Stats").empty();if(vizDataRaw.mystats&&vizDataRaw.mystats.length>0){$.each(vizDataRaw.mystats,function(i,stat){var displayText=stat.label;$("ul#ul-Stats").append('<li><span>'+trucateText(displayText,globalListTextSize)+'</span><a href="#" id='+stat.id+' class=\'edit-delete\' onclick=deleteStat('+stat.id+')><span>Delete</span></a><a href="#" class=\'edit-edit\' onclick=loadStat('+stat.id+')><span>Edit</span></a></li>');});if(vizDataRaw.mystats.length>=4){$('div#divNewStatButton').hide();}
else{$('div#divNewStatButton').show();}}}
function addEditStat(){if($("#statsForm").valid()){var id=$("#mSave").attr('value');if(id){editStat(id);}
else
addStat();}}
function addStat(){var statJson=getStat();if(statJson){vizDataRaw.mystats.push(statJson);saveChanges([resetStat,bindStats,hideNewStat,generateViz],"#statSubmit");}}
function editStat(id){if(id){var itemIndex=findItemInArray(vizDataRaw.mystats,id);if(itemIndex>=0){var statToChange=vizDataRaw.mystats[itemIndex];var changedStat=getStat();statToChange.label=changedStat.label;statToChange.number=changedStat.number;statToChange.unit=changedStat.unit;statToChange.category=changedStat.category;statToChange.icon=changedStat.category;;statToChange.is_bound=false;saveChanges([resetStat,bindStats,hideNewStat,generateViz],"#statSubmit");}}}
function deleteStat(id){if(confirm("Are you sure you want to delete this?")){if(id){var itemIndex=findItemInArray(vizDataRaw.mystats,id);if(itemIndex>=0){vizDataRaw.mystats.splice(itemIndex,1);saveChanges([bindStats,generateViz]);}}}}
function getStat(){var statJson={};statJson.category=$('select#mCategory option:selected').val();statJson.label=$('select#mCategory option:selected').text();statJson.icon=statJson.category;if(statJson.category==0)
{statJson.label=$("input#mLabel").val();statJson.unit=$('select#mUnit option:selected').val();statJson.number=$("input#mStat").val();}
else if(statJson.category==1)
{statJson.number=$("input#mStat").val();}
return statJson;}
function loadStat(id){$('div#newStat').show('slow');var validator=$("#statsForm").validate();validator.resetForm();$("#mSave").removeClass("edit-add");$("#mSave").addClass("edit-save");if(id){var itemIndex=findItemInArray(vizDataRaw.mystats,id);if(itemIndex>=0){var statItem=vizDataRaw.mystats[itemIndex];$("select#mCategory").val(statItem.category);if(statItem.category==0){$("#divLabel").show();$("#divStat").show();$("#divUnit").show();$("input#mLabel").val(statItem.label);$("select#mUnit").val(statItem.unit);$("input#mStat").val(statItem.number);}
else if(statItem.category==1){$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();$("input#mStat").val(statItem.number);}
else{$("#divLabel").hide();$("#divStat").hide();$("#divUnit").hide();}
$("#mSave > span").text("Save");$("#mSave").attr('value',id);}}}
function resetStat(){var validator=$("#statsForm").validate();validator.resetForm();$("input#mLabel").val("");$('select#mCategory').val("");$('select#mUnit').val("");$("input#mStat").val("");$("#mSave").attr('value',"");}
function getUnixTimeStamp(year,month,day){var d=1;if(day)
d=day;return Math.round(new Date(year,month-1,d).getTime()/1000);}
function compare(a,b){if(a.start_date<b.start_date)
return-1;if(a.start_date>b.start_date)
return 1;return 0;}
function bindAllDialogs(){$("#edit-content-nav > li:not(#editProfile)").css("color","#333333");$('#edit-content-nav > li').qtip('hide');$('#editWork > a').click(function(){$("#dialog_work").dialog("open");});$('#editEducation > a').click(function(){$("#dialog_education").dialog("open");});$('#editSkills > a').click(function(){$("#dialog_skills").dialog("open");});$('#editLanguages > a').click(function(){$("#dialog_languages").dialog("open");});$('#editInterests > a').click(function(){$("#dialog_interests").dialog("open");});$('#editLinks > a').click(function(){$("#dialog_links").dialog("open");});$('#editAwards > a').click(function(){$("#dialog_awards").dialog("open");});$('#editRecommendations > a').click(function(){$("#dialog_Recommendations").dialog("open");});$('#editPortfolio > a').click(function(){$("#dialog_Portfolio").dialog("open");});$('#editMyStats > a').click(function(){$("#dialog_MyStats").dialog("open");});}
function setDialogs(){showDialog("dialog_profile");showDialog("dialog_work");showDialog("dialog_education");showDialog("dialog_skills");showDialog("dialog_languages");showDialog("dialog_interests");showDialog("dialog_links");showDialog("dialog_awards");showDialog("dialog_Recommendations");showDialog("dialog_Portfolio");showDialog("dialog_MyStats");$('#editProfile > a').click(function(){$.ajax({type:'GET',url:'/user/data',success:function(resp){vizDataRaw=resp;console.log("ajax called");currentUsername=vizDataRaw.user_info.username;$('#urlName').val(currentUsername);$('#urlNameText').html(currentUsername);}});$("#dialog_profile").dialog("open");});}
function setUserNameLogic(){var timeout;var delay=1000;var isLoading=false;$('#urlName').keyup(function(){if(timeout){clearTimeout(timeout);}
if(!isLoading){var name=$(this).val();$('#urlNameText').html(name);if(name&&name.length>2){timeout=setTimeout(function(){isLoading=true;$.ajax({type:'GET',url:'/ajax/username?username='+escape(name),success:function(resp){var style=(resp&&resp.code===200)?"color:Green":"color:Red";$('#divNameStatus').html("<span style='"+style+"'>"+resp.message+"</span>").fadeIn().delay(1000).fadeOut('slow');}});setTimeout(function(){isLoading=false;},1000);},delay);}}});}
function showEditLoadingImage(element){if(element){$('.edit-options').hide();$(element).append('<div id="loading-image" style="text-align:center;"><img src="/media/img/ajax-loader.gif" alt="Loading..." /></div>');}}
function hideEditLoadingImage(element){if(element){$('.edit-options').show();$('#loading-image').remove();}}
var temp2=(function(){var colors=["#ED008C","#CCC","#0a0a0a","#BBB","#333","#999","#DDD"];return{getDefaultColors:function(){return colors;},getDefaultFonts:function(){return temp1.getDefaultFonts();},generate:function(){temp1.generate("c",colors);}};}());var temp3=(function(){var colors=["#ED008C","#CCC","#0a0a0a","#BBB","#333","#999","#DDD"];return{getDefaultColors:function(){return colors;},getDefaultFonts:function(){return temp1.getDefaultFonts();},generate:function(){temp1.generate("t",colors);}};}());var temp1=(function(){var colors=["#ED008C","#CCC","#0a0a0a","#BBB","#333","#999","#DDD"];var fonts=["cooper-black-std","proxima-nova","ff-netto-web"];var style={"fonts":{"title":"Museo Slab 500","content":"Familar Pro Bold"},"header":{"header_bg":colors[2],"name":{"fontsize":50,"fontweight":"bold","fontcolor":colors[0]},"title":{"fontsize":24,"fontweight":"bold","fontcolor":colors[1]},"summary":{"fontsize":16}},"skills":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","skill_fillcolor":"#00adef","skill_emptycolor":"#ddd","skill_fontsize":12},"languages":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","lang_fontcolor":"#000","lang_fontsize":22},"interests":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"awards":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"recomm":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","rec_fontcolor":"#fff","rec_fontsize":18,"rec_font":"Verdana","rec_fill":"#000","recommender_fontsize":20,"recommender_fontcolor":'#ed008c',"recommender_fontweight":"bold","recommender_font":"Verdana"},"timeline":{"title_fontsize":20,"title_fontcolor":"#fff","title_fontweight":"bold","title_font":"Verdana","title_bgcolor":"#999","bg_color":"#ffffff","bg_color_alt":"#F2EEEE","year_color":"#CDC9C9","year_color_alt":"#F0ECEC","colors":["#ed008c","#00adef","#BBCB5F","#fef200"]},"connections":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","bg_color":"#000","conn_fontcolor":"#fef200","conn_fontsize":140,"conn_fontweight":"bold","conn_text_fontcolor":"#fff","conn_text_fontsize":35,"conn_text_fontweight":"bold"}};var timelineTitleHeight=35;var timelineTitleWidth=155;var timelineTitleChamfer=15;var infographicWidth=960;var infographicHeight=1550;var timelineWidth=infographicWidth;var yearInterval=4;var yearWidth=30;var yearIntervalWidth=30;var totalIntervals=timelineWidth/yearIntervalWidth;var headerHeight=160;var headerAndBottomDiff=35;var experienceStartY=headerHeight+headerAndBottomDiff;var experienceTimeLineHeight=240;var timeLineDifference=60;var educationStartY=experienceTimeLineHeight+timeLineDifference+experienceStartY;var educationTimeLineHeight=240;var timelineHeight=experienceTimeLineHeight+educationTimeLineHeight+timeLineDifference;var skillsHeight=200;var skillsStartY=timelineHeight+timeLineDifference+experienceStartY;var groupsHeight=400;var groupsStartY=skillsStartY+skillsHeight+timeLineDifference;var timeLineType="s";var yearLimit=19;return{getDefaultColors:function(){return clone(colors);},getDefaultFonts:function(){return clone(fonts);},generate:function(timeLineShape,defColors){function drawWorkEduDiv(id){var div=createDiv('__workedu');div.style.marginBottom="16px";document.getElementById(id).appendChild(div);if(vizData.timeline_work&&vizData.timeline_work.length>0){var workTextDiv=createDiv('__workText');div.appendChild(workTextDiv);var paper=new Raphael(workTextDiv,infographicWidth,90);drawTimeLineLabel("EXPERIENCE",paper,50,0);var workDiv=createDiv('__work');div.appendChild(workDiv);var paper=new Raphael(workDiv,timelineWidth,experienceTimeLineHeight+50);drawExperienceTimeLine(vizData.timeline_work,paper);}
if(vizData.timeline_education&&vizData.timeline_education.length>0){var timeLineEducation=Raphael.fn.viz.applyConstraintsOnTimeLine(yearLimit,vizData.timeline_education,vizData.counts.year_education_began,vizData.counts.year_education_ended);if(timeLineEducation&&timeLineEducation.length>0){var eduTextDiv=createDiv('__eduText');div.appendChild(eduTextDiv);var paper=new Raphael(eduTextDiv,infographicWidth,90);drawTimeLineLabel("EDUCATION",paper,50,0);var eduDiv=createDiv('__edu');div.appendChild(eduDiv);var paper=new Raphael(eduDiv,timelineWidth,educationTimeLineHeight+50);drawEducationTimeLine(timeLineEducation,paper);}}}
function drawSkillsDiv(id){var div=createDiv('__skills');document.getElementById(id).appendChild(div);if(customizedSections.skills&&vizData.skills&&vizData.skills.length>0){var paper=new Raphael(div,timelineWidth,skillsHeight+timeLineDifference+25);skillsStartY=25;groupsStartY=25;var text=paper.text(infographicWidth/2,(skillsStartY+20),"SKILLS").attr({'font-family':customizedFonts[1],'font-size':style.skills.title_fontsize,fill:style.skills.title_fontcolor,"font-weight":style.skills.title_fontweight});if(vizData.skills){drawSkills(vizData.skills,paper);}}}
if(!customizedColors){if(defColors){customizedColors=clone(defColors);}else{customizedColors=clone(colors);}}
if(!customizedFonts){customizedFonts=clone(fonts);}
timeLineType=timeLineShape;var userInfo=vizData.user_info;var userWeb=vizData.urls;Viz.widgets.header("infographic",userInfo,style.header);drawWorkEduDiv("infographic");if(customizedSections.skills&&vizData.skills&&vizData.skills.length>0){var skillStyle={'titleStyle':{'fill':customizedColors[0],'font-family':customizedFonts[0]},'textStyle':{'fill':customizedColors[1],'font-family':customizedFonts[2]},'nameStyle':{'fill':customizedColors[1],'font-family':customizedFonts[1]},'backgroundStyle':{'fill':customizedColors[2]}};Viz.widgets.skillChart("infographic",vizData.skills,skillStyle);}
if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){Viz.widgets.drawInterests("infographic",Viz.stripHidden(vizData.interests),style.interests);}
if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){Viz.widgets.languageChart("infographic",Viz.stripHidden(vizData.languages));}
if(customizedSections.awards&&vizData.awards&&vizData.awards.length>0){Viz.widgets.drawAwards("infographic",Viz.stripHidden(vizData.awards),style.awards);}
if(customizedSections.myStats&&vizData.mystats&&vizData.mystats.length>0){var statStyle={'titleFont':customizedFonts[1],'titleColor':'black','textFont':customizedFonts[2],'textColor':'black','numberFont':customizedFonts[2],'numberColor':customizedColors[3],'iconColor':customizedColors[2]};Viz.widgets.myStatChart("infographic",Viz.stripHidden(vizData.mystats),vizData.counts,statStyle);}
if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){Viz.widgets.drawRecommendations("infographic",Viz.stripHidden(vizData.recommendations));}}};function createDiv(id){newdiv=document.createElement('div');newdiv.setAttribute('id',id);return newdiv;}
function drawInterests(groupsStartY,interests,paper){var text=paper.text(275,groupsStartY+50,"INTERESTS");text.attr({'font-family':customizedFonts[1],'font-size':style.languages.title_fontsize,fill:style.languages.title_fontcolor,"font-weight":style.languages.title_fontweight});if(interests&&interests.length>0){var yPositionText=(groupsStartY+120);var i;for(i=0;i<interests.length&&i<8;i++){var textLanguage=paper.text(275,yPositionText,interests[i].name).attr({'font-size':style.interests.int_fontsize,fill:style.languages.lang_fontcolor,'font-family':customizedFonts[1]});yPositionText+=40;}}}
function drawLanguages(groupsStartY,languages,paper){var text=paper.text(275,groupsStartY+50,"LANGUAGES");text.attr({'font-family':customizedFonts[1],'font-size':style.languages.title_fontsize,fill:style.languages.title_fontcolor,"font-weight":style.languages.title_fontweight});var yPositionText=(groupsStartY+120);var i;for(i=0;i<languages.length&&i<8;i++){var textLanguage=paper.text(275,yPositionText,languages[i].name).attr({'font-size':style.languages.lang_fontsize,fill:style.languages.lang_fontcolor,'font-family':customizedFonts[1]});yPositionText+=40;}}
function drawConnections(connections,paper){var textNoOfConn=connections;var fontSize=style.connections.conn_fontsize;if(textNoOfConn===500){textNoOfConn=textNoOfConn+"+";fontSize=fontSize-30;}
var title=paper.text(infographicWidth-200,(groupsStartY+50),"LINKEDIN").attr({'font-family':customizedFonts[1],'font-size':style.connections.title_fontsize,fill:style.connections.title_fontcolor,"font-weight":style.connections.title_fontweight});var circ=paper.circle(infographicWidth-200,groupsStartY+250,160).attr({fill:customizedColors[2],stroke:'none'});var text=paper.text(infographicWidth-200,groupsStartY+225,textNoOfConn).attr({'font-size':fontSize,fill:customizedColors[0],"font-weight":style.connections.conn_fontweight});var textConn=paper.text(infographicWidth-200,groupsStartY+305,"Connections").attr({'font-family':customizedFonts[1],'font-size':style.connections.conn_text_fontsize,fill:style.connections.conn_text_fontcolor,"font-weight":style.connections.conn_text_fontweight});}
function drawRecommendation(groupsStartY,recomm,paper){var text=paper.text(275,groupsStartY+50,"RECOMMENDATIONS");text.attr({'font-family':customizedFonts[1],'font-size':style.recomm.title_fontsize,fill:style.recomm.title_fontcolor,"font-weight":style.recomm.title_fontweight});var recommendations=clone(recomm);var totalRecommendationsToDisplay=recommendations.length>3?3:recommendations.length;var yPositionBlock=(groupsStartY+100);var yPositionText=(groupsStartY+120);var blockHeight=50;var textLength=105;var lineLength=47;var maxLines=2;var i;if(recommendations.length===1){blockHeight=300;yPositionText+=130;textLength=500;maxLines=12;}
for(i=0;i<totalRecommendationsToDisplay;i++){var bubble=paper.path("M 50 "+yPositionBlock+" l 450 0 l 0 "+blockHeight+" l -420 0 l 5 20 l -20 -20 l -15 0 l 0 -"+blockHeight+" z").attr({fill:customizedColors[3],stroke:customizedColors[3],'stroke-width':20,'stroke-linejoin':'round'});drawTooltip(bubble.node,recommendations[i].content.recommendationText);var displayText=getWrappedText(clone(recommendations[i].content.recommendationText),textLength,lineLength,maxLines);var textRecomm=paper.text(275,yPositionText,displayText).attr({'font-size':style.recomm.rec_fontsize,fill:style.recomm.rec_fontcolor,'font':style.recomm.rec_font});drawTooltip(textRecomm.node,recommendations[i].content.recommendationText);var textRecommender=paper.text(120,yPositionBlock+blockHeight+40,recommendations[i].content.recommender.firstName).attr({'font-size':style.recomm.recommender_fontsize,fill:customizedColors[2],"font-weight":style.recomm.recommender_fontweight,'font':style.recomm.recommender_font});yPositionText+=120;yPositionBlock+=120;}}
function drawSkills(skills,paper){var skillY=skillsStartY+150;var skillHeight=30;var skillX=150;var shapeWidth=80;var skillBox;var yearDisplay=shapeWidth;var i;for(i=0;i<skills.length&&i<5;i++){if(timeLineType&&timeLineType==="c"){shapeWidth=70;yearDisplay=90;skillBox=paper.g.disc(skillX,skillY,shapeWidth).attr({fill:customizedColors[2],"stroke":"none"});}else if(timeLineType&&timeLineType==="t"){shapeWidth=70;yearDisplay=90;skillBox=paper.g.diamond(skillX,skillY,shapeWidth).attr({fill:customizedColors[2],"stroke":"none"});}else{shapeWidth=70;yearDisplay=90;skillBox=paper.g.disc(skillX,skillY,shapeWidth).attr({fill:customizedColors[2],"stroke":"none"});}
drawTooltip(skillBox.node,getSkillsTooltip(skills[i]));var textLength=20;var lineLength=10;var maxLines=2;var skillText=getWrappedText(clone(skills[i].name),textLength,lineLength,maxLines);var textSkill=paper.text(skillX,skillY,skillText).attr({fill:"#fff","font-family":"proxima-nova","font-size":13});drawTooltip(skillText.node,getSkillsTooltip(skills[i]));if(skills[i].years&&skills[i].proficiency===null){skills[i].proficiency="Unspecified";}
if(skills[i].years===null){skills[i].years="Unspecified";}
var skillPro=paper.text(skillX,skillY+yearDisplay,skills[i].proficiency+"\n"+skills[i].years+"+ years").attr({"font-size":15,"font-family":"proxima-nova",fill:customizedColors[2],stroke:"none","opacity":0.9});skillX+=170;}}
function drawTimeLineLabel(text,paper,textY,pathY){var timelineTitleHeight=35;var timelineTitleWidth=155;var timelineTitleChamfer=15;var labelPath=" M 0 "+pathY+" l 0 "+timelineTitleHeight+" l "+(timelineTitleWidth-timelineTitleChamfer)+" 0 a "+timelineTitleChamfer+","+timelineTitleChamfer+" 0 0,0 "+timelineTitleChamfer+",-"+timelineTitleChamfer+" l 0 -"+(timelineTitleHeight-timelineTitleChamfer)+"z";var labelText=paper.text((infographicWidth/2),textY,text).attr({"font-family":customizedFonts[1],"font-size":35,"font-weight":"bold",fill:customizedColors[2],stroke:"none"});}
function drawExperienceTimeLine(expTimeLine,paper){experienceStartY=25;var timeLineExp=paper.viz.applyConstraintsOnTimeLine(yearLimit,expTimeLine,vizData.counts.year_work_began,vizData.counts.year_work_ended);var graphSet=paper.set();if(timeLineExp&&timeLineExp.length>0){var lastExp=getMaxEndDate(timeLineExp);var firstExp=getMinStartDate(timeLineExp,yearLimit,lastExp.getFullYear());var timelineStartYear=firstExp.getFullYear();var timelineEndYear=lastExp.getFullYear();var timelineYears=(timelineEndYear-timelineStartYear)+1;var yearHeight=25;var yearLabel="";var yearWidth=timelineWidth/timelineYears;var color;var i;for(i=0;i<timelineYears;i++){color=style.timeline.year_color;if(i%2){color=style.timeline.year_color_alt;}
var yearRect=paper.rect((i*yearWidth),experienceTimeLineHeight+experienceStartY,yearWidth,3).attr({fill:customizedColors[2],stroke:"none"});graphSet.push(yearRect);yearLabel=(timelineYears>12)?("'"+(timelineStartYear+i).toString().substr(2)):(timelineStartYear+i);var yearLine=paper.rect((i*yearWidth),experienceTimeLineHeight+experienceStartY+3,3,5).attr({fill:customizedColors[2],stroke:"none"});graphSet.push(yearLine);var yearText=paper.text((i*yearWidth)+(yearWidth/2),experienceTimeLineHeight+experienceStartY+(yearHeight/2)+5,yearLabel).attr({"font-family":customizedFonts[2],fill:customizedColors[2],"font-size":16});graphSet.push(yearText);}
for(i=0;i<timeLineExp.length;i++){var start=getDateFromString(timeLineExp[i].start_date);if(start<firstExp){start=firstExp;}
var end=getDateFromString(timeLineExp[i].end_date);timeLineExp[i].range=((end.getTime()-start.getTime())/86400000);if(timeLineExp[i].range<30){timeLineExp[i].range=30;}}
var maxBlockHeight=setBlocksHeight(timeLineExp);var dayWidth=(yearWidth/365);timeLineExp.sort(sortByRange);timeLineExp.reverse();var experienceBottom=experienceTimeLineHeight+experienceStartY;var experienceRadius=0;var experienceWidth=0;var timelineStartDate=new Date(timelineStartYear,0,1);var experienceStartX=0;var currentExperienceHeight;var c=3;for(i=0;i<timeLineExp.length;i++){var thisStartDate=getDateFromString(timeLineExp[i].start_date);if(thisStartDate<firstExp){thisStartDate=firstExp;}
experienceStartX=((thisStartDate.getTime()-timelineStartDate.getTime())/86400000)*dayWidth;experienceWidth=((timeLineExp[i].range/365)*yearWidth);currentExperienceHeight=timeLineExp[i].height;timeLineExp[i].title=timeLineExp[i].position;timeLineExp[i].desc=timeLineExp[i].company;timeLineExp[i].width=experienceWidth;timeLineExp[i].center=experienceStartX+(experienceWidth/2);timeLineExp[i].apex=(experienceBottom-currentExperienceHeight)+8;var experienceGraphicPath;if(timeLineType&&timeLineType==="c"){experienceGraphicPath=["M",experienceStartX,experienceBottom,"a",(experienceWidth/2),(currentExperienceHeight),0,0,1,(experienceWidth),0,"z"];}else if(timeLineType&&timeLineType==="t"){experienceGraphicPath="M "+experienceStartX+" "+experienceBottom+" l "+(experienceWidth/2)+" -"+currentExperienceHeight+" "+(experienceWidth/2)+" "+currentExperienceHeight+"z";}else{experienceGraphicPath=" M "+experienceStartX+" "+experienceBottom+" l 0 -"+(currentExperienceHeight-experienceRadius)+" a 0 0 1 0 1 0 0 l "+(experienceWidth-(experienceRadius*2))+" 0  a 0 0 1 0 1 0 0 l 0 "+(currentExperienceHeight-experienceRadius)+"z";}
var strokeWidth=0;var strokeColor="#fff";var experienceItem=paper.path(experienceGraphicPath).attr({fill:customizedColors[c],stroke:strokeColor,"stroke-width":strokeWidth,opacity:"0.8"});graphSet.push(experienceItem);var tipText=getExperienceToolTip(timeLineExp[i]);drawTooltip(experienceItem.node,tipText);c++;if(c>=customizedColors.length){c=3;}}
var downShift=paper.viz.scatterLabels(100,10,timeLineExp,{spacing:10,horz_spacing:10});paper.setSize(paper.width,paper.height+downShift);graphSet.translate(0,downShift);}}
function drawEducationTimeLine(timeLineEducation,paper){educationStartY=25;var graphSet=paper.set();if(timeLineEducation&&timeLineEducation.length>0){var lastEdu=getMaxEndDate(timeLineEducation);var firstEdu=getMinStartDate(timeLineEducation,yearLimit,lastEdu.getFullYear());var minEduYear=firstEdu.getFullYear();var maxEduYear=lastEdu.getFullYear();var timelineTop=25;var yearHeight=25;var yearLabel="";var educationBottom=educationStartY+educationTimeLineHeight;var realMinYear=getMinStartDate(timeLineEducation);var timelineStartYear=minEduYear;if(realMinYear>=firstEdu){timelineStartYear-=1;}
var curr_year=(new Date()).getFullYear();var timelineEndYear=maxEduYear+((maxEduYear===curr_year)?0:1);var timelineYears=(timelineEndYear-timelineStartYear)+1;var yearWidth=timelineWidth/timelineYears;var color;var i;for(i=0;i<timelineYears;i++){color=style.timeline.year_color;if(i%2){color=style.timeline.year_color_alt;}
var yearRect=paper.rect((i*yearWidth),educationBottom,yearWidth,3).attr({fill:customizedColors[2],stroke:"none"});yearLabel=(timelineYears>12)?("'"+(timelineStartYear+i).toString().substr(2)):(timelineStartYear+i);var yearLine=paper.rect((i*yearWidth),educationTimeLineHeight+educationStartY+3,3,5).attr({fill:customizedColors[2],stroke:"none"});var yearText=paper.text((i*yearWidth)+(yearWidth/2),(educationBottom+yearHeight/2)+3,yearLabel).attr({"font-family":customizedFonts[2],fill:customizedColors[2],"font-size":16});graphSet.push(yearRect);graphSet.push(yearLine);graphSet.push(yearText);}
for(i=0;i<timeLineEducation.length;i++){var start=getDateFromString(timeLineEducation[i].start_date);if(start<firstEdu){start=firstEdu;}
var end=getDateFromString(timeLineEducation[i].end_date);timeLineEducation[i].range=((end.getTime()-start.getTime())/86400000);if(timeLineEducation[i].range<30){timeLineEducation[i].range=30;}}
var maxBlockHeight=setBlocksHeight(timeLineEducation);var dayWidth=(yearWidth/365);timeLineEducation.sort(sortByRange);timeLineEducation.reverse();var educationRadius=0;var educationWidth=0;var timelineStartDate=new Date(timelineStartYear,0,1);var educationStartX=0;var currentEducationHeight;var c=3;for(i=0;i<timeLineEducation.length;i++){var thisStartDate=getDateFromString(timeLineEducation[i].start_date);if(thisStartDate<firstEdu){thisStartDate=firstEdu;}
educationStartX=((thisStartDate.getTime()-timelineStartDate.getTime())/86400000)*dayWidth;educationWidth=((timeLineEducation[i].range/365)*yearWidth);currentEducationHeight=timeLineEducation[i].height;timeLineEducation[i].title=timeLineEducation[i].degree;timeLineEducation[i].desc=timeLineEducation[i].school;timeLineEducation[i].width=educationWidth;timeLineEducation[i].center=educationStartX+(educationWidth/2);timeLineEducation[i].apex=(educationBottom-currentEducationHeight)+8;var educationGraphicPath;if(timeLineType&&timeLineType==="c"){educationGraphicPath=["M",educationStartX,educationBottom,"a",(educationWidth/2),(currentEducationHeight),0,0,1,(educationWidth),0,"z"];}else if(timeLineType&&timeLineType==="t"){educationGraphicPath="M "+educationStartX+" "+educationBottom+" l "+(educationWidth/2)+" -"+currentEducationHeight+" "+(educationWidth/2)+" "+currentEducationHeight+"z";}else{educationGraphicPath=" M "+educationStartX+" "+educationBottom+" l 0 -"+(currentEducationHeight-educationRadius)+" a 0 0 1 0 1 0 0 l "+(educationWidth-(educationRadius*2))+" 0  a 0 0 1 0 1 0 0 l 0 "+(currentEducationHeight-educationRadius)+"z";}
var strokeWidth=0;var strokeColor="#fff";var educationItem=paper.path(educationGraphicPath).attr({fill:customizedColors[c],stroke:strokeColor,"stroke-width":strokeWidth,opacity:"0.8"});graphSet.push(educationItem);c++;if(c>=customizedColors.length){c=3;}
var tipText=getEducationToolTip(timeLineEducation[i]);drawTooltip(educationItem.node,tipText);}
var downShift=paper.viz.scatterLabels(100,10,timeLineEducation,{spacing:10,horz_spacing:10});paper.setSize(paper.width,paper.height+downShift);graphSet.translate(0,downShift);}}
function drawTimeLineBackground(paper,y,width,height){var intervalRect;var i;for(i=0;i<totalIntervals;i++){color=style.timeline.bg_color;if(i%2){color=style.timeline.bg_color_alt;}
intervalRect=paper.rect((i*yearIntervalWidth),y,yearIntervalWidth,height).attr({fill:color,stroke:"none"});}}
function setBlocksHeight(timeLine){var experienceHeight=50;var experienceHeightInc=15;var maxBlockHeight=experienceHeight;var currentStart,currentEnd,previousStart,previousEnd;timeLine.sort(sortByRange);var i;var j;for(i=0;i<timeLine.length;i++){timeLine[i].height=experienceHeight;currentStart=getDateFromString(timeLine[i].start_date).getTime();currentEnd=getDateFromString(timeLine[i].end_date).getTime();for(j=0;j<i;j++){previousStart=getDateFromString(timeLine[j].start_date).getTime();previousEnd=getDateFromString(timeLine[j].end_date).getTime();if((previousStart>currentStart&&previousStart<currentEnd)||(previousEnd>currentStart&&previousEnd<currentEnd)||(previousStart===currentStart&&previousEnd===currentEnd)){if(timeLine[i].height===timeLine[j].height){timeLine[i].height=timeLine[i].height+experienceHeightInc;if(timeLine[i].height>maxBlockHeight){maxBlockHeight=timeLine[i].height;}}}}}
return maxBlockHeight;}})();var temp4=(function(){var paper;var headerObj={name:'',title:''};var colors=["#007eff","#fff","#313843","#dd0083","#313843","#c1b79f","#f9e5e4"];var fonts=["museo-slab","museo-sans","museo-slab"];var style={"fonts":{"title":"museo-slab","content":"museo-sans"},"header":{"header_bg":colors[2],"align":"left","name":{"font":"","fontsize":50,"fontweight":"bold","fontcolor":colors[0]},"title":{"font":"","fontsize":25,"fontweight":"bold","fontcolor":colors[1]},"summary":{"fontsize":16}},"skills":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","skill_fillcolor":"#00adef","skill_emptycolor":"#ddd","skill_fontsize":12},"interests":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22,'showTitle':'hide','marginVertical':1},"languages":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","lang_fontcolor":"#000","lang_fontsize":12,"lang_font":"Verdana"},"awards":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"recomm":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","rec_fontcolor":"#fff","rec_fontsize":18,"rec_font":"Verdana","rec_fill":"#000","recommender_fontsize":20,"recommender_fontcolor":'#ed008c',"recommender_fontweight":"bold","recommender_font":"Verdana"},"timeline":{"title_fontsize":20,"title_fontcolor":"#fff","title_fontweight":"bold","title_font":"Verdana","title_bgcolor":"#999","bg_color":"#ffffff","bg_color_alt":"#F2EEEE","year_color":"#CDC9C9","year_color_alt":"#F0ECEC","colors":["#ed008c","#00adef","#BBCB5F","#fef200"]},"connections":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","bg_color":"#000","conn_fontcolor":"#fef200","conn_fontsize":140,"conn_fontweight":"bold","conn_text_fontcolor":"#fff","conn_text_fontsize":35,"conn_text_fontweight":"bold"}};var jobLegends=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];var educationLegends=["I","II","III","IV","V","VI","VII","VIII","VIX","XX","XXI","XXII","XXIII","XXIV","XXV"];var xAxis;var busyGraphics=false;var arcPath="M100,0C100,27.614,77.614,50,50,50S0,27.614,0,0";var wavePath="M150,0C100,27.614,77.614,50,50,50S0,27.614,0,0";var infographicWidth=960;var infographicHeight=1700;var headerHeight=160;var headerWidth=960;var sectionSpace=80;var timelineStartY=730;var timelineEndY=730;var eduArcMax=200;var workArcMax=200;var infographicMaxHeight;var timelineYears;return{getDefaultColors:function(){return clone(colors);},getDefaultFonts:function(){return clone(fonts);},generate:function(){if(!customizedColors){customizedColors=clone(colors);}
if(!customizedFonts){customizedFonts=clone(fonts);}
var infographicDiv=document.getElementById("infographic");var temp4Div=createDiv('temp4Div');infographicDiv.appendChild(temp4Div);temp4Div.style.backgroundColor=customizedColors[6];handleResponse(vizData);}};function createDiv(id){newdiv=document.createElement('div');newdiv.setAttribute('id',id);return newdiv;}
function drawHeaderDiv(id,json){var div=createDiv('__header');document.getElementById(id).appendChild(div);var paper=new Raphael(div,arcStyle.positioning.header.w,arcStyle.positioning.header.h);var header=paper.rect(arcStyle.positioning.header.x,arcStyle.positioning.header.x,arcStyle.positioning.header.w,arcStyle.positioning.header.h).attr({fill:customizedColors[2],stroke:"none"});headerObj.name=paper.text(arcStyle.positioning.header.name.x,arcStyle.positioning.header.name.y,json.user_info.first_name+" "+json.user_info.last_name).attr({"font-size":arcStyle.positioning.header.name.font_size,fill:customizedColors[0],"text-anchor":"start","font-family":customizedFonts[0]});headerObj.title=paper.text(arcStyle.positioning.header.title.x,arcStyle.positioning.header.title.y+6,trucateText(json.user_info.title,60)).attr({"font-size":arcStyle.positioning.header.title.font_size,fill:customizedColors[1],"text-anchor":"start","font-family":customizedFonts[1]});}
function drawWorkEducationDiv(id,json){timelineStartY=730;timelineEndY=arcStyle.gridLine.height+arcStyle.gridLine.marginTop+sectionSpace;var div=createDiv('__workedu');document.getElementById(id).appendChild(div);var timeline=createDiv('__timeline');div.appendChild(timeline);var paper=new Raphael(timeline,arcStyle.positioning.header.w,arcStyle.gridLine.height+arcStyle.gridLine.marginTop+sectionSpace);arcStyle.gridLine.marginTop=25;paper.image("/media/img/suitcase.png",arcStyle.gridLine.marginLeft-30,arcStyle.gridLine.marginTop,24,24).attr({opacity:0.7});paper.text(arcStyle.gridLine.marginLeft+10,arcStyle.gridLine.marginTop+15,"EMPLOYMENT & EDUCATION").attr({fill:customizedColors[0],"text-anchor":"start","font-size":24,"font-family":customizedFonts[2]});var educationTimeline=json.timeline_education;var workTimeline=json.timeline_work;var timeline_counts=json.counts;var educationStart=0;var educationEnd=0;var workStart=0;var workEnd=0;var timelineStart;var timelineEnd;timelineStart=Math.min(timeline_counts.year_work_began,timeline_counts.year_education_began);timelineEnd=Math.max(timeline_counts.year_work_ended,timeline_counts.year_education_ended);timelineYears=timelineEnd-timelineStart+2;var canvasWidth=infographicWidth-20;var yearWidth=canvasWidth/timelineYears;var dayWidth=yearWidth/365;var timelineYearsArr=[];for(i=0;i<timelineYears;i++){paper.path(["M",(arcStyle.gridLine.marginLeft+yearWidth*i),(arcStyle.gridLine.height+arcStyle.gridLine.marginTop+sectionSpace),"L",(arcStyle.gridLine.marginLeft+yearWidth*i),(arcStyle.gridLine.marginTop+sectionSpace)]).attr(arcStyle.gridLine.verticalAxis);var cursorYearFull=timelineStart+i;var cursorYear=cursorYearFull.toString();cursorYear="'"+cursorYear.substring(2,cursorYear.length);if((timelineStart+i)<(timelineEnd+1)){paper.text((arcStyle.gridLine.marginLeft+2+yearWidth*i),(arcStyle.gridLine.height/2+12+arcStyle.gridLine.marginTop+sectionSpace),cursorYear).attr({"text-anchor":"start","font-size":16,fill:customizedColors[0]});}
timelineYearsArr.push(cursorYearFull);}
xAxis=paper.path(["M",arcStyle.gridLine.marginLeft,(arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop+sectionSpace),"L",(arcStyle.gridLine.marginLeft+yearWidth*(timelineYears-1)),(arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop+sectionSpace)]).attr(arcStyle.gridLine.horizontalAxis);addWorkTimeline(dayWidth,yearWidth,timelineYearsArr,workTimeline,paper);addEducationTimeline(dayWidth,yearWidth,timelineYearsArr,educationTimeline,paper);paper.setSize(infographicWidth,timelineEndY);var legend=createDiv('__legend');div.appendChild(legend);paper=new Raphael(legend,arcStyle.positioning.header.w,arcStyle.positioning.header.h);timelineStartY=40;timelineEndY=0;var height=addLegends(workTimeline,educationTimeline,paper);paper.setSize(infographicWidth,height);}
function drawSkillsDiv(id,json){var div=createDiv('__skills');document.getElementById(id).appendChild(div);timelineEndY=0;var paper=new Raphael(div,arcStyle.positioning.header.w,40+230+40);addSkills(json.skills,paper);}
function drawExtraDiv(id,json){var div=createDiv('__extra');document.getElementById(id).appendChild(div);timelineEndY=0;var height=0;var displayed=false;var paper;if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){height=(vizData.recommendations.length===1)?300:Math.min(vizData.recommendations.length,3)*120;height=Math.max(425,height);paper=new Raphael(div,arcStyle.positioning.header.w,height+25);addRecommendations(json.recommendations,paper);displayed=true;}else if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){height=120+(Math.min(vizData.languages.length,4)*40);height=Math.max(425,height);paper=new Raphael(div,arcStyle.positioning.header.w,height+25);addLanguages(json.languages,paper);displayed=true;}else if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){height=90+(Math.min(vizData.interests.length,4)*80);height=Math.max(425,height);paper=new Raphael(div,arcStyle.positioning.header.w,height+25);addInterests(json.interests,paper);displayed=true;}
if(displayed){addConnections(json.counts.connections,paper);}}
function isBetweenRange(value,rangeMin,rangeMax){return(value>=rangeMin&&value<=rangeMax);}
function isOverlap(box1,box2){return(isBetweenRange(box1.x,box2.x,box2.x+box2.width)||isBetweenRange(box1.x+box1.width,box2.x,box2.x+box2.width))&&(isBetweenRange(box1.y,box2.y,box2.y+box2.height)||isBetweenRange(box1.y+box1.height,box2.y,box2.y+box2.height));}
function drawSkillTitle(el){var titleDiv=Viz.createTag('div','title');root=(typeof el==="string")?document.getElementById(el):el;root.appendChild(titleDiv);timelineEndY=-40;var titlePaper=new Raphael(titleDiv,arcStyle.positioning.header.w,30);var skillsTitleIcon=titlePaper.path("M26.834,14.693c1.816-2.088,2.181-4.938,1.193-7.334l-3.646,4.252l-3.594-0.699L19.596,7.45l3.637-4.242c-2.502-0.63-5.258,0.13-7.066,2.21c-1.907,2.193-2.219,5.229-1.039,7.693L5.624,24.04c-1.011,1.162-0.888,2.924,0.274,3.935c1.162,1.01,2.924,0.888,3.935-0.274l9.493-10.918C21.939,17.625,24.918,16.896,26.834,14.693z");skillsTitleIcon.attr({fill:arcStyle.positioning.skills.fill,opacity:arcStyle.positioning.skills.opacity});skillsTitleIcon.translate(arcStyle.gridLine.marginLeft-36,timelineEndY+40).scale(0.8,0.8).rotate(300);var skillsTitle=titlePaper.text(arcStyle.gridLine.marginLeft,timelineEndY+55,"SKILLS & SPECIALTIES").attr({"text-anchor":"start",fill:customizedColors[0],"font-size":24,"font-family":customizedFonts[2]});}
function drawRecommendationTitle(el){var titleDiv=Viz.createTag('div','title');root=(typeof el==="string")?document.getElementById(el):el;root.appendChild(titleDiv);root.style.marginTop='48px';timelineEndY=-30;var titlePaper=new Raphael(titleDiv,arcStyle.positioning.header.w,30);var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=titlePaper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=titlePaper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"RECOMMENDATIONS").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});}
function drawLanguageTitle(el){var titleDiv=Viz.createTag('div','title');root=(typeof el==="string")?document.getElementById(el):el;root.appendChild(titleDiv);root.style.marginTop='48px';timelineEndY=-30;var titlePaper=new Raphael(titleDiv,arcStyle.positioning.header.w,30);var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=titlePaper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=titlePaper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"LANGUAGES").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});}
function drawInterestTitle(el){var titleDiv=Viz.createTag('div','title');root=(typeof el==="string")?document.getElementById(el):el;root.appendChild(titleDiv);root.style.marginTop='48px';timelineEndY=-30;var titlePaper=new Raphael(titleDiv,arcStyle.positioning.header.w,30);var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=titlePaper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=titlePaper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"INTERESTS").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});}
function handleResponse(json){var timelineEndY=730;var userInfo=json.user_info;Viz.widgets.header("temp4Div",userInfo,style.header);drawWorkEducationDiv('temp4Div',json);if(customizedSections.skills){var skillDiv=Viz.createTag('div','__skills');document.getElementById('temp4Div').appendChild(skillDiv);skillDiv.style.marginTop='48px';var skillStyle={'titleStyle':{'fill':customizedColors[0],'font-family':customizedFonts[0]},'textStyle':{'fill':Viz.isTooLight(customizedColors[6])?'black':customizedColors[1],'font-family':customizedFonts[1]},'labelStyle':{'fill':'black','font-family':customizedFonts[1]},'legendStyle':{'fill':'black'},'circleStyle':{'fill':customizedColors[3]},'backgroundStyle':{'fill':'none'},'newId':'chart','type':'lola','legendPosition':'right','marginVertical':12,'paddingVertical':12,'showTitle':'hide'};drawSkillTitle(skillDiv);Viz.widgets.skillChart(skillDiv,vizData.skills,skillStyle);}
if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){var interestDiv=Viz.createTag('div','__interest');document.getElementById('temp4Div').appendChild(interestDiv);drawInterestTitle(interestDiv);Viz.widgets.drawInterests(interestDiv,Viz.stripHidden(vizData.interests),style.interests);}
if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){var langDiv=Viz.createTag('div','__language');document.getElementById('temp4Div').appendChild(langDiv);var langStyle={showTitle:'hide',legendAlign:'left',marginVertical:1,marginHorizontal:24};drawLanguageTitle(langDiv);Viz.widgets.languageChart(langDiv,Viz.stripHidden(vizData.languages),langStyle);}
if(customizedSections.awards&&vizData.awards&&vizData.awards.length>0){var awardDiv=Viz.createTag('div','__award');document.getElementById('temp4Div').appendChild(awardDiv);Viz.widgets.drawAwards(awardDiv,Viz.stripHidden(vizData.awards),style.awards);}
if(customizedSections.myStats&&vizData.mystats&&vizData.mystats.length>0){var statDiv=Viz.createTag('div','__mystat');document.getElementById('temp4Div').appendChild(statDiv);var statStyle={'titleFont':customizedFonts[1],'titleColor':'black','textFont':customizedFonts[2],'textColor':'black','numberFont':customizedFonts[2],'numberColor':customizedColors[3],'iconColor':customizedColors[2]};Viz.widgets.myStatChart(statDiv,Viz.stripHidden(vizData.mystats),vizData.counts,statStyle);}
if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){var recDiv=Viz.createTag('div','__recommendation');document.getElementById('temp4Div').appendChild(recDiv);var recStyle={showTitle:'hide',legendAlign:'left','marginVertical':1,'paddingVertical':1,marginHorizontal:24};drawRecommendationTitle(recDiv);Viz.widgets.drawRecommendations(recDiv,Viz.stripHidden(vizData.recommendations),recStyle);}}
function addEducationTimeline(dayWidth,yearWidth,timelineYearsArr,workTimeline,paper){var educationLegendPositions=[];var workTimelineYearsCount=workTimeline.length;var workTimeline2=clone(workTimeline);var reversedWork=workTimeline2.reverse();var orderedJobs=[];var jobStartDate,jobEndDate,maxHeight=(arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop+sectionSpace);var i=0;for(i=0;i<workTimelineYearsCount;i++){jobStartDate=getDateFromString(reversedWork[i].start_date);jobEndDate=getDateFromString(reversedWork[i].end_date);var jobDays=days_between(jobStartDate,jobEndDate);orderedJobs.push({'id':i,'count':jobDays});}
orderedJobs.sort(sortTimeline);var workPaths=paper.set();var jobYears;for(i=0;i<workTimelineYearsCount;i++){jobStartDate=getDateFromString(reversedWork[i].start_date);var jobStartYear=jobStartDate.getFullYear();jobEndDate=getDateFromString(reversedWork[i].end_date);var jobEndYear=jobEndDate.getFullYear();jobYears=jobEndYear-jobStartYear;var dateRefStart1=new Date();dateRefStart1.setFullYear(jobStartYear,0,1);var dateRefEnd1=new Date();dateRefEnd1.setFullYear((jobStartYear+1),0,1);var coundDaysInStartYear=days_between(dateRefStart1,dateRefEnd1);var dateRefStart2=new Date();dateRefStart2.setFullYear(jobEndYear,0,1);var dateRefEnd2=new Date();dateRefEnd2.setFullYear((jobEndYear+1),0,1);var coundDaysInEndYear=days_between(dateRefStart2,dateRefEnd2);var countJobDays=days_between(jobStartDate,jobEndDate);var cursorStart,cursorEnd;for(j=0;j<timelineYearsArr.length;j++){if(jobStartYear===timelineYearsArr[j]){cursorStart=yearWidth*j;}}
for(j=0;j<timelineYearsArr.length;j++){if(jobEndYear===timelineYearsArr[j]){cursorEnd=yearWidth*j;}}
var daysBeforeStart=days_between(dateRefStart1,jobStartDate);var timePast=Math.round(100/(coundDaysInStartYear/daysBeforeStart))*0.01;var randRGB="#"+Math.round(0xdddddd*Math.random()).toString(16);var thePath,pathX,pathY,maxPathWidth,scaleTest,newPathX,newPathY,newPathH;if(timelineYears/jobYears>2){thePath=paper.path(arcPath).attr({stroke:"none"}).translate(50+cursorStart,arcStyle.gridLine.height/2).scale(1,1);thePath.translate(timePast*yearWidth,arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop-thePath.getBBox().y-thePath.getBBox().width/2+sectionSpace);pathX=thePath.getBBox().x;pathY=thePath.getBBox().y;thePath.scale(0.01,0.01);maxPathWidth=countJobDays*dayWidth;if(countJobDays*dayWidth<100){maxPathWidth+=30;}
scaleTest=0;while(thePath.getBBox().width<maxPathWidth){thePath.scale(0.01+scaleTest,0.01+scaleTest);scaleTest=scaleTest+0.03;}
newPathX=thePath.getBBox().x;newPathY=thePath.getBBox().y;newPathH=thePath.getBBox().height;thePath.attr({translation:(pathX-newPathX)+','+(newPathY-pathY+newPathH+22)});}else{thePath=paper.path(wavePath).attr({stroke:"none"}).translate(50+cursorStart,arcStyle.gridLine.height/2).scale(1,1);thePath.translate(timePast*yearWidth,arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop-thePath.getBBox().y-thePath.getBBox().width/2+sectionSpace+25);pathX=thePath.getBBox().x;pathY=thePath.getBBox().y;thePath.scale(0.01,0.01);maxPathWidth=countJobDays*dayWidth;scaleTest=0;while(thePath.getBBox().width<maxPathWidth){thePath.scale(0.01+scaleTest,0.01+scaleTest);scaleTest=scaleTest+0.03;}
newPathX=thePath.getBBox().x;newPathY=thePath.getBBox().y;newPathH=thePath.getBBox().height;thePath.attr({translation:(pathX-newPathX)+','+(newPathY-pathY+newPathH+22)});}
workPaths.push(thePath);var tipText=getEducationToolTip(reversedWork[i]);drawTooltip(thePath.node,tipText,'bottom center');var educationTitleX=thePath.getBBox().x+(thePath.getBBox().width/2)-4;var educationTitleY=thePath.getBBox().y+(thePath.getBBox().height/2);var pos={"x":educationTitleX,"y":educationTitleY};educationLegendPositions.push(pos);maxHeight=Math.max(maxHeight,thePath.getBBox().y+thePath.getBBox().height);}
var countWorkPaths=workPaths.length;if(countWorkPaths===1){workPaths[orderedJobs[0].id].attr({fill:customizedColors[5],opacity:0.7});}
if(countWorkPaths===2){workPaths[orderedJobs[0].id].attr({fill:customizedColors[5],opacity:0.7});workPaths[orderedJobs[1].id].attr({fill:customizedColors[3],opacity:0.7});}
if(countWorkPaths>2){for(i=0;i<countWorkPaths;i++){if(i<countWorkPaths/3){workPaths[orderedJobs[i].id].attr({fill:customizedColors[5],opacity:0.7});}else if(i<=countWorkPaths/1.5){workPaths[orderedJobs[i].id].attr({fill:customizedColors[3],opacity:0.7}).toFront();}else{workPaths[orderedJobs[i].id].attr({fill:customizedColors[4],opacity:0.7}).toFront();}}}
for(i=0;i<countWorkPaths;i++){paper.text(educationLegendPositions[i].x,educationLegendPositions[i].y,educationLegends[countWorkPaths-i-1]).attr({fill:"#fff","text-anchor":"start","font-size":16,"font-family":customizedFonts[2]});}
timelineEndY=maxHeight+26;}
function addWorkTimeline(dayWidth,yearWidth,timelineYearsArr,workTimeline,paper){var deadReckoning=25;var jobLegendPositions=[];var workTimelineYearsCount=workTimeline.length;var workTimeline2=clone(workTimeline);var reversedWork=workTimeline2.reverse();var orderedJobs=[];var conjoint=[];var conjointTip=[];var conjointPath=[];var jobStartDate,jobEndDate;var i=0;var j=0;for(i=0;i<workTimelineYearsCount;i++){jobStartDate=getDateFromString(reversedWork[i].start_date);jobEndDate=getDateFromString(reversedWork[i].end_date);var jobDays=days_between(jobStartDate,jobEndDate);orderedJobs.push({'id':i,'count':jobDays});}
var jobYears;orderedJobs.sort(sortTimeline);var workPaths=paper.set();var tipTexts=[];for(i=0;i<workTimelineYearsCount;i++){jobStartDate=getDateFromString(reversedWork[i].start_date);var jobStartYear=jobStartDate.getFullYear();jobEndDate=getDateFromString(reversedWork[i].end_date);var jobEndYear=jobEndDate.getFullYear();jobYears=jobEndYear-jobStartYear;var dateRefStart1=new Date();dateRefStart1.setFullYear(jobStartYear,0,1);var dateRefEnd1=new Date();dateRefEnd1.setFullYear((jobStartYear+1),0,1);var coundDaysInStartYear=days_between(dateRefStart1,dateRefEnd1);var dateRefStart2=new Date();dateRefStart2.setFullYear(jobEndYear,0,1);var dateRefEnd2=new Date();dateRefEnd2.setFullYear((jobEndYear+1),0,1);var coundDaysInEndYear=days_between(dateRefStart2,dateRefEnd2);var countJobDays=days_between(jobStartDate,jobEndDate);var cursorStart,cursorEnd;for(j=0;j<timelineYearsArr.length;j++){if(jobStartYear===timelineYearsArr[j]){cursorStart=yearWidth*j;}}
for(j=0;j<timelineYearsArr.length;j++){if(jobEndYear===timelineYearsArr[j]){cursorEnd=yearWidth*j;}}
var daysBeforeStart=days_between(dateRefStart1,jobStartDate);var timePast=Math.round(100/(coundDaysInStartYear/daysBeforeStart))*0.01;var thePath,pathX,pathY,maxPathWidth,scaleTest,newPathX,newPathY;if(timelineYears/jobYears>2){thePath=paper.path(arcPath).attr({stroke:"none"}).translate(50+cursorStart,arcStyle.gridLine.height/2).rotate(180).scale(1,1);thePath.translate(timePast*yearWidth,arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop-thePath.getBBox().y-thePath.getBBox().width/2+sectionSpace);pathX=thePath.getBBox().x;pathY=thePath.getBBox().y;thePath.scale(0.01,0.01);maxPathWidth=countJobDays*dayWidth;if(countJobDays*dayWidth<100){maxPathWidth+=30;}
scaleTest=0;while(thePath.getBBox().width<maxPathWidth){thePath.scale(0.01+scaleTest,0.01+scaleTest);scaleTest=scaleTest+0.03;}
newPathX=thePath.getBBox().x;newPathY=thePath.getBBox().y;thePath.attr({translation:(pathX-newPathX)+','+(newPathY-pathY)});}else{thePath=paper.path(wavePath).attr({stroke:"none"}).translate(50+cursorStart,arcStyle.gridLine.height/2).rotate(180).scale(1,1);thePath.translate(timePast*yearWidth,arcStyle.gridLine.height/2+arcStyle.gridLine.marginTop-thePath.getBBox().y-thePath.getBBox().width/2+sectionSpace-20);pathX=thePath.getBBox().x;pathY=thePath.getBBox().y;thePath.scale(0.01,0.01);maxPathWidth=countJobDays*dayWidth;scaleTest=0;while(thePath.getBBox().width<maxPathWidth){thePath.scale(0.01+scaleTest,0.01+scaleTest);scaleTest=scaleTest+0.03;}
newPathX=thePath.getBBox().x;newPathY=thePath.getBBox().y;thePath.attr({translation:(pathX-newPathX)+','+(newPathY-pathY+45)});}
var tipText=getExperienceToolTip(reversedWork[i]);workPaths.push(thePath);tipTexts.push(tipText);var jobTitleX=thePath.getBBox().x+(thePath.getBBox().width/2);var jobTitleY=thePath.getBBox().y+(thePath.getBBox().height/2);var pos={"x":jobTitleX,"y":jobTitleY};jobLegendPositions.push(pos);}
var countWorkPaths=workPaths.length;if(countWorkPaths===1){workPaths[orderedJobs[0].id].attr({fill:customizedColors[5]});}
if(countWorkPaths===2){workPaths[orderedJobs[0].id].attr({fill:customizedColors[5]});workPaths[orderedJobs[1].id].attr({fill:customizedColors[3]});}
if(countWorkPaths>2){for(i=0;i<countWorkPaths;i++){var newFill;if(i<countWorkPaths/3){newFill=customizedColors[5];}else if(i<=countWorkPaths/1.5){newFill=customizedColors[3];}else{newFill=customizedColors[4];}
workPaths[orderedJobs[i].id].attr({fill:newFill,opacity:0.7,stroke:"none"}).toFront();}}
for(i=0;i<countWorkPaths;i++){var placeQTip=true;var workLabel=paper.text(jobLegendPositions[i].x,jobLegendPositions[i].y,jobLegends[countWorkPaths-i-1]).attr({fill:"#fff","text-anchor":"middle","font-size":16,"font-family":customizedFonts[2]});for(j=0;j<countWorkPaths;j++){if(j!==i){if(isOverlap(workLabel.getBBox(),workPaths[j].getBBox())){if(isBetweenRange(workPaths[i].getBBox().x,workPaths[j].getBBox().x-deadReckoning,workPaths[j].getBBox().x+deadReckoning)&&isBetweenRange(workPaths[i].getBBox().width,workPaths[j].getBBox().width-deadReckoning,workPaths[j].getBBox().width+deadReckoning)){if(conjoint[j]){conjoint[j].push(jobLegends[countWorkPaths-i-1]);conjointTip[j].push(tipTexts[i]);conjointPath[j].push(workPaths[i]);}else{conjoint[i]=[jobLegends[countWorkPaths-i-1]];conjointTip[i]=[tipTexts[i]];conjointPath[i]=[workPaths[i]];}
workLabel.remove();}}}}
if(placeQTip){drawTooltip(workPaths[i].node,tipTexts[i],'top center');}}
for(i in conjoint){if(conjoint.hasOwnProperty(i)){var text=conjoint[i].join('');var tip=conjointTip[i].join('<br /><br />');var label=paper.text(jobLegendPositions[i].x,jobLegendPositions[i].y,text).attr({fill:"#fff","text-anchor":"middle","font-size":16,"font-family":customizedFonts[2]});drawTooltip(label.node,tip,'top center');for(j in conjointPath){if(conjointPath.hasOwnProperty(j)){drawTooltip(conjointPath[j].node,tip,'top center');}}}}}
function addLegends(workTimeline,educationTimeline,paper){var workTimelineYearsCount=workTimeline.length;var eduTimelineYearsCount=educationTimeline.length;var height;var title;var k=0;for(i=workTimelineYearsCount;i>0;i--){var workTitle=(workTimeline[workTimelineYearsCount-i].position?workTimeline[workTimelineYearsCount-i].position:'')+(workTimeline[workTimelineYearsCount-i].company?" @ "+workTimeline[workTimelineYearsCount-i].company:'');paper.text(arcStyle.gridLine.marginLeft,timelineStartY+(k*25),jobLegends[workTimelineYearsCount-i]+". ").attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();if(workTitle.length>50){var workLines=Math.ceil(workTitle.length/50);title=paper.text(arcStyle.gridLine.marginLeft+20,timelineStartY+10+(k*25),workTitle.wordWrap(40,"\n",1)).attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();k=k+workLines;}else{title=paper.text(arcStyle.gridLine.marginLeft+20,timelineStartY+(k*25),workTitle).attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();k++;}}
var j=0;for(i=eduTimelineYearsCount;i>0;i--){var eduTitle=(educationTimeline[eduTimelineYearsCount-i].degree?educationTimeline[eduTimelineYearsCount-i].degree:'')+(educationTimeline[eduTimelineYearsCount-i].school?' @ '+educationTimeline[eduTimelineYearsCount-i].school:'');paper.text(arcStyle.gridLine.marginLeft+500,timelineStartY+(j*25),educationLegends[eduTimelineYearsCount-i]+". ").attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();if(eduTitle.length>40){var eduLines=Math.ceil(eduTitle.length/40);title=paper.text(arcStyle.gridLine.marginLeft+530,timelineStartY+10+(j*25),eduTitle.wordWrap(40,"\n",1)).attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();j=j+eduLines;}else{title=paper.text(arcStyle.gridLine.marginLeft+530,timelineStartY+(j*25),eduTitle).attr({fill:"#000","text-anchor":"start","font-size":18,"font-family":customizedFonts[2]}).toFront();j++;}}
if(k>j){height=k*25+50;}else{height=j*25+50;}
paper.rect(arcStyle.positioning.timeline.legend.x,timelineStartY-40,arcStyle.positioning.timeline.legend.w,height).attr({fill:customizedColors[5],stroke:"none"}).toBack();timelineEndY=timelineStartY-40+height;return height;}
function addSkills(skills,paper){var countSkills=skills.length;if(countSkills>0){var skillsTitleIcon=paper.path("M26.834,14.693c1.816-2.088,2.181-4.938,1.193-7.334l-3.646,4.252l-3.594-0.699L19.596,7.45l3.637-4.242c-2.502-0.63-5.258,0.13-7.066,2.21c-1.907,2.193-2.219,5.229-1.039,7.693L5.624,24.04c-1.011,1.162-0.888,2.924,0.274,3.935c1.162,1.01,2.924,0.888,3.935-0.274l9.493-10.918C21.939,17.625,24.918,16.896,26.834,14.693z");skillsTitleIcon.attr({fill:arcStyle.positioning.skills.fill,opacity:arcStyle.positioning.skills.opacity});skillsTitleIcon.translate(arcStyle.gridLine.marginLeft-36,timelineEndY+40).scale(0.8,0.8).rotate(300);var skillsTitle=paper.text(arcStyle.gridLine.marginLeft,timelineEndY+55,"SKILLS & SPECIALTIES").attr({"text-anchor":"start",fill:customizedColors[0],"font-size":24,"font-family":customizedFonts[2]});countSkills=Math.min(countSkills,6);for(i=0;i<countSkills;i++){var skillBack=paper.circle(100+i*135,timelineEndY+40+140,65);skillBack.attr({"fill":customizedColors[2],"stroke":"none","opacity":0.9});drawTooltip(skillBack.node,getSkillsTooltip(skills[i]));var skillName=skills[i].name;if(skillName.length>12){var skillArr=[];skillArr=skillName.split(' ');var newSkillName='';for(j=0;j<skillArr.length;j++){newSkillName=newSkillName+skillArr[j]+'\n';}
skillName=newSkillName;}
var skillYears=(skills[i].years)?(skills[i].years+"+ years"):"";var skillText=paper.text(100+i*135,timelineEndY+40+140,skillName).attr({"font-size":15,"font-family":customizedFonts[2],fill:customizedColors[1],stroke:"none"});drawTooltip(skillText.node,getSkillsTooltip(skills[i]));var skillPro=paper.text(100+i*135,timelineEndY+40+230,(skills[i].proficiency||" ")+"\n"+skillYears).attr({"font-size":15,"font-family":customizedFonts[2],fill:customizedColors[3],stroke:"none","opacity":0.9});}
timelineEndY=timelineEndY+40+230+40;}}
function addRecommendations(rec,paper){var countRecs=rec.length;if(countRecs>0){var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=paper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=paper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"RECOMMENDATIONS").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});var recBackPath="M576.667,46.208c0,4.12-5.372,7.459-12,7.459H12c-6.627,0-12-3.34-12-7.459V7.459C0,3.339,5.373,0,12,0h552.667c6.628,0,12,3.339,12,7.459V46.208z M28.135,53.667l24.631,22.259l-6.961-22.259";countRecs=Math.min(countRecs,3);for(i=0;i<countRecs;i++){var recBack=paper.path(recBackPath).attr({"fill":customizedColors[2],"stroke":customizedColors[2],"stroke-width":3,"stroke-opacity":0.5}).scale(1,0.7).translate(40,timelineEndY+60+i*100+10);drawTooltip(recBack.node,rec[i].content.recommendationText);var recBackShadow=paper.path(recBackPath).attr(arcStyle.recommendations.bubbleShadow).scale(1,0.7).translate(44,timelineEndY+64+i*100+10);drawTooltip(recBackShadow.node,rec[i].content.recommendationText);var rectTextString=rec[i].content.recommendationText;if(rectTextString.length>85){rectTextString=rectTextString.substring(0,85)+'\n'+(rectTextString.substring(85,160)+'...').replace(new RegExp("\\n","g")," ");}
var displayText=getWrappedText(clone(rec[i].content.recommendationText),200,80,2);var displayRecText=paper.text(50,timelineEndY+100+i*100,displayText).attr({fill:customizedColors[1],"text-anchor":"start","font-size":13,"font-family":customizedFonts[2]});drawTooltip(displayRecText.node,rec[i].content.recommendationText);if(typeof(rec[i].content.recommender)==='object'){var recAuthor=rec[i].content.recommender.firstName+' '+rec[i].content.recommender.lastName;var recAuthorText=paper.text(105,timelineEndY+140+i*100,recAuthor).attr({fill:customizedColors[3],"text-anchor":"start","font-size":16,"font-family":customizedFonts[2]});}}}
infographicMaxHeight=timelineEndY+140+200;}
function addLanguages(languages,paper){var countLang=languages.length;if(countLang>0){var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=paper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=paper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"LANGUAGES").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});var recBackPath="M499,51.44c0,4.971-4.889,9-10.92,9H91.24c-6.031,0-10.92-4.029-10.92-9V0.209c0-4.971,4.889-9,10.92-9h396.84c6.031,0,10.92,4.029,10.92,9V51.44z";countLang=Math.min(countLang,4);for(i=0;i<countLang;i++){var recBack=paper.path(recBackPath).attr({"fill":customizedColors[2],"stroke":customizedColors[2],"stroke-width":3,"stroke-opacity":0.5}).scale(1,0.7).translate(40,timelineEndY+80+i*80+10);var langTextString=languages[i].name;if(langTextString.length>35){langTextString=langTextString.substring(0,35)+' ...';}
paper.text(320,timelineEndY+115+i*80,langTextString).attr({fill:customizedColors[1],"text-anchor":"middle","font-size":18,"font-family":customizedFonts[2]});}
infographicMaxHeight=timelineEndY+140+200;}}
function addInterests(interests,paper){var countLang=interests.length;var recIconPath="M15.985,5.972c-7.563,0-13.695,4.077-13.695,9.106c0,2.877,2.013,5.44,5.147,7.108c-0.446,1.479-1.336,3.117-3.056,4.566c0,0,4.015-0.266,6.851-3.143c0.163,0.04,0.332,0.07,0.497,0.107c-0.155-0.462-0.246-0.943-0.246-1.443c0-3.393,3.776-6.05,8.599-6.05c3.464,0,6.379,1.376,7.751,3.406c1.168-1.34,1.847-2.892,1.847-4.552C29.68,10.049,23.548,5.972,15.985,5.972zM27.68,22.274c0-2.79-3.401-5.053-7.599-5.053c-4.196,0-7.599,2.263-7.599,5.053c0,2.791,3.403,5.053,7.599,5.053c0.929,0,1.814-0.116,2.637-0.319c1.573,1.597,3.801,1.744,3.801,1.744c-0.954-0.804-1.447-1.713-1.695-2.534C26.562,25.293,27.68,23.871,27.68,22.274z";var recIcon=paper.path(recIconPath).attr(arcStyle.recommendations.icon).scale(1,1.2).translate(arcStyle.gridLine.marginLeft-30,timelineEndY+20+10);var recText=paper.text(arcStyle.gridLine.marginLeft+15,timelineEndY+38+10,"INTERESTS").attr({"font-size":24,"font-family":customizedFonts[2],fill:customizedColors[0],"text-anchor":"start"});if(countLang>0){var recBackPath="M499,51.44c0,4.971-4.889,9-10.92,9H91.24c-6.031,0-10.92-4.029-10.92-9V0.209c0-4.971,4.889-9,10.92-9h396.84c6.031,0,10.92,4.029,10.92,9V51.44z";countLang=Math.min(countLang,4);for(i=0;i<countLang;i++){if(interests[i]){var recBack=paper.path(recBackPath).attr({"fill":customizedColors[2],"stroke":customizedColors[2],"stroke-width":3,"stroke-opacity":0.5}).scale(1,0.7).translate(40,timelineEndY+80+i*80+10);var langTextString=interests[i].name;if(langTextString.length>35){langTextString=langTextString.substring(0,35)+' ...';}
paper.text(320,timelineEndY+115+i*80,langTextString).attr({fill:customizedColors[1],"text-anchor":"middle","font-size":18,"font-family":customizedFonts[2]});}}
infographicMaxHeight=timelineEndY+140+200;}}
function addConnections(count,paper){var countBackPath="M26,51.875c-1.103,0-2.085-1.22-3.035-2.4c-0.864-1.073-1.68-2.086-2.63-2.34c-0.186-0.05-0.393-0.075-0.613-0.075c-0.886,0-1.938,0.404-2.954,0.795c-0.983,0.378-2,0.769-2.819,0.769c-0.352,0-0.643-0.07-0.891-0.213c-0.924-0.535-1.163-2.062-1.393-3.539c-0.206-1.322-0.419-2.689-1.134-3.404c-0.716-0.716-2.084-0.929-3.408-1.136c-1.476-0.23-3.001-0.468-3.535-1.391c-0.523-0.903,0.025-2.33,0.556-3.709c0.486-1.263,0.988-2.568,0.72-3.567c-0.254-0.951-1.268-1.768-2.342-2.633C1.344,28.083,0.125,27.101,0.125,26s1.219-2.083,2.398-3.032c1.074-0.865,2.088-1.682,2.342-2.633c0.268-0.999-0.234-2.304-0.72-3.567c-0.53-1.379-1.079-2.806-0.556-3.709c0.534-0.923,2.06-1.161,3.535-1.391c1.323-0.207,2.692-0.42,3.408-1.136s0.929-2.084,1.136-3.407c0.23-1.476,0.468-3.001,1.391-3.536c0.248-0.144,0.539-0.213,0.891-0.213c0.818,0,1.835,0.391,2.818,0.769c1.017,0.391,2.069,0.795,2.955,0.795c0.22,0,0.427-0.025,0.613-0.075c0.951-0.254,1.768-1.268,2.633-2.342C23.917,1.344,24.899,0.125,26,0.125s2.083,1.219,3.032,2.398c0.865,1.074,1.682,2.088,2.633,2.342c0.187,0.05,0.393,0.075,0.613,0.075c0.886,0,1.938-0.404,2.955-0.795c0.983-0.378,2-0.769,2.819-0.769c0.351,0,0.642,0.07,0.89,0.213c0.922,0.534,1.161,2.061,1.391,3.536c0.206,1.323,0.42,2.692,1.136,3.407c0.715,0.716,2.083,0.929,3.405,1.136c1.476,0.231,3.002,0.469,3.536,1.393c0.523,0.903-0.025,2.33-0.555,3.708c-0.485,1.262-0.987,2.567-0.719,3.566c0.254,0.951,1.268,1.768,2.341,2.633c1.178,0.949,2.397,1.931,2.397,3.032s-1.219,2.083-2.398,3.033c-1.073,0.864-2.087,1.681-2.341,2.632c-0.267,0.999,0.235,2.303,0.72,3.565c0.53,1.38,1.079,2.807,0.556,3.711c-0.534,0.923-2.06,1.161-3.535,1.391c-1.323,0.207-2.692,0.42-3.408,1.136c-0.714,0.715-0.928,2.083-1.134,3.404c-0.23,1.477-0.469,3.004-1.393,3.539c-0.248,0.144-0.539,0.213-0.891,0.213c-0.819,0-1.835-0.391-2.819-0.77c-1.017-0.391-2.067-0.795-2.953-0.795c-0.22,0-0.426,0.025-0.612,0.075c-0.951,0.254-1.768,1.268-2.633,2.342C28.083,50.656,27.101,51.875,26,51.875L26,51.875z";var countBack=paper.path(countBackPath);countBack.attr({"fill":customizedColors[2],"stroke":"none"}).translate(780,timelineEndY+150).scale(4,4);countText=paper.text(812,timelineEndY+150+15,count+"+").attr({fill:customizedColors[0],"font-size":58,"font-family":customizedFonts[2]});var countTitle=paper.text(812,timelineEndY+150+15+40,"CONNECTIONS").attr({fill:customizedColors[1],"font-size":18,"font-family":customizedFonts[2]});}
function resizeCanvas(){paper.setSize(infographicWidth,infographicMaxHeight+100);paper.rect(0,0,960,infographicMaxHeight+100).attr({stroke:"none",fill:customizedColors[6]}).toBack();}
function days_between(a,b){var c=a.getTime(),d=b.getTime();return Math.round(Math.abs(c-d)/864E5);}
function sortTimeline(a,b){return b.count-a.count;}}());String.prototype.wordWrap=function(m,b,c){var i,j,l,s,r;if(m<1){return this;}
for(i=-1,l=(r=this.split("\n")).length;++i<l;r[i]+=s){for(s=r[i],r[i]="";s.length>m;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:"")){j=c===2||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||(c===1&&m)||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;}}
return r.join("\n");};var temp4Style={"fonts":{"title":"museo-slab","content":"Familar Pro Bold"},"colors":{"title":"#007eff","content":"#fff","arc_pink":"#dd0083","arc_dimGray":"#313843","arc_beige":"#c1b79f"},"positioning":{"header":{"x":0,"y":0,"w":960,"h":134,"name":{"x":34,"y":48,"w":864,"h":40,"font_size":56},"title":{"x":34,"y":88,"w":864,"h":20,"font_size":27}},"timeline":{"icon":{"x":34,"y":208,"w":40,"h":40},"title":{"x":80,"y":214,"w":816,"h":22,"font_size":30},"legend":{"x":0,"y":768,"w":960,"h":240,"font_size":18,"work":{"x":80,"y":800,"w":505,"h":166,"text_align":"left"},"education":{"x":616,"y":800,"w":282,"h":166,"text_align":"right"}}},"skills":{"fill":"#313843","opacity":0.8,"back":{"fill":"#313843","stroke":"none","opacity":0.9},"textStyle":{"fill":"#FFF","font-family":"museo-slab","font-size":15},"proficiency":{"fill":"#dd0083","font-family":"museo-slab","font-size":15}},"icon":{"x":34,"y":1056,"w":40,"h":40},"title":{"x":80,"y":1062,"w":816,"h":22,"font_size":30}},"vanity":{"x":0,"y":1344,"w":960,"h":528,"recommendations":{"comment_font_size":18,"recommender_font_size":24},"conections":{"num_font_size":88,"connections_font_size":24}},"footer":{"x":0,"y":1872,"w":960,"h":128,"font_size":16,"logo":{"x":768,"y":1952}},gridLine:{marginTop:80,marginLeft:50,height:400,horizontalAxis:{stroke:"#000","stroke-width":2,opacity:0.5},verticalAxis:{stroke:"#FFF"}},recommendations:{"title":{"fill":"#007eff","text-anchor":"start","font-size":16,"font-family":"museo-slab"},"icon":{"fill":"#313843","stroke":"none","opacity":0.8},"bubbleBack":{"fill":"#313843","stroke":"#313843","stroke-width":3,"stroke-opacity":0.5},"bubbleShadow":{"fill":"#313843","stroke":"#313843","stroke-width":3,"stroke-opacity":0.5,"opacity":0.3},"commentStyle":{fill:"#FFF","text-anchor":"start","font-size":13,"font-family":"museo-slab"},"author":{"fill":"#dd0083","text-anchor":"start","font-size":16,"font-family":"museo-slab"}},connections:{"title":{"fill":"#fff","font-size":18,"font-family":"museo-slab"},"countText":{"fill":"#007eff","font-size":58,"font-family":"museo-slab"},"countBack":{"fill":"#313843","stroke":"none"}}};var arcStyle={"fonts":{"title":"museo-slab","content":"Familar Pro Bold"},"colors":{"title":"#007eff","content":"#fff","arc_pink":"#dd0083","arc_dimGray":"#313843","arc_beige":"#c1b79f"},"positioning":{"header":{"x":0,"y":0,"w":960,"h":120,"name":{"x":34,"y":48,"w":864,"h":40,"font_size":56},"title":{"x":34,"y":88,"w":864,"h":20,"font_size":27}},"timeline":{"icon":{"x":34,"y":208,"w":40,"h":40},"title":{"x":80,"y":214,"w":816,"h":22,"font_size":30},"legend":{"x":0,"y":730,"w":960,"h":240,"font_size":18,"work":{"x":80,"y":800,"w":505,"h":166,"text_align":"left"},"education":{"x":616,"y":800,"w":282,"h":166,"text_align":"right"}}},"skills":{"fill":"#313843","opacity":0.8,"back":{"fill":"#313843","stroke":"none","opacity":0.9},"textStyle":{"fill":"#FFF","font-family":"museo-slab","font-size":15},"proficiency":{"fill":"#dd0083","font-family":"museo-slab","font-size":15},"icon":{"x":34,"y":900,"w":40,"h":40},"title":{"x":80,"y":1062,"w":816,"h":22,"font_size":30}},"vanity":{"x":0,"y":1344,"w":960,"h":528,"recommendations":{"comment_font_size":18,"recommender_font_size":24},"conections":{"num_font_size":88,"connections_font_size":24}},"footer":{"x":0,"y":1872,"w":960,"h":128,"font_size":16,"logo":{"x":768,"y":1952}}},gridLine:{marginTop:160,marginLeft:50,height:400,horizontalAxis:{stroke:"#000","stroke-width":2,opacity:0.5},verticalAxis:{stroke:"#FFF"}},recommendations:{"title":{"fill":"#007eff","text-anchor":"start","font-size":24,"font-family":"museo-slab","text_align":"left"},"icon":{"fill":"#313843","stroke":"none","opacity":0.8},"bubbleBack":{"fill":"#313843","stroke":"#313843","stroke-width":3,"stroke-opacity":0.5},"bubbleShadow":{"fill":"#313843","stroke":"#313843","stroke-width":3,"stroke-opacity":0.5,"opacity":0.3},"commentStyle":{fill:"#FFF","text-anchor":"start","font-size":13,"font-family":"museo-slab"},"author":{"fill":"#dd0083","text-anchor":"start","font-size":16,"font-family":"museo-slab"}},connections:{"title":{"fill":"#fff","font-size":18,"font-family":"museo-slab"},"countText":{"fill":"#007eff","font-size":58,"font-family":"museo-slab"},"countBack":{"fill":"#313843","stroke":"none"}}};var temp5=(function(){var paper;var headerObj={name:'',title:''};var colors=["#ffffff","#ffffff","#B0C087","#FAAF40","#775961","#559FC7","#000"];var fonts=["proxima-nova","museo-slab","proxima-nova"];var style={"fonts":{"title":"Museo Slab 500","content":"Familar Pro Bold"},"header":{"header_bg":colors[2],"name":{"fontsize":50,"fontweight":"bold","fontcolor":colors[0]},"title":{"fontsize":24,"fontweight":"bold","fontcolor":colors[1]},"summary":{"fontsize":16}},"skills":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","skill_fillcolor":"#00adef","skill_emptycolor":"#ddd","skill_fontsize":12},"awards":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"languages":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","lang_fontcolor":"#000","lang_fontsize":22},"interests":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"recomm":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","rec_fontcolor":"#fff","rec_fontsize":18,"rec_font":"Verdana","rec_fill":"#000","recommender_fontsize":20,"recommender_fontcolor":'#ed008c',"recommender_fontweight":"bold","recommender_font":"Verdana"},"timeline":{"title_fontsize":20,"title_fontcolor":"#fff","title_fontweight":"bold","title_font":"Verdana","title_bgcolor":"#999","bg_color":"#ffffff","bg_color_alt":"#F2EEEE","year_color":"#CDC9C9","year_color_alt":"#F0ECEC","colors":["#ed008c","#00adef","#BBCB5F","#fef200"]},"connections":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","bg_color":"#000","conn_fontcolor":"#fef200","conn_fontsize":140,"conn_fontweight":"bold","conn_text_fontcolor":"#fff","conn_text_fontsize":35,"conn_text_fontweight":"bold"}};var timelineTitleHeight=35;var timelineTitleWidth=155;var timelineTitleChamfer=15;var infographicWidth=960;var infographicHeight=1700;var timelineWidth=infographicWidth;var hues=["ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200"];var yearInterval=4;var yearWidth=30;var yearIntervalWidth=30;var totalIntervals=timelineWidth/yearIntervalWidth;var headerHeight=160;var headerAndBottomDiff=35;var experienceStartY=headerHeight+headerAndBottomDiff;var experienceTimeLineHeight=240;var timeLineDifference=60;var educationStartY=experienceTimeLineHeight+timeLineDifference+experienceStartY;var educationTimeLineHeight=240;var timelineHeight=experienceTimeLineHeight+educationTimeLineHeight+timeLineDifference;var skillsHeight=200;var skillsStartY=timelineHeight+timeLineDifference+experienceStartY;var groupsHeight=300;var groupsStartY=skillsStartY+skillsHeight+timeLineDifference;return{getDefaultColors:function(){return clone(colors);},getDefaultFonts:function(){return clone(fonts);},generate:function(timeLineShape){function addLegends(paper,dimension,educationTimeline,isEducation,funcGetText){var educationTimelineYearsCount=educationTimeline.length;var ypos=dimension.y+193;var title;educationTimeline.sort(function(a,b){return b.end_date-a.end_date;});for(i=0;i<Math.min(educationTimelineYearsCount,6);i++){try{var text=funcGetText(educationTimeline[i])
var startYear="";if(educationTimeline[i].start_date)
startYear=getDateFromString(educationTimeline[i].start_date).getFullYear();var endYear="";if(educationTimeline[i].end_date)
endYear=getDateFromString(educationTimeline[i].end_date).getFullYear();var title=text.title||"";var desc=text.desc||"";var years="";if(startYear)
years=startYear+"-"+endYear;var educationTitle=years+"\n"+text.desc+"\n "+title;title=paper.text(dimension.x+dimension.middle,ypos,educationTitle.wordWrap(35,"\n",1)).attr({fill:customizedColors[6],"text-anchor":"middle","font-size":18,"font-family":customizedFonts[2]}).toFront();ypos=ypos+105;if(isEducation)
tipText=getEducationToolTip(educationTimeline[i]);else
tipText=getExperienceToolTip(educationTimeline[i]);drawTooltip(title.node,tipText);}
catch(err){}}}
function pentagonPath(dimension,pointHeight){return["M",dimension.x,dimension.y,"l",dimension.width,0,0,102.942,-dimension.middle,pointHeight,-dimension.middle,-pointHeight,"z"];}
function drawTitle(paper,dimension,title){var shadow=paper.text(dimension.x+dimension.middle,dimension.y+76,title).attr({"font-size":36,"font-family":customizedFonts[0],fill:"#000000",opacity:.5,"text-anchor":"middle"});var text=paper.text(dimension.x+dimension.middle,dimension.y+73,title).attr({"font-size":36,"font-family":customizedFonts[0],fill:customizedColors[1]});return{"text":text,"shadow":shadow}}
function createDiv(id){newdiv=document.createElement('div');newdiv.setAttribute('id',id);return newdiv;}
if(!customizedColors)
customizedColors=clone(colors);if(!customizedFonts)
customizedFonts=clone(fonts);var userInfo=vizData.user_info;var workTimeline=vizData.timeline_work;var educationTimeline=vizData.timeline_education;var reduceHeight=0;String.prototype.wordWrap=function(m,b,c){var i,j,l,s,r;if(m<1)
return this;for(i=-1,l=(r=this.split("\n")).length;++i<l;r[i]+=s)
for(s=r[i],r[i]="";s.length>m;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:""))
j=c==2||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||c==1&&m||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;return r.join("\n");}
var displaySkills=customizedSections.skills&&vizData.skills&&vizData.skills.length>0;function drawHeaderDiv(id){var header=createDiv('__header');document.getElementById(id).appendChild(header);var paper=Raphael(header,infographicWidth,256);var headerbg="M0 0L0 219.321 0 219.321 0 219.321 0 219.402 0.08 219.402 13.058 232.869 26.038 219.402 26.197 219.402 39.175 232.869 52.154 219.402 52.313 219.402 65.292 232.869 78.271 219.402 78.43 219.402 91.41 232.869 104.389 219.402 104.548 219.402 117.527 232.869 130.506 219.402 130.665 219.402 143.643 232.869 156.623 219.402 156.782 219.402 169.762 232.869 182.739 219.402 182.899 219.402 195.878 232.869 208.856 219.402 209.016 219.402 221.995 232.869 234.974 219.402 235.133 219.402 248.113 232.869 261.092 219.402 261.25 219.402 274.23 232.869 287.208 219.402 287.367 219.402 300.347 232.869 313.325 219.402 313.484 219.402 326.463 232.869 339.443 219.402 339.603 219.402 352.581 232.869 365.56 219.402 365.719 219.402 378.697 232.869 391.677 219.402 391.836 219.402 404.814 232.869 417.794 219.402 417.953 219.402 430.932 232.869 443.911 219.402 444.07 219.402 457.049 232.869 470.028 219.402 470.187 219.402 483.167 232.869 496.147 219.402 496.307 219.402 509.285 232.869 522.263 219.402 522.423 219.402 535.4 232.869 548.381 219.402 548.54 219.402 561.519 232.869 574.497 219.402 574.656 219.402 587.633 232.869 600.613 219.402 600.771 219.402 613.752 232.869 626.731 219.402 626.889 219.402 639.868 232.869 652.849 219.402 653.008 219.402 665.986 232.869 678.966 219.402 679.124 219.402 692.105 232.869 705.083 219.402 705.242 219.402 718.221 232.869 731.198 219.402 731.357 219.402 744.338 232.869 757.316 219.402 757.477 219.402 770.455 232.869 783.433 219.402 783.592 219.402 796.571 232.869 809.552 219.402 809.711 219.402 822.689 232.869 835.669 219.402 835.829 219.402 848.807 232.869 861.785 219.402 861.945 219.402 874.924 232.869 887.902 219.402 888.062 219.402 901.04 232.869 914.019 219.402 914.178 219.402 927.156 232.869 940.137 219.402 940.295 219.402 953.273 232.869 966.255 219.402 966.334 219.402 966.334 0z";paper.path(headerbg).attr({fill:customizedColors[2],stroke:"none"});var headertextshadow=paper.text(paper.width/2,55,userInfo.first_name+" "+userInfo.last_name).attr({"font-size":70,"font-family":customizedFonts[0],fill:"#000000",opacity:.5});var headertext=paper.text(paper.width/2,50,userInfo.first_name+" "+userInfo.last_name).attr({"font-size":70,"font-family":customizedFonts[0],fill:customizedColors[0]});var headline=paper.text(paper.width/2,150,trucateText(userInfo.title,35)).attr({"font-size":48,"font-family":customizedFonts[1],fill:customizedColors[1]});}
function drawEducationDiv(id){var div=createDiv('__workedu');document.getElementById(id).appendChild(div);var div=createDiv('__edu');document.getElementById(id).appendChild(div);var education={"x":0,"y":0,"width":286.302,"height":858.216,"middle":143.151}
if(!displaySkills){var education={"x":0,"y":0,"width":433.507,"height":858.216,"middle":216.753}}
var paper=Raphael(div,education.width,education.height);paper.rect(education.x,education.y,education.width,education.height).attr({fill:"#FFFFFF",stroke:"none"});var EDpent=pentagonPath(education,34.560);paper.path(EDpent).attr({fill:customizedColors[3],stroke:"none"});var educationText=drawTitle(paper,education,"Education");addLegends(paper,education,educationTimeline,true,function(item){return{"title":item.degree,"desc":item.school,"summary":""}});}
function drawWorkDiv(id){var div=createDiv('__work');document.getElementById(id).appendChild(div);var work={"x":0,"y":0,"width":286.302,"height":858.216,"middle":143.151}
if(!displaySkills){var work={"x":0,"y":0,"width":433.507,"height":858.216,"middle":216.753}}
var paper=Raphael(div,work.width,work.height);paper.rect(work.x,work.y,work.width,work.height).attr({fill:"#FFFFFF",stroke:"none"});var WORKpent=pentagonPath(work,34.560);paper.path(WORKpent).attr({fill:customizedColors[4],stroke:"none"});var workText=drawTitle(paper,work,"Employment");addLegends(paper,work,workTimeline,false,function(item){return{"title":item.position,"desc":item.company,"summary":item.summary}});}
function drawSkillsDiv(id){var div=createDiv('__skills');document.getElementById(id).appendChild(div);if(displaySkills){var skills={"x":0,"y":0,"width":286.302,"height":858.216,"middle":143.151};var paper=Raphael(div,skills.width,skills.height);paper.rect(skills.x,skills.y,skills.width,skills.height).attr({fill:"#FFFFFF",stroke:"none"});var SKILLpent=pentagonPath(skills,34.560);paper.path(SKILLpent).attr({fill:customizedColors[5],stroke:"none"});var workText=drawTitle(paper,skills,"Skills");(function addSkills(dimension,skills){var countSkills=skills.length;var ypos=dimension.y+163;for(i=0;i<Math.min(countSkills,6);i++){if(skills[i].proficiency=="Beginner"){var stars=1;}
if(skills[i].proficiency=="Intermediate"){var stars=2;}
if(skills[i].proficiency=="Advanced"){var stars=3;}
if(skills[i].proficiency=="Expert"){var stars=4;}
var xpos=dimension.x+dimension.middle-((stars/2)*50)+25;var skillText=paper.text(dimension.x+dimension.middle,ypos,skills[i].name.wordWrap(35,"\n",1)).attr({fill:customizedColors[6],"text-anchor":"middle","font-size":18,"font-family":customizedFonts[2]}).toFront();drawTooltip(skillText.node,getSkillsTooltip(skills[i]));for(s=0;s<stars;s++){paper.g.star(xpos,40+ypos,25,10,5).attr({fill:customizedColors[6],stroke:"none"});xpos=xpos+50;}
ypos=ypos+105;}})(skills,vizData.skills);}}
function drawExtraDiv(id){var div=createDiv('__extra');document.getElementById(id).appendChild(div);div.style.marginBottom='35px';var displayed=false;var details={"x":33.183,"y":0,"width":433.507,"height":477.518,"middle":216.753};if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){var paper=Raphael(div,infographicWidth,details.height);paper.rect(details.x,details.y,details.width,details.height).attr({fill:"#FFFFFF",stroke:"none"});var AWARDpent=pentagonPath(details,55.359);paper.path(AWARDpent).attr({fill:customizedColors[3],stroke:"none"});var rectextshadow=drawTitle(paper,details,"Recommendations");displayed=true;(function addrecs(dimension,recommendations){var Recs=recommendations.length;var ypos=dimension.y+210
var title;if(Recs>3){Recs=3;}
for(i=0;i<Recs;i++){var displayText=getWrappedText(clone(recommendations[i].content.recommendationText),150,40,3);displayText=displayText+"\n"+recommendations[i].content.recommender.firstName;title=paper.text(dimension.x+dimension.middle,ypos,displayText).attr({fill:customizedColors[6],"text-anchor":"middle","font-size":18,"font-family":customizedFonts[2],"font-weight":"italic"}).toFront();ypos=ypos+100;drawTooltip(title.node,recommendations[i].content.recommendationText);}})(details,vizData.recommendations);paper.setSize(infographicWidth,details.height);}
else if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){var paper=Raphael(div,infographicWidth,details.height);paper.rect(details.x,details.y,details.width,details.height).attr({fill:"#FFFFFF",stroke:"none"});var AWARDpent=pentagonPath(details,55.359);paper.path(AWARDpent).attr({fill:customizedColors[3],stroke:"none"});var rectextshadow=drawTitle(paper,details,"Interests");displayed=true;(function addInterests(dimension,interests){if(interests&&interests.length>0){var yPositionText=(dimension.y+210);for(var i=0;i<Math.min(interests.length,6);i++){var textLanguage=paper.text(dimension.x+dimension.middle,yPositionText,interests[i].name).attr({fill:customizedColors[6],"text-anchor":"middle",'font-size':18,'font-family':customizedFonts[2],"font-weight":"italic"});yPositionText+=40;}}})(details,vizData.interests);paper.setSize(infographicWidth,details.height);}
else if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){var paper=Raphael(div,infographicWidth,details.height);paper.rect(details.x,details.y,details.width,details.height).attr({fill:"#FFFFFF",stroke:"none"});var AWARDpent=pentagonPath(details,55.359);paper.path(AWARDpent).attr({fill:customizedColors[3],stroke:"none"});var rectextshadow=drawTitle(paper,details,"Languages");displayed=true;(function addlanguage(dimension,language){var languageCount=language.length;var yPositionText=(dimension.y+210);var title;if(languageCount>5){languageCount=5;}
for(var i=0;i<languageCount;i++){var languageTitle=language[i].name;title=paper.text(dimension.x+dimension.middle,yPositionText,language[i].name).attr({fill:customizedColors[6],"text-anchor":"middle","font-size":36,"font-family":customizedFonts[2]}).toFront();yPositionText+=40;}})(details,vizData.languages);paper.setSize(infographicWidth,details.height);}
if(displayed){var style={"connections":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","bg_color":"#000","conn_fontcolor":"#fef200","conn_fontsize":140,"conn_fontweight":"normal","conn_text_fontcolor":"#000","conn_text_fontsize":35,"conn_text_fontweight":"bold"}}
var connections={"x":496.939,"y":0,"width":433.507,"height":details.height,"middle":216.753}
paper.rect(connections.x,connections.y,connections.width,connections.height).attr({fill:"#FFFFFF",stroke:"none"});var CONNECTIONSpent=pentagonPath(connections,55.359);paper.path(CONNECTIONSpent).attr({fill:customizedColors[5],stroke:"none"});var latextshadow=drawTitle(paper,connections,"Connections");(function drawConnections(dimensions,connections,paper){var textNoOfConn=connections;var fontSize=style.connections.conn_fontsize;if(textNoOfConn==500){textNoOfConn=textNoOfConn+"+";fontSize=fontSize-30;}
var text=paper.text(dimensions.x+dimensions.middle,dimensions.y+(dimensions.height/2)+55.359,textNoOfConn).attr({'font-size':fontSize,fill:"black","font-weight":style.connections.conn_fontweight,"font-family":customizedFonts[2]});})(connections,vizData.counts.connections,paper);}
else
reduceHeight+=480;}
function drawFooterDiv(id){var div=createDiv('__footer');document.getElementById(id).appendChild(div);div.style.marginBottom='-3px';var paper=Raphael(div,infographicWidth,15);var footerDimension={"startX":966.253,"startY":13};var footer="m "+footerDimension.startX+" "+footerDimension.startY+" l -12.979,-13.466 -12.977,13.466 -0.16,0 -12.981,-13.466 -12.976,13.466 -0.162,0 -12.978,-13.466 -12.977,13.466 -0.159,0 -12.98,-13.466 -12.979,13.466 -0.161,0 -12.977,-13.466 -12.978,13.466 -0.162,0 -12.978,-13.466 -12.978,13.466 -0.16,0 -12.98,-13.466 -12.978,13.466 -0.16,0 -12.978,-13.466 -12.978,13.466 -0.162,0 -12.977,-13.466 -12.979,13.466 -0.161,0 -12.977,-13.466 -12.978,13.466 -0.161,0 -12.978,-13.466 -12.979,13.466 -0.16,0 -12.979,-13.466 -12.976,13.466 -0.161,0 -12.981,-13.466 -12.978,13.466 -0.161,0 -12.977,-13.466 -12.979,13.466 -0.16,0 -12.98,-13.466 -12.977,13.466 -0.159,0 -12.978,-13.466 -12.98,13.466 -0.161,0 -12.978,-13.466 -12.976,13.466 -0.162,0 -12.977,-13.466 -12.979,13.466 -0.162,0 -12.977,-13.466 -12.98,13.466 -0.16,0 -12.978,-13.466 -12.979,13.466 -0.159,0 -12.979,-13.466 -12.979,13.466 -0.159,0 -12.98,-13.466 -12.978,13.466 -0.16,0 -12.978,-13.466 -12.979,13.466 -0.16,0 -12.977,-13.466 -12.979,13.466 -0.16,0 -12.979,-13.466 -12.978,13.466 -0.161,0 -12.978,-13.466 -12.98,13.466 -0.159,0 -12.978,-13.466 -12.979,13.466 -0.159,0 -12.979,-13.466 -12.979,13.466 -0.159,0 -12.98,-13.466 -12.977,13.466 -0.161,0 -12.979,-13.466 -12.977,13.466 -0.161,0 -12.978,-13.466 -12.98,13.466 -0.16,0 -12.978,-13.466 -12.979,13.466 -0.16,0 -12.978,-13.466 -12.979,13.466 -0.16,0 -12.977,-13.466 -12.98,13.466 -0.16,0 -12.979,-13.466 -12.978,13.466 -0.16,0 -12.978,-13.466 -12.978,13.466 -0.16,0 -12.979,-13.466 -12.979,13.466 -0.08,0 0,77.61996 966.334,0 0,-77.61996 z";paper.path(footer).attr({fill:customizedColors[2],stroke:"none"});}
var wrapperDiv=createDiv('__wrapper');wrapperDiv.style.backgroundColor="#E6E7E8";document.getElementById('infographic').appendChild(wrapperDiv);drawHeaderDiv('__wrapper');var tableDiv=createDiv('__table');if(displaySkills){tableDiv.innerHTML="<table style='margin-bottom: 26px'><tr><td id='_1'></td><td id='_2'></td><td id='_3'></td></tr></table>";}else{tableDiv.innerHTML="<table style='margin-bottom: 26px'><tr><td id='_1'></td><td id='_2'></td></tr></table>";}
wrapperDiv.appendChild(tableDiv);drawEducationDiv('_1');drawWorkDiv('_2');if(displaySkills){drawSkillsDiv('_3');}
if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){Viz.widgets.drawInterests("infographic",Viz.stripHidden(vizData.interests),style.interests);}
if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){Viz.widgets.languageChart("infographic",Viz.stripHidden(vizData.languages));}
if(customizedSections.awards&&vizData.awards&&vizData.awards.length>0){Viz.widgets.drawAwards("infographic",Viz.stripHidden(vizData.awards),style.awards);}
if(customizedSections.myStats&&vizData.mystats&&vizData.mystats.length>0){var statStyle={'titleFont':customizedFonts[1],'titleColor':'black','textFont':customizedFonts[2],'textColor':'black','numberFont':customizedFonts[2],'numberColor':customizedColors[3],'iconColor':customizedColors[2]};Viz.widgets.myStatChart("infographic",Viz.stripHidden(vizData.mystats),vizData.counts,statStyle);}
if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){Viz.widgets.drawRecommendations("infographic",Viz.stripHidden(vizData.recommendations));}}}})();var temp6=(function(){var paper;var colors=["#fff","#fef200","#000","#ed008c","#00adef","#fef200","#BBCB5F"];var fonts=["museo-slab","museo-slab","cooper-black-std"];var style={"fonts":{"title":"Museo Slab 500","content":"Familar Pro Bold"},"header":{"header_bg":colors[2],"name":{"fontsize":50,"fontweight":"bold","fontcolor":colors[0]},"title":{"fontsize":25,"fontweight":"bold","fontcolor":"#000"}},"skills":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","skill_fillcolor":"#00adef","skill_emptycolor":"#ddd","skill_fontsize":12},"languages":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","lang_fontcolor":"#000","lang_fontsize":22},"interests":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"awards":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22},"recomm":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","rec_fontcolor":"#fff","rec_fontsize":18,"rec_font":"Verdana","rec_fill":"#000","recommender_fontsize":20,"recommender_fontcolor":'#ed008c',"recommender_fontweight":"bold","recommender_font":"Verdana"},"timeline":{"title_fontsize":20,"title_fontcolor":"#fff","title_fontweight":"bold","title_font":"Verdana","title_bgcolor":"#999","bg_color":"#ffffff","bg_color_alt":"#F2EEEE","year_color":"#CDC9C9","year_color_alt":"#F0ECEC","colors":["#ed008c","#00adef","#BBCB5F","#fef200"]},"connections":{"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","bg_color":"#000","conn_fontcolor":"#fef200","conn_fontsize":140,"conn_fontweight":"bold","conn_text_fontcolor":"#fff","conn_text_fontsize":35,"conn_text_fontweight":"bold"}};var skillsStyle={"main":{"hr":{"style":{"stroke":"#e6e7e9"}},"style":{"fill":"#000","stroke-width":"1px","stroke":"#808080"}},"label":{"hr":{"style":{"stroke":"#fff","stroke-width":2}},"style":{"fontsize":35,"fontcolor":"#fff","fontweight":"bold"}},"bar":{"label":{"style":{"font-size":"20px","text-anchor":"end","fill":"#fff"}},"yearLabel":{"style":{"font-size":"20px","text-anchor":"start","fill":"#fff"}},"style":{"stroke":"#222","stroke-width":"1px"}},"axis":{"style":{"stroke":"#fff","stroke-width":"6px"},"yearLabel":{"style":{"font-size":"20px","fill":"#fff"}}}};var timelineTitleHeight=35;var timelineTitleWidth=155;var timelineTitleChamfer=15;var infographicWidth=960;var infographicHeight=2000;var timelineWidth=infographicWidth;var hues=["ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200","ed008c","00adef","BBCB5F","fef200"];var yearInterval=4;var yearWidth=30;var yearIntervalWidth=30;var totalIntervals=timelineWidth/yearIntervalWidth;var headerHeight=160;var headerAndBottomDiff=35;var experienceStartY=headerHeight+headerAndBottomDiff;var experienceTimeLineHeight=240;var timeLineDifference=60;var educationStartY=experienceTimeLineHeight+timeLineDifference+experienceStartY;var educationTimeLineHeight=240;var timelineHeight=experienceTimeLineHeight+educationTimeLineHeight+timeLineDifference;var skillsHeight=200;var skillsStartY=timelineHeight+timeLineDifference+experienceStartY;var groupsHeight=300;var groupsStartY=skillsStartY;var verticalTimeLineWidth=infographicWidth;var verticalTimeLineStartY=experienceStartY+30;var verticalTimeLineTitleHeight=40;var verticalTimeLineTitleWidth=verticalTimeLineWidth/2;var verticalTimeLineYearHeight=100;var verticalTimeLineShadowWidth=10;var verticalTimeLinePaddingTop=50;var verticalTimeLineAxisRectWidth=70;var verticalTimeLineAxisRectHeight=30;var verticalTimeLineHeight_dynamic=0;var verticalTimelineStyle;var verticalSkillsMargin=30;var verticalSkillHorizontalPadding=50;var verticalSkillsHeight=600+verticalSkillsMargin*2;var verticalSkillsStartY_dynamic=0;var verticalSkillsLabelHeight=80;var verticalSkillsVerticalAxisX=260;var verticalSkillsVerticalAxisHeight=400;var verticalSkillsVerticalAxisTopPadding=40;var verticalSkillsMaxSkills=5;var verticalSkillsMaxYears=20;var verticalSkillsHues=["00adef","ed008c"];var verticalSkillsBarHeight=26;var verticalDetailsHeight=0;return{getDefaultColors:function(){return clone(colors);},getDefaultFonts:function(){return clone(fonts);},generate:function(timeLineShape,defColors){if(!customizedColors){if(defColors)
customizedColors=clone(defColors);else
customizedColors=clone(colors);}
if(!customizedFonts)
customizedFonts=clone(fonts);verticalTimelineStyle={"mainLabel":{"style":{"font-family":customizedFonts[1],"font-size":40,fill:"#000"}},"axis":{"line":{"style":{"stroke":"#000","stroke-width":5}},"labelRect":{"style":{fill:"#000"}},"labelText":{"style":{fill:"#fff","font-size":"18"}}},"block":{"style":{"stroke":"none",},"shadow":{"style":{"fill":"#000","opacity":"0.3","stroke":"none"}},"label":{"style":{"font-family":customizedFonts[2],"fill":"#000","font-size":12,}}}};function drawHeaderDiv(id){var div=createDiv('__header');document.getElementById(id).appendChild(div);var paper=Raphael(div,timelineWidth,headerHeight);var div=paper.rect(0,0,timelineWidth,headerHeight+30).attr({fill:customizedColors[2],stroke:"none"});var userName=paper.text(infographicWidth/2,50,userInfo.first_name+" "+userInfo.last_name).attr({'font-family':customizedFonts[0],'font-size':style.header.name.fontsize,fill:customizedColors[0],"font-weight":style.header.name.fontweight});var userTitle=paper.text(infographicWidth/2,110,trucateText(userInfo.title,60)).attr({'font-family':customizedFonts[1],'font-size':style.header.title.fontsize,fill:customizedColors[1],"font-weight":style.header.title.fontweight});}
function drawWorkEducationDiv(id){var div=createDiv('__workedu');document.getElementById(id).appendChild(div);var paper=Raphael(div,timelineWidth,headerHeight);verticalTimeLineStartY=35;drawVerticalTimeLine(jsonData.counts,jsonData.timeline_work,jsonData.timeline_education,paper);paper.setSize(infographicWidth,timelineHeight);}
function drawSkillsDiv(id){var div=createDiv('__skills');document.getElementById(id).appendChild(div);verticalTimeLineStartY=35;verticalTimeLineHeight_dynamic=0;skillsStartY=170;verticalSkillsHeight=600+verticalSkillsMargin*2;var paper=Raphael(div,timelineWidth,verticalSkillsHeight);drawSkillsChart(jsonData.skills,paper);}
function drawExtraDiv(id){var div=createDiv('__extra');document.getElementById(id).appendChild(div);var verticalDetailsY=0
verticalDetailsHeight=500;var displayed=false;if(customizedSections.interests&&vizData.languages&&vizData.languages.length>0){var height=0;height=120+(Math.min(vizData.languages.length,8)*40);height=Math.max(425,height);var paper=Raphael(div,timelineWidth,height+25);drawLanguages(verticalDetailsY,jsonData.languages,paper);displayed=true;}else if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){var height=0;if(vizData.recommendations.length==1){height=300;}else{height=Math.min(vizData.recommendations.length,3)*120;}
height=Math.max(425,height);var paper=Raphael(div,timelineWidth,height);drawRecommendation(verticalDetailsY,vizData.recommendations,paper);displayed=true;}else if(customizedSections.languages&&vizData.interests&&vizData.interests.length>0){var height=0;height=120+(Math.min(vizData.interests.length,8)*40);height=Math.max(425,height);var paper=Raphael(div,timelineWidth,height+25);drawInterests(verticalDetailsY,vizData.interests,paper);displayed=true;}
if(displayed)
drawConnections(verticalDetailsY,jsonData.counts.connections,paper);else
verticalDetailsHeight=0;}
var jsonData=clone(vizData);timeLineType=timeLineShape;var userInfo=jsonData.user_info;drawHeaderDiv("infographic");drawWorkEducationDiv("infographic");if(customizedSections.skills&&vizData.skills&&vizData.skills.length>0){drawSkillsDiv("infographic");}else{verticalSkillsHeight=0;}
if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){Viz.widgets.drawInterests("infographic",Viz.stripHidden(vizData.interests),style.interests);}
if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){Viz.widgets.languageChart("infographic",Viz.stripHidden(vizData.languages));}
if(customizedSections.awards&&vizData.awards&&vizData.awards.length>0){Viz.widgets.drawAwards("infographic",Viz.stripHidden(vizData.awards),style.awards);}
if(customizedSections.myStats&&vizData.mystats&&vizData.mystats.length>0){var statStyle={'titleFont':customizedFonts[1],'titleColor':'black','textFont':customizedFonts[2],'textColor':'black','numberFont':customizedFonts[2],'numberColor':customizedColors[3],'iconColor':customizedColors[2]};Viz.widgets.myStatChart("infographic",Viz.stripHidden(vizData.mystats),vizData.counts,statStyle);}
if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){Viz.widgets.drawRecommendations("infographic",Viz.stripHidden(vizData.recommendations));}}};function createDiv(id){newdiv=document.createElement('div');newdiv.setAttribute('id',id);return newdiv;}
function drawSkillsChart(skills,paper){if(typeof skills=="undefined"||skills.length==0)return;verticalSkillsStartY_dynamic=verticalTimeLineStartY+verticalTimeLineHeight_dynamic;var skillsCount=(skills.length>verticalSkillsMaxSkills?verticalSkillsMaxSkills:skills.length);var skillHeight=Math.round(verticalSkillsVerticalAxisHeight/skillsCount);var fnCalculateMaxYear=function(){var max=0;for(var i=0;i<skillsCount;i++)if(skills[i].years>max)max=skills[i].years;return max>verticalSkillsMaxYears?verticalSkillsMaxYears:max;}
var fnCalculateMiddleYear=function(maxYear){if(maxYear<6)return undefined;return Math.round(maxYear/2);}
var fnGetBarLabelText=function(years){if(years==1)return"1 year";else return years+" years";}
var sy=verticalSkillsStartY_dynamic;var margin=verticalSkillsMargin;var inner_sx=margin+verticalSkillHorizontalPadding;var inner_width=infographicWidth-inner_sx*2;var inner_sy=sy+margin;var inner_height=verticalSkillsHeight-margin*2;var maxYear=fnCalculateMaxYear();var middleYear=fnCalculateMiddleYear(maxYear);var barsWidth=inner_sx+inner_width-verticalSkillsVerticalAxisX;var fnDrawLabel=function(){paper.path("M"+inner_sx+" "+(inner_sy+verticalSkillsLabelHeight+skillsStartY-200)+" H"+(inner_sx+inner_width)).attr(skillsStyle.label.hr.style);paper.text(inner_sx+inner_width/2,inner_sy+skillsStartY-200+verticalSkillsLabelHeight/2,"SKILLS").attr({'font-family':customizedFonts[1],'font-size':skillsStyle.label.style.fontsize,fill:skillsStyle.label.style.fontcolor,"font-weight":skillsStyle.label.style.fontweight});}
var fnCalculateSkillsGeometry=function(){var yearWidth=barsWidth/maxYear;for(var i=0;i<skillsCount;i++){skills[i].labelX=verticalSkillsVerticalAxisX-20;skills[i].y=inner_sy+verticalSkillsLabelHeight+verticalSkillsVerticalAxisTopPadding+(skillHeight*i+skillHeight/2);skills[i].fill=getHue[i%2];skills[i].width=yearWidth*(skills[i].years>verticalSkillsMaxYears?verticalSkillsMaxYears:skills[i].years);}}
function getHue(paletteId){return customizedColors[(paletteId%(customizedColors.length))+3];}
function getHueIndex(colour){return customizedColors.indexOf(colour);}
var fnDrawChart=function(){for(var i=0;i<skills.length&&i<verticalSkillsMaxSkills;i++){var title=skills[i].name;var skillT=paper.text(skills[i].labelX,skills[i].y+skillsStartY-200,title).attr(skillsStyle.bar.label.style);drawTooltip(skillT.node,getSkillsTooltip(skills[i]));var xpos=0;if(skills[i].proficiency=="Beginner"){var stars=1;}
if(skills[i].proficiency=="Intermediate"){var stars=2;}
if(skills[i].proficiency=="Advanced"){var stars=3;}
if(skills[i].proficiency=="Expert"){var stars=4;}
for(s=0;s<stars;s++){paper.g.star(skills[i].labelX-10+xpos,skills[i].y+25+skillsStartY-200,12.5,5,5).attr({fill:customizedColors[1],stroke:"none"});xpos=xpos-30;}
var skillR=paper.rect(verticalSkillsVerticalAxisX,skills[i].y+skillsStartY-200-verticalSkillsBarHeight/2,skills[i].width,verticalSkillsBarHeight).attr(skillsStyle.bar.style).attr({"fill":skills[i].fill=getHue(getHueIndex(skills[i].fill)+1)});drawTooltip(skillR.node,getSkillsTooltip(skills[i]));}
paper.path("M"+verticalSkillsVerticalAxisX+" "+(inner_sy+skillsStartY-200+verticalSkillsLabelHeight+verticalSkillsVerticalAxisTopPadding)+" V"+(inner_sy+verticalSkillsLabelHeight+skillsStartY-200+verticalSkillsVerticalAxisTopPadding+verticalSkillsVerticalAxisHeight+3)).attr(skillsStyle.axis.style);paper.path("M"+verticalSkillsVerticalAxisX+" "+(inner_sy+skillsStartY-200+verticalSkillsLabelHeight+verticalSkillsVerticalAxisTopPadding+verticalSkillsVerticalAxisHeight)+" H"+(inner_sx+inner_width)).attr(skillsStyle.axis.style);var horizontalLabelY=inner_sy+verticalSkillsLabelHeight+verticalSkillsVerticalAxisTopPadding+verticalSkillsVerticalAxisHeight+20;paper.text(verticalSkillsVerticalAxisX,skillsStartY-200+horizontalLabelY,"0 years").attr({"text-anchor":"start"}).attr(skillsStyle.axis.yearLabel.style);paper.text(inner_sx+inner_width,skillsStartY-200+horizontalLabelY,maxYear+" years").attr({"text-anchor":"end"}).attr(skillsStyle.axis.yearLabel.style);if(typeof middleYear!="undefined"){paper.text(verticalSkillsVerticalAxisX+(barsWidth/maxYear*middleYear),skillsStartY-200+horizontalLabelY,middleYear+" years").attr({"text-anchor":"middle"}).attr(skillsStyle.axis.yearLabel.style);}}
paper.path("M"+margin+" "+(sy+verticalSkillsHeight+skillsStartY-200)+"H"+(infographicWidth-margin)).attr(skillsStyle.main.hr.style);var skillRect=paper.rect(0+margin,sy+margin+skillsStartY-200,infographicWidth-margin*2,verticalSkillsHeight-margin*2).attr(skillsStyle.main.style);fnCalculateSkillsGeometry();fnDrawLabel();fnDrawChart();}
function drawVerticalTimeLine(counts,timeLineExp,timeLineEdu,paper){var timeLineExpExists=false,timeLineEduExists=false;if(typeof timeLineExp!="undefined"&&timeLineExp.length>0)timeLineExpExists=true;if(typeof timeLineEdu!="undefined"&&timeLineEdu.length>0)timeLineEduExists=true;if(!timeLineExpExists&&!timeLineEduExists){return;}
var firstYear=Math.min(counts.year_education_began,counts.year_work_began);var lastYear=Math.max(counts.year_education_ended,counts.year_work_ended);var yearCount=(lastYear-firstYear)+1;var fnDrawVerticalTimeLineLabel=function(x,y,text){var eduLabelText=paper.text(x,y,text).attr(verticalTimelineStyle.mainLabel.style);}
var fnDrawAxis=function(){var axisHeight=verticalTimeLinePaddingTop+verticalTimeLineYearHeight*yearCount;timelineHeight=axisHeight+50+verticalTimeLinePaddingTop;paper.path("M"+verticalTimeLineWidth/2+" "+verticalTimeLineStartY+"V"+(verticalTimeLineStartY+axisHeight)).attr(verticalTimelineStyle.axis.line.style);var sx=verticalTimeLineWidth/2;var sy=verticalTimeLineStartY+verticalTimeLinePaddingTop;var yh=verticalTimeLineYearHeight;for(var i=0;i<yearCount;i++){paper.rect(sx-verticalTimeLineAxisRectWidth/2,sy+yh*(i+1)-verticalTimeLineAxisRectHeight/2,verticalTimeLineAxisRectWidth,verticalTimeLineAxisRectHeight).attr(verticalTimelineStyle.axis.labelRect.style);paper.text(sx,sy+yh*(i+1),lastYear-i).attr(verticalTimelineStyle.axis.labelText.style);skillsStartY=sy+yh*(i+1);}}
var fnCalculateRange=function(timeline){for(var i=0;i<timeline.length;i++){var start=getDateFromString(timeline[i].start_date);var end=getDateFromString(timeline[i].end_date);timeline[i].range=(end.getTime()-start.getTime())/86400000;if(timeline[i].range<30)
timeline[i].range=30;}}
var fnSetBlocksWidth=function(timeLine){var experienceWidth=100;var experienceWidthInc=100;var maxBlockWidth=100;var currentStart,currentEnd,previousStart,previousEnd;timeLine.sort(sortByRange);var maxOverlaps=0;for(var i=0;i<timeLine.length;i++){var overlap=0;timeLine[i].width=experienceWidth;currentStart=getDateFromString(timeLine[i].start_date).getTime();currentEnd=getDateFromString(timeLine[i].end_date).getTime();for(var j=0;j<i;j++){previousStart=getDateFromString(timeLine[j].start_date).getTime();previousEnd=getDateFromString(timeLine[j].end_date).getTime();if((previousStart>currentStart&&previousStart<currentEnd)||(previousEnd>currentStart&&previousEnd<currentEnd)||(previousStart==currentStart&&previousEnd==currentEnd)){if(timeLine[i].width==timeLine[j].width){overlap++;}}}
if(overlap>maxOverlaps)
maxOverlaps=overlap;}
if(maxOverlaps>10)
experienceWidthInc=30;else if(maxOverlaps>6)
experienceWidthInc=50;else if(maxOverlaps>3)
experienceWidthInc=70;for(var i=0;i<timeLine.length;i++){var overlap=0;timeLine[i].width=experienceWidth;currentStart=getDateFromString(timeLine[i].start_date).getTime();currentEnd=getDateFromString(timeLine[i].end_date).getTime();for(var j=0;j<i;j++){previousStart=getDateFromString(timeLine[j].start_date).getTime();previousEnd=getDateFromString(timeLine[j].end_date).getTime();if((previousStart>currentStart&&previousStart<currentEnd)||(previousEnd>currentStart&&previousEnd<currentEnd)||(previousStart==currentStart&&previousEnd==currentEnd)){if(timeLine[i].width==timeLine[j].width){timeLine[i].width=timeLine[i].width+experienceWidthInc;if(timeLine[i].width>maxBlockWidth)
maxBlockWidth=timeLine[i].width;}}}}
return maxBlockWidth;}
var fnCalculateBlocksGeometry=function(timeLine,reverse){var fnCheckLayerHoversLayer=function(whatLayer,inLayer){if(whatLayer.width>inLayer.width)return false;if((whatLayer.y+whatLayer.height)>inLayer.y&&whatLayer.y<(inLayer.y+inLayer.height))
return true;return false;}
var fnCalculateInterception=function(one,two){var out=[];out[0]=(one[0]>two[0]?one[0]:two[0]);out[1]=(one[1]<two[1]?one[1]:two[1]);return out;}
var fnCalculateUnion=function(one,two){var out=[];if(one[1]>=two[0]||two[1]>=one[0]){out[0]=(one[0]<=two[0]?one[0]:two[0]);out[1]=(one[1]>=two[1]?one[1]:two[1]);}
return out;}
var fnCalculateVerticalShadow=function(whatLayer,inLayer){var whatBounds=[whatLayer.y,whatLayer.y+whatLayer.height];var inBounds=[inLayer.y,inLayer.y+inLayer.height];out=fnCalculateInterception(whatBounds,inBounds);out[0]-=whatLayer.y;out[1]-=whatLayer.y;if(out[0]==0)out[0]+=verticalTimeLineShadowWidth;if(whatLayer.shadow.vertical.length>0){for(var i=0;i<whatLayer.shadow.vertical.length;i++){var union=fnCalculateUnion(whatLayer.shadow.vertical[i],out);}
return[union];}
else
return[out];}
var fnCalculateHorizontalShadow=function(whatLayer,inLayer){if((whatLayer.y+whatLayer.height)<(inLayer.y+inLayer.height)){return[[0,whatLayer.width+verticalTimeLineShadowWidth]];}else
return whatLayer.shadow.horizontal;}
var fnCalculateHorizontalShadowHeight=function(whatLayer,inLayer){var tmp=(inLayer.y+inLayer.height)-(whatLayer.y+whatLayer.height);if(tmp>0&&tmp<verticalTimeLineShadowWidth){return tmp;}
else return verticalTimeLineShadowWidth;}
var fnFixHorizontalShadow=function(whatLayer,inLayer){if(false&&whatLayer.y+whatLayer.height>inLayer.y-verticalTimeLineShadowWidth){return[];}else
return whatLayer.shadow.horizontal;}
function getHue(paletteId){return customizedColors[(paletteId%(customizedColors.length-4))+4];}
function getHueIndex(colour){return customizedColors.indexOf(colour)-3;}
var dayHeight=verticalTimeLineYearHeight/365;timeLine.sort(sortByRange).reverse();var timelineStartDate=new Date(firstYear,1,1);var timelineEndDate=new Date(lastYear,12,31);var sx=verticalTimeLineWidth/2;var sy=verticalTimeLineStartY+verticalTimeLinePaddingTop;var shw=verticalTimeLineShadowWidth;for(var i=0;i<timeLine.length;i++){var thisStartDate=getDateFromString(timeLine[i].start_date);var thisEndDate=getDateFromString(timeLine[i].end_date);thisStartY=Math.floor(sy+((timelineEndDate.getTime()-thisEndDate.getTime())/86400000)*dayHeight);thisHeight=Math.floor((timeLine[i].range/365)*verticalTimeLineYearHeight);thisWidth=timeLine[i].width;timeLine[i].height=thisHeight;timeLine[i].center=thisStartY+(thisHeight/2);timeLine[i].x=sx;timeLine[i].y=thisStartY;timeLine[i].fill=getHue(i);timeLine[i].shadow={"hasShadow":false,"vertical":[],"horizontal":[],"horizontalHeight":verticalTimeLineShadowWidth};if(reverse){timeLine[i].x=sx-timeLine[i].width;}}
for(var i=0;i<timeLine.length;i++){for(var j=0;j<timeLine.length;j++){if(i!=j&&fnCheckLayerHoversLayer(timeLine[i],timeLine[j])&&timeLine[i].fill==timeLine[j].fill){timeLine[i].fill=getHue(getHueIndex(timeLine[i].fill)+1);}
if(i!=j&&fnCheckLayerHoversLayer(timeLine[i],timeLine[j])){timeLine[i].shadow.hasShadow=true;timeLine[i].shadow.vertical=fnCalculateVerticalShadow(timeLine[i],timeLine[j]);timeLine[i].shadow.horizontal=fnCalculateHorizontalShadow(timeLine[i],timeLine[j]);timeLine[i].shadow.horizontalHeight=fnCalculateHorizontalShadowHeight(timeLine[i],timeLine[j]);}
if(i!=j&&timeLine[i].width==timeLine[j].width){timeLine[i].shadow.horizontal=fnFixHorizontalShadow(timeLine[i],timeLine[j])}}}}
var fnCalculateLabelsPosition=function(timeLine){timeLine.sort(sortByRange).reverse();var labelHeight=new Number(verticalTimelineStyle.block.label.style['font-size'])*2+6;for(var i=0;i<timeLine.length;i++)
timeLine[i].labelY=timeLine[i].center;for(var i=0;i<timeLine.length;i++){for(var j=0;j<timeLine.length;j++){if(i!=j&&Math.abs(timeLine[i].labelY-timeLine[j].labelY)<labelHeight){var labelShift=Math.ceil((labelHeight-Math.abs(timeLine[i].labelY-timeLine[j].labelY))/2);if(timeLine[i].labelY>timeLine[j].labelY){timeLine[i].labelY+=labelShift;timeLine[j].labelY-=labelShift;}else{timeLine[i].labelY-=labelShift;timeLine[j].labelY+=labelShift;}}}}}
var fnSortByWidthAndEnd=function(a,b){return(a.width*new Date(a.end_date).getTime()-b.width*new Date(b.end_date).getTime());}
fnDrawVerticalTimeLineLabel(verticalTimeLineTitleWidth/2,verticalTimeLineStartY+verticalTimeLineTitleHeight/2,"EDUCATION");fnDrawVerticalTimeLineLabel(verticalTimeLineTitleWidth/2+verticalTimeLineTitleWidth,verticalTimeLineStartY+verticalTimeLineTitleHeight/2,"EMPLOYMENT");if(timeLineExpExists){fnCalculateRange(timeLineExp);var maxExpBlockWidth=fnSetBlocksWidth(timeLineExp);fnCalculateBlocksGeometry(timeLineExp,false);fnCalculateLabelsPosition(timeLineExp);fnCalculateLabelsPosition(timeLineExp);timeLineExp.sort(fnSortByWidthAndEnd).reverse();for(var i=0;i<timeLineExp.length;i++){var experienceItem=paper.rect(timeLineExp[i].x,timeLineExp[i].y,timeLineExp[i].width,timeLineExp[i].height).attr(verticalTimelineStyle.block.style).attr({fill:timeLineExp[i].fill});var tipText=getExperienceToolTip(timeLineExp[i]);drawTooltip(experienceItem.node,tipText);if(timeLineExp[i].shadow.hasShadow){for(var vs=0;vs<timeLineExp[i].shadow.vertical.length;vs++){var x=timeLineExp[i].x+timeLineExp[i].width,y=timeLineExp[i].y+timeLineExp[i].shadow.vertical[vs][0],width=verticalTimeLineShadowWidth,height=timeLineExp[i].shadow.vertical[vs][1]-timeLineExp[i].shadow.vertical[vs][0]
paper.rect(x,y,width,height).attr(verticalTimelineStyle.block.shadow.style);}
for(var hs=0;hs<timeLineExp[i].shadow.horizontal.length;hs++){paper.rect(timeLineExp[i].x+timeLineExp[i].shadow.horizontal[hs][0],timeLineExp[i].y+timeLineExp[i].height,timeLineExp[i].shadow.horizontal[hs][1],timeLineExp[i].shadow.horizontalHeight).attr(verticalTimelineStyle.block.shadow.style);}}}
for(var i=0;i<timeLineExp.length;i++){timeLineExp[i].label=(timeLineExp[i].position||"")+"\n"+(timeLineExp[i].company||"");var label=paper.text(timeLineExp[i].x+timeLineExp[i].width-50,timeLineExp[i].labelY,timeLineExp[i].label).attr(verticalTimelineStyle.block.label.style).attr({"text-anchor":"start"});var tipText=getExperienceToolTip(timeLineExp[i]);drawTooltip(label.node,tipText);}}
if(timeLineEduExists){fnCalculateRange(timeLineEdu);var maxEduBlockWidth=fnSetBlocksWidth(timeLineEdu);fnCalculateBlocksGeometry(timeLineEdu,true);fnCalculateLabelsPosition(timeLineEdu);fnCalculateLabelsPosition(timeLineEdu);timeLineEdu.sort(fnSortByWidthAndEnd).reverse();for(var i=0;i<timeLineEdu.length;i++){var eduItem=paper.rect(timeLineEdu[i].x,timeLineEdu[i].y,timeLineEdu[i].width,timeLineEdu[i].height).attr(verticalTimelineStyle.block.style).attr({fill:timeLineEdu[i].fill});var tipText=getEducationToolTip(timeLineEdu[i]);drawTooltip(eduItem.node,tipText);if(timeLineEdu[i].shadow.hasShadow){for(var vs=0;vs<timeLineEdu[i].shadow.vertical.length;vs++){var x=timeLineEdu[i].x-verticalTimeLineShadowWidth,y=timeLineEdu[i].y+timeLineEdu[i].shadow.vertical[vs][0],width=verticalTimeLineShadowWidth,height=timeLineEdu[i].shadow.vertical[vs][1]-timeLineEdu[i].shadow.vertical[vs][0]
paper.rect(x,y,width,height).attr(verticalTimelineStyle.block.shadow.style);}
for(var hs=0;hs<timeLineEdu[i].shadow.horizontal.length;hs++){var x=timeLineEdu[i].x+timeLineEdu[i].shadow.horizontal[hs][0]-verticalTimeLineShadowWidth,y=timeLineEdu[i].y+timeLineEdu[i].height,width=timeLineEdu[i].shadow.horizontal[hs][1],height=timeLineEdu[i].shadow.horizontalHeight;paper.rect(x,y,width,height).attr(verticalTimelineStyle.block.shadow.style);}}}
for(var i=0;i<timeLineEdu.length;i++){timeLineEdu[i].label=(timeLineEdu[i].degree||"")+"\n"+(timeLineEdu[i].school||"");var eduLabel=paper.text(timeLineEdu[i].x+timeLineEdu[i].width-50,timeLineEdu[i].labelY,timeLineEdu[i].label).attr(verticalTimelineStyle.block.label.style).attr({"text-anchor":"end"});var tipText=getEducationToolTip(timeLineEdu[i]);drawTooltip(eduLabel.node,tipText);}}
fnDrawAxis();}
function drawInterests(startY,interests,paper){var text=paper.text(275,startY+50,"INTERESTS");text.attr({'font-family':customizedFonts[1],'font-size':style.languages.title_fontsize,fill:"#000","font-weight":style.languages.title_fontweight});if(interests&&interests.length>0){var yPositionText=startY+120;for(var i=0;i<Math.min(interests.length,8);i++){var textLanguage=paper.text(275,yPositionText,interests[i].name).attr({'font-size':style.languages.lang_fontsize,fill:style.languages.lang_fontcolor,'font-family':customizedFonts[2]});yPositionText+=40;}}}
function drawLanguages(startY,data,paper){var text=paper.text(275,startY+50,"LANGUAGES");text.attr({'font-family':customizedFonts[1],'font-size':style.languages.title_fontsize,fill:"#000","font-weight":style.languages.title_fontweight});var yPositionText=startY+120;for(var i=0;i<Math.min(data.length,8);i++){var textLanguage=paper.text(275,yPositionText,data[i].name).attr({'font-size':style.languages.lang_fontsize,fill:style.languages.lang_fontcolor,'font-family':customizedFonts[2]});yPositionText+=40;}}
function drawConnections(startY,connections,paper){var textNoOfConn=connections;var fontSize=style.connections.conn_fontsize;if(textNoOfConn==500){textNoOfConn=textNoOfConn+"+";fontSize=fontSize-30;}
var title=paper.text(infographicWidth-200,startY+50,"LINKEDIN").attr({'font-family':customizedFonts[1],'font-size':style.connections.title_fontsize,fill:"#000","font-weight":style.connections.title_fontweight});var circ=paper.circle(infographicWidth-200,startY+250,160).attr({fill:customizedColors[2],stroke:'none'});var text=paper.text(infographicWidth-200,startY+225,textNoOfConn).attr({'font-size':fontSize,fill:customizedColors[1],"font-weight":style.connections.conn_fontweight});var textConn=paper.text(infographicWidth-200,startY+305,"Connections").attr({'font-family':customizedFonts[1],'font-size':style.connections.conn_text_fontsize,fill:'white',"font-weight":style.connections.conn_text_fontweight});}
function drawRecommendation(groupsStartY,recomm,paper){var text=paper.text(275,groupsStartY+50,"RECOMMENDATIONS");text.attr({'font-family':customizedFonts[1],'font-size':style.recomm.title_fontsize,fill:style.recomm.title_fontcolor,"font-weight":style.recomm.title_fontweight});var recommendations=clone(recomm);var totalRecommendationsToDisplay=recommendations.length>3?3:recommendations.length;var yPositionBlock=(groupsStartY+100);var yPositionText=(groupsStartY+120);var blockHeight=50;var textLength=105;var lineLength=50;var maxLines=2;if(recommendations.length==1){blockHeight=300;yPositionText+=130;textLength=500;maxLines=12;}
for(var i=0;i<totalRecommendationsToDisplay;i++){var bubble=paper.path("M 50 "+yPositionBlock+" l 450 0 l 0 "+blockHeight+" l -420 0 l 5 20 l -20 -20 l -15 0 l 0 -"+blockHeight+" z").attr({fill:customizedColors[3],stroke:customizedColors[3],'stroke-width':20,'stroke-linejoin':'round'});drawTooltip(bubble.node,recommendations[i].content.recommendationText);var displayText=getWrappedText(clone(recommendations[i].content.recommendationText),textLength,lineLength,maxLines);var textRecomm=paper.text(275,yPositionText,displayText).attr({'font-size':style.recomm.rec_fontsize,fill:style.recomm.rec_fontcolor,'font':style.recomm.rec_font});drawTooltip(textRecomm.node,recommendations[i].content.recommendationText);var textRecommender=paper.text(120,yPositionBlock+blockHeight+40,recommendations[i].content.recommender.firstName).attr({'font-size':style.recomm.recommender_fontsize,fill:customizedColors[2],"font-weight":style.recomm.recommender_fontweight,'font':style.recomm.recommender_font});yPositionText+=120;yPositionBlock+=120;}}
function resizeCanvas2(){paper.setSize(infographicWidth,timelineHeight+timeLineDifference+100+verticalSkillsHeight+verticalDetailsHeight);}})();var temp7={default_colors:["#ffffff","#ffffff","#B0C087","#FAAF40","#775961","#559FC7","#000"],default_fonts:["Arial","museo-slab","Arial"],getDefaultColors:function(){return Viz.clone(temp7.default_colors);},getDefaultFonts:function(){return Viz.clone(temp7.default_fonts);},generate:function(){if(!customizedColors){customizedColors=Viz.clone(temp7.default_colors);}
if(!customizedFonts){console.log("Is there a problem officer?");customizedFonts=Viz.clone(temp7.default_fonts);}
var drawTitle=function(icon,text){var titleOptions={className:"icon",color:Viz.isTooLight(customizedColors[2])?"black":customizedColors[2],style:{'padding':"12px 48px 24px 35px"},textStyle:{"font-size":"24px","font-weight":"bold","font-family":customizedFonts[1]}};$.extend(titleOptions,{icon:icon,text:text});$("#infographic").append(Viz.widget.create("viz.title",titleOptions));};var headerStyle={style:{'background-color':customizedColors[2],'padding':"24px 48px 24px 48px",'text-align':"center"},nameStyle:{'font-size':"50px",'color':customizedColors[0],'text-align':"left",'font-weight':"bold",'font-family':customizedFonts[0],},titleStyle:{'font-family':customizedFonts[1],'font-size':"24px",'color':customizedColors[1],'text-align':"left",'font-weight':"bold"},summaryStyle:{'display':"block",'font-family':customizedFonts[1],'font-size':"16px",'color':Viz.isTooLight(customizedColors[2])?"black":customizedColors[2],'text-align':"left",'padding':"12px 48px 24px 35px",'width':"600px"}};var hrStyle={line:"2px dashed "+customizedColors[2]};$("#infographic").append(Viz.widget.create("template7.header",headerStyle));drawTitle("work circle","Experience");var timeline=Viz.widget.create("template7.timeline",{marginVertical:0,colors:customizedColors})
$("#infographic").append(timeline);timeline.drawLabels();drawTitle("work circle","Education");if(customizedSections.skills&&vizData.skills&&vizData.skills.length>0){var skillStyle={'titleStyle':{'fill':customizedColors[0],'font-family':customizedFonts[0]},'textStyle':{'fill':customizedColors[1],'font-family':customizedFonts[1]},'backgroundStyle':{'fill':customizedColors[2]},'marginVertical':0,'showTitle':'hide'};$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","Skills");Viz.widgets.skillChart("infographic",vizData.skills,skillStyle);}
if(customizedSections.interests&&vizData.interests&&vizData.interests.length>0){var interestStyle={"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22,'marginVertical':0,'showTitle':'hide'};$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","Interests");Viz.widgets.drawInterests("infographic",Viz.stripHidden(vizData.interests),interestStyle);}
if(customizedSections.languages&&vizData.languages&&vizData.languages.length>0){$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","Languages");Viz.widgets.languageChart("infographic",Viz.stripHidden(vizData.languages),{'marginVertical':0,'showTitle':'hide'});}
if(customizedSections.awards&&vizData.awards&&vizData.awards.length>0){var awardStyle={"title_fontsize":35,"title_fontcolor":"#000","title_fontweight":"bold","int_fontcolor":"#000","int_fontsize":22,'showTitle':'hide'};$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","Awards");Viz.widgets.drawAwards("infographic",Viz.stripHidden(vizData.awards),awardStyle);}
if(customizedSections.myStats&&vizData.mystats&&vizData.mystats.length>0){var statStyle={'titleFont':customizedFonts[1],'titleColor':'black','textFont':customizedFonts[2],'textColor':'black','numberFont':customizedFonts[2],'numberColor':customizedColors[3],'iconColor':customizedColors[2],'showTitle':'hide'};$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","My Stats");Viz.widgets.myStatChart("infographic",Viz.stripHidden(vizData.mystats),vizData.counts,statStyle);}
if(customizedSections.recommendations&&vizData.recommendations&&vizData.recommendations.length>0){$("#infographic").append(Viz.widget.create("viz.hr",{line:"2px dashed #999"}));drawTitle("work circle","Recommendations");Viz.widgets.drawRecommendations("infographic",Viz.stripHidden(vizData.recommendations),{'showTitle':'hide'});}
$("circle",".icon").attr("fill",Viz.isTooLight(customizedColors[2])?"black":customizedColors[2]);}};﻿
function drawTooltip(item,tipText,atPosition){var atPos=atPosition||'bottom center';$(item).qtip({content:{text:tipText},position:{viewport:$(window),adjust:{method:'flip'},my:'top center',at:atPos},show:{solo:true},hide:'unfocus mouseleave',style:{classes:'ui-tooltip-tipsy ui-dark'}});}
function drawWizardTip(item,tipText,myPosition,atPosition,target){var myPos=myPosition||'left center';var atPos=atPosition||'top center';var trigger=target||false;$(item).qtip({content:{text:tipText},position:{viewport:$(window),adjust:{method:'flip'},my:myPos,at:atPos},style:{classes:'ui-tooltip-tipsy ui-pink ui-tooltip-shadow'},show:{event:false,ready:true,target:trigger},hide:{fixed:true,event:false,inactive:3000}});}
function drawTip(element,text,myPosition,atPosition,show,hide,style,showNow,showOnce,theTarget,isSolo){var el=(typeof element==="string")?$(element):element;var myPos=myPosition||'left center';var atPos=atPosition||'top center';var tipShow=(typeof show==='undefined')?'mouseenter':show;var tipHide=(typeof hide==='undefined')?'mouseleave':hide;var tipStyle=style||'ui-pink ui-tooltip-shadow';var now=showNow||false;var once=showOnce||false;var target=theTarget||el;target=(typeof target==="string")?$(target):target;var solo=isSolo||false;var hideFunction=!once?false:function(event,api){$(event.target).qtip('disable')}
tipHide=!tipHide?false:{'event':tipHide};el.qtip({content:{text:text},position:{adjust:{method:'shift flip'},my:myPos,at:atPos},show:{event:tipShow,target:target,solo:solo},hide:tipHide,style:{classes:'ui-tooltip-tipsy '+tipStyle},events:{hide:hideFunction}});if(now){el.qtip('show');}}
function drawSaveTip(item,tipText,myPosition,atPosition){var myPos=myPosition||'left center';var atPos=atPosition||'top center';$(item).qtip({content:{text:tipText},position:{viewport:$(window),adjust:{method:'flip'},my:myPos,at:atPos},style:{classes:'ui-tooltip-tipsy ui-dark ui-tooltip-shadow'},show:{event:false,ready:true,},hide:{event:false,inactive:3000}});}
function sortByRange(a,b){return a.range-b.range;}
function sortByHeight(a,b){return a.height-b.height;}
function sortByStart(a,b){return getDateFromString(a.start_date).getTime()-getDateFromString(b.start_date).getTime();}
function trucateText(text,length){var textSize=length||25;var truncatedText=text||" ";if(truncatedText.length>textSize)
truncatedText=truncatedText.substring(0,textSize)+"..";return truncatedText;}
function getDateFromString(datestring){var date=new Date(datestring*1000);return date;}
function addNewlines(str,afterEvery){var result="";while(str.length>0){result+=str.substring(0,afterEvery);if(str.length>=afterEvery)
result+='\n';str=str.substring(afterEvery);}
return result;}
function getWrappedText(str,totalLength,lineBreakLength,maxLines){var wrapped="";if(str){str=str.replace(/(<([^>]+)>)/ig,"");str=str.replace(/(\r\n|\n|\r)/gm,"");if(str.length==totalLength){return str;}
else{var strArray=str.split(" ");if(strArray&&strArray.length>0){var lengthCounter=1;var lengthToCompare=lineBreakLength;for(var i=0;i<strArray.length;i++){wrapped=wrapped+" "+strArray[i];if(wrapped.length>=totalLength)
return wrapped+"..";if(wrapped.length>=lengthToCompare){if(maxLines&&lengthCounter>=maxLines)
return wrapped+"..";wrapped=wrapped+'\n';lengthCounter++;lengthToCompare=wrapped.length+lineBreakLength;}}}}}
return wrapped;}
function executeFunctionByName(functionName,context){vizData=clone(vizDataRaw);var args=Array.prototype.slice.call(arguments).splice(2);var namespaces=functionName.split(".");var func=namespaces.pop();for(var i=0;i<namespaces.length;i++){if(namespaces[i]in context)
context=context[namespaces[i]];else
break;}
if(func in context){return context[func].apply(this,args);}else{context=window;var ns=("temp1.generate").split(".");var fn=namespaces.pop();for(var i=0;i<ns.length;i++){if(ns[i]in context)
context=context[ns[i]];else
break;}
return context.apply(this,args);}}
function clearPaper(paper){var paperDom=paper.canvas;paperDom.parentNode.removeChild(paperDom);}
function isValidEmailAddress(emailAddress){var pattern=new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);return pattern.test(emailAddress);}
function clone(obj){if(obj==null||typeof(obj)!='object')
return obj;var temp=obj.constructor();for(var key in obj)
temp[key]=clone(obj[key]);return temp;}
function formatXml(xml){var formatted='';var reg=/(>)(<)(\/*)/g;xml=xml.replace(reg,'$1\r\n$2$3');var pad=0;jQuery.each(xml.split('\r\n'),function(index,node){var indent=0;if(node.match(/.+<\/\w[^>]*>$/)){indent=0;}else if(node.match(/^<\/\w/)){if(pad!=0){pad-=1;}}else if(node.match(/^<\w[^>]*[^\/]>.*$/)){indent=1;}else{indent=0;}
var padding='';for(var i=0;i<pad;i++){padding+='  ';}
formatted+=padding+node+'\r\n';pad+=indent;});return formatted;}
function quote(string){var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};if(string.match(_escapeable)){return'"'+string.replace(_escapeable,function(a){var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';}
function jsonSerialize(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};function href(url,event,value){track(event,value)
setTimeout('window.location="'+url+'"',100);}
function track(event,value){var _gaq=_gaq||[];_gaq.push(['_trackEvent',event,value]);}
function kissto(url,event,value){kiss(event,value)
setTimeout('window.location="'+url+'"',100);}
$.extend({getUrlVar:function(){var vars=window.location.href.substr(window.location.href.indexOf('?')+1);return vars;},getUrlStr:function(){return window.location.href.toString();}});function daysInMonth(iMonth,iYear)
{return 32-new Date(iYear,iMonth,32).getDate();}
function attachKeyUpAjax(element,url,success,error){var el=(typeof element==="string")?$(element):element;var timeout;var delay=1000;var isLoading=false;el.keyup(function(event){if(event.keyCode==='9'||event.keyCode=='13'||event.keyCode=='10'){return;}
if(timeout){clearTimeout(timeout);}
if(!isLoading){var value=$(this).val();timeout=setTimeout(function(){isLoading=true;$.ajax({type:'GET',url:(typeof url==="function")?url(value):url,success:function(resp){if(!resp){return;}
if(success){success(resp,value);}}});setTimeout(function(){isLoading=false;},1000);},delay);}});}Raphael.fn.viz={debug:true,getStars:function(prof){var stars=0;if(prof){switch(prof){case"advanced":stars=3;break;case"expert":stars=4;break;case"intermediate":stars=2;break;case"beginner":stars=1;break;default:stars=0;}}
return stars;},applyConstraintsOnTimeLine:function(yearLimit,dataToProcess,startYear,endYear){var timeLineArray=[];var tempArray=clone(dataToProcess);var tempStartYear;var minDate=getMinStartDate(dataToProcess,yearLimit,endYear);for(var i=0;i<tempArray.length;i++){if(tempArray[i].start_date&&tempArray[i].end_date){var endDate=getDateFromString(tempArray[i].end_date);var startDate=getDateFromString(tempArray[i].start_date);tempStartYear=startDate.getFullYear();if(tempStartYear>=minDate.getFullYear())
timeLineArray.push(tempArray[i]);else if((endYear-tempStartYear)>=yearLimit&&endDate>minDate){tempArray[i].isInPast=true;timeLineArray.push(tempArray[i]);}}}
return timeLineArray;},normalize:function(array,offset){offset=offset||0;var max=0,result=[];for(var i=0;i<array.length;++i){max=Math.max(max,array[i]+offset);}
for(var i=0;i<array.length;++i){result.push(array[i]/max);}
return result;},wedge:function(x,y,radius,startAngle,endAngle,opts){opts=opts||{};function sector(cx,cy,r,startAngle,endAngle){var rad=Math.PI/180,start={x:cx+r*Math.cos(startAngle*rad),y:cy+r*Math.sin(startAngle*rad)},end={x:cx+r*Math.cos(endAngle*rad),y:cy+r*Math.sin(endAngle*rad)},largeSweep=Math.abs(startAngle-endAngle)>=180?1:0,res=[" M",cx,cy," L",start.x,start.y," A",r,r,0,largeSweep,1,end.x,end.y,"z"];return res;}
this.path(sector(x,y,radius,startAngle,endAngle)).attr({fill:opts.colors||"#666","stroke-width":(opts.strokewidth==null?1:opts.strokewidth),"stroke-linejoin":"round",stroke:opts.stroke||"#666",opacity:opts.opacity||"1"});},seperateSkillChart:function(x,y,skills,opts){var debug=this.viz.debug;opts=opts||{};var data=[],factor=opts.factor||50,pieColor=opts.colors||'red',emptyColor=opts.empty||'#999',spacing=opts.spacing||20,radius=opts.radius||50
fontSize=opts.fontSize||10;for(var skill in skills){data.push(skills[skill].level*skills[skill].years);}
data=this.viz.normalize(data,factor);for(var i=0;i<Math.min(5,data.length);++i){var startX=(spacing+2*radius)*i+x,angle=(data[i]*360)-90;this.viz.wedge(startX,y,radius,-90,angle,{colors:pieColor,stroke:opts.stroke,opacity:opts.opacity});this.viz.wedge(startX,y,radius,angle,270,{colors:emptyColor,stroke:opts.stroke,opacity:opts.opacity});var label=this.text(startX,y+radius+10,skills[i].name.replace(/ /gi,"\n"));var labelBox=label.getBBox();label.attr({"font-size":fontSize,y:labelBox.y+((y+radius+10)-(labelBox.y-labelBox.height/2))});}},scatterLabels:function(x,y,data,opts){var debug=this.viz.debug;function sortByTextSize(a,b){return Math.max(b.title.length,b.desc.length)-Math.max(a.title.length,a.desc.length)}
function sortByHeight(a,b){return b.height-a.height;}
function isOverlap(start1,end1,start2,end2){return(end1>=start2&&end1<=end2)||(end2>=start1&&end2<=end1);}
function truncate(text,size,appendText){appendText=appendText||"...";return text.substr(0,size)+(text.length>size?appendText:"");}
function toElement(index,data,title,desc,startX,startY,maxWidth,maxHeight){return{index:index,titleElement:title,descElement:desc,maxWidth:maxWidth,maxHeight:maxHeight,startX:startX,startY:startY,middle:{x:startX+(maxWidth/2),y:startY+(maxHeight/2)},data:data};}
data=data||[];opts=opts||[];var spacing=opts.spacing||5,horz_spacing=opts.horizontal_spacing||5,X_relativity=0,layers=[],reverse=opts.reverse||false;data.sort(sortByHeight);for(i=0;i<data.length;++i){var canvasWidth=opts.canvasWidth||this.width,titleText=data[i].title||"",title=this.text(data[i].center,y,titleText).attr({fill:"#000",'font-family':customizedFonts[2],"text-anchor":"start","font-size":12,"font-weight":"bold"}),titleBox=title.getBBox(),descText=data[i].desc||"",desc=this.text(data[i].center,y+titleBox.height,descText).attr({fill:"#000",'font-family':customizedFonts[2],"text-anchor":"start","font-size":12}),descBox=desc.getBBox(),maxWidth=Math.max(titleBox.width,descBox.width)+(spacing*2)+(horz_spacing*2),middle={x:data[i].center-(maxWidth/2)},startX=Math.max(middle.x-Math.max(0,(middle.x+maxWidth+spacing)-canvasWidth),spacing),startY=y,maxHeight=Math.max(titleBox.height,descBox.height);addNewLayer=true;if(middle.x>maxWidth/2){X_relativity+=(canvasWidth/2)-middle.x;}
for(var layerIndex=0;layerIndex<layers.length;++layerIndex){var isClearToPlace=true,newY=y+(layerIndex*maxHeight*2)+(layerIndex*spacing);title.attr({y:newY,x:startX});desc.attr({y:newY+titleBox.height,x:startX});for(var elIndex=0;elIndex<layers[layerIndex].length;++elIndex){var element=layers[layerIndex][elIndex];if(isOverlap(element.startX,element.startX+element.maxWidth,startX,startX+maxWidth)){if(isOverlap(data[i].center-spacing,data[i].center+spacing,element.middle.x-spacing,element.middle.x+spacing)){if(data[i].center>element.middle.x){startX+=spacing+(X_relativity<0)?spacing*2:0;startX=Math.min(this.width-maxWidth,startX);}else{startX-=spacing+(X_relativity>=0)?spacing*2:0;startX=Math.max(spacing,startX);}}
isClearToPlace=false;break;}}
if(isClearToPlace){layers[layerIndex].push(toElement(i,data[i],title,desc,startX,newY,maxWidth,descBox.y+maxHeight,data[i].desc));addNewLayer=false;break;}}
if(addNewLayer){var newY=y+(layers.length*maxHeight*2)+(layers.length*spacing);layers.push([toElement(i,data[i],title,desc,startX,newY,maxWidth,descBox.y+maxHeight,data[i].desc)]);title.attr({y:newY,x:startX});desc.attr({y:newY+titleBox.height,x:startX});}}
if(layers.length<4){var element=layers[0][0];var offsetRange=element.data.apex-y;var itemHeight=element.titleElement.getBBox().height*2+spacing
offset=(offsetRange-itemHeight*layers.length+spacing*(layers.length-1))/2
for(var layerIndex=0;layerIndex<layers.length;++layerIndex){for(var elIndex=0;elIndex<layers[layerIndex].length;++elIndex){var element=layers[layerIndex][elIndex];var titleNewY=element.titleElement.getBBox().y+offset;var descNewY=element.descElement.getBBox().y+offset;element.titleElement.attr({y:titleNewY});element.descElement.attr({y:descNewY});}}}
var downShift=reverse?0:(layers.length-3)*(maxHeight+spacing*2);for(var layerIndex=0;layerIndex<layers.length;++layerIndex){for(var elIndex=0;elIndex<layers[layerIndex].length;++elIndex){var element=layers[layerIndex][elIndex],titleBox=element.titleElement.getBBox(),descBox=element.descElement.getBBox(),maxY=Math.max(element.data.title?titleBox.y:0,element.data.desc?descBox.y:0),minY=Math.min(element.data.title?titleBox.y:0,element.data.desc?descBox.y:0),maxHeight=Math.max(element.data.title?titleBox.height:0,element.data.desc?descBox.height:0),linePath=["M",element.middle.x,reverse?minY:(maxY+maxHeight),"L",element.data.center,element.data.apex+downShift];this.path(linePath).attr({fill:"#fff",opacity:".7"});if(element.data.is_current){this.g.star(Math.max(element.data.center,spacing),element.data.apex+downShift,5).attr({stroke:"none",fill:"#000"});}
else if(element.data.isInPast){this.g.arrow(Math.max(element.data.center-3,spacing),(element.data.apex+downShift),-5).attr({stroke:"none",fill:"#000"});}
else{this.circle(Math.max(element.data.center,spacing),element.data.apex+downShift,3).attr({stroke:"none",fill:"#000"});}}}
for(var layerIndex=0;layerIndex<layers.length;++layerIndex){for(var elIndex=0;elIndex<layers[layerIndex].length;++elIndex){var element=layers[layerIndex][elIndex];element.titleElement.toFront();element.descElement.toFront();}}
return downShift;},}
function getExperienceToolTip(expItem){$("#Photo_Gallery").hide();$("#Display_Links").hide();var ttext='';if(expItem.portfolio){ttext='<div class="tip-layout"><div class="tip-desc">';}
if(expItem.position&&expItem.position.length>0){ttext=ttext+expItem.position;}
if(expItem.company&&expItem.company.length>0){if(ttext.length>0){ttext=ttext+" @ ";}
ttext=ttext+expItem.company;}
if(ttext.length>0){ttext="<b>"+ttext+"</b></br>";}
var startDate=getDateFromString(expItem.start_date);var endDate=getDateFromString(expItem.end_date);ttext=ttext+(startDate.getMonth()+1)+"/"+startDate.getFullYear()+" - ";if(expItem.is_current)
ttext+="Current";else
ttext+=(endDate.getMonth()+1)+"/"+endDate.getFullYear();if(expItem.portfolio){ttext=ttext+'</div><div class="tip-portfolio"><a onclick="showGallery('+expItem.portfolio+')"><img alt="View Portfolio" title="Portfolio" src="/media/img/portfolio.gif"/></a></div></div><br /><br />';}
if(expItem.location){ttext=ttext+"</br> Location: "+expItem.location;}
if(expItem.summary&&expItem.summary.length>0){ttext+="</br></br>";var htmlFormatted=expItem.summary.replace(/\n/g,"<br />").substring(0,750);ttext=ttext+htmlFormatted;}
if(expItem.portfolio){ttext=ttext+'</div>';}
return ttext;}
function getEducationToolTip(eduItem){var ttext='';if(eduItem.degree&&eduItem.degree.length>0){ttext=eduItem.degree;}
if(eduItem.discipline&&eduItem.discipline.length>0){if(ttext.length>0){ttext=ttext+": ";}
ttext=ttext+eduItem.discipline;}
if(ttext.length>0){ttext="<b>"+ttext+"</b></br>";}
var startDate=getDateFromString(eduItem.start_date);var endDate=getDateFromString(eduItem.end_date);ttext=ttext+(startDate.getMonth()+1)+"/"+startDate.getFullYear()+" - ";if(eduItem.is_current)
ttext+="Current";else
ttext+=(endDate.getMonth()+1)+"/"+endDate.getFullYear();if(eduItem.school&&eduItem.school.length>0){ttext+="</br>";ttext=ttext+eduItem.school;}
if(eduItem.location){ttext=ttext+"</br> Location: "+eduItem.location;}
if(eduItem.activities&&eduItem.activities.length>0){ttext+="</br></br>";ttext=ttext+eduItem.activities.substring(0,750);}
return ttext;}
function getSkillsTooltip(skill){var skillTooltip=skill.name;if(skill.years||skill.proficiency){skillTooltip+="</br>";if(skill.years)
skillTooltip=skillTooltip+" "+skill.years+" years";if(skill.proficiency)
skillTooltip=skillTooltip+" "+skill.proficiency;}
return skillTooltip;}
function loadGallery(id){$.ajax({type:'GET',url:'/portfolio/'+id,success:function(resp){initpic(resp);}});function initpic(resp){var galleryNum=resp.items.length;if(galleryNum>=5){galleryNum-=galleryNum-5;}
var data=[galleryNum];for(i=0;i<galleryNum;i++){if(resp.items[i].type==1){var url=encodeURIComponent(resp.items[i].url);var linkurl='http://images.websnapr.com/?url='+url+'&key='+'k2BgmWIUhk9W'+'&hash='+encodeURIComponent(websnapr_hash);data[i]={"image":linkurl,"caption":resp.items[i].desc,"title":resp.items[i].title,"link":resp.items[i].url,"target":"_blank"};}else{data[i]={"image":resp.items[i].url,"caption":resp.items[i].desc,"title":resp.items[i].title};}}
$(".pika-stage").remove();$(".pika-thumbs").remove();$(".pika-tooltip").remove();$(".pikachoose").PikaChoose({data:data,autoPlay:false,carousel:true,text:{previous:"",next:""}});$("#Photo_Gallery").show();$("#Photo_Gallery").dialog("open");}}
function showGallery(id){loadGallery(id);$('.qtip:visible').qtip("hide");}
function getMinStartDate(items,yearLimit,endYear){if(items&&items.length>0){var currentDate=new Date();var minDate=currentDate;$.each(items,function(i,item){var endDate=getDateFromString(item.end_date);var startDate=getDateFromString(item.start_date);if(yearLimit&&endYear){if(startDate<minDate&&((endYear-startDate.getFullYear())<yearLimit)){minDate=startDate;}}
else if(startDate<minDate){minDate=startDate;}});if(yearLimit&&endYear){if(minDate==currentDate){minDate=new Date(endYear-yearLimit,01,01);}}
return minDate;}
return null;}
function getMaxEndDate(items){if(items&&items.length>0){var maxDate=getDateFromString(items[0].end_date);;$.each(items,function(i,item){if(item.end_date&&item.start_date){var date=getDateFromString(item.end_date);if(date>maxDate){maxDate=date;}}});return maxDate;}
return null;}Viz.widgets.skillChart=function(el,skillData,options){function skillSort(a,b){return(b.years-a.years);}
function drawCircle(set,paper,circleX,circleY,radius,type,circleStyle){set.push(paper.circle(circleX,circleY,radius).attr(circleStyle));if(type===1){set.push(paper.circle(circleX,circleY,radius-5).attr(circleStyle));}else if(type===2){set.push(paper.circle(circleX,circleY,radius).attr(circleStyle).attr({'stroke-width':'4px'}));}else if(type===3){set.push(paper.circle(circleX,circleY,radius-6).attr(circleStyle).attr({'stroke-width':'5px'}));}}
function drawLegend(legendSet,cardboard,legendX,legendY,legendRadius,legendFontSize,legendTextSpace,legend,circleStyle,legendStyle){var i;for(i in legend){if(legend.hasOwnProperty(i)){legendX+=legendRadius;drawCircle(legendSet,cardboard,legendX,legendY,12,legend[i].value,circleStyle);legendSet.push(cardboard.text(legendX,legendY+legendRadius+(legendFontSize/2)+legendTextSpace,legend[i].key).attr(legendStyle).attr({'font-size':legendFontSize+"px"}));legendX+=legendRadius+legendSpacing;}}
legendX+=legendRadius;legendSet.push(cardboard.text(legendX,legendY,'#').attr(titleStyle).attr({'font-size':"36px"}));legendSet.push(cardboard.text(legendX,legendY+legendRadius+(legendFontSize/2)+legendTextSpace,'no. of years').attr(legendStyle).attr({'font-size':legendFontSize+"px"}));}
function drawLolaCircle(set,paper,circleX,circleY,radius,type,circleStyle){var opacity=0.4;if(type===1){opacity=0.55;}else if(type===2){opacity=0.75;}else if(type===3){opacity=1.0;}
set.push(paper.circle(circleX,circleY,radius).attr(circleStyle).attr({'stroke':'none','opacity':opacity}).attr({'font-family':'ff-dagny-web-pro'}));}
function drawLolaLegend(legendSet,cardboard,legendX,legendY,legendRadius,legendFontSize,legendTextSpace,legend,circleStyle,legendStyle){legendX+=legendRadius;legendSet.push(cardboard.text(legendX,legendY,'#').attr(legendStyle).attr({'font-size':"36px"}));legendSet.push(cardboard.text(legendX,legendY+legendRadius+(legendFontSize/2)+legendTextSpace,'no. of years').attr(legendStyle).attr({'font-size':legendFontSize+"px"}));legendX+=legendRadius+legendSpacing;var i;for(i in legend){if(legend.hasOwnProperty(i)){legendX+=legendRadius;drawLolaCircle(legendSet,cardboard,legendX,legendY,12,legend[i].value,circleStyle);legendSet.push(cardboard.text(legendX,legendY+legendRadius+(legendFontSize/2)+legendTextSpace,legend[i].key).attr(legendStyle).attr({'font-size':legendFontSize+"px"}).attr({'font-family':'ff-dagny-web-pro'}));legendX+=legendRadius+legendSpacing;}}}
var v=Viz,root=(typeof el==="string")?document.getElementById(el):el,opt=options||{},newId=opt.newId||'__skills',div=v.createTag('div',newId),key=opt.key||'years',defaults={width:opt.width||960,height:opt.height||500},limit=opt.limit||5,showTitle=opt.showTitle||'show',titleFontSize=opt.titleFontSize||35,sizeLimit={radius:{min:opt.radiusMin||50,max:opt.radiusMax||140.5},font:{min:opt.fontMin||40,max:opt.fontMax||84}},margin={horizontal:opt.marginHorizontal||0,vertical:(!isNaN(opt.marginVertical)&&opt.marginVertical>=0)?opt.marginVertical:25},padding={horizontal:opt.paddingHorizontal||36,vertical:opt.paddingVertical||36},skillMargin={horizontal:opt.skillMarginHorizontal||5,vertical:opt.skillMarginVertical||0},backgroundStyle=opt.backgroundStyle||{'fill':'black'},circleStyle=opt.circleStyle||{'fill':'#111','stroke':'#DDD','stroke-width':'1.5px'},titleStyle=opt.titleStyle||{},nameStyle=opt.nameStyle||{},textStyle=opt.textStyle||{},skills=v.clone(skillData),cardboard=new Raphael(div,defaults.width,defaults.height),newspaper=cardboard.set(),legendSet=cardboard.set(),labelSet=cardboard.set(),width_adj=defaults.width-(padding.horizontal*2),circleX=0,circleY=0,circleWidthSum=0,maxRadius=0,textHeightMax=0,legend=[{key:'beginner',value:0},{key:'intermediate',value:1},{key:'advanced',value:2},{key:'expert',value:3}],fontXFactor=1.142857142857143,legendMarginX=padding.horizontal,legendMarginY=padding.vertical,legendRadius=12,legendTextSpace=8,legendFontSize=11,legendStyle=opt.legendStyle||{},legendPosition=opt.legendPosition||'left',legendSpacing=48,legendHeight=(legendRadius*2)+legendTextSpace+legendFontSize;div.style.marginTop=margin.vertical+'px';margin.vertical=0;div.style.marginBottom=(margin.vertical-3)+'px';div.style.marginLeft=margin.horizontal+'px';div.style.marginRight=margin.horizontal+'px';root.appendChild(div);titleStyle=$.extend({'font-family':'museo-slab','font-size':titleFontSize+'px','fill':'white','font-weight':'bold'},titleStyle);nameStyle=$.extend({'font-size':titleFontSize+'px','fill':'white','font-weight':'bold'},nameStyle);textStyle=$.extend({'font-family':'ff-dagny-web-pro','fill':'white'},textStyle);legendStyle=$.extend({'font-family':'ff-dagny-web-pro','fill':'white'},legendStyle);skills.sort(skillSort);v.limit(skills,limit);v.abnormalize(skills,key);v.normalize(skills,key);width_adj=defaults.width-(padding.horizontal*2)-(((sizeLimit.radius.min+skillMargin.horizontal)*2)*skills.length-(2*skillMargin.horizontal));if(showTitle==='show'){cardboard.text(defaults.width/2,padding.vertical+(35/2),"SKILLS").attr({'text-anchor':'middle'}).attr(nameStyle);}
newspaper.push(labelSet);var i;for(i in skills){if(skills.hasOwnProperty(i)){var fontSize=Math.max(sizeLimit.font.min,skills[i].abnorm*sizeLimit.font.max),radius=0;if(skills.length>3){radius=skills[i].norm*(width_adj/2)+sizeLimit.radius.min;}else{radius=Math.max(sizeLimit.radius.min,skills[i].abnorm*sizeLimit.radius.max);}
maxRadius=Math.max(maxRadius,radius);skills[i].years=skills[i].years||"<1";skills[i].years=(skills[i].years>=20)?"20+":skills[i].years;circleX+=radius+skillMargin.horizontal;if(opt.type==='lola'){drawLolaCircle(newspaper,cardboard,circleX,circleY,radius,skills[i].proficiency_id,circleStyle);}else{drawCircle(newspaper,cardboard,circleX,circleY,radius,skills[i].proficiency_id,circleStyle);}
newspaper.push(cardboard.text(circleX,circleY,skills[i].years).attr(titleStyle).attr({'font-size':fontSize+"px"}));labelSet.push(cardboard.text(circleX,circleY,getWrappedText(skills[i].name,100,5,3)).attr(textStyle).attr({'text-anchor':'middle','font-size':(18+fontSize/5)+"px"}));var label=labelSet[labelSet.length-1];label.translate(0,label.getBBox().height/2);textHeightMax=Math.max(textHeightMax,label.getBBox().height);circleX+=radius+skillMargin.horizontal;circleWidthSum+=(radius+skillMargin.horizontal)*2;}}
var titleAreaHeight=padding.vertical+titleFontSize+maxRadius+46;if(showTitle==='hide'){titleAreaHeight=maxRadius+padding.vertical;}
newspaper.translate((defaults.width-circleWidthSum)/2,titleAreaHeight);labelSet.translate(0,maxRadius+12);defaults.height=titleAreaHeight+maxRadius+(textHeightMax+12)+36+legendHeight+legendMarginY;cardboard.setSize(defaults.width,defaults.height);var legendX=(legendFontSize*fontXFactor)+legendMarginX,legendY=defaults.height-legendHeight+legendRadius-legendMarginY;if(opt.type==='lola'){drawLolaLegend(legendSet,cardboard,legendX,legendY,legendRadius,legendFontSize,legendTextSpace,legend,circleStyle,textStyle);}else{drawLegend(legendSet,cardboard,legendX,legendY,legendRadius,legendFontSize,legendTextSpace,legend,circleStyle,textStyle);}
if(legendPosition==='right'){legendSet.translate(defaults.width-legendMarginX-legendSet.getBBox().width-36,0);}
cardboard.rect(0,0,defaults.width,defaults.height).attr(backgroundStyle).attr({'stroke':'none'}).toBack();};Viz.widgets.languageChart=function(element,lang,opt){var viz=Viz,element=(typeof element==="string")?document.getElementById(element):element,opt=opt||{},div=viz.createTag('div','__language'),showTitle=opt.showTitle||'show',legendAlign=opt.legendAlign||'center',margin={horizontal:opt.marginHorizontal||0,vertical:opt.marginVertical||24},titleDiv=viz.createTag('div','title'),svgDiv=viz.createTag('div','svg');div.style.marginTop=margin.vertical+"px";div.style.marginBottom=margin.vertical+"px";langData=viz.clone(lang),drawTitle(titleDiv,showTitle,legendAlign,margin);langData.sort(langSortAscending);var W=Raphael(svgDiv,960,550),attr={fill:"#000",stroke:"none","stroke-width":1,"stroke-linejoin":"round"};div.appendChild(titleDiv);div.appendChild(svgDiv);element.appendChild(div);var countries={};countries["path2374"]="M781.68,324.4l-2.31,8.68l-12.53,4.23l-3.75-4.4l-1.82,0.5l3.4,13.12l5.09,0.57l6.79,2.57v2.57l3.11-0.57l4.53-6.27v-5.13l2.55-5.13l2.83,0.57l-3.4-7.13l-0.52-4.59L781.68,324.4L781.68,324.4z";countries["path4385"]="M852.76,348.29l-0.37,24.44l3.52-0.19l4.63-5.41l3.89,0.19l2.5,2.24l0.83,6.9l7.96,4.2l2.04-0.75v-2.52l-6.39-5.32l-3.15-7.28l2.5-1.21l-1.85-4.01l-3.7-0.09l-0.93-4.29l-9.81-6.62L852.76,348.29L852.76,348.29z";countries["path19128"]="M137.49,225.43l4.83,15.21l-2.25,1.26l0.25,3.02l4.25,3.27v6.05l5.25,5.04l-2.25-14.86l-3-9.83l0.75-6.8l2.5,0.25l1,2.27l-1,5.79l13,25.44v9.07l10.5,12.34l11.5,5.29l4.75-2.77l6.75,5.54l4-4.03l-1.75-4.54l5.75-1.76l1.75,1.01l1.75-1.76h2.75l5-8.82l-2.5-2.27l-9.75,2.27l-2.25,6.55l-5.75,1.01l-6.75-2.77l-3-9.57l2.27-12.07l-4.64-2.89l-2.21-11.59l-1.85-0.79l-3.38,3.43l-3.88-2.07l-1.52-7.73l-15.37-1.61l-7.94-5.97L137.49,225.43L137.49,225.43z";countries["path2068"]="M517.77,143.66l-5.6-0.2l-3.55,2.17l-0.05,1.61l2.3,2.17l7.15,1.21L517.77,143.66L517.77,143.66z";countries["path1298"]="M473.88,227.49l-4.08-1.37l-16.98,3.19l-3.7,2.81l2.26,11.67l-6.75,0.27l-4.06,6.53l-9.67,2.32l0.03,4.75l31.85,24.35l5.43,0.46l18.11-14.15l-1.81-2.28l-3.4-0.46l-2.04-3.42v-14.15l-1.36-1.37l0.23-3.65l-3.62-3.65l-0.45-3.88l1.58-1.14l-0.68-4.11L473.88,227.49L473.88,227.49z";countries["path1300"]="M448.29,232.28h-11.55l-2.26,5.02l-5.21,2.51l-4.3,11.64l-8.38,5.02l-11.77,19.39l11.55-0.23l0.45-5.7h2.94v-7.76h10.19l0.23-10.04l9.74-2.28l4.08-6.62l6.34-0.23L448.29,232.28L448.29,232.28z";countries["path1307"]="M404.9,276.66l2.18,2.85l-0.45,12.32l3.17-2.28l2.26-0.46l3.17,1.14l3.62,5.02l3.4-2.28l16.53-0.23l-4.08-27.61l4.38-0.02l-8.16-6.25l0.01,4.06l-10.33,0.01l-0.05,7.75l-2.97-0.01l-0.38,5.72L404.9,276.66L404.9,276.66z";countries["path1309"]="M410.12,290.32l-3.94,2.86l-0.9,1.6l-0.28,1.6l1.45,1.04l4.84-0.07l3.11-0.84l0.35,1.53l-0.28,2.02l2.97,1.46l0.62,0.7l3.94,0.14l0.14-1.74l-3.6-4.32l-4.01-5.43l-2.49-1.04L410.12,290.32L410.12,290.32z";countries["path1311"]="M406.89,298.34l-0.13,1.11l6.92-0.1l0.35-1.03l-0.15-1.04l-1.99,0.81L406.89,298.34L406.89,298.34z";countries["path1313"]="M406.79,300.22l1.24,3.01l0.69-1.86l8.41,0.88l-3.64-1.87L406.79,300.22L406.79,300.22z";countries["path1315"]="M408.6,304.53l1.4,2.77l3.93-3.38l0.04-1.04l-4.63-0.67L408.6,304.53L408.6,304.53z";countries["path1317"]="M410.42,307.94l3.04,4.68l3.96-3.44l4.06-0.18l3.38,4.49l2.87,1.89l1.08-2.1l0.96-0.54l-0.07-4.62l-1.91-5.48l-5.86,0.65l-7.25-0.58l-0.04,1.86L410.42,307.94L410.42,307.94z";countries["path1319"]="M413.93,313.13l5.65,5.46l4.03-4.89l-2.52-3.95l-3.47,0.35L413.93,313.13L413.93,313.13z";countries["path1321"]="M420.17,319.19l10.98,7.34l-0.26-5.56l-3.32-3.91l-3.24-2.87L420.17,319.19L420.17,319.19z";countries["path1323"]="M432.07,326.75l4.28-3.03l5.32-0.93l5.43,1.17l-2.77-4.19l-0.81-2.56l0.81-7.57l-4.85,0.23l-2.2-2.1l-4.62,0.12l-2.2,0.35l0.23,5.12l-1.16,0.47l-1.39,2.56l3.58,4.19L432.07,326.75L432.07,326.75z";countries["path2083"]="M419.46,295.84l3.08-2.11l17.12-0.1l-3.96-27.54l4.52-0.13l21.87,16.69l2.94,0.42l-1.11,9.28l-13.75,1.25l-10.61,7.92l-1.93,5.42l-7.37,0.31l-1.88-5.41l-5.65,0.4l0.22-1.77L419.46,295.84L419.46,295.84z";countries["path2843"]="M450.59,294.28l3.64-0.29l5.97,8.44l-5.54,4.18l-4.01-1.03l-5.39,0.07l-0.87,3.16l-4.52,0.22l-1.24-1.69l1.6-5.14L450.59,294.28L450.59,294.28z";countries["path3603"]="M460.89,302l2.55-0.06l2.3-3.45l3.86-0.69l4.11,2.51l8.77,0.25l6.78-2.76l2.55-2.19l0.19-2.88l4.73-4.77l1.25-10.53l-3.11-6.52l-7.96-1.94l-18.42,14.36l-2.61-0.25l-1.12,9.97l-9.4,0.94L460.89,302L460.89,302z";countries["path4363"]="M444.34,317.05l1.12,2.63l2.92,4.58l1.62-0.06l4.42-2.51l-0.31-14.29l-3.42-1l-4.79,0.13L444.34,317.05L444.34,317.05z";countries["path5123"]="M455.22,321.25l2.68-1.57l-0.06-10.35l-1.74-2.82l-1.12,0.94L455.22,321.25L455.22,321.25z";countries["path5883"]="M458.71,319.49h2.12l0.12-6.02l2.68-3.89l-0.12-6.77l-2.43-0.06l-4.17,3.26l1.74,3.32L458.71,319.49L458.71,319.49z";countries["path6643"]="M461.57,319.37l3.92,0.19l4.73,5.27l2.3,0.63l1.8-0.88l2.74-0.38l0.93-3.82l3.73-2.45l4.04-0.19l7.4-13.61l-0.12-3.07l-3.42-2.63l-6.84,3.01l-9.15-0.13l-4.36-2.76l-3.11,0.69l-1.62,2.82l-0.12,7.96l-2.61,3.7L461.57,319.37L461.57,319.37z";countries["path6647"]="M474.91,227.33l5.53-2.23l1.82,1.18l0.07,1.44l-0.85,1.11l0.13,1.97l0.85,0.46v3.54l-0.98,1.64l0.13,1.05l3.71,1.31l-2.99,4.65l-1.17-0.07l-0.2,3.74l-1.3,0.2l-1.11-0.98l0.26-3.8l-3.64-3.54l-0.46-3.08l1.76-1.38L474.91,227.33L474.91,227.33z";countries["path7407"]="M480.05,248.03l1.56-0.26l0.46-3.6h0.78l3.19-5.24l7.87,2.29l2.15,3.34l7.74,3.54l4.03-1.7l-0.39-1.7l-1.76-1.7l0.2-1.18l2.86-2.42h5.66l2.15,2.88l4.55,0.66l0.59,36.89l-3.38-0.13l-20.42-10.62l-2.21,1.25l-8.39-2.1l-2.28-3.01l-3.32-0.46l-1.69-3.01L480.05,248.03L480.05,248.03z";countries["path7409"]="M521.93,243.06l2.67,0.07l5.2,1.44l2.47,0.07l3.06-2.56h1.43l2.6,1.44h3.29l0.59-0.04l2.08,5.98l0.59,1.93l0.55,2.89l-0.98,0.72l-1.69-0.85l-1.95-6.36l-1.76-0.13l-0.13,2.16l1.17,3.74l9.37,11.6l0.2,4.98l-2.73,3.15L522.32,273L521.93,243.06L521.93,243.06z";countries["path7411"]="M492.79,296l0.13-2.95l4.74-4.61l1.27-11.32l-3.16-6.04l2.21-1.13l21.4,11.15l-0.13,10.94l-3.77,3.21v5.64l2.47,4.78h-4.36l-7.22,7.14l-0.19,2.16l-5.33-0.07l-0.07,0.98l-3.04-0.4l-2.08-3.93l-1.56-0.77l0.2-1.2l1.96-1.5v-7.02l-2.71-0.42l-3.27-2.43L492.79,296L492.79,296L492.79,296z";countries["path8171"]="M520.15,292.43l0.18-11.83l2.46,0.07l-0.28-6.57l25.8,0.23l3.69-3.72l7.96,12.73l-4.36,5.14v7.85l-6.86,14.75l-2.36,1.04l0.75,4.11h2.94l3.99,5.79l-3.2,0.41l-0.82,1.49l-0.08,2.15l-9.6-0.17l-0.98-1.49l-6.71-0.38l-12.32-12.68l1.23-0.74l0.33-2.98l-2.95-1.74l-2.69-5.31l0.15-4.94L520.15,292.43L520.15,292.43z";countries["path11979"]="M477.82,324.28l3.22,2.96l-0.23,4.58l17.66-0.41l1.44-1.62l-5.06-5.45l-0.75-1.97l3.22-6.03l-2.19-4l-1.84-0.99v-2.03l2.13-1.39l0.12-6.32l-1.69-0.19l-0.03,3.32l-7.42,13.85l-4.54,0.23l-3.11,2.14L477.82,324.28L477.82,324.28z";countries["path8177"]="M556.71,294.7l-0.25-5.89l3.96-4.62l1.07,0.82l1.95,6.52l9.36,6.97l-1.7,2.09l-6.85-5.89H556.71L556.71,294.7z";countries["path8179"]="M571.48,301.54l-0.57,3.36l3.96-0.06l0.06-4.94l-1.45-0.89L571.48,301.54L571.48,301.54z";countries["path8939"]="M549.49,311.76l7.28-16.2l7.23,0.04l6.41,5.57l-0.45,4.59h4.97l0.51,2.76l8.04,4.81l4.96,0.25l-9.43,10.13l-12.95,3.99h-3.21l-5.72-4.88l-2.26-0.95l-4.38-6.45l-2.89,0.04l-0.34-2.96L549.49,311.76L549.49,311.76z";countries["path9699"]="M575.74,305.04l4.08,2.78l1.21-0.06l10.13-3.48l1.15,3.71l-0.81,3.13l-2.19,1.74l-5.47-0.35l-7.83-4.81L575.74,305.04L575.74,305.04z";countries["path10459"]="M599.62,299.65l2.13,2.38l2.88-1.74l1.04-0.35l-1.32-1.28l-2.53,0.75L599.62,299.65L599.62,299.65z";countries["path11219"]="M591.97,304.05l4.37-1.68l1.55,0.93l-0.17,3.88l-4.03,11.48l-21.81,23.36l-2.53-1.74l-0.17-9.86l3.28-3.77l6.96-2.15l10.21-10.78l2.67-2.38l0.75-3.48L591.97,304.05L591.97,304.05z";countries["path11981"]="M495.66,324.05l4.66,5.04l1.84-2.38l2.93,0.12l0.63-2.32l2.88-1.8l5.98,4.12l3.45-3.42l13.39,0.59L519,311.18l1.67-1.04l0.23-2.26l-2.82-1.33h-4.14l-6.67,6.61l-0.23,2.72l-5.29-0.17l-0.17,1.16l-3.45-0.35l-3.11,5.91L495.66,324.05L495.66,324.05z";countries["path11983"]="M470.74,337.15l1.15-0.58l0.86,0.7l-0.86,1.33l-1.04-0.41L470.74,337.15L470.74,337.15z";countries["path11985"]="M473.05,333.5l1.73-0.29l0.58,1.1l-0.86,0.93l-0.86-0.12L473.05,333.5L473.05,333.5z";countries["path11987"]="M476.84,327.41l-0.46,1.97l1.38,0.75l1.32-0.99l-0.46-2.03L476.84,327.41L476.84,327.41z";countries["path11989"]="M486.39,332.63l-0.12,2.49l-5.64-0.12l-3.45,6.67l8.11,8.87l2.01-1.68l-0.06-1.74l-1.38-0.64v-1.22l3.11-1.97l2.76,2.09l3.05,0.06l-0.06-10.49l-4.83-0.23l-0.06-2.2L486.39,332.63L486.39,332.63z";countries["path11991"]="M480.99,332.69l-0.06,1.39l4.54,0.23l-0.06-1.57L480.99,332.69L480.99,332.69z";countries["path11993"]="M491,332.52l-0.06,1.45l4.78,0.12l0.17,12.41l-4.37-0.12l-2.53-1.97l-1.96,1.1l-0.09,0.55l1.01,0.49l0.29,2.55l-2.7,2.32l0.58,1.22l2.99-2.32h1.44l0.46,1.39l1.9,0.81l6.1-5.16l-0.12-3.77l1.27-3.07l3.91-2.9l1.05-9.81l-2.78,0.01l-3.22,4.41L491,332.52L491,332.52z";countries["path12753"]="M486.55,353.23l1.74,2.26l2.25-2.13l-0.66-2.21l-0.56-0.04L486.55,353.23L486.55,353.23z";countries["path13513"]="M489.38,355.71l10.31-0.18l2.09,2.97l-0.08,2.19l0.77,0.7h5.12l1.47-2.89h2.09l0.85,0.86l2.87-0.08l0.85,10.08l4.96,0.16v0.78l13.33,6.01l0.62,1.17h2.79l-0.31-4.22l-5.04-2.42l0.31-3.2l2.17-5.08l4.96-0.16l-4.26-14.14l0.08-6.01l6.74-10.54l0.08-1.48l-1.01-0.55l0.04-2.86l-1.23-0.11l-1.24-1.58l-20.35-0.92l-3.73,3.63l-6.11-4.02l-2.15,1.32l-1.56,13.13l-3.86,2.98l-1.16,2.64l0.21,3.91l-6.96,5.69l-1.85-0.84l0.25,1.09L489.38,355.71L489.38,355.71z";countries["path13515"]="M537.82,339.9l2.81,2.59l-0.12,2.77l-4.36,0.09v-3.06L537.82,339.9L537.82,339.9z";countries["path13517"]="M536.21,346.21l4.27-0.09l-1.11,3.74l-1.08,0.94h-1.32l-0.94-2.53L536.21,346.21L536.21,346.21z";countries["path14277"]="M538.3,339.09l3.03,2.84l1.9-1.21l5.14-0.84l0.88,0.09l0.33-1.95l2.9-6.1l-2.44-5.08l-7.91,0.05l-0.05,2.09l1.06,1.02l-0.16,2.09L538.3,339.09L538.3,339.09z";countries["path14279"]="M550.83,326.52l2.66,5.19l-3.19,6.69l-0.42,2.03l15.93,9.85l4.94-7.76l-2.5-2.03l-0.05-10.22l3.13-3.42l-4.99,1.66l-3.77,0.05l-5.9-4.98l-1.86-0.8l-3.45,0.32l-0.61,1.02L550.83,326.52L550.83,326.52z";countries["path15039"]="M550.57,371.42l17.47-2.14l-3.93-7.6l-0.21-7.28l1.27-3.48l-16.62-10.44l-5.21,0.86l-1.81,1.34l-0.16,3.05l-1.17,4.23l-1.22,1.45l-1.75,0.16l3.35,11.61l5.47,2.57l3.77,0.11L550.57,371.42L550.57,371.42z";countries["path16569"]="M514.55,384.7l3.17,4.4l4.91,0.3l1.74,0.96l5.14,0.06l4.43-6.21l12.38-5.54l1.08-4.88l-1.44-6.99l-6.46-3.68l-4.31,0.3l-2.15,4.76l0.06,2.17l5.08,2.47l0.3,5.37l-4.37,0.24l-1.08-1.81l-12.14-5.18l-0.36,3.98l-5.74,0.18L514.55,384.7L514.55,384.7z";countries["path15809"]="M488.62,356.71l3.41,12.73l-0.08,4.02l-4.99,5.36l-0.75,8.71l19.2,0.17l6.24,2.26l5.15-0.67l-3-3.76l0.01-10.74l5.9-0.25v-4.19l-4.79-0.2l-0.96-9.92l-2.02,0.03l-1.09-0.98l-1.19,0.06l-1.58,3.06H502l-1.41-1.42l0.42-2.01l-1.66-2.43L488.62,356.71L488.62,356.71z";countries["path18089"]="M547.16,379.4l3.11,3.25l-0.06,4.16l0.6,1.75l4.13-4.46l-0.48-5.67l-2.21-1.69l-1.97-9.95l-3.41-0.12l1.55,7.17L547.16,379.4L547.16,379.4z";countries["path18849"]="M541.17,413.28l2.69,2.23l6.34-3.86l1.02-5.73v-9.46l10.17-8.32l1.74,0.06l6.16-5.91l-0.96-12.18L552,372.17l0.48,3.68l2.81,2.17l0.66,6.63l-5.5,5.37l-1.32-3.01l0.24-3.98l-3.17-3.44l-7.78,3.62l7.24,3.68l0.24,10.73l-4.79,7.11L541.17,413.28L541.17,413.28z";countries["path19609"]="M524.66,392.3l8.97,10.13l6.88,1.75l4.61-7.23l-0.36-9.58l-7.48-3.86l-2.81,1.27l-4.19,6.39l-5.8-0.06L524.66,392.3L524.66,392.3z";countries["path20369"]="M496.55,421.96l3.35,0.24l1.97,1.99l4.67,0.06l1.14-13.26v-8.68l2.99-0.6l1.14-9.1l7.6-0.24l2.69-2.23l-4.55-0.18l-6.16,0.84l-6.64-2.41h-18.66l0.48,5.3l6.22,9.16l-1.08,4.7l0.06,2.47L496.55,421.96L496.55,421.96z";countries["path21129"]="M508.51,411.23l2.15,0.66l-0.3,6.15l2.21,0.3l5.08-4.58l6.1,0.66l1.62-4.1l7.72-7.05l-9.27-10.67l-0.12-1.75l-1.02-0.3l-2.81,2.59l-7.3,0.18l-1.02,9.1l-2.87,0.66L508.51,411.23L508.51,411.23z";countries["path21131"]="M540.87,414l-2.51,0.42l-1.08,2.95l1.92,1.75h2.33l1.97-2.83L540.87,414L540.87,414z";countries["path21891"]="M527.41,425.39l3.05-2.35l1.44,0.06l1.74,2.17l-0.18,2.17l-2.93,1.08v0.84l-3.23-0.18l-0.78-2.35L527.41,425.39L527.41,425.39z";countries["path22651"]="M534.16,403.63l-7.9,7.3l-1.88,4.51l-6.26-0.78l-5.21,4.63l-3.46-0.34l0.28-6.4l-1.23-0.43l-0.86,13.09l-6.14-0.06l-1.85-2.18l-2.71-0.03l2.47,7.09l4.41,4.17l-3.15,3.67l2.04,4.6l4.72,1.8l3.76-3.2l10.77,0.06l0.77-0.96l4.78-0.84l16.17-16.1l-0.06-5.07l-1.73,2.24h-2.59l-3.15-2.64l1.6-3.98l2.75-0.56l-0.25-8.18L534.16,403.63L534.16,403.63z M530.37,422.13l1.51-0.06l2.45,2.66l-0.07,3.08l-2.87,1.45l-0.18,1.02l-4.38,0.05l-1.37-3.3l1.25-2.42L530.37,422.13L530.37,422.13z";countries["path25914"]="M321.13,50.07l-1.36,2.17l2.45,2.45l-1.09,2.45l3.54,4.62l4.35-1.36l5.71-0.54l6.53,7.07l4.35,11.69l-3.53,7.34l4.89-0.82l2.72,1.63l0.27,3.54l-5.98,0.27l3.26,3.26l4.08,0.82l-8.97,11.96l-1.09,7.34l1.9,5.98l-1.36,3.54l2.45,7.61l4.62,5.17l1.36-0.27l2.99-0.82l0.27,4.35l1.9,2.72l3.53-0.27l2.72-10.06l8.16-10.06l12.24-4.89l7.61-9.52l3.53,1.63h7.34l5.98-5.98l7.34-2.99l0.82-4.62l-4.62-4.08l-4.08-1.36l-2.18-5.71l5.17-2.99l8.16,4.35l2.72-2.99l-4.35-2.45l9.25-12.51l-1.63-5.44l-4.35-0.27l1.63-4.89l5.44-2.45l11.15-9.79l-3.26-3.53l-12.51,1.09l-6.53,6.53l3.81-8.43l-4.35-1.09l-2.45,4.35l-3.53-2.99l-9.79,1.09l2.72-4.35l16.04-0.54l-4.08-5.44l-17.4-3.26l-7.07,1.09l0.27,3.54l-7.34-2.45l0.27-2.45l-5.17,1.09l-1.09,2.72l5.44,1.9l-5.71,4.08l-4.08-4.62l-5.71-1.63l-0.82,4.35h-5.71l-2.18-4.62l-8.97-1.36l-4.89,2.45l-0.27,3.26l-6.25-0.82l-3.81,1.63l0.27,3.81v1.9l-7.07,1.36l-3.26-2.17l-2.18,3.53l3.26,3.54l6.8-0.82l0.54,2.18l-5.17,2.45L321.13,50.07L321.13,50.07z";countries["path25916"]="M342.89,92.49l1.63,2.45l-0.82,2.99h-1.63l-2.18-2.45l0.54-1.9L342.89,92.49L342.89,92.49z";countries["path25918"]="M410.87,85.69l4.62,1.36l-0.27,3.81l-4.89-2.45l-1.09-1.36L410.87,85.69L410.87,85.69z";countries["path26695"]="M319.57,556.47l-2.49,0.5l-0.55,2.55l4.76-0.7L319.57,556.47L319.57,556.47z";countries["path26697"]="M323.59,552.54l-2.99,0.57l0.57,2.31l3.64-0.13L323.59,552.54L323.59,552.54z";countries["path26701"]="M329.33,547.24l-2.16,0.85l-0.55,2.04l1.87,0.68l3.14-2.16L329.33,547.24L329.33,547.24z";countries["path1364"]="M761.17,427.98l-0.35,25.38l-3.9,2.86l-0.35,2.5l5.32,3.57l13.13-2.5h6.74l2.48-3.58l14.9-2.86l10.64,3.22l-0.71,4.29l1.42,4.29l8.16-1.43l0.35,2.14l-5.32,3.93l1.77,1.43l3.9-1.43l-1.06,11.8l7.45,5.72l4.26-1.43l2.13,2.14l12.42-1.79l11.71-18.95l4.26-1.07l8.51-15.73l2.13-13.58l-5.32-6.79l2.13-1.43l-4.26-13.23l-4.61-3.22l0.71-17.87l-4.26-3.22l-1.06-10.01h-2.13l-7.1,23.59l-3.9,0.36l-8.87-8.94l4.97-13.23l-9.22-1.79l-10.29,2.86l-2.84,8.22l-4.61,1.07l-0.35-5.72l-18.8,11.44l0.35,4.29l-2.84,3.93h-7.1l-15.26,6.43L761.17,427.98L761.17,427.98z";countries["path1366"]="M825.74,496.26l-1.77,7.15l0.35,5l5.32-0.36l6.03-9.29L825.74,496.26L825.74,496.26z";countries["path1368"]="M913.02,481.96l1.06,11.8l-1.42,5.36l-5.32,3.93l0.35,4.65v5l1.42,1.79l14.55-12.51v-2.86h-3.55l-4.97-16.8L913.02,481.96L913.02,481.96z";countries["path1370"]="M902.38,507.7l2.84,5.36l-7.81,7.51l-0.71,3.93l-5.32,0.71l-8.87,8.22l-8.16-3.93l-0.71-2.86l14.9-6.43L902.38,507.7L902.38,507.7z";countries["path1372"]="M906.64,420.47l-0.35,1.79l4.61,6.43l2.48,1.07l0.35-2.5L906.64,420.47L906.64,420.47z";countries["path2372"]="M722.48,317.57l-0.28,2.28l6.79,11.41h1.98l14.15,23.67l5.66,0.57l2.83-8.27l-4.53-2.85l-0.85-4.56L722.48,317.57L722.48,317.57z";countries["path2060"]="M764.14,332.92l3.02,3.49l11.58-4.01l2.29-8.84l5.16-0.37l4.72-3.42l-6.12-4.46l-1.4-2.45l-3.02,5.57l1.11,3.2l-1.84,2.67l-3.47-0.89l-8.41,6.17l0.22,3.57L764.14,332.92L764.14,332.92z";countries["path2820"]="M779.77,319.25l-2.88,3.49l2.36,0.74l1.33-1.86L779.77,319.25L779.77,319.25z";countries["path3596"]="M789.53,349.11l2.26,2.77l-1.47,4.16v0.79h3.34l1.18-10.4l1.08,0.3l1.96,9.5l1.87,0.5l1.77-4.06l-1.77-6.14l-1.47-2.67l4.62-3.37l-1.08-1.49l-4.42,2.87h-1.18l-2.16-3.17l0.69-1.39l3.64-1.78l5.5,1.68l1.67-0.1l4.13-3.86l-1.67-1.68l-3.83,2.97h-2.46l-3.73-1.78l-2.65,0.1l-2.95,4.75l-1.87,8.22L789.53,349.11L789.53,349.11z";countries["path3598"]="M814.19,330.5l-1.87,4.55l2.95,3.86h0.98l1.28-2.57l0.69-0.89l-1.28-1.39l-1.87-0.69L814.19,330.5L814.19,330.5z";countries["path3600"]="M819.99,345.45l-4.03,0.89l-1.18,1.29l0.98,1.68l2.65-0.99l1.67-0.99l2.46,1.98l1.08-0.89l-1.96-2.38L819.99,345.45L819.99,345.45z";countries["path3602"]="M753.17,358.32l-2.75,1.88l0.59,1.58l8.75,1.98l4.42,0.79l1.87,1.98l5.01,0.4l2.36,1.98l2.16-0.5l1.97-1.78l-3.64-1.68l-3.14-2.67l-8.16-1.98L753.17,358.32L753.17,358.32z";countries["path3604"]="M781.77,366.93l-2.16,1.19l1.28,1.39l3.14-1.19L781.77,366.93L781.77,366.93z";countries["path3606"]="M785.5,366.04l0.39,1.88l2.26,0.59l0.88-1.09l-0.98-1.49L785.5,366.04L785.5,366.04z";countries["path3608"]="M790.91,370.99l-2.75,0.4l2.46,2.08h1.96L790.91,370.99L790.91,370.99z";countries["path3610"]="M791.69,367.72l-0.59,1.19l4.42,0.69l3.44-1.98l-1.96-0.59l-3.14,0.89l-1.18-0.99L791.69,367.72L791.69,367.72z";countries["path3612"]="M806.14,368.42l-5.11,4.26l0.49,1.09l2.16-0.4l2.55-2.38l5.01-0.69l-0.98-1.68L806.14,368.42L806.14,368.42z";countries["path5154"]="M880.48,349l-0.88,1.25l4.81,4.26l0.66,2.5l1.31-0.15l0.15-2.57l-1.46-1.32L880.48,349L880.48,349z";countries["path5156"]="M882.89,355.03l-0.95,0.22l-0.58,2.57l-1.82,1.18l-5.47,0.96l0.22,2.06l5.76-0.29l3.65-2.28l-0.22-3.97L882.89,355.03L882.89,355.03z";countries["path5158"]="M889.38,359.51l1.24,3.45l2.19,2.13l0.66-0.59l-0.22-2.28l-2.48-3.01L889.38,359.51L889.38,359.51z";countries["path5918"]="M895.43,364.65l0.15,2.28l1.39,1.32l1.31-0.81l-1.17-2.43L895.43,364.65L895.43,364.65z";countries["path5920"]="M897.18,370.31l-1.17,1.25l1.24,2.28l1.46,0.44l-0.07-1.54L897.18,370.31L897.18,370.31z";countries["path5922"]="M900.03,368.99l1.02,2.5l1.97,2.35l1.09-1.76l-1.46-2.5L900.03,368.99L900.03,368.99z";countries["path5924"]="M905.14,372.74l0.58,3.09l1.39,1.91l1.17-2.42L905.14,372.74L905.14,372.74z";countries["path5926"]="M906.74,379.65l-0.51,0.88l1.68,2.21l1.17,0.07l-0.73-2.87L906.74,379.65L906.74,379.65z";countries["path5928"]="M903.02,384.05l-1.75,0.81l1.53,2.13l1.31-0.74L903.02,384.05L903.02,384.05z";countries["path5930"]="M920.87,397.22l-1.24,1.66l0.52,1.87l0.62,0.42l1.13-1.46L920.87,397.22L920.87,397.22z";countries["path5932"]="M921.49,402.31l0.1,1.35l1.34,0.42l0.93-0.52l-0.93-1.46L921.49,402.31L921.49,402.31z";countries["path5934"]="M923.45,414.37l-0.62,0.94l0.93,1.04l1.55-0.52L923.45,414.37L923.45,414.37z";countries["path5936"]="M948.62,412.29l-1.24,1.66l-0.1,1.87l1.44,1.46L948.62,412.29L948.62,412.29z";countries["path7454"]="M789.37,297.53l-0.86,1.64l-0.48,2.02l-4.78,6.07l0.29,1.25l2.01-0.29l6.21-6.94L789.37,297.53L789.37,297.53z";countries["path7456"]="M797.11,295.22l-0.1,5.01l1.82,1.83l0.67,3.56l1.82,0.39l0.86-2.22l-1.43-1.06l-0.38-6.26L797.11,295.22L797.11,295.22z";countries["path7458"]="M802.28,297.15l-0.1,4.43l1.05,1.73l1.82-2.12l-0.48-3.85L802.28,297.15L802.28,297.15z";countries["path7460"]="M803.42,293.29l1.82,2.41l0.86,2.31h1.63l-0.29-3.95l-1.82-1.25L803.42,293.29L803.42,293.29z";countries["path7462"]="M806.96,302.35l0.38,2.89l-3.35,2.7l-2.77,0.29l-2.96,3.18l0.1,1.45l2.77-0.87l1.91-1.25l1.63,4.14l2.87,2.02l1.15-0.39l1.05-1.25l-2.29-2.31l1.34-1.06l1.53,1.25l1.05-1.73l-1.05-2.12l-0.19-4.72L806.96,302.35L806.96,302.35z";countries["path7464"]="M791.38,272.97l-2.58,1.83l-0.29,5.78l4.02,7.8l1.34,1.06l1.72-1.16l2.96,0.48l0.57,2.6l2.2,0.19l1.05-1.44l-1.34-1.83l-1.63-1.54l-3.44-0.38l-1.82-2.99l2.1-3.18l0.19-2.79l-1.43-3.56L791.38,272.97L791.38,272.97z";countries["path7466"]="M792.72,290.21l0.76,2.7l1.34,0.87l0.96-1.25l-1.53-2.12L792.72,290.21L792.72,290.21z";countries["path7468"]="M759.83,270.17l-2.39,0.67l-1.72,2.12l1.43,2.79l2.1,0.19l2.39-2.12l0.57-2.79L759.83,270.17L759.83,270.17z";countries["path7470"]="M787.46,248.31l-3.54,2.7l-0.19,5.2l3.06,3.56l0.76-0.67L787.46,248.31L787.46,248.31z";countries["path7472"]="M803.23,216.42l-1.63,1.64l0.67,2.31l1.43,0.1l0.96,5.01l1.15,1.25l2.01-1.83l0.86-3.28l-2.49-3.56L803.23,216.42L803.23,216.42z";countries["path7474"]="M812.03,213.15l-2.77,2.6l-0.1,2.99l0.67,0.87l3.73-3.18l-0.29-3.18L812.03,213.15L812.03,213.15z";countries["path7476"]="M808.2,206.98l-4.88,5.59l0.86,1.35l2.39,0.29l4.49-3.47l3.16-0.58l2.87,3.37l2.2-0.77l0.86-3.28l4.11-0.1l4.02-4.82l-2.1-8l-0.96-4.24l2.1-1.73l-4.78-7.22l-1.24,0.1l-2.58,2.89v2.41l1.15,1.35l0.38,6.36l-2.96,3.66l-1.72-1.06l-1.34,2.99l-0.29,2.79l1.05,1.64l-0.67,1.25l-2.2-1.83h-1.53l-1.34,0.77L808.2,206.98L808.2,206.98z";countries["path7478"]="M816.43,163.44l-1.53,1.35l0.77,2.89l1.34,1.35l-0.1,4.43l-1.72,0.67l-1.34,2.99l3.92,5.39l2.58-0.87l0.48-1.35l-2.77-2.5l1.72-2.22l1.82,0.29l1.43,1.54l0.1-3.18l3.92-3.18l2.2-0.58l-1.82-3.08l-0.86-1.35l-1.43,0.96l-1.24,1.54l-2.68-0.58l-2.77-1.83L816.43,163.44L816.43,163.44z";countries["path7480"]="M830.86,160.45l-2.68,3.76l0.19,1.83l1.34-0.58l3.15-3.95L830.86,160.45L830.86,160.45z";countries["path7482"]="M834.4,154.96l-0.96,2.6l0.1,1.73l1.63-1.06l1.53-3.08V154L834.4,154.96L834.4,154.96z";countries["path7484"]="M840.04,132.03l-1.24,1.54l0.1,2.41l1.15-0.1l1.91-3.37L840.04,132.03L840.04,132.03z";countries["path7486"]="M837.75,137.91v4.24l1.34,0.48l0.96-1.54v-3.27L837.75,137.91L837.75,137.91z";countries["path7488"]="M798.64,122.59l-0.09,6.17l7.74,11.95l2.77,10.4l4.88,9.25l1.91,0.67l1.63-1.35l0.76-2.22l-6.98-7.61l0.19-3.95l1.53-0.67l0.38-2.31l-13.67-19.36L798.64,122.59L798.64,122.59z";countries["path7490"]="M852.57,103.42l-1.91,0.19l1.15,1.64l2.39,1.64l0.67-0.77L852.57,103.42L852.57,103.42z";countries["path7492"]="M856.29,104.58l0.29,1.64l2.96,0.87l0.29-1.16L856.29,104.58L856.29,104.58z";countries["path9010"]="M872.54,110.87l1.25,2.24l2.08-0.14l0.42-1.54L872.54,110.87L872.54,110.87z";countries["path9012"]="M893.51,114.37l1.67,3.08l1.25-1.4v-2.1L893.51,114.37L893.51,114.37z";countries["path9014"]="M907.81,104.57l-2.36,3.08l0.55,1.4l2.92-1.82l0.28-1.82L907.81,104.57L907.81,104.57z";countries["path9016"]="M919.61,94.92l-2.08,2.52l2.22,0.84L919.61,94.92L919.61,94.92z";countries["path9018"]="M922.53,90.72l-1.39,2.24l0.14,2.24l1.94-0.84L922.53,90.72L922.53,90.72z";countries["path9020"]="M881.29,38.39l-2.36,1.54l-0.56,1.96l1.11,1.26l2.5-0.84l2.5,0.84l1.39,0.42l-0.14-4.62L881.29,38.39L881.29,38.39z";countries["path9782"]="M69.17,53.35l3.46,6.47l2.22-0.5v-2.24L69.17,53.35L69.17,53.35z";countries["path12062"]="M78.49,3.32L74.6,6.85l1.17,2.61l2.08-1.44l1.17,1.31L82.9,7.9l-0.13-2.22L78.49,3.32L78.49,3.32z";countries["path12823"]="M49.66,110.26l-0.17,3.01l2.16-0.5v-1.34L49.66,110.26L49.66,110.26z";countries["path12825"]="M46.34,111.6l-4.32,2.18l0.67,2.34l1.66-1.34l3.32-1.51L46.34,111.6L46.34,111.6z";countries["path12827"]="M28.39,114.44l-2.99-0.67l-0.5,1.34l0.33,2.51L28.39,114.44L28.39,114.44z";countries["path12829"]="M22.07,114.28l-2.83-1.17l-1,1.84l1.83,1.84L22.07,114.28L22.07,114.28z";countries["path12831"]="M12.27,111.6l-1.33-1.84l-1.33,0.5v2.51l1.5,1L12.27,111.6L12.27,111.6z";countries["path12833"]="M1.47,99.71l1.66,1.17l-0.5,1.34H1.47V99.71L1.47,99.71z";countries["path13593"]="M622.76,499.62l-0.15,4.29l5.94,1.38l1.37-3.53l-2.13,0.61l-2.74,0.61l-0.76-3.22L622.76,499.62L622.76,499.62z";countries["path13595"]="M613.01,398.99l-1.52,1.99l0.3,2.15l3.2-2.61L613.01,398.99L613.01,398.99z";countries["path13597"]="M607.38,402.37l-2.28,0.15l-0.15,1.99l1.52,0.31l2.28-1.07L607.38,402.37L607.38,402.37z";countries["path13599"]="M592.3,372.92l-2.13,5.06l-3.65,6.44l-6.39,0.46l-2.74,3.22l0.46,9.82l-3.96,4.6l0.46,7.82l3.35,3.83l3.96-0.46l3.96-2.92l-0.91-4.6l9.13-15.8l-1.83-1.99l1.83-3.83l1.98,0.61l0.61-1.53l-1.83-7.82l-1.07-3.22L592.3,372.92L592.3,372.92z";countries["path13601"]="M577.69,371.23l0.46,1.53l1.98,0.31l0.76-1.99L577.69,371.23L577.69,371.23z";countries["path13603"]="M580.58,374.3l0.76,1.69h1.22l0.61-2.15L580.58,374.3L580.58,374.3z";countries["path13605"]="M602.35,358.34l-0.61,1.23l1.67,1.38l1.22-1.38L602.35,358.34L602.35,358.34z";countries["path13607"]="M610.88,349.14l-1.83,1.23l1.37,2.15h1.83L610.88,349.14L610.88,349.14z";countries["path13609"]="M611.64,354.51l-1.22,1.38l0.91,1.38l1.67,0.31l0.15-2.92L611.64,354.51L611.64,354.51z";countries["path13611"]="M656.4,320.76l0.3,2.61l1.67,0.61l0.3-2.3L656.4,320.76L656.4,320.76z";countries["path13613"]="M658.53,326.28l-0.15,3.22l1.22,0.61l1.07-2.15L658.53,326.28L658.53,326.28z";countries["path13615"]="M658.84,332.57l-1.07,1.07l1.22,1.07l1.52-1.07L658.84,332.57L658.84,332.57z";countries["path13617"]="M372.64,217.02l-1.36,1.37l2.44,1.37l0.27-1.91L372.64,217.02L372.64,217.02z";countries["path13619"]="M379.97,216.2l-1.63,1.09l1.36,1.09l2.17-0.55L379.97,216.2L379.97,216.2z";countries["path13621"]="M381.05,220.03l-0.81,2.19l1.08,1.37l1.36-1.09L381.05,220.03L381.05,220.03z";countries["path13623"]="M387.56,224.4l-0.54,1.37l0.81,0.82l2.17-1.37L387.56,224.4L387.56,224.4z";countries["path13625"]="M408.18,236.42l-1.08,1.37l1.08,1.37l1.63-0.82L408.18,236.42L408.18,236.42z";countries["path13627"]="M415.62,253.73l-1.75,1.01l0.81,0.82L415.62,253.73L415.62,253.73z";countries["path13629"]="M409.54,253.92l-2.17,0.55l1.08,1.64h1.63L409.54,253.92L409.54,253.92z";countries["path13631"]="M404.38,252.28l-1.36,1.37l1.9,1.64l1.08-2.46L404.38,252.28L404.38,252.28z";countries["path13633"]="M387.56,290.54l-1.9,1.09l1.36,1.09l1.63-0.82L387.56,290.54L387.56,290.54z";countries["path13637"]="M392.23,292.74l-1.24,1.1l0.88,1.63l2.12-0.95L392.23,292.74L392.23,292.74z";countries["path13639"]="M389.52,295.83l-1.59,0.95l1.71,2.29l1.35-0.71L389.52,295.83L389.52,295.83z";countries["path13641"]="M10,248.7l-0.14,2.33l2.04,1.37l1.22-1.09L10,248.7L10,248.7z";countries["path13643"]="M15.29,252.13l-1.9,1.37l1.63,2.05l1.9-1.64L15.29,252.13L15.29,252.13z";countries["path13645"]="M19.1,255.41l-1.63,2.19l0.54,1.37l2.31-1.09L19.1,255.41L19.1,255.41z";countries["path13647"]="M21.81,259.65l-0.95,5.47l0.95,2.05l3.12-0.96l1.63-2.74l-3.4-3.15L21.81,259.65L21.81,259.65z";countries["path13655"]="M276.6,283.37l-1.5,0.62l0.53,1.33l1.76-1.15l-0.35-0.36L276.6,283.37L276.6,283.37z";countries["path13657"]="M279.07,284.88l-0.88,1.87l1.06,1.42l1.32-1.15L279.07,284.88L279.07,284.88z";countries["path13659"]="M282.07,290.03l-1.06,0.98l0.79,1.6l1.5-0.44L282.07,290.03L282.07,290.03z";countries["path13661"]="M281.98,294.03l-0.71,1.51l1.15,1.24l1.5-0.8L281.98,294.03L281.98,294.03z";countries["path13663"]="M282.07,297.85l-1.23,0.89l0.97,1.78l1.59-0.89L282.07,297.85L282.07,297.85z";countries["path13665"]="M280.57,301.31l-1.15,1.15l0.44,0.71h1.41l0.44-1.16L280.57,301.31L280.57,301.31z";countries["path13667"]="M282.24,304.78l-1.06,0.98l-1.15,0.18v1.42l2.12,1.95l0.88-1.42l0.53-1.6l-0.18-1.33L282.24,304.78L282.24,304.78z";countries["path13669"]="M271.05,281.06l-2.64-0.89l-2.12,1.33l1.06,1.24l3.61,0.53L271.05,281.06L271.05,281.06z";countries["path15205"]="M250.87,275.38l-1.67,1.71l1.91,0.78l0.28,2.39l-4.23,0.37l0.43,2.3l1.23,0.09l0.71-1.06l4.94,0.16l0.89,1.71l1.14-1.34l3.33-0.9l2.93,0.62l0.34-1.77l-5.28-3.45l-3.42-1.28L250.87,275.38L250.87,275.38z";countries["path13671"]="M263.11,280.44l-5.29-3.46l-2.5-0.85l-0.84,6l0.88,1.69l1.15-1.33l3.35-0.89l2.91,0.62L263.11,280.44L263.11,280.44z";countries["path13673"]="M250.86,275.38l3.44,0.36l-0.41,4.22l-0.34,2.22l-4.01-0.22l-0.71,1.07l-1.23-0.09l-0.44-2.31l4.23-0.35l-0.26-2.4l-1.94-0.8L250.86,275.38L250.86,275.38z";countries["path15980"]="M307.95,508.18l-2.63-0.29l-2.62,1.76l1.9,2.06L307.95,508.18L307.95,508.18z";countries["path15984"]="M310.57,506.86l-0.87,2.79l-2.48,2.2l0.15,0.73l4.23-1.62l1.75-2.2L310.57,506.86L310.57,506.86z";countries["path15986"]="M406.36,117.31l-1.96-1.11l-2.64,1.67l-2.27,2.1l0.06,1.17l2.94,0.37l-0.18,2.1l-1.04,1.05l0.25,0.68l2.94,0.19v3.4l4.23,0.74l2.51,1.42l2.82,0.12l4.84-2.41l3.74-4.94l0.06-3.34l-2.27-1.92l-1.9-1.61l-0.86,0.62l-1.29,1.67l-1.47-0.19l-1.47-1.61l-1.9,0.18l-2.76,2.29l-1.66,1.79l-0.92-0.8l-0.06-1.98l0.92-0.62L406.36,117.31L406.36,117.31z";countries["path15988"]="M488.26,53.96l-1.65-1.66l-3.66,1.78h-6.72L475.17,58l3.77,3.33l1.65-0.24l2.36-4.04l2,1.43l-1.42,2.85l-0.71,4.16l1.65,2.61l3.54-5.94l4.6-5.59l-1.77-1.54L488.26,53.96L488.26,53.96z";countries["path15990"]="M490.26,46.83l-2.95,2.73l1.77,2.73h3.18l1.3,1.78l3.89,2.02l4.48-2.61l3.07-2.61l-1.06-2.14l-3.07-1.78l-2.24,2.02l-1.53-1.9l-1.18,0.12l-1.53,3.33l-2.24-2.26l-0.24-1.54L490.26,46.83L490.26,46.83z";countries["path15992"]="M496.98,59.07l-2.36,2.14l-2,1.54l0.94,1.66l1.89,0.59l3.07-1.43l1.42-1.78l-1.3-2.14L496.98,59.07L496.98,59.07z";countries["path15994"]="M547.82,38.79l1.72,0.69l-1.21,2.08v2.95l-2.58,1.56H543l-1.55-1.91l0.17-2.08l1.21-1.56h2.41L547.82,38.79L547.82,38.79z";countries["path15996"]="M554.36,36.88v2.08l1.72,1.39l2.41-0.17l2.07-1.91v-1.39h-1.89l-1.55,0.52l-1.21-1.39L554.36,36.88L554.36,36.88z";countries["path15998"]="M564.18,37.06l1.21,2.6l2.41,0.17l1.72-0.69l-0.86-2.43l-2.24-0.52L564.18,37.06L564.18,37.06z";countries["path16002"]="M573.99,33.59l-1.89-0.35l-1.72,1.74l0.86,1.56l0.52,2.43l2.24-1.73l0.52-1.91L573.99,33.59L573.99,33.59z";countries["path16004"]="M584.49,51.98l-0.52,2.43l-3.96,3.47l-8.44,1.91l-6.89,11.45l-1.21,3.3l6.89,1.74l1.03-4.16l2.07-6.42l5.34-2.78l4.48-3.47l3.27-1.39h1.72v-4.68L584.49,51.98L584.49,51.98z";countries["path16006"]="M562.28,77.31l4.65,0.52l1.55,5.38l3.96,4.16l-1.38,2.78h-2.41l-2.24-2.6l-4.99-0.17l-2.07-2.78v-1.91l3.1-0.87L562.28,77.31L562.28,77.31z";countries["path16008"]="M634.95,18.15l-2.24-1.39h-2.58l-0.52,1.56l-2.75,1.56l-2.07,0.69l-0.34,2.08l4.82,0.35L634.95,18.15L634.95,18.15z";countries["path16010"]="M640.28,18.67l-1.21,2.6l-2.41-0.17l-3.79,2.78l-1.03,3.47h2.41l1.38-2.26l3.27,2.43l3.1-1.39l2.24-1.91l-0.86-2.95l-1.21-2.08L640.28,18.67L640.28,18.67z";countries["path16012"]="M645.28,20.58l1.21,4.86l1.89,4.51l2.07-3.64l3.96-0.87v-2.6l-2.58-1.91L645.28,20.58L645.28,20.58z";countries["path16014"]="M739.76,12.8l2.69,2.26l1.91-0.79l0.56-3.17L741,8.39l-2.58,1.7l-6.28,0.57v2.83l-6.62,0.11v4.63l7.74,5.76l2.02-1.47l-0.45-4.07l4.94-1.24l-1.01-1.92l-1.79-1.81L739.76,12.8L739.76,12.8z";countries["path16016"]="M746.94,10.09l1.79,3.39l6.96-0.79l1.91-2.49l-0.45-2.15l-1.91-0.79l-1.79,1.36l-5.16,1.13L746.94,10.09L746.94,10.09z";countries["path16018"]="M746.49,23.31l-3.48-0.9L741,24.56l-0.9,2.94l4.71-0.45l3.59-1.81L746.49,23.31L746.49,23.31z";countries["path16020"]="M836.68,3.76l-2.92-0.9L830.4,4.1l-1.68,2.49l2.13,2.83l5.61-2.49l1.12-1.24L836.68,3.76L836.68,3.76z";countries["path16022"]="M680.54,308.05l0.25,2.72l0.25,1.98l-1.47,0.25l0.74,4.45l2.21,1.24l3.43-1.98l-0.98-4.69l0.25-1.73l-3.19-2.96L680.54,308.05L680.54,308.05z";countries["path16828"]="M220.85,266.92v1.27l5.32,0.1l2.51-1.46l0.39,1.07l5.22,1.27l4.64,4.19l-1.06,1.46l0.19,1.66l3.87,0.97l3.87-1.75l1.74-1.75l-2.51-1.27l-12.95-7.6l-4.54-0.49L220.85,266.92L220.85,266.92z";countries["path16830"]="M239.61,259.13l-1.26-0.39l-0.1,2.43l1.55,1.56l1.06-1.56L239.61,259.13L239.61,259.13z";countries["path16832"]="M242.12,262.93l-1.74,0.97l1.64,2.34l0.87-1.17L242.12,262.93L242.12,262.93z";countries["path16834"]="M247.73,264.68l-1.84-0.1l0.19,1.17l1.35,1.95l1.16-1.27L247.73,264.68L247.73,264.68z";countries["path16836"]="M246.86,262.35l-3-1.27l-0.58-3.02l1.16-0.49l1.16,2.34l1.16,0.88L246.86,262.35L246.86,262.35z";countries["path16838"]="M243.96,256.21l-1.55-0.39l-0.29-1.95l-1.64-0.58l1.06-1.07l1.93,0.68l1.45,0.88L243.96,256.21L243.96,256.21z";countries["path17598"]="M238.93,279.59l-3.48,0.88v0.97l2.03,1.17h2.13l1.35-1.56L238.93,279.59L238.93,279.59z";countries["path4383"]="M831.93,339.34l-4.17,0.47l-2.68,1.96l1.11,2.24l4.54,0.84v0.84l-2.87,2.33l1.39,4.85l1.39,0.09l1.2-4.76h2.22l0.93,4.66l10.83,8.96l0.28,7l3.7,4.01l1.67-0.09l0.37-24.72l-6.29-4.38l-5.93,4.01l-2.13,1.31l-3.52-2.24l-0.09-7.09L831.93,339.34L831.93,339.34z";countries["path9780"]="M93.11,44.89l-8.39,1.99l1.73,9.45l9.13,2.49l0.49,1.99L82.5,65.04l-7.65,12.68l2.71,13.43L82,94.13l3.46-3.23l0.99,1.99l-4.2,4.97l-16.29,7.46l-10.37,2.49l-0.25,3.73l23.94-6.96l9.87-2.74l9.13-11.19l10.12-6.71l-5.18,8.7l5.68,0.75l9.63-4.23l1.73,6.96l6.66,1.49l6.91,6.71l0.49,4.97l-0.99,1.24l1.23,4.72h1.73l0.25-7.96h1.97l0.49,19.64l4.94-4.23l-3.46-20.39h-5.18l-5.68-7.21l27.89-47.25l-27.64-21.63l-30.85,5.97l-1.23,9.45l6.66,3.98l-2.47,6.47L93.11,44.89L93.11,44.89z";countries["path13653"]="M194.97,338.18l-0.62,2.75l-1.15,1.16l0.79,1.42l2.03-0.8l0.97-1.69l-0.62-1.78L194.97,338.18L194.97,338.18z";countries["path16024"]="M203.73,35.89l0.22,4.02l-7.98,8.27l2,6.7l5.76-1.56l3.33-4.92l8.42-3.13l6.87-0.45l-5.32-5.81l-2.66,2.01l-2-0.67l-1.11-2.46l-2.44-2.46L203.73,35.89L203.73,35.89z";countries["path16026"]="M214.15,24.05l-1.77,3.13l8.65,3.13l3.1-4.69l1.33,3.13h2.22l4.21-4.69l-5.1-1.34l-2-1.56l-2.66,2.68L214.15,24.05L214.15,24.05z";countries["path16028"]="M229.23,30.31l-6.87,2.9v2.23l8.87,3.35l-2,2.23l1.33,2.9l5.54-2.46h4.66l2.22,3.57l3.77-3.8l-0.89-3.58l-3.1,1.12l-0.44-4.47l1.55-2.68h-1.55l-2.44,1.56l-1.11,0.89l0.67,3.13l-1.77,1.34l-2.66-0.22l-0.67-4.02L229.23,30.31L229.23,30.31z";countries["path16030"]="M238.32,23.38l-0.67,2.23l4.21,2.01l3.1-1.79l-0.22-1.34L238.32,23.38L238.32,23.38z";countries["path16032"]="M241.64,19.58l-3.1,1.12l0.22,1.56l6.87-0.45l-0.22-1.56L241.64,19.58L241.64,19.58z";countries["path16034"]="M256.5,23.38l-0.44,1.56l-1.11,1.56v2.23l4.21-0.67l4.43,3.8h1.55v-3.8l-4.43-4.92L256.5,23.38L256.5,23.38z";countries["path16036"]="M267.81,27.85l1.77,2.01l-1.55,2.68l1.11,2.9l4.88-2.68v-2.01l-2.88-3.35L267.81,27.85L267.81,27.85z";countries["path16038"]="M274.24,22.71l0.22,3.57h5.99l1.55,1.34l-0.22,1.56l-5.32,0.67l3.77,5.14l5.1,0.89l7.09-3.13l-10.2-15.42l-3.1,2.01l0.22,2.68l-3.55-1.34L274.24,22.71L274.24,22.71z";countries["path16044"]="M222.58,47.96l-8.42,2.23l-4.88,4.25l0.44,4.69l8.87,2.68l-2,4.47l-6.43-4.02l-1.77,3.35l4.21,2.9l-0.22,4.69l6.43,1.79l7.76-0.45l1.33-2.46l5.76,6.48l3.99-1.34l0.67-4.47l2.88,2.01l0.44-4.47l-3.55-2.23l0.22-14.07l-3.1-2.46L231.89,56L222.58,47.96L222.58,47.96z";countries["path16046"]="M249.63,57.79l-2.88-1.34l-1.55,2.01l3.1,4.92l0.22,4.69l6.65-4.02v-5.81l2.44-2.46l-2.44-1.79h-3.99L249.63,57.79L249.63,57.79z";countries["path16048"]="M263.82,55.78l-4.66,3.8l1.11,4.69h2.88l1.33-2.46l2,2.01l2-0.22l5.32-4.47L263.82,55.78L263.82,55.78z";countries["path16050"]="M263.37,48.4l-1.11,2.23l4.88,1.79l1.33-2.01L263.37,48.4L263.37,48.4z";countries["path16052"]="M260.49,39.91l-4.88,0.67l-2.88,2.68l5.32,0.22l-1.55,4.02l1.11,1.79l1.55-0.22l3.77-6.03L260.49,39.91L260.49,39.91z";countries["path16054"]="M268.92,38.35l-2.66,0.89l0.44,3.57l4.43,2.9l0.22,2.23l-1.33,1.34l0.67,4.47l17.07,5.58l4.66,1.56l4.66-4.02l-5.54-4.47l-5.1,1.34l-7.09-0.67l-2.66-2.68l-0.67-7.37l-4.43-2.23L268.92,38.35L268.92,38.35z";countries["path16056"]="M282.88,61.59L278,61.14l-5.76,2.23l-3.1,4.24l0.89,11.62l9.53,0.45l9.09,4.47l6.43,7.37l4.88-0.22l-1.33,6.92l-4.43,7.37l-4.88,2.23l-3.55-0.67l-1.77-1.56l-2.66,3.57l1.11,3.57l3.77,0.22l4.66-2.23l3.99,10.28l9.98,6.48l6.87-8.71l-5.76-9.38l3.33-3.8l4.66,7.82l8.42-7.37l-1.55-3.35l-5.76,1.79l-3.99-10.95l3.77-6.25l-7.54-8.04l-4.21,2.9l-3.99-8.71l-8.42,1.12l-2.22-10.5l-6.87,4.69l-0.67,5.81h-3.77l0.44-5.14L282.88,61.59L282.88,61.59z";countries["path16058"]="M292.86,65.61l-1.77,1.79l1.55,2.46l7.32,0.89l-4.66-4.92L292.86,65.61L292.86,65.61z";countries["path16060"]="M285.77,40.36v2.01l-4.88,1.12l1.33,2.23l5.54,2.23l6.21,0.67l4.43,3.13l4.43-2.46l-3.1-3.13h3.99l2.44-2.68l5.99-0.89v-1.34l-3.33-2.23l0.44-2.46l9.31,1.56l13.75-5.36l-5.1-1.56l1.33-1.79h10.64l1.77-1.79l-21.51-7.6l-5.1-1.79l-5.54,4.02l-6.21-5.14l-3.33-0.22l-0.67,4.25l-4.21-3.8l-4.88,1.56l0.89,2.46l7.32,1.56l-0.44,3.57l3.99,2.46l9.76-2.46l0.22,3.35l-7.98,3.8l-4.88-3.8l-4.43,0.45l4.43,6.26l-2.22,1.12l-3.33-2.9l-2.44,1.56l2.22,4.24h3.77l-0.89,4.02l-3.1-0.45l-3.99-4.25L285.77,40.36L285.77,40.36z";countries["path16062"]="M266.01,101.85l-4.23,5.32l-0.26,5.86l3.7-2.13h4.49l3.17,2.93l2.91-2.4L266.01,101.85L266.01,101.85z";countries["path16064"]="M317.52,171.05l-10.57,10.12l1.06,2.4l12.94,4.79l1.85-3.19l-1.06-5.32l-4.23,0.53l-2.38-2.66l3.96-3.99L317.52,171.05L317.52,171.05z";countries["path18360"]="M158.22,48.66l1.99,3.01l1,4.02l4.98,1.25l3.49-3.76l2.99,1.51l8.47,0.75l5.98-2.51l1,8.28h3.49V57.7l3.49,0.25l8.72,10.29l5.73,3.51l-2.99,4.77l1.25,1.25L219,80.03l0.25,5.02l2.99,0.5l0.75-7.53l4.73-1.25l3.49,5.27l7.47,3.51l3.74,0.75l2.49-3.01l0.25-4.77l4.48-2.76l1.49,4.02l-3.99,7.03l0.5,3.51l2.24-3.51l4.48-4.02l0.25-5.27l-2.49-4.02l0.75-3.26l5.98-3.01l2.74,2.01l0.5,17.57l4.23-3.76l2.49,1.51l-3.49,6.02l4.48,1l6.48-10.04l5.48,5.77l-2.24,10.29l-5.48,3.01l-5.23-2.51l-9.46,2.01l1,3.26l-2.49,4.02l-7.72,1.76l-8.72,6.78l-7.72,10.29l-1,3.26l5.23,2.01l1.99,5.02l7.22,7.28l11.46,5.02l-2.49,11.54l-0.25,3.26l2.99,2.01l3.99-5.27l0.5-10.04l6.23-0.25l2.99-5.77l0.5-8.78l7.97-15.56l9.96,3.51l5.23,7.28l-2.24,7.28l3.99,2.26l9.71-6.53l2.74,17.82l8.97,10.79l0.25,5.52l-9.96,2.51l-4.73,5.02l-9.96-2.26l-4.98-0.25l-8.72,6.78l5.23-1.25l6.48-1.25l1.25,1.51l-1.74,5.52l0.25,5.02l2.99,2.01l2.99-0.75l1.5-2.26h1.99l-3.24,6.02l-6.23,0.25l-2.74,4.02h-3.49l-1-3.01l4.98-5.02l-5.98,2.01l-0.27-8.53l-1.72-1l-5.23,2.26l-0.5,4.27h-11.96l-10.21,7.03l-13.7,4.52l-1.49-2.01l6.9-10.3l-3.92-3.77l-2.49-4.78l-5.07-3.87l-5.44-0.45l-9.75-6.83l-70.71-11.62l-1.17-4.79l-6.48-6.02v-5.02l1-4.52l-0.5-2.51l-2.49-2.51l-0.5-4.02l6.48-4.52l-3.99-21.58l-5.48-0.25l-4.98-6.53L158.22,48.66L158.22,48.66z";countries["path19122"]="M148.76,158.34l-1,4.02l-3.49-2.26h-1.74l-1,4.27l-12.21,27.36l3.24,23.84l3.99,2.01l0.75,6.53h8.22l7.97,6.02l15.69,1.51l1.74,8.03l2.49,1.76l3.49-3.51l2.74,1.25l2.49,11.54l4.23,2.76l3.49-6.53l10.71-7.78l6.97,3.26l5.98,0.5l0.25-3.76l12.45,0.25l2.49,2.76l0.5,6.27l-1.49,3.51l1.74,6.02h3.74l3.74-5.77l-1.49-2.76l-1.49-6.02l2.24-6.78l10.21-8.78l7.72-2.26l-1-7.28l10.71-11.55l10.71-1.76L272.8,199l10.46-6.02v-8.03l-1-0.5l-3.74,1.25l-0.5,4.92l-12.43,0.15l-9.74,6.47l-15.29,5l-2.44-2.99l6.94-10.5l-3.43-3.27l-2.33-4.44l-4.83-3.88l-5.25-0.44l-9.92-6.77L148.76,158.34L148.76,158.34z";countries["path19124"]="M133.83,128.41l-1.7,3.26l0.59,2.31l1.11,0.69l-0.26,0.94l-1.19,0.34l0.34,3.43l1.28,1.29l1.02-1.11l-1.28-3.34l0.76-2.66l1.87-2.49l-1.36-2.31L133.83,128.41L133.83,128.41z";countries["path19126"]="M139.45,147.95l-1.53,0.6l2.81,3.26l0.68,3.86l2.81,3l2.38-0.43v-3.94l-2.89-1.8L139.45,147.95L139.45,147.95z";countries["path19130"]="M194.88,291.52l5.93,4.34l5.98-7.43l-1.02-1.54l-2.04-0.07v-4.35l-1.53-0.93l-4.63,1.38l1.77,4.08L194.88,291.52L194.88,291.52z";countries["path19132"]="M207.55,288.78l9.24-0.35l2.74,3.26l-1.71-0.39l-3.29,0.14l-4.3,4.04l-1.84,4.09l-1.21-0.64l-0.01-4.48l-2.66-1.78L207.55,288.78L207.55,288.78z";countries["path19134"]="M201.65,296.27l4.7,2.34l-0.07-3.71l-2.41-1.47L201.65,296.27L201.65,296.27z";countries["path19136"]="M217.74,292.11l2.19,0.44l0.07,4.49l-2.55,7.28l-6.87-0.68l-1.53-3.51l2.04-4.26l3.87-3.6L217.74,292.11L217.74,292.11z";countries["path19138"]="M217.38,304.98l1.39,2.72l1.13,1.5l-1.52,4.51l-2.9-2.04l-4.74-4.34v-2.87L217.38,304.98L217.38,304.98z";countries["path19140"]="M220.59,309.61l-1.46,4.56l4.82,1.25l2.99,0.59l0.51-3.53l3.21-1.62l2.85,1.47l1.12,1.79l1.36-0.16l1.07-3.25l-3.56-1.47l-2.7-1.47l-2.7,1.84l-3.21,1.62l-3.28-1.32L220.59,309.61L220.59,309.61z";countries["path19142"]="M253.73,299.78l-2.06-0.21l-13.62,11.23l-1.44,3.95l-1.86,0.21l0.83,8.73l-4.75,11.65l5.16,4.37l6.61,0.42l4.54,6.66l6.6,0.21l-0.21,4.99H256l2.68-9.15l-2.48-3.12l0.62-5.82l5.16-0.42l-0.62-13.52l-11.56-3.74l-2.68-7.28L253.73,299.78L253.73,299.78z";countries["path19144"]="M250.46,305.92l0.44,2.59l3.25,1.03l0.74-4.77l3.43-3.55l3.43,4.02l7.89,2.15l6.68-1.4l4.55,5.61l3.43,2.15l-3.76,5.73l1.26,4.34l-2.15,2.66l-2.23,1.87l-4.83-2.43l-1.11,1.12v3.46l3.53,1.68l-2.6,2.81l-2.6,2.81l-3.43-0.28l-3.45-3.79l-0.73-14.26l-11.78-4.02l-2.14-6.27L250.46,305.92L250.46,305.92z";countries["path19146"]="M285.05,314.13l7.22,6.54l-2.87,3.32l-0.23,1.97l3.77,3.89l-0.09,3.74l-6.56,2.5l-3.93-5.31l0.84-6.38l-1.68-4.75L285.05,314.13L285.05,314.13z";countries["path19148"]="M293.13,321.14l2.04,1.87l3.16-1.96l2.88,0.09l-0.37,1.12l-1.21,2.52l-0.19,6.27l-5.75,2.34l0.28-4.02l-3.71-3.46l0.19-1.78L293.13,321.14L293.13,321.14z";countries["path19150"]="M302.13,321.8l5.85,3.65l-3.06,6.08l-1.11,1.4l-3.25-1.87l0.09-6.55L302.13,321.8L302.13,321.8z";countries["path19152"]="M230.2,335.85l-4.73,2.94l-0.34,4.36l-0.95,1.43l2.98,2.86l-1.29,1.41l0.3,3.6l5.33,1.27l8.07-9.55l-0.02-3.33l-3.87-0.25L230.2,335.85L230.2,335.85z";countries["path19154"]="M225.03,349.52l-1.94,1.96l0.13,3.13l16.94,30.88l17.59,11.34l2.72-4.56l0.65-10.03l-1.42-6.25l-4.79-8.08l-2.85,0.91l-1.29,1.43l-5.69-6.52l1.42-7.69l6.6-4.3l-0.52-4.04l-6.72-0.26l-3.49-5.86l-1.94-0.65l0.13,3.52l-8.66,10.29l-6.47-1.56L225.03,349.52L225.03,349.52z";countries["path19156"]="M258.71,372.79l8.23-3.59l2.72,0.26l1.81,7.56l12.54,4.17l2.07,6.39l5.17,0.65l2.2,5.47l-1.55,4.95l-8.41,0.65l-3.1,7.95l-6.6-0.13l-2.07-0.39l-3.81,3.7l-1.88-0.18l-6.47-14.99l1.79-2.68l0.63-10.6l-1.6-6.31L258.71,372.79L258.71,372.79z";countries["path19158"]="M291.76,399.51l2.2,2.4l-0.26,5.08l6.34-0.39l4.79,6.13l-0.39,5.47l-3.1,4.69l-6.34,0.26l-0.26-2.61l1.81-4.3l-6.21-3.91h-5.17l-3.88-4.17l2.82-8.06L291.76,399.51L291.76,399.51z";countries["path19160"]="M300.36,431.93l-2.05,2.19l0.85,11.78l6.44,1.87l8.19-8.21L300.36,431.93L300.36,431.93z";countries["path19162"]="M305.47,418.2l1.94,1.82l-7.37,10.95l-2.59,2.87l0.9,12.51l5.69,6.91l-4.78,8.34l-3.62,1.56h-4.14l1.16,6.51l-6.47,2.22l1.55,5.47l-3.88,12.38l4.79,3.91l-2.59,6.38l-4.4,6.91l2.33,4.82l-5.69,0.91l-4.66-5.73l-0.78-17.85l-7.24-30.32l2.19-10.6l-4.66-13.55l3.1-17.59l2.85-3.39l-0.7-2.57l3.66-3.34l8.16,0.56l4.56,4.87l5.27,0.09l5.4,3.3l-1.59,3.72l0.38,3.76l7.65-0.36L305.47,418.2L305.47,418.2z";countries["path19164"]="M285.04,514.1l-4.27,9.38l7.37,0.78l0.13-6.25L285.04,514.1L285.04,514.1z";countries["path19166"]="M288.92,518.79l0.26,5.73l4.4-0.39l3.75-2.48l-6.34-1.3L288.92,518.79L288.92,518.79z";countries["path19168"]="M283.59,512.63l-3.21,3.55l-0.39,4.17l-6.21-3.52l-6.6-9.51l-1.94-3.39l2.72-3.52l-0.26-4.43l-3.1-1.3l-2.46-1.82l0.52-2.48l3.23-0.91l0.65-14.33l-5.04-2.87l-3.29-74.59l0.85-1.48l6.44,14.85l2.06,0.04l0.67,2.37l-2.74,3.32l-3.15,17.87l4.48,13.76l-2.07,10.42l7.3,30.64l0.77,17.92l5.23,6.05L283.59,512.63L283.59,512.63z";countries["path19170"]="M262.28,475.14l-1.29,1.95l0.65,3.39l1.29,0.13l0.65-4.3L262.28,475.14L262.28,475.14z";countries["path19172"]="M314.24,438.85l6.25-12.02l0.23-10.1l11.66-7.52h6.53l5.13-8.69l0.93-16.68l-2.1-4.46l12.36-11.28l0.47-12.45l-16.79-8.22l-20.28-6.34l-9.56-0.94l2.57-5.4l-0.7-8.22l-2.09-0.69l-3.09,6.14l-1.62,2.03l-4.16-1.84l-13.99,4.93l-4.66-5.87l0.75-6.13l-4.4,4.48l-4.86-2.62l-0.49,0.69l0.01,2.13l4.19,2.25l-6.29,6.63l-3.97-0.04l-4.02-4.09l-4.55,0.14l-0.56,4.86l2.61,3.17l-3.08,9.87l-3.6,0.28l-5.73,3.62l-1.4,7.11l4.97,5.32l0.91-1.03l3.49-0.94l2.98,5.02l8.53-3.66l3.31,0.19l2.28,8.07l12.17,3.86l2.1,6.44l5.18,0.62l2.47,6.15l-1.67,5.47l2.18,2.86l-0.32,4.26l5.84-0.55l5.35,6.76l-0.42,4.75l3.17,2.68l-7.6,11.51L314.24,438.85L314.24,438.85z";countries["path20174"]="M204.56,282.4l-0.05,3.65h0.84l2.86-5.34h-1.94L204.56,282.4L204.56,282.4z";countries["path1675"]="M817.97,72.93l1.76,6.08l3.52,1.01l3.52-5.57l-2.01-3.8l0.75-3.29h5.28l-1.26,2.53l0.5,9.12l-7.54,18.74l0.75,4.05l-0.25,6.84l14.07,20.51l2.76,0.76l0.25-16.71l2.76-2.53l-3.02-6.58l2.51-2.79l-5.53-7.34l-3.02,0.25l-1-12.15l7.79-2.03l0.5-3.55l4.02-1.01l2.26,2.03l2.76-11.14l4.77-8.1l3.77-2.03l3.27,0.25v-3.8l-5.28-1.01l-7.29-6.08l3.52-4.05l-3.02-6.84l2.51-2.53l3.02,4.05l7.54,2.79l8.29,0.76l1.01-3.54l-4.27-4.3l4.77-6.58l-10.81-3.8l-2.76,5.57l-3.52-4.56l-19.85-6.84l-18.85,3.29l-2.76,1.52v1.52l4.02,2.03l-0.5,4.81l-7.29-3.04l-16.08,6.33l-2.76-5.82h-11.06l-5.03,5.32l-17.84-4.05l-16.33,3.29l-2.01,5.06l2.51,0.76l-0.25,3.8l-15.83,1.77l1.01,5.06l-14.58-2.53l3.52-6.58l-14.83-0.76l1.26,6.84l-4.77,2.28l-4.02-3.8l-16.33,2.79l-6.28,5.82l-0.25,3.54l-4.02,0.25l-0.5-4.05l12.82-11.14v-7.6l-8.29-2.28l-10.81,3.54l-4.52-4.56h-2.01l-2.51,5.06l2.01,2.28l-14.33,7.85l-12.31,9.37l-7.54,10.38v4.3l8.04,3.29l-4.02,3.04l-8.54-3.04l-3.52,3.04l-5.28-6.08l-1.01,2.28l5.78,18.23l1.51,0.51l4.02-2.03l2.01,1.52v3.29l-3.77-1.52l-2.26,1.77l1.51,3.29l-1.26,8.61l-7.79,0.76l-0.5-2.79l4.52-2.79l1.01-7.6l-5.03-6.58l-1.76-11.39l-8.04-1.27l-0.75,4.05l1.51,2.03l-3.27,2.79l1.26,7.6l4.77,2.03l1.01,5.57l-4.78-3.04l-12.31-2.28l-1.51,4.05l-9.8,3.54l-1.51-2.53l-12.82,7.09l-0.25,4.81l-5.03,0.76l1.51-3.54v-3.54l-5.03-1.77l-3.27,1.27l2.76,5.32l2.01,3.54v2.79l-3.77-0.76l-0.75-0.76l-3.77,4.05l2.01,3.54l-8.54-0.25l2.76,3.55l-0.75,1.52h-4.52l-3.27-2.28l-0.75-6.33l-5.28-2.03v-2.53l11.06,2.28l6.03,0.51l2.51-3.8l-2.26-4.05l-16.08-6.33l-5.55,1.38l-1.9,1.63l0.59,3.75l2.36,0.41l-0.55,5.9l7.28,17.1l-5.26,8.34l-0.36,1.88l2.67,1.88l-2.41,1.59l-1.6,0.03l0.3,7.35l2.21,3.13l0.03,3.04l2.83,0.26l4.33,1.65l4.58,6.3l0.05,1.66l-1.49,2.55l3.42-0.19l3.33,0.96l4.5,6.37l11.08,1.01l-0.48,7.58l-3.82,3.27l0.79,1.28l-3.77,4.05l-1,3.8l2.26,3.29l7.29,2.53l3.02-1.77l19.35,7.34l0.75-2.03l-4.02-3.8v-4.81l-2.51-0.76l0.5-4.05l4.02-4.81l-7.21-5.4l0.5-7.51l7.71-5.07l9.05,0.51l1.51,2.79l9.3,0.51l6.79-3.8l-3.52-3.8l0.75-7.09l17.59-8.61l13.53,6.1l4.52-4.05l13.32,12.66l10.05-1.01l3.52,3.54l9.55,1.01l6.28-8.61l8.04,3.55l4.27,0.76l4.27-3.8l-3.77-2.53l3.27-5.06l9.3,3.04l2.01,4.05l4.02,0.25l2.51-1.77l6.79-0.25l0.75,1.77l7.79,0.51l5.28-5.57l10.81,1.27l3.27-1.27l1-6.08l-3.27-7.34l3.27-2.79h10.3l9.8,11.65l12.56,7.09h3.77l0.5-3.04l4.52-2.79l0.5,16.46l-4.02,0.25v4.05l2.26,2.79l-0.42,3.62l1.67,0.69l1.01-2.53l1.51,0.51l1,1.01l4.52-1.01l4.52-13.17l0.5-16.46l-5.78-13.17l-7.29-8.86l-3.52,0.51v2.79l-8.54-3.29l3.27-7.09l2.76-18.74l11.56-3.54l5.53-3.54h6.03L805.86,96l1.51,2.53l5.28-5.57l3.02,0.25l-0.5-3.29l-4.78-1.01l3.27-11.9L817.97,72.93L817.97,72.93z";countries["path1677"]="M670.4,170.07l-3.46,8.7l-4.77-0.25l-5.03,11.01l4.27,5.44l-8.8,12.15l-4.52-0.76l-3.02,3.8l0.75,2.28l3.52,0.25l1.76,4.05l3.52,0.76l10.81,13.93v7.09l5.28,3.29l5.78-1.01l7.29,4.3l8.8,2.53l4.27-0.51l4.78-0.51l10.05-6.58l3.27,0.51l1.25,2.97l2.77,0.83l3.77,5.57l-2.51,5.57l1.51,3.8l4.27,1.52l0.75,4.56l5.03,0.51l0.75-2.28l7.29-3.8l4.52,0.25l5.28,5.82l3.52-1.52l2.26,0.25l1.01,2.79l1.76,0.25l2.51-3.54l10.05-3.8l9.05-10.89l3.02-10.38l-0.25-6.84l-3.77-0.76l2.26-2.53l-0.5-4.05l-9.55-9.62v-4.81l2.76-3.54l2.76-1.27l0.25-2.79h-7.04l-1.26,3.8l-3.27-0.76l-4.02-4.3l2.51-6.58l3.52-3.8l3.27,0.25l-0.5,5.82l1.76,1.52l4.27-4.3l1.51-0.25l-0.5-3.29l4.02-4.81l3.02,0.25l1.76-5.57l2.06-1.09l0.21-3.47l-2-2.1l-0.17-5.48l3.85-0.25l-0.25-14.13l-2.7,1.62l-1.01,3.62l-4.51-0.01l-13.07-7.35l-9.44-11.38l-9.58-0.1l-2.44,2.12l3.1,7.1l-1.08,6.66l-3.86,1.6l-2.17-0.17l-0.16,6.59l2.26,0.51l4.02-1.77l5.28,2.53v2.53l-3.77,0.25l-3.02,6.58l-2.76,0.25l-9.8,12.91l-10.3,4.56l-7.04,0.51l-4.77-3.29l-6.79,3.55l-7.29-2.28l-1.76-4.81l-12.31-0.76l-6.53-10.63h-2.76l-2.22-4.93L670.4,170.07z";countries["path1302"]="M673.8,170.17l5.82-7.72l6.99,3.23l4.75,1.27l5.82-5.34l-3.95-2.91l2.6-3.67l7.76,2.74l2.69,4.41l4.86,0.13l2.54-1.89l5.23-0.21l1.14,1.94l8.69,0.44l5.5-5.61l7.61,0.8l-0.44,7.64l3.33,0.76l4.09-1.86l4.33,2.14l-0.1,1.08l-3.14,0.09l-3.27,6.86l-2.54,0.25l-9.88,12.91l-10.09,4.45l-6.31,0.49l-5.24-3.38l-6.7,3.58l-6.6-2.05l-1.87-4.79l-12.5-0.88l-6.4-10.85l-3.11-0.2L673.8,170.17L673.8,170.17z";countries["path2064"]="M778.28,194.27l1.84,0.77l0.56,6.44l3.65,0.21l3.44-4.03l-1.19-1.06l0.14-4.32l3.16-3.82l-1.61-2.9l1.05-1.2l0.58-3l-1.83-0.83l-1.56,0.79l-1.93,5.86l-3.12-0.27l-3.61,4.26L778.28,194.27L778.28,194.27z";countries["path2066"]="M788.34,198.2l6.18,5.04l1.05,4.88l-0.21,2.62l-3.02,3.4l-2.6,0.14l-2.95-6.37l-1.12-3.04l1.19-0.92l-0.28-1.27l-1.47-0.66L788.34,198.2L788.34,198.2z";countries["path2826"]="M576.69,188.62l4.1-1.75l4.58-0.16l0.32,7h-2.68l-2.05,3.34l2.68,4.45l3.95,2.23l0.36,2.55l1.45-0.48l1.34-1.59l2.21,0.48l1.11,2.23h2.84v-2.86l-1.74-5.09l-0.79-4.13l5.05-2.23l6.79,1.11l4.26,4.29l9.63-0.95l5.37,7.63l6.31,0.32l1.74-2.86l2.21-0.48l0.32-3.18l3.31-0.16l1.74,2.07l1.74-4.13l14.99,2.07l2.52-3.34l-4.26-5.25l5.68-12.4l4.58,0.32l3.16-7.63l-6.31-0.64l-3.63-3.5l-10,1.16l-12.88-12.45l-4.54,4.03l-13.77-6.25l-16.89,8.27l-0.47,5.88l3.95,4.61l-7.7,4.35l-9.99-0.22l-2.09-3.07l-7.83-0.43l-7.42,4.77l-0.16,6.52L576.69,188.62L576.69,188.62z";countries["path3587"]="M593.85,207.59l-0.62,2.63h-4.15v3.56l4.46,2.94l-1.38,4.03v1.86l1.85,0.31l2.46-3.25l5.54-1.24l11.84,4.49l0.15,3.25l6.61,0.62l7.38-7.75l-0.92-2.48l-4.92-1.08l-13.84-8.99l-0.62-3.25h-5.23l-2.31,4.34h-2.31L593.85,207.59L593.85,207.59z";countries["path3589"]="M628.92,219.06l3.08,0.16v-5.27l-2.92-1.7l4.92-6.2h2l2,2.33l5.23-2.01l-7.23-2.48l-0.28-1.5l-1.72,0.42l-1.69,2.94l-7.29-0.24l-5.35-7.57l-9.4,0.93l-4.48-4.44l-6.2-1.05l-4.5,1.83l2.61,8.68l0.03,2.92l1.9,0.04l2.33-4.44l6.2,0.08l0.92,3.41l13.29,8.82l5.14,1.18L628.92,219.06L628.92,219.06z";countries["path4349"]="M630.19,211.84l4.11-5.1h1.55l0.54,1.14l-1.9,1.38v1.14l1.25,0.9l6.01,0.36l1.96-0.84l0.89,0.18l0.6,1.92l3.57,0.36l1.79,3.78l-0.54,1.14l-0.71,0.06l-0.71-1.44l-1.55-0.12l-2.68,0.36l-0.18,2.52l-2.68-0.18l0.12-3.18l-1.96-1.92l-2.98,2.46l0.06,1.62l-2.62,0.9h-1.55l0.12-5.58L630.19,211.84L630.19,211.84z";countries["path4351"]="M636.81,199.21l-0.31,2.53l0.25,1.56l8.7,2.92l-7.64,3.08l-0.87-0.72l-1.65,1.06l0.08,0.58l0.88,0.4l5.36,0.14l2.72-0.82l3.49-4.4l4.37,0.76l5.27-7.3l-14.1-1.92l-1.95,4.73l-2.46-2.64L636.81,199.21L636.81,199.21z";countries["path5112"]="M614.12,227.05l1.59,12.46l3.96,0.87l0.37,2.24l-2.84,2.37l5.29,4.27l10.28-3.7l0.82-4.38l6.47-4.04l2.48-9.36l1.85-1.99l-1.92-3.34l6.26-3.87l-0.8-1.12l-2.89,0.18l-0.26,2.66l-3.88-0.04l-0.07-3.55l-1.25-1.49l-2.1,1.91l0.06,1.75l-3.17,1.2l-5.85-0.37l-7.6,7.96L614.12,227.05L614.12,227.05z";countries["path5114"]="M623.13,249.84l2.6,3.86l-0.25,1.99l-3.46,1.37l-0.25,3.24h3.96l1.36-1.12h7.54l6.8,5.98l0.87-2.87h5.07l0.12-3.61l-5.19-4.98l1.11-2.74l5.32-0.37l7.17-14.95l-3.96-3.11l-1.48-5.23l9.64-0.87l-5.69-8.1l-3.03-0.82l-1.24,1.5l-0.93,0.07l-5.69,3.61l1.86,3.12l-2.1,2.24l-2.6,9.59l-6.43,4.11l-0.87,4.49L623.13,249.84L623.13,249.84z";countries["path5116"]="M670.98,313.01l4.58-2.24l2.72-9.84l-0.12-12.08l15.58-16.82v-3.99l3.21-1.25l-0.12-4.61l-3.46-6.73l1.98-3.61l4.33,3.99l5.56,0.25v2.24l-1.73,1.87l0.37,1l2.97,0.12l0.62,3.36h0.87l2.23-3.99l1.11-10.46l3.71-2.62l0.12-3.61l-1.48-2.87l-2.35-0.12l-9.2,6.08l0.58,3.91l-6.46-0.02l-2.28-2.79l-1.24,0.16l0.42,3.88l-13.97-1l-8.66-3.86l-0.46-4.75l-5.77-3.58l-0.07-7.37l-3.96-4.53l-9.1,0.87l0.99,3.96l4.46,3.61l-7.71,15.78l-5.16,0.39l-0.85,1.9l5.08,4.7l-0.25,4.75l-5.19-0.08l-0.56,2.36l4.31-0.19l0.12,1.87l-3.09,1.62l1.98,3.74l3.83,1.25l2.35-1.74l1.11-3.11l1.36-0.62l1.61,1.62l-0.49,3.99l-1.11,1.87l0.25,3.24L670.98,313.01L670.98,313.01z";countries["path5876"]="M671.19,242.56l0.46,4.27l8.08,3.66l12.95,0.96l-0.49-3.13l-8.65-2.38l-7.34-4.37L671.19,242.56L671.19,242.56z";countries["path6636"]="M695.4,248.08l1.55,2.12l5.24,0.04l-0.53-2.9L695.4,248.08L695.4,248.08z";countries["path7396"]="M695.57,253.11l-1.31,2.37l3.4,6.46l0.1,5.04l0.62,1.35l3.99,0.07l2.26-2.17l1.64,0.99l0.33,3.07l1.31-0.82l0.08-3.92l-1.1-0.13l-0.69-3.33l-2.78-0.1l-0.69-1.85l1.7-2.27l0.03-1.12h-4.94L695.57,253.11L695.57,253.11z";countries["path8157"]="M729.44,303.65l-2.77-4.44l2.01-2.82l-1.9-3.49l-1.79-0.34l-0.34-5.86l-2.68-5.19l-0.78,1.24l-1.79,3.04l-2.24,0.34l-1.12-1.47l-0.56-3.95l-1.68-3.16l-6.84-6.45l1.68-1.11l0.31-4.67l2.5-4.2l1.08-10.45l3.62-2.47l0.12-3.81l2.17,0.72l3.42,4.95l-2.54,5.44l1.71,4.27l4.23,1.66l0.77,4.65l5.68,0.88l-1.57,2.71l-7.16,2.82l-0.78,4.62l5.26,6.76l0.22,3.61l-1.23,1.24l0.11,1.13l3.92,5.75l0.11,5.97L729.44,303.65L729.44,303.65z";countries["path8159"]="M730.03,270.47l3.24,4.17v5.07l1.12,0.56l5.15-2.48l1.01,0.34l6.15,7.1l-0.22,4.85l-2.01-0.34l-1.79-1.13l-1.34,0.11l-2.35,3.94l0.45,2.14l1.9,1.01l-0.11,2.37l-1.34,0.68l-4.59-3.16v-2.82l-1.9-0.11l-0.78,1.24l-0.4,12.62l2.97,5.42l5.26,5.07l-0.22,1.47l-2.8-0.11l-2.57-3.83h-2.69l-3.36-2.71l-1.01-2.82l1.45-2.37l0.5-2.14l1.58-2.8l-0.07-6.44l-3.86-5.58l-0.16-0.68l1.25-1.26l-0.29-4.43l-5.14-6.51l0.6-3.75L730.03,270.47L730.03,270.47z";countries["path8161"]="M732.71,315.45l2.01,4.51l0.45,5.86l2.69,4.17l6.49,3.94l2.46,0.23l-0.45-4.06l-2.13-5.18l-3.12-6.63l-0.26,1.16l-3.76-0.17l-2.7-3.88L732.71,315.45L732.71,315.45z";countries["path8163"]="M740.48,299.47l4.09,4.37l7.61-5.64l0.67-8.9l-3.93,2.71l-2.04-1.14l-2.77-0.37l-1.55-1.09l-0.75,0.04l-2.03,3.33l0.33,1.54l2.06,1.15l-0.25,3.13L740.48,299.47L740.48,299.47z";countries["path8165"]="M735.47,262.93l-2.42,1.23l-2.01,5.86l3.36,4.28l-0.56,4.73l0.56,0.23l5.59-2.71l7.5,8.38l-0.18,5.28l1.63,0.88l4.03-3.27l-0.33-2.59l-11.63-11.05l0.11-1.69l1.45-1.01l-1.01-2.82l-4.81-0.79L735.47,262.93L735.47,262.93z";countries["path8167"]="M745.06,304.45l1.19,1.87l0.22,2.14l3.13,0.34l3.8-5.07l3.58-1.01l1.9-5.18l-0.89-8.34l-3.69-5.07l-3.89-3.11l-4.95-8.5l3.55-5.94l-5.08-5.83l-4.07-0.18l-3.66,1.97l1.09,4.71l4.88,0.86l1.31,3.63l-1.72,1.12l0.11,0.9l11.45,11.2l0.45,3.29l-0.69,10.4L745.06,304.45L745.06,304.45z";countries["path8928"]="M555.46,204.16l3.27,4.27l4.08,1.88l2.51-0.01l4.31-1.17l1.08-1.69l-12.75-4.77L555.46,204.16L555.46,204.16z";countries["path8930"]="M569.72,209.89l4.8,6.26l-1.41,1.65l-3.4-0.59l-4.22-3.78l0.23-2.48L569.72,209.89L569.72,209.89z";countries["path8932"]="M571.41,207.72l-1.01,1.72l4.71,6.18l1.64-0.53l2.7,2.83l1.17-4.96l2.93,0.47l-0.12-1.42l-4.82-4.22l-0.92,2.48L571.41,207.72L571.41,207.72z";countries["path8934"]="M569.65,217.95l-1.22,1.27l0.12,2.01l1.52,2.13l5.39,5.9l-0.82,2.36h-0.94l-0.47,2.36l3.05,3.9l2.81,0.24l5.63,7.79l3.16,0.24l2.46,1.77l0.12,3.54l9.73,5.67h3.63l2.23-1.89l2.81-0.12l1.64,3.78l10.51,1.46l0.31-3.86l3.48-1.26l0.16-1.38l-2.77-3.78l-6.17-4.96l3.24-2.95l-0.23-1.3l-4.06-0.63l-1.72-13.7l-0.2-3.15l-11.01-4.21l-4.88,1.1l-2.73,3.35l-2.42-0.16l-0.7,0.59l-5.39-0.35l-6.8-4.96l-2.53-2.77l-1.16,0.28l-2.09,2.39L569.65,217.95L569.65,217.95z";countries["path8936"]="M558.7,209.19l-2.23,2.36l-8.2-0.24l-4.92-2.95l-4.8-0.12l-5.51,3.9l-5.16,0.24l-0.47,2.95h-5.86l-2.34,2.13v1.18l1.41,1.18v1.3l-0.59,1.54l0.59,1.3l1.88-0.94l1.88,2.01l-0.47,1.42l-0.7,0.95l1.05,1.18l5.16,1.06l3.63-1.54v-2.24l1.76,0.35l4.22,2.48l4.57-0.71l1.99-1.89l1.29,0.47v2.13h1.76l1.52-2.95l13.36-1.42l5.83-0.71l-1.54-2.02l-0.03-2.73l1.17-1.4l-4.26-3.42l0.23-2.95h-2.34L558.7,209.19L558.7,209.19z";countries["path1705"]="M571.99,289.23l1.44,4.28v4.18l3.46,3.14l24.38-9.93l0.23-2.73l-3.91-7.02l-9.81,3.13l-5.63,5.54l-6.53-3.86L571.99,289.23L571.99,289.23z";countries["path10461"]="M598.38,280.84l7.39-4.26l1.31-6.25l-1.62-0.93l0.67-6.7l1.41-0.82l1.51,2.37l8.99,4.7v2.61l-10.89,16.03l-5.01,0.17L598.38,280.84L598.38,280.84z";countries["path10463"]="M594.01,264.94l0.87,3.48l9.86,0.87l0.69-7.14l1.9-1.04l0.52-2.61l-3.11,0.87l-3.46,5.23L594.01,264.94L594.01,264.94z";countries["path10465"]="M592.63,259.02l-0.52,4.01l1.54,1.17l1.4-0.13l0.52-5.05l-1.21-0.87L592.63,259.02L592.63,259.02z";countries["path10467"]="M583.29,247.17l-2.25-1.22l-1.56,1.57l0.17,3.14l3.63,1.39L583.29,247.17L583.29,247.17z";countries["path10469"]="M584,253.24l7.01,9.77l2.26,1.8l1.01,4.38l10.79,0.85l1.22,0.64l-1.21,5.4l-7.09,4.18l-10.37,3.14l-5.53,5.4l-6.57-3.83l-3.98,3.48L566,279.4l-3.8-1.74l-1.38-2.09v-4.53l-13.83-16.72l-0.52-2.96h3.98l4.84-4.18l0.17-2.09l-1.38-1.39l2.77-2.26l5.88,0.35l10.03,8.36l5.92-0.27l0.38,1.46L584,253.24L584,253.24z";countries["path11229"]="M546.67,229.13l-0.35,2.54l2.82,1.18l-0.12,7.04l2.82-0.06l2.82-2.13l1.06-0.18l6.4-5.09l1.29-7.39l-12.79,1.3l-1.35,2.96L546.67,229.13L546.67,229.13z";countries["path11231"]="M564.31,225.03l-1.56,7.71l-6.46,5.38l0.41,2.54l6.31,0.43l10.05,8.18l5.62-0.16l0.15-1.89l2.06-2.21l2.88,1.63l0.38-0.36l-5.57-7.41l-2.64-0.16l-3.51-4.51l0.7-3.32l1.07-0.14l0.37-1.47l-4.78-5.03L564.31,225.03L564.31,225.03z";countries["path11233"]="M548.9,240.78l-2.46,8.58l-0.11,1.31h3.87l4.33-3.82l0.11-1.45l-1.77-1.81l3.17-2.63l-0.46-2.44l-0.87,0.2l-2.64,1.89L548.9,240.78L548.9,240.78z";countries["path11235"]="M546.2,232.44l0.06,1.95l-0.82,2.96l2.82,0.24l0.18-4.2L546.2,232.44L546.2,232.44z";countries["path11237"]="M545.32,238.06l-1.58,5.03l2.05,6.03l2.35-8.81v-1.89L545.32,238.06L545.32,238.06z";countries["path11239"]="M543.21,229.84l1.23,0.89l-3.81,3.61l-1.82-0.06l-1.35-0.95l0.18-1.77l2.76-0.18L543.21,229.84L543.21,229.84z";countries["path1730"]="M515.46,102.14l2.02-1.48L517.3,99l-1.28-0.74l0.18-2.03h1.1v-1.11l-4.77-1.29l-7.15,0.74l-0.73,3.14L503,97.16l-1.1-1.85l-3.49,0.18L498.04,99l-1.65,0.74l-0.92-1.85l-7.34,5.91l1.47,1.66l-2.75,1.29l-6.24,12.38l-2.2,1.48l0.18,1.11l2.2,1.11l-0.55,2.4l-3.67-0.19l-1.1-1.29l-2.38,2.77l-1.47,1.11l-0.37,2.59l-1.28,0.74l-3.3,0.74l-1.65,5.18l1.1,8.5l1.28,3.88l1.47,1.48l3.3-0.18l4.77-4.62l1.83-3.14l0.55,4.62l3.12-5.54l0.18-15.53l2.54-1.6l0.76-8.57l7.7-11.09l3.67-1.29l1.65-2.03l5.5,1.29l2.75,1.66l0.92-4.62l4.59-2.77L515.46,102.14L515.46,102.14z";countries["path1732"]="M446.12,149.08l-1.83,2.77l0.73,1.11h4.22v1.85l-1.1,1.48l0.73,3.88l2.38,4.62l1.83,4.25l2.93,1.11l1.28,2.22l-0.18,2.03l-1.83,1.11l-0.18,0.92l1.28,0.74l-1.1,1.48l-2.57,1.11l-4.95-0.55l-7.71,3.51l-2.57-1.29l7.34-4.25l-0.92-0.55l-3.85-0.37l2.38-3.51l0.37-2.96l3.12-0.37l-0.55-5.73l-3.67-0.18l-1.1-1.29l0.18-4.25l-2.2,0.18l2.2-7.39l4.04-2.96L446.12,149.08L446.12,149.08z";countries["path1734"]="M438.42,161.47l-3.3,0.37l-0.18,2.96l2.2,1.48l2.38-0.55l0.92-1.66L438.42,161.47L438.42,161.47z";countries["path1304"]="M439.51,166.55l-0.91,6l-8.07,2.96h-2.57l-1.83-1.29v-1.11l4.04-2.59l-1.1-2.22l0.18-3.14l3.49,0.18l1.6-3.76l-0.21,3.34l2.71,2.15L439.51,166.55L439.51,166.55z";countries["path1306"]="M497.72,104.58l1.96,1.81h3.67l2.02,3.88l0.55,6.65l-4.95,3.51v3.51l-3.49,4.81l-2.02,0.18l-2.75,4.62l0.18,4.44l4.77,3.51l-0.37,2.03l-1.83,2.77l-2.75,2.4l0.18,7.95l-4.22,1.48l-1.47,3.14h-2.02l-1.1-5.54l-4.59-7.04l3.77-6.31l0.26-15.59l2.6-1.43l0.63-8.92l7.41-10.61L497.72,104.58L497.72,104.58z";countries["path1308"]="M506.79,116.94l2.07,0.91l1.28,2.4l-1.28,1.66l-6.42,7.02l-1.1,3.7l1.47,5.36l4.95,3.7l6.6-3.14l5.32-0.74l4.95-7.95l-3.67-8.69l-3.49-8.32l0.55-5.36l-2.2-0.37l-0.57-3.91l-2.96-4.83l-3.28,2.27l-1.29,5.27l-3.48-2.09l-4.84-1.18l-1.08,1.26l1.86,1.68l3.39-0.06l2.73,4.41L506.79,116.94L506.79,116.94z";countries["path2070"]="M518.07,151.37l-6.85-1.11l0.15,3.83l6.35,3.88l2.6-0.76l-0.15-2.92L518.07,151.37L518.07,151.37z";countries["path2072"]="M506.76,147.64l-1.55-0.05l-0.9,0.91l0.65,0.96l1.55,0.1l0.8-1.16L506.76,147.64L506.76,147.64z";countries["path2074"]="M506.61,151.72l-1.5-0.15l-2.7,3.23v1.51l0.9,0.35l1.75,0.05l2.9-2.37l0.4-0.81L506.61,151.72L506.61,151.72z";countries["path2076"]="M510.81,154.7l-2.15-0.05l-2.95,2.82h-2.5l0.15,3.53l-1.5,2.77l5.4,0.05l1.55-0.2l1.55,1.87l3.55-0.15l3.4-4.33l-0.2-2.57L510.81,154.7L510.81,154.7z";countries["path2836"]="M510.66,166.29l1.5,2.47l-0.6,1.97l0.1,1.56l0.55,1.87l3.1-1.76l3.85,0.1l2.7,1.11h6.85l2-4.79l1.2-1.81v-1.21l-4.3-6.05l-3.8-1.51l-3.1-0.35l-2.7,0.86l0.1,2.72l-3.75,4.74L510.66,166.29L510.66,166.29z";countries["path1745"]="M511.46,174.76l0.85,1.56l0.2,1.66l-0.7,1.61l-1.6,3.08l-1.35,0.61l-1.75-0.76l-1.05,0.05l-2.55,0.96l-2.9-0.86l-4.7-3.33l-4.6-2.47l-1.85-2.82l-0.35-6.65l3.6-3.13l4.7-1.56l1.75-0.2l-0.7,1.41l0.45,0.55l7.91,0.15l1.7-0.05l2.8,4.29l-0.7,1.76l0.3,2.07L511.46,174.76L511.46,174.76z";countries["path4356"]="M448.36,205h-12.74l-2.57-1.16l-1.24,0.09l-1.5,3.12l0.53,3.21l4.87,0.45l0.62,2.05l-2.12,11.95l0.09,2.14l3.45,1.87l3.98,0.27l7.96-1.96l3.89-4.9l0.09-4.99l6.9-6.24l0.35-2.76l-6.28-0.09L448.36,205L448.36,205z";countries["path4358"]="M430.93,211.24l-0.62,8.65l-1.77,1.6l0.18,0.98l1.24,2.05l-0.8,2.5l1.33,0.45l3.1-0.36l-0.18-2.5l2.03-11.59l-0.44-1.6L430.93,211.24L430.93,211.24z";countries["path4360"]="M461.1,217.21l-1.59,0.54l0.35,1.43h2.3l0.97-1.07L461.1,217.21L461.1,217.21z";countries["path4362"]="M477.56,213.38l-2.65,1.34l0.35,5.17l2.12,0.36l1.59-1.52v-4.9L477.56,213.38L477.56,213.38z";countries["path4364"]="M477.83,206.96l-1.95,1.96l-0.18,1.78l1.59,0.98l0.62-0.09l0.35-2.59L477.83,206.96L477.83,206.96z";countries["path4366"]="M460.4,178.7l-2.21,0.54l-4.42,4.81l-1.33,0.09l-1.77-1.25l-1.15,0.27l-0.88,2.76l-6.46,0.18l0.18,1.43l4.42,2.94l5.13,4.1l-0.09,4.9l-2.74,4.81l5.93,2.85l6.02,0.18l1.86-2.14l3.8,0.09l1.06,0.98l3.8-0.27l1.95-2.5l-2.48-2.94l-0.18-1.87l0.53-2.05l-1.24-1.78l-2.12,0.62l-0.27-1.6l4.69-5.17v-3.12l-3.1-1.78l-1.59-0.27L460.4,178.7L460.4,178.7z";countries["path5126"]="M470.09,168.27l-4.53,2.23l0.96,0.87l0.1,2.23l-0.96-0.19l-1.06-1.65l-2.53,4.01l3.89,0.81l1.45,1.53l0.77,0.02l0.51-3.46l2.45-1.03L470.09,168.27L470.09,168.27z";countries["path5128"]="M461.61,176.52l-0.64,1.6l6.88,4.54l1.98,0.47l0.07-2.15l-1.73-1.94h-1.06l-1.45-1.65L461.61,176.52L461.61,176.52z";countries["path5130"]="M471.14,167.88l3.57-0.58v-2.52l2.99-0.49l1.64,1.65l1.73,0.19l2.7-1.17l2.41,0.68l2.12,1.84l0.29,6.89l2.12,2.82l-2.79,0.39l-4.63,2.91l0.39,0.97l4.14,3.88l-0.29,1.94l-3.85,1.94l-3.57,0.1l-0.87,1.84h-1.83l-0.87-1.94l-3.18-0.78l-0.1-3.2l-2.7-1.84l0.29-2.33l-1.83-2.52l0.48-3.3l2.5-1.17L471.14,167.88L471.14,167.88z";countries["path5890"]="M476.77,151.5l-4.15,4.59l-0.15,2.99l1.89,4.93l2.96-0.56l-0.37-4.03l2.04-2.28l-0.04-1.79l-1.44-3.73L476.77,151.5L476.77,151.5z";countries["path5892"]="M481.44,159.64l-0.93-0.04l-1.22,1.12l0.15,1.75l2.89,0.08l0.15-1.98L481.44,159.64L481.44,159.64z";countries["path5894"]="M498.49,150.17l-2.11,1.67l1.06,2.45l1.87-1.82L498.49,150.17L498.49,150.17z";countries["path6654"]="M472.91,189.38l-4.36,4.64l0.09,0.47l1.79-0.56l1.61,2.24l2.72-0.96l1.88,1.46l0.77-0.44l2.32-3.64l-0.59-0.56l-2.29-0.06l-1.11-2.27L472.91,189.38L472.91,189.38z";countries["path7414"]="M488.43,184.87h2.97h1.46l2.37,1.69l4.39-3.65l-4.26-3.04l-4.22-2.04l-2.89,0.52l-3.92,2.52L488.43,184.87L488.43,184.87z";countries["path8174"]="M495.84,187.13l0.69,0.61l0.09,1.04l7.63-0.17l5.64-2.43l-0.09-2.47l-1.08,0.48l-1.55-0.83l-0.95-0.04l-2.5,1l-3.4-0.82L495.84,187.13L495.84,187.13z";countries["path1762"]="M480.63,190.12l-0.65,1.35l0.56,0.96l2.33-0.48h1.98l2.15,1.82l4.57-0.83l3.36-2l0.86-1.35l-0.13-1.74l-3.02-2.26l-4.05,0.04l-0.34,2.3l-4.26,2.08L480.63,190.12L480.63,190.12z";countries["path9694"]="M496.74,189.6l-1.16,1.82l0.09,2.78l1.85,0.95l5.69,0.17l7.93-6.68l0.04-1.48l-0.86-0.43l-5.73,2.6L496.74,189.6L496.74,189.6z";countries["path10454"]="M494.8,191.99l-2.54,1.52l-4.74,1.04l0.95,2.74l3.32,0.04l3.06-2.56L494.8,191.99L494.8,191.99z";countries["path11214"]="M495.62,195.16l-3.53,2.91h-3.58l-0.43,2.52l1.64,0.43l0.82-1.22l1.29,1.13l1.03,3.6l7.07,3.3l0.7-0.8l-7.17-7.4l0.73-1.35l6.81-0.26l0.69-2.17l-4.44,0.13L495.62,195.16L495.62,195.16z";countries["path11974"]="M494.8,198.94l-0.37,0.61l6.71,6.92l2.46-3.62l-0.09-1.43l-2.15-2.61L494.8,198.94L494.8,198.94z";countries["path12734"]="M472.27,196.98l-0.62,1.57l0.17,1.71l2.39,2.79l3.76-0.13l8.3,9.64l5.18,1.5l3.06,2.89l0.73,6.59l1.64-0.96l1.42-3.59l-0.35-2.58l2.43-0.22l0.35-1.46l-6.85-3.28l-6.5-6.39l-2.59-3.82l-0.63-3.63l3.31-0.79l-0.85-2.39l-2.03-1.71l-1.75-0.08l-2.44,0.67l-2.3,3.22l-1.39,0.92l-2.15-1.32L472.27,196.98L472.27,196.98z";countries["path13494"]="M492.44,223.02l-1.45-0.78l-4.95,0.78l0.17,1.34l4.45,2.24l0.67,0.73l1.17,0.17L492.44,223.02L492.44,223.02z";countries["path13496"]="M492.61,230.47l-1.67,0.34l0.06,1.85l1.5,0.5l0.67-0.56L492.61,230.47L492.61,230.47z";countries["path14256"]="M515.57,173.15l-2.9,1.63l0.72,3.08l-2.68,5.65l0.02,2.49l1.26,0.8l8.08,0.4l2.26-1.87l2.42,0.81l3.47,4.63l-2.54,4.56l3.02,0.88l3.95-4.55l2.26,0.41l2.1,1.46l-1.85,2.44l2.5,3.9h2.66l1.37-2.6l2.82-0.57l0.08-2.11l-5.24-0.81l0.16-2.27h5.08l5.48-4.39l2.42-2.11l0.4-6.66l-10.8-0.97l-4.43-6.25l-3.06-1.05l-3.71,0.16l-1.67,4.13l-7.6,0.1l-2.47-1.14L515.57,173.15L515.57,173.15z";countries["path15016"]="M520.75,187.71l3.1,4.77l-0.26,2.7l1.11,0.05l2.63-4.45l-3.16-3.92l-1.79-0.74L520.75,187.71L520.75,187.71z";countries["path15776"]="M512.18,187.6l-0.26,1.48l-5.79,4.82l4.84,7.1l3.1,2.17h5.58l1.84-1.54l2.47-0.32l1.84,1.11l3.26-3.71l-0.63-1.86l-3.31-0.85l-2.26-0.11l0.11-3.18l-3-4.72L512.18,187.6L512.18,187.6z";countries["path16536"]="M505.55,194.54l-2.05,1.54h-1l-0.68,2.12l2.42,2.81l0.16,2.23l-3,4.24l0.42,1.27l1.74,0.32l1.37-1.86l0.74-0.05l1.26,1.22l3.84-1.17l-0.32-5.46L505.55,194.54L505.55,194.54z";countries["path17296"]="M511.44,202.39l0.16,4.98l1.68,3.5l6.31,0.11l2.84-2.01l2.79-1.11l-0.68-3.18l0.63-1.7l-1.42-0.74l-1.95,0.16l-1.53,1.54l-6.42,0.05L511.44,202.39L511.44,202.39z";countries["path18056"]="M504.02,209.76v4.61l1.32,2.49l0.95-0.11l1.63-2.97l-0.95-1.33l-0.37-3.29l-1.26-1.17L504.02,209.76L504.02,209.76z";countries["path18816"]="M510.92,208.01l-3.37,1.11l0.16,2.86l0.79,1.01l4-1.86L510.92,208.01L510.92,208.01z";countries["path19576"]="M506.71,217.6l-0.11,1.33l4.63,2.33l2.21,0.85l-1.16,1.22l-2.58,0.26l-0.37,1.17l0.89,2.01l2.89,1.54l1.26,0.11l0.16-3.45l1.89-2.28l-5.16-6.1l0.68-2.07l1.21-0.05l1.84,1.48l1.16-0.58l0.37-2.07l5.42,0.05l0.21-3.18l-2.26,1.59l-6.63-0.16l-4.31,2.23L506.71,217.6L506.71,217.6z";countries["path20336"]="M523.02,209.7l-0.16,3.55l3.1-0.95l1.42-0.95l-0.42-1.54l-1.47-1.17L523.02,209.7L523.02,209.7z";countries["path21096"]="M516.76,230.59l1.63,0.05l0.68,1.01h2.37l1.58-0.58l0.53,0.64l-1.05,1.38l-4.63,0.16l-0.84-1.11l-0.89-0.53L516.76,230.59L516.76,230.59z";var english=["path1366","path5114","path9780","path18360","path19122","path1364","path1368","path1370","path5116","path1734","path1304","path1732","path19146","path22651","path20369","path21129","path21891","path19609","path15039","path14279","path6643","path11979","path7464","path7462","path7456","path7454","path7460"];var spanish=["path19128","path16828","path13671","path19130","path19132","path19134","path20174","path19136","path19138","path19140","path19142","path19152","path19144","path19154","path19156","path19168","path19162","path19158","path19160","path19164","path19166","path4356"];var portuguese=["path19172","path4358","path15809","path18849"];var chinese=["path1677","path7470","path7468"];var russian=["path1675","path12060"];var french=["path5128","path18360","path4366","path1300","path1298","path6647","path1323","path1317","path19150"];var hindi=["path5116"];var urdu=["path5116","path5114"];var bahasa=["path8161","path2372","path3602","path2374","path2060","path2820","path4383","path3596"];var arabic=["path11235","path6647","path1300","path1298","path7407","path7409","path8171","path7411","path10469","path1705","path10461","path10463","path11231","path11233","path11229"];var farsi=["path8934","path5112"];var german=["path5130","path1762"];var dutch=["path5126","path19148"];var italian=["path12734"];var polish=["path1745"];var ukrainian=["path14256"];var latvian=["path2070"];var lithuanian=["path2076"];var estonian=["path2068"];var romanian=["path15776","path15016"];var bulgarian=["path17296"];var turkish=["path20336","path8936","path11239"];var greek=["path19576","path21096","path11239"];var serbian=["path16536"];var moldovian=["path18816"];var albanian=["path18056"];var bosnian=["path11974"];var croatian=["path11214"];var slovanian=["path10454"];var hungarian=["path9694"];var czech=["path7414"];var slovak=["path8174"];var finnish=["path1308"];var swedish=["path1306"];var norwegian=["path1730"];var danish=["path5890","path5892"];var bengali=["path7396"];var burmese=["path8157"];var thai=["path8159"];var vietnamese=["path8167"];var loas=["path8165"];var khmer=["path8163"];var tagalog=["path7464","path7454","path7456","path7462","path7458","path7460"];var japanese=["path7478","path7476","path7474","path7472"];var korean=["path2066","path2064"];var qtipMap={};for(var country in countries){var c=W.path(countries[country]);c.attr({fill:"#000",stroke:"#fff","stroke-width":0.2,});}
drawLegend();for(var lang in langData){var l=langData[lang].name;if(l=="english"||l=="English")
highlight(english,langData[lang]);else if(l=="spanish"||l=="Spanish"||l=="Espanol")
highlight(spanish,langData[lang]);else if(l=="portuguese"||l=="Portuguese")
highlight(portuguese,langData[lang]);else if(l=="french"||l=="French")
highlight(french,langData[lang]);else if(l=="arabic"||l=="Arabic")
highlight(arabic,langData[lang]);else if(l=="chinese"||l=="Chinese"||l=="Mandarin"||l=="mandarin")
highlight(chinese,langData[lang]);else if(l=="russian"||l=="Russian")
highlight(russian,langData[lang]);else if(l=="hindi"||l=="Hindi")
highlight(hindi,langData[lang]);else if(l=="urdu"||l=="Urdu")
highlight(urdu,langData[lang]);else if(l=="farsi"||l=="Farsi")
highlight(farsi,langData[lang]);else if(l=="bahasa"||(l.indexOf("Bahasa")!=-1)||l=="Malay")
highlight(bahasa,langData[lang]);else if(l=="german"||l=="German")
highlight(german,langData[lang]);else if(l=="dutch"||l=="Dutch")
highlight(dutch,langData[lang]);else if(l=="italian"||l=="Italian"||(l.indexOf("Italian")!=-1))
highlight(italian,langData[lang]);else if(l=="korean"||l=="Korean")
highlight(korean,langData[lang]);else if(l=="japanese"||l=="Japanese")
highlight(japanese,langData[lang]);else if(l=="tagalog"||l=="Tagalog")
highlight(tagalog,langData[lang]);else if(l=="khmer"||l=="Khmer"||l=="Cambodian")
highlight(khmer,langData[lang]);else if(l=="loas"||l=="Loas")
highlight(loas,langData[lang]);else if(l=="vietnamese"||l=="vietnamese")
highlight(vietnamese,langData[lang]);else if(l=="thai"||l=="Thai")
highlight(thai,langData[lang]);else if(l=="burmese"||l=="Burmese")
highlight(burmese,langData[lang]);else if(l=="bengali"||l=="Bengali")
highlight(bengali,langData[lang]);else if(l=="danish"||l=="Danish")
highlight(danish,langData[lang]);else if(l=="norwegian"||l=="Norwegian")
highlight(norwegian,langData[lang]);else if(l=="swedish"||l=="Swedish")
highlight(swedish,langData[lang]);else if(l=="finnish"||l=="Finnish")
highlight(finnish,langData[lang]);else if(l=="slovak"||l=="Slovak")
highlight(slovak,langData[lang]);else if(l=="czech"||l=="Czech")
highlight(czech,langData[lang]);else if(l=="hungarian"||l=="Hungarian")
highlight(hungarian,langData[lang]);else if(l=="slovanian"||l=="Slovanian")
highlight(slovanian,langData[lang]);else if(l=="croatian"||l=="Croatian")
highlight(croatian,langData[lang]);else if(l=="bosnian"||l=="Bosnian")
highlight(bosnian,langData[lang]);else if(l=="albanian"||l=="Albanian")
highlight(albanian,langData[lang]);else if(l=="moldovian"||l=="Moldovian")
highlight(moldovian,langData[lang]);else if(l=="serbian"||(l.indexOf("Serb")!=-1))
highlight(serbian,langData[lang]);else if(l=="greek"||l=="Greek")
highlight(greek,langData[lang]);else if(l=="turkish"||l=="Turkish")
highlight(turkish,langData[lang]);else if(l=="bulgarian"||l=="Bulgarian")
highlight(bulgarian,langData[lang]);else if(l=="romanian"||(l.indexOf("Roman")!=-1))
highlight(romanian,langData[lang]);else if(l=="estonian"||l=="Estonian")
highlight(estonian,langData[lang]);else if(l=="lithuanian"||l=="Lithuanian")
highlight(lithuanian,langData[lang]);else if(l=="latvian"||(l.indexOf("Latvia")!=-1))
highlight(latvian,langData[lang]);else if(l=="ukrainian"||l=="Ukrainian")
highlight(ukrainian,langData[lang]);else if(l=="polish"||l=="Polish")
highlight(polish,langData[lang]);}
function highlight(array,lang){for(var i=0;i<array.length;i++){var c=W.path(countries[array[i]]);c.attr({fill:"#fff",stroke:"#fff","stroke-width":0.2,});addTip(array[i],lang);var c=W.path(countries[array[i]]);var opacity=getOpacityBasedonProficiency(lang.proficiency_level);c.attr({fill:customizedColors[3],stroke:"#fff","stroke-width":0.2,opacity:opacity});drawTooltip(c.node,qtipMap[array[i]]);}}
function getOpacityBasedonProficiency(pro){if(pro==4)
return 1.0;else if(pro==3)
return 0.8;else if(pro==2)
return 0.6;else if(pro==1)
return 0.4;else if(pro==0)
return 0.2;else
return 1.0;}
function drawLegend(){W.text(10,320,"Proficiency").attr({"text-anchor":"start","font-size":16,"font-weight":"bold","font-family":customizedFonts[1]});W.rect(10,350,20,20).attr({fill:customizedColors[3],stroke:"none"});W.text(40,360,"Native").attr({"text-anchor":"start","font-size":14,"font-family":customizedFonts[2]});W.rect(10,380,20,20).attr({fill:customizedColors[3],stroke:"none",opacity:0.8});W.text(40,390,"Full Professional").attr({"text-anchor":"start","font-size":14,"font-family":customizedFonts[2]});W.rect(10,410,20,20).attr({fill:customizedColors[3],stroke:"none",opacity:0.6});W.text(40,420,"Professional").attr({"text-anchor":"start","font-size":14,"font-family":customizedFonts[2]});W.rect(10,440,20,20).attr({fill:customizedColors[3],stroke:"none",opacity:0.4});W.text(40,450,"Limited").attr({"text-anchor":"start","font-size":14,"font-family":customizedFonts[2]});W.rect(10,470,20,20).attr({fill:customizedColors[3],stroke:"none",opacity:0.2});W.text(40,480,"Elementary").attr({"text-anchor":"start","font-size":14,"font-family":customizedFonts[2]});W.text(930,540,"Map by: Al MacDonald / twitter account @F1LT3R").attr({"text-anchor":"end","font-size":7});}
function langSortAscending(a,b){return(a.proficiency_level-b.proficiency_level);}
function langSortDescending(a,b){return(b.proficiency_level-a.proficiency_level);}
function drawTitle(divy,showTitle,legendAlign,margin){if(showTitle==='show'){$(divy).prepend('<div style="font-family:'+customizedFonts[1]+'; font-size:35px; font-weight:bold; text-align:center">LANGUAGES</div>');}
langData.sort(langSortDescending);var str="";for(var lang in langData){str=str+'<span style="color:'+customizedColors[3]+';opacity:'+getOpacityBasedonProficiency(langData[lang].proficiency_level)+'">';str=str+langData[lang].name;str=str+'</span>';if(lang<(langData.length-1))
str=str+" • ";}
$(divy).append('<div style="font-family:'+customizedFonts[2]+'; font-size:20px; font-weight:bold; text-align:'+legendAlign+'; margin-left: '+margin.horizontal+'px; margin-right: '+margin.horizontal+'px;">'+str+'</div>');}
function addTip(id,lang){if(id in qtipMap)
qtipMap[id]=qtipMap[id]+", "+lang.name;else
qtipMap[id]=lang.name;}};Viz.widgets.drawInterests=function(element,rawData,opt){var viz=Viz,element=(typeof element==="string")?document.getElementById(element):element,opt=opt||{},div=viz.createTag('div','__interests'),showTitle=opt.showTitle||'show',margin={horizontal:opt.marginHorizontal||0,vertical:opt.marginVertical||24};var interestLimit=6;element.appendChild(div);div.style.marginTop=margin.vertical+"px";div.style.marginBottom=margin.vertical+"px";if(showTitle==='show'){$(div).append('<div style="font-family:'+customizedFonts[1]+'; font-size:'+opt.title_fontsize+'px; font-weight:'+opt.title_fontweight+'; text-align:center">INTERESTS</div>');}
var data=clone(rawData);$.each(data,function(i,interest){if(!interest.weight)
interest.weight=5;});viz.normalize(data,"weight");data.sort(sortInterests);var html="";if(data&&data.length>0){html='<table>';html=html+'<tr style="height:172px">';var c=3;$.each(data,function(i,interest){if(i<interestLimit){var width=interest.norm*100;var weightDisplay=interest.weight||"";html=html+'<td style="border:solid 10px #fff; background:'+customizedColors[c]+'; width:'+width+'%; font-family:'+customizedFonts[2]+'; font-size:14px; text-align:left;vertical-align:text-top;"></td>';c++;if(c>=customizedColors.length)
c=3;}});html=html+"</tr>";html=html+'<tr>';viz.abnormalize(data,"weight");$.each(data,function(i,interest){if(i<interestLimit){var size=interest.abnorm*24;if(size<12)
size=12;html=html+'<td style="font-family:'+customizedFonts[2]+'; font-size:'+size+'px; text-align:left;vertical-align:text-top;width:'+interest.norm*100+'%;">'+interest.name+'</td>';}});html=html+"</tr>";html+="</table>";}
$(div).append(html);function sortInterests(a,b){return(b.weight-a.weight);}}
Viz.widgets.drawRecommendations=function(element,data,opt){var viz=Viz,element=(typeof element==="string")?document.getElementById(element):element,opt=opt||{},div=viz.createTag('div','__recommendations'),showTitle=opt.showTitle||'show',legendAlign=opt.legendAlign||'center',margin={horizontal:opt.marginHorizontal||0,vertical:opt.marginVertical||24};div.style.marginTop=margin.vertical+"px";div.style.marginBottom=margin.vertical+"px";div.style.overflow="hidden";var recommendationLimit=10;var labelColors={"service-provider":customizedColors[2],"colleague":customizedColors[3],"business-partner":customizedColors[4],"education":customizedColors[5]};element.appendChild(div);if(showTitle==='show'){$(div).append('<div style="font-family:'+customizedFonts[1]+'; font-size:35px; font-weight:bold; text-align:center; text-transform:uppercase">Recommendations</div>');}
var labelString="<font color='"+labelColors["colleague"]+"'>colleague</font> &#8226; <font color='"+labelColors["business-partner"]+"'>business-partner</font> &#8226; <font color='"+labelColors["education"]+"'>fellow student/advisor</font> &#8226; <font color='"+labelColors["service-provider"]+"'>service-provider</font>";$(div).append('<div style="font-family:'+customizedFonts[2]+'; font-size:16px; font-weight:bold; text-align:'+legendAlign+'; margin-left: '+margin.horizontal+'px; margin-right: '+margin.horizontal+'px;">'+labelString+'</div>');var openQuote="<span style='line-height: 12px; font-size: 64px; font-weight: bold; font-family:"+customizedFonts[0]+";'>&ldquo; </span>";var closeQuote="<span style='line-height: 0px; font-size: 64px; font-weight: bold; font-family:"+customizedFonts[0]+";'> &rdquo;</span>";if(data&&data.length>0){$.each(data,function(i,rec){if(i<recommendationLimit){var orientation,styleFloat;if(i%2==0){orientation="even";styleFloat="right";}else{orientation="odd";styleFloat="left";};var table="<table border='0' style='width:auto;'><tr> <td style='vertical-align: top;'>"+openQuote+"</td> <td style='vertical-align: top;'><p style='text-align: justify;'>"+rec.content.recommendationText+"</p></td> <td style='vertical-align: bottom;'>"+closeQuote+"</td></tr></table>";$(div).append('<div class="recommendation-wrapper"><span class="recommendation-square '+rec.content.recommendationType.code+' '+orientation+'" style="font-family:'+customizedFonts[2]+';">'+table+"</span>");$(div).append('<span class="recommender-square '+orientation+'" style="font-family:'+customizedFonts[2]+'; color: '+labelColors[rec.content.recommendationType.code]+';">'+
rec.content.recommender.firstName+" "+rec.content.recommender.lastName+"<span>"+rec.content.recommendationType.code+"</span></span></div>");}});}}
Viz.widgets.header=function(element,userInfo,options){var viz=Viz,root=(typeof element==="string")?document.getElementById(element):element,opt=options||{},div=viz.createTag('div','__header'),textAlign=opt.align||"center";root.appendChild(div);div.style.backgroundColor=customizedColors[2];div.style.padding="12px 48px 24px 48px";div.style.textAlign=textAlign;var name=((userInfo.first_name||"")+" "+(userInfo.last_name||"")).trim();var nameSize=opt.name.fontsize-(name.length>=30?8:0);$(div).append('<div style="font-family:'+customizedFonts[0]+';  font-size: '+nameSize+'px; color: '+customizedColors[0]+'; text-align:'+textAlign+'; font-weight:'+opt.name.fontweight+'">'+name+'</div>');var title=((userInfo.title||"")).trim();$(div).append('<div style="font-family:'+customizedFonts[1]+';  font-size: '+opt.title.fontsize+'px; color: '+customizedColors[1]+'; text-align:'+textAlign+'; font-weight:'+opt.title.fontweight+'">'+title+'</div>');if(userInfo.summary&&userInfo.summary.length>0){$(div).append('<span style="font-family:'+customizedFonts[2]+';  font-size: '+opt.summary.fontsize+'px; color: '+customizedColors[1]+'; text-align:left;"><p style="display: inline-block; padding: 18px 12px 0 12px;">'+userInfo.summary+'</p></span>');}};Viz.widgets.myStatChart=function(el,statData,countData,options){var icons={'suitcase':'M99.993,20.614c0.015-5.786-4.813-10.183-10.017-10.187l-18.102,0.001L62.987,0H50H37.013l-8.888,10.429h-18.05C4.833,10.433,0.005,14.829,0,20.615c0.005,0.142,0,46.837,0,46.837c0.005,6.54,4.952,10.293,10.075,10.301h79.901c5.082-0.009,10.03-3.762,10.017-10.302C99.993,67.451,100.008,20.756,99.993,20.614z M39.321,5H50h10.679l4.627,5.429H34.694L39.321,5z','baggage':'M17.473,82.588h-7.398C4.952,82.58,0.005,78.827,0,72.287c0,0,0.005-46.695,0-46.837  c0.005-5.786,4.833-10.182,10.075-10.186h7.398V82.588L17.473,82.588zM64.025,15.378V5.7c0.028-3.486-3.065-5.715-6.829-5.688c0,0-14.393-0.027-14.341,0c-3.749-0.027-6.894,2.202-6.887,5.688  v9.678H22.48v67.325h55.146V15.378H64.025z M58.961,15.378H40.919v-9.96h18.042V15.378zM82.578,82.588h7.398c5.083-0.009,10.031-3.762,10.017-10.302c0,0,0.015-46.695,0-46.837  c0.015-5.786-4.814-10.182-10.017-10.186h-7.398V82.588L82.578,82.588z','group':'M25.053,24.8C23.921,24.347,23.469,23.102,23.469,23.102S22.959,23.384,22.959,22.592S23.469,23.102,23.979,20.043999999999997C23.979,20.043999999999997,25.393,19.647,25.111,16.363999999999997H24.771C24.771,16.363999999999997,25.62,12.853999999999997,24.771,11.664999999999997C23.921,10.475999999999997,23.582,9.683999999999997,21.713,9.116999999999997S20.525000000000002,8.662999999999997,19.166,8.720999999999997C17.807000000000002,8.777999999999997,16.674,9.512999999999996,16.674,9.908999999999997C16.674,9.908999999999997,15.825,9.965999999999998,15.485999999999999,10.305999999999997C15.145999999999999,10.645999999999997,14.579999999999998,12.229999999999997,14.579999999999998,12.626999999999997S14.862999999999998,15.684999999999997,15.145999999999999,16.250999999999998L14.809,16.363999999999997C14.526,19.647,15.940999999999999,20.043999999999997,15.940999999999999,20.043999999999997C16.45,23.101999999999997,16.959999999999997,21.799999999999997,16.959999999999997,22.592S16.449999999999996,23.102,16.449999999999996,23.102S15.997999999999996,24.347,14.865999999999996,24.8C13.733999999999996,25.252000000000002,7.449999999999996,27.686,6.9389999999999965,28.196C6.427999999999996,28.707,6.485999999999996,31.084000000000003,6.485999999999996,31.084000000000003H33.43299999999999C33.43299999999999,31.084000000000003,33.49199999999999,28.707000000000004,32.980999999999995,28.196000000000005C32.468999999999994,27.686000000000003,26.184999999999995,25.252000000000006,25.052999999999994,24.800000000000004ZM12.583,24.628C12.484,24.448,12.435,24.318,12.435,24.318S12.003,24.557000000000002,12.003,23.886000000000003S12.435,24.318,12.867,21.727000000000004C12.867,21.727000000000004,14.066,21.391000000000005,13.826,18.608000000000004H13.538C13.538,18.608000000000004,13.681000000000001,18.017000000000003,13.775,17.274000000000004C13.771,16.966000000000005,13.781,16.638000000000005,13.812000000000001,16.278000000000006L13.850000000000001,15.852000000000006C13.829,15.360000000000007,13.743000000000002,14.913000000000006,13.538000000000002,14.626000000000005C12.818000000000001,13.619000000000005,12.530000000000001,12.947000000000005,10.947000000000003,12.467000000000006C9.364000000000003,11.987000000000005,9.939000000000004,12.082000000000006,8.788000000000004,12.131000000000006C7.636000000000004,12.179000000000006,6.676000000000004,12.802000000000005,6.676000000000004,13.139000000000006C6.676000000000004,13.139000000000006,5.956000000000004,13.187000000000006,5.668000000000004,13.475000000000007C5.397000000000004,13.746000000000008,4.963000000000004,14.937000000000006,4.911000000000004,15.360000000000007V15.641000000000007C4.958000000000004,16.294000000000008,5.169000000000004,18.090000000000007,5.380000000000004,18.513000000000005L5.094000000000005,18.609000000000005C4.855000000000005,21.392000000000007,6.053000000000004,21.728000000000005,6.053000000000004,21.728000000000005C6.485000000000005,24.319000000000006,6.917000000000004,23.216000000000005,6.917000000000004,23.887000000000004S6.485000000000004,24.319000000000003,6.485000000000004,24.319000000000003S6.102000000000004,25.376,5.142000000000004,25.758000000000003C5.081000000000004,25.782000000000004,5.003000000000004,25.814000000000004,4.910000000000004,25.85V31.084000000000003H5.485000000000004C5.456000000000004,29.806000000000004,5.562000000000004,28.157000000000004,6.231000000000003,27.490000000000002C6.587000000000003,27.135,7.754000000000003,26.551000000000002,12.583000000000004,24.628ZM34.913,15.572000000000001C34.873,15.194,34.785999999999994,14.857000000000001,34.620999999999995,14.626000000000001C33.901999999999994,13.618000000000002,33.61299999999999,12.947000000000001,32.03099999999999,12.467000000000002C30.446999999999992,11.987000000000002,31.022999999999993,12.082000000000003,29.87099999999999,12.131000000000002C28.71999999999999,12.179000000000002,27.75999999999999,12.802000000000001,27.75999999999999,13.139000000000003C27.75999999999999,13.139000000000003,27.04099999999999,13.187000000000003,26.751999999999992,13.475000000000003C26.48099999999999,13.747000000000003,26.042999999999992,14.947000000000003,25.993999999999993,15.366000000000003H26.026999999999994L26.106999999999992,16.279000000000003C26.126999999999992,16.510000000000005,26.12899999999999,16.715000000000003,26.133999999999993,16.924000000000003C26.223999999999993,17.590000000000003,26.343999999999994,18.274000000000004,26.46399999999999,18.513L26.17799999999999,18.609C25.93899999999999,21.392000000000003,27.13799999999999,21.728,27.13799999999999,21.728C27.56999999999999,24.319000000000003,28.00099999999999,23.216,28.00099999999999,23.887S27.568999999999992,24.319,27.568999999999992,24.319S27.51599999999999,24.461,27.40599999999999,24.657C32.17599999999999,26.557,33.33299999999999,27.137,33.68499999999999,27.491C34.35499999999999,28.158,34.45999999999999,29.806,34.43099999999999,31.085H34.91099999999999V25.779C34.89499999999999,25.773,34.87299999999999,25.764,34.85899999999999,25.758C33.899999999999984,25.375,33.51599999999999,24.319,33.51599999999999,24.319S33.08299999999999,24.558,33.08299999999999,23.887S33.51599999999999,24.319,33.94699999999999,21.728C33.94699999999999,21.728,34.75099999999999,21.499000000000002,34.90999999999999,19.887V18.66C34.90899999999999,18.642,34.90899999999999,18.627,34.90699999999999,18.609H34.61799999999999C34.61799999999999,18.609,34.83299999999999,17.719,34.90999999999999,16.748V15.572000000000001Z','cloud':'M28.345,17.904C28.363999999999997,17.709,28.375,17.512,28.375,17.313C28.375,13.860999999999999,25.576999999999998,11.062999999999999,22.125,11.062999999999999C19.446,11.062999999999999,17.167,12.751999999999999,16.278,15.122C15.688999999999998,14.475999999999999,14.848999999999998,14.063,13.905999999999999,14.063C12.127999999999998,14.063,10.687,15.504000000000001,10.687,17.282C10.687,17.492,10.709999999999999,17.697,10.748999999999999,17.895C8.376999999999999,18.286,6.5619999999999985,20.331,6.5619999999999985,22.813C6.5619999999999985,25.575,8.800999999999998,27.813,11.561999999999998,27.813H27.436999999999998C30.198999999999998,27.813,32.437,25.575,32.437,22.813C32.437999999999995,20.362,30.671999999999997,18.332,28.345,17.904Z','diamond':'M0,22.778 45.041,73.119 24.476,22.778 zM43.389,0 17.406,0 26.908,14.919 zM11.854,0 0,18.618 23.711,18.618 zM50,18.618 70.565,18.618 50,0 29.433,18.618 zM50,22.778 29.433,22.778 50,73.119 70.565,22.778 zM82.82,0 56.84,0 73.32,14.919 zM76.287,18.618 100,18.618 88.144,0 zM54.957,73.119 100,22.778 75.523,22.778 z','man':'M18.118,0 a8.159,8.159 0 1,0 0,16.318a8.159,8.159 0 1,0 0,-16.318zM8.472,95.426c0,2.524,2.05,4.574,4.574,4.574c2.529,0,4.576-2.05,4.576-4.574l0.004-38.374h2.037L19.65,95.426 c0,2.524,2.048,4.574,4.574,4.574s4.573-2.05,4.573-4.574l0.02-66.158h2.006v24.38c0,4.905,6.398,4.905,6.384,0v-24.9 c0-5.418-3.184-10.728-9.523-10.728L9.396,18.012C3.619,18.012,0,22.722,0,28.599v25.05c0,4.869,6.433,4.869,6.433,0v-24.38h2.048 L8.472,95.426z','vizme':'M55.957,200.183 h81.063V0.817C115.5,0.5,104.167,28.833,84.696,69.605c-6.623,11.55-15.863,31.854-28.739,31.854V200.183zM0.5,52.851v147.025h45.425V101.65 C32.833,101.65,11.929,96.828,0.5,52.851zM147.03,0.5v200h53.47V70.564 C200.5,70.564,189.457,5.875,147.03,0.5z','circle':'M18.118,0 a8.159,8.159 0 1,0 0,16.318a8.159,8.159 0 1,0 0,-16.318z','heart':'M49.999,91.46c3.944-3.943,26.458-26.47,40.533-40.543c12.61-12.611,12.341-30.992,0.876-42.395  C79.943-2.884,61.404-2.834,49.999,8.632C38.595-2.834,20.056-2.884,8.591,8.522C-2.874,19.925-3.142,38.306,9.467,50.917  C23.541,64.99,46.058,87.517,49.999,91.46z','exercise':'M71.046,17.12c3.911,0,7.078-3.167,7.078-7.078c0-3.889-3.167-7.055-7.078-7.055c-3.889,0-7.055,3.166-7.055,7.055  C63.992,13.954,67.158,17.12,71.046,17.12zM76.308,18.704H65.994L48.415,1.125c-1.374-1.443-3.655-1.513-5.099-0.116c-1.444,1.374-1.514,3.655-0.14,5.099  l18.37,18.394v60.955c0,2.212,1.77,3.981,3.958,3.981c2.212,0,3.981-1.77,3.981-3.981V52.394h3.213l0.023,33.062  c0,2.212,1.793,3.981,3.981,3.981s3.958-1.77,3.958-3.981l-0.023-60.955L99.009,6.107c1.373-1.444,1.303-3.725-0.141-5.099  c-1.443-1.397-3.725-1.327-5.099,0.116L76.308,18.704zM38.938,45.595c-1.071-1.094-2.538-1.746-4.167-1.746H19.975c-1.63,0-3.097,0.652-4.145,1.746L0.999,60.427  c-1.374,1.443-1.327,3.725,0.116,5.099s3.749,1.327,5.099-0.116l11.501-11.502v15.366H4.817c-2.375,0-4.284,1.909-4.284,4.284  c0,1.234,0.466,2.328,1.304,3.12l14.529,14.528c1.28,1.887,3.795,2.491,5.797,1.327c2.119-1.21,2.817-3.888,1.606-5.983  l-8.289-8.266l0.163,0.023h23.807l-8.312,8.266c-1.188,2.096-0.489,4.772,1.606,5.983c2.002,1.164,4.541,0.559,5.821-1.327  l14.529-14.528c0.838-0.792,1.303-1.886,1.303-3.12c0-2.375-1.908-4.284-4.284-4.284H37.239V54.093l11.292,11.339  c1.374,1.444,3.656,1.49,5.099,0.116c1.443-1.373,1.49-3.654,0.116-5.099L38.938,45.595zM27.518,42.335c3.9,0,7.043-3.166,7.043-7.055c0-3.911-3.144-7.055-7.043-7.055c-3.888,0-7.055,3.144-7.055,7.055  C20.463,39.169,23.63,42.335,27.518,42.335z','infinity':'M93.29,5.042c-8.948-6.722-23.507-6.722-32.454,0L50,13.185L39.164,5.042c-8.948-6.722-23.506-6.722-32.453,0  c-8.947,6.724-8.947,17.662,0,24.386c8.947,6.722,23.505,6.722,32.452,0L50,21.284l10.836,8.144c8.947,6.722,23.507,6.722,32.454,0  C102.236,22.704,102.236,11.766,93.29,5.042z M33.829,25.418c-6.006,4.514-15.778,4.514-21.784,0  c-6.006-4.512-6.006-11.854,0-16.368c6.006-4.512,15.778-4.512,21.784,0h0l10.836,8.143l-0.056,0.041l0.055,0.042L33.829,25.418z   M87.955,25.418c-6.007,4.514-15.778,4.514-21.785,0l-10.835-8.142l0.056-0.042l-0.056-0.041L66.17,9.05l0,0  c6.007-4.512,15.778-4.512,21.785,0C93.961,13.563,93.961,20.906,87.955,25.418z'},icon_map={"-1":'infinity',0:'cloud',1:'suitcase',2:'man',3:'diamond'};function pickScale(number){if(isNaN(number)){return{max:null,inc:null};}
if(number<10){return{max:10,inc:1};}
var scale=Math.floor(Math.log(number)/(Math.log(10)));var inc=Math.pow(10,(scale-1));if(number===500){return{max:500,inc:50};}
if(number<(inc*20)){return{max:inc*20,inc:inc*2};}
if(number<(inc*50)){return{max:inc*50,inc:inc*5};}
if(number<(inc*80)){return{max:inc*80,inc:inc*8};}
return{max:inc*100,inc:inc*10};}
function stripPluralText(number,text){return number>1?text.replace("(s)","s"):text.replace("(s)","");}
function calculateNumber(stat,countData){if(stat.category==="1"&&!stat.number){return countData.year_work_sum;}else if(stat.category==="2"){return countData.connections;}else if(!stat.number){return 0;}else{return stat.number;}}
function calculateUnit(stat){if(stat.category==="1"||stat.unit==="2"){return"year(s)";}else if(stat.category==="2"){return"connection(s)";}else if(stat.unit==="1"){return'dollar(s)';}else{return"unit(s)";}}
function createOneRow(id){var table=Viz.createTag('table');table.cellPadding="0";table.cellSpacing="0";table.style.width="1px";table.style.margin="0 auto 0 auto";var row=Viz.createTag('tr',id);table.appendChild(row);return{table:table,row:row};}
function getIconPath(iconId){if(icon_map.hasOwnProperty(iconId)){return icons[icon_map[iconId]];}else{return icons.cloud;}}
function scaleIcon(icon,size){var scale=(icon.getBBox().width>icon.getBBox().height)?(size/icon.getBBox().width):(size/icon.getBBox().height);icon.scale(scale);}
function drawIcon(paper,iconId,index,fill,iconSize){fill=fill||'#EC008C';iconSize=iconSize||40;var icon=paper.path(getIconPath(iconId)).attr({fill:fill,'stroke':'none'});scaleIcon(icon,iconSize);icon.translate(-icon.getBBox().x+(index%5)*(iconSize+1)+(iconSize-icon.getBBox().width)/2,-icon.getBBox().y+Math.floor(index/5)*(iconSize+4)+(iconSize-icon.getBBox().height)/2);return icon;}
var v=Viz,root=(typeof el==="string")?document.getElementById(el):el,opt=options||{},newId=opt.newId||'__skills',div=v.createTag('div',newId),statDiv=v.createTag('div','stat'),data=v.clone(statData),limit=opt.limit||5,showTitle=opt.showTitle||'show',titleFont=opt.titleFont||'museo-slab',titleColor=opt.titleColor||'black',numberFont=opt.numberFont||'ff-dagny-web-pro',numberColor=opt.numberColor||'#ED008C',iconColor=v.isTooLight(opt.iconColor||'black')?'black':opt.iconColor||'black',iconFadedColor=opt.iconFadedColor||v.lightenColor(iconColor,128),textFont=opt.textFont||'ff-dagny-web-pro',textColor=opt.textColor||'black';root.appendChild(div);if(showTitle==='show'){$(div).append('<div style="font-family:'+titleFont+'; font-size:35px; font-weight:bold; text-align:center; text-transform:uppercase; margin-bottom: 12px;">My Stats</div>');}
if(!(data&&data.length>0)){return;}
var columns=[];var statIndex=0;for(statIndex=0;statIndex<data.length;statIndex++){var stat=data[statIndex],columnTd=v.createTag('td'),columnDiv=v.createTag('div'),iconDiv=v.createTag('div'),legendDiv=v.createTag('div'),legendIconSpan=v.createTag('span');var number=calculateNumber(stat,countData),unit=calculateUnit(stat),scale=pickScale(number),prefix=(stat.unit==="1")?'$':'',postfix=(stat.category==="2"&&number===500)?'+':'';var numberText='<span style="font-family:'+numberFont+'; font-size: 48px; color: '+numberColor+'; font-weight: bold;">'+prefix+number+postfix+'</span>';var labelText='<span style="font-family:'+textFont+'; font-size: 24px; color: '+textColor+'; font-weight: bold;">'+stripPluralText(number,stat.label)+'</span>';var text='<div>'+numberText+' '+labelText+'</div>';var legendHtml='<span style="display: inline-block; vertical-align: middle; margin-left: 4px;">= '+scale.inc+' '+stripPluralText(scale.inc,unit)+'</span>';columnTd.appendChild(iconDiv);columnTd.appendChild(columnDiv);columnTd.appendChild(legendDiv);legendDiv.appendChild(legendIconSpan);columnTd.style.verticalAlign='top';columnTd.style.padding='0';columnDiv.style.width="226px";columnDiv.style.minHeight='100px';columnDiv.style.margin="0 auto 0 auto";legendDiv.style.position="relative";legendDiv.style.bottom="0px";legendDiv.style.fontFamily=textFont;legendDiv.style.fontSize='12px';legendDiv.style.color=textColor;legendDiv.style.opacity=0.7;legendIconSpan.style.display='inline-block';legendIconSpan.style.verticalAlign='middle';$(columnDiv).append(text);if(scale.inc&&scale.max){var paper=new Raphael(iconDiv,205,100);$(legendDiv).append(legendHtml);var iconIndex=0;var repeat=Math.floor(number/scale.inc);var extra=number-(repeat*scale.inc);var iconId=(stat.unit==="1")?3:stat.icon;for(iconIndex=0;iconIndex<repeat;iconIndex++){icon=drawIcon(paper,iconId,iconIndex,iconColor);}
if(extra>0){var percent=Math.ceil((extra/scale.inc)*100);drawIcon(paper,iconId,iconIndex,'0-'+iconColor+'-'+iconColor+':'+percent+'-'+iconFadedColor+':'+percent);}
var legendPaper=new Raphael(legendIconSpan,30,30);var legendIcon=drawIcon(legendPaper,iconId,0,iconFadedColor,29);}else{var legendHtml='<span style="display: inline-block; vertical-align: middle; margin-left: 4px;">= infinite</span>';$(legendDiv).append(legendHtml);var paper=new Raphael(iconDiv,100,100);var icon=drawIcon(paper,-1,0,iconColor,99);var legendPaper=new Raphael(legendIconSpan,30,30);var legendIcon=drawIcon(legendPaper,-1,0,iconFadedColor,29);}
columns.push(columnTd);if(statIndex!==(data.length-1)){var dividerColumn=v.createTag('td');dividerColumn.style.width="8px";dividerColumn.style.padding='0';columns.push(dividerColumn);}}
var tableJson=createOneRow();div.appendChild(statDiv);statDiv.appendChild(tableJson.table);var columnIndex=0;for(columnIndex in columns){if(columns.hasOwnProperty(columnIndex)){tableJson.row.appendChild(columns[columnIndex]);}}
var dividerHeight=tableJson.table.offsetHeight;for(columnIndex=1;columnIndex<columns.length;columnIndex+=2){var divider=columns[columnIndex];var dividerRaphael=new Raphael(divider,8,dividerHeight);dividerRaphael.path(['M',4,4,'L',4,(dividerHeight-4)]).attr({stroke:'black','stroke-width':'4','stroke-dasharray':'-'});}};Viz.widgets.drawAwards=function(element,rawData,opt){var viz=Viz,element=(typeof element==="string")?document.getElementById(element):element,opt=opt||{},div=viz.createTag('div','__awards'),showTitle=opt.showTitle||'show',margin={horizontal:opt.marginHorizontal||0,vertical:opt.marginVertical||24},awardLimit=6,data=clone(rawData);data.sort(function(a,b){return(b.awarded_date-a.awarded_date)});element.appendChild(div);div.style.marginTop=margin.vertical+"px";div.style.marginBottom=margin.vertical+"px";div.setAttribute('class',"awardContainer");if(showTitle==='show'){$(div).append('<div style="font-family:'+customizedFonts[1]+'; font-size:'+opt.title_fontsize+'px; font-weight:'+opt.title_fontweight+'; text-align:center">AWARDS & HONORS</div>');};$(div).append('<div class="clear" />');$(div).append('<div id="awardCenter" />');$.each(data,function(i,award){var awardYear="";if(award.awarded_date){awardYear=getDateFromString(award.awarded_date).getFullYear();}
award.year=awardYear;});var col=0;$.each(data,function(i,award){if(i==0||data[i-1].year!=award.year||award.year==""){col++;var awardYear=award.year||"";var id="award"+awardYear;$('#awardCenter').append('<div id ="'+id+'" class="yblock" style="font-family:'+customizedFonts[2]+'; color: '+customizedColors[3]+'"><div class="awardyearblock" style="color:'+customizedColors[3]+'; border-bottom: 10px solid '+customizedColors[3]+'";>'+awardYear+'</div></div>');if(col%5==0){$('#awardCenter').append('<div class="clear" />');};};$('.yblock').last().append('<div class="awardblock" id="award'+i+'">'+stripComma(award.name)+'</div>');var fontSize=(award.weight||5)*1.5+10;$('#award'+i+'').css({'color':customizedColors[1],'font-size':fontSize})});$('.yblock').css('width',960/((col>5)?5:col));$('.awardblock').css('background-color',customizedColors[2]);if(col>5){$('#awardCenter').css('text-align','left');}
function sortAwards(a,b){return(b.year-a.year);}
function stripComma(str){if(str.charAt(str.length-1)==","){return str.slice(0,-1);};return str;};}
Viz.widget.register("template7.timeline",function(options){var widget=Viz.createTag("div"),opt=options||{},paper=new Raphael(widget,960,340),margin={horizontal:opt.marginHorizontal||0,vertical:(!isNaN(opt.marginVertical)&&opt.marginVertical>=0)?opt.marginVertical:25},hues=opt.colors||['#a3af81','#836c7e','#6b7785','#4c1a26','#703f30','#307066','#305670','#367030'],dimensions={infographicPadding:35,infographicWidth:960,timelineWidth:960-35*2,timelineBlockHeight:25,workHeight:170,educationHeight:170,years:[]},mutedTemplateStyle={"common":{"lines":{"style":{"stroke":"#caced1"}}},"timeline":{"axis":{"style":{stroke:"#222","stroke-width":"4px"},"yearLabel":{"style":{"font-size":11,"font-weight":"bold","text-anchor":"center"}}},"block":{"style":{"stroke":"none"},"anchor":{"style":{stroke:"none",fill:"#1f1f1f"}}}}};widget.style.marginTop=margin.vertical+'px';widget.raphael=paper;var timeLineExp=vizData.timeline_work;var timeLineEdu=vizData.timeline_education;var sortByRange=function(a,b){return a.range-b.range;};var getDateFromString=function(unixtimestamp){return new Date(unixtimestamp*1000);};var drawHorizontalLine=function(paper,y,isDashed){var line=paper.path("M"+dimensions.infographicPadding+" "+(y-0.5)+" H"+(dimensions.infographicWidth-dimensions.infographicPadding)).attr(mutedTemplateStyle.common.lines.style);if(isDashed){line.attr({"stroke-dasharray":"- "});}
return line;};var drawTriangleNotch=function(paper,x,y,width){var height=(0.5*width)*Math.sqrt(3);var path="M "+x+" "+y+" l "+(-0.5*width)+" 0 l "+(0.5*width)+" "+height+" l "+(0.5*width)+" "+(-1*height)+" z";var triangle=paper.path(path).attr({fill:"#222",stroke:"none"});return triangle;};var fnCalculateRange=function(timeline){var i;for(i=0;i<timeline.length;i++){var start=getDateFromString(timeline[i].start_date);var end=getDateFromString(timeline[i].end_date);timeline[i].range=(end.getTime()-start.getTime())/86400000;if(timeline[i].range<30){timeline[i].range=30;}}};var fnSetBlocksHeight=function(timeLine){var maxBlockHeight=dimensions.timelineBlockHeight;var currentStart,currentEnd,previousStart,previousEnd;var i;var j;timeLine.sort(sortByRange);for(i=0;i<timeLine.length;i++){timeLine[i].height=dimensions.timelineBlockHeight;currentStart=getDateFromString(timeLine[i].start_date).getTime();currentEnd=getDateFromString(timeLine[i].end_date).getTime();for(j=0;j<i;j++){previousStart=getDateFromString(timeLine[j].start_date).getTime();previousEnd=getDateFromString(timeLine[j].end_date).getTime();if((previousStart>currentStart&&previousStart<currentEnd)||(previousEnd>currentStart&&previousEnd<currentEnd)||(previousStart===currentStart&&previousEnd===currentEnd)){if(timeLine[i].height===timeLine[j].height){timeLine[i].height=timeLine[i].height+dimensions.timelineBlockHeight;if(timeLine[i].height>maxBlockHeight){maxBlockHeight=timeLine[i].height;}}}}}
return maxBlockHeight;};var timeLineExpExists=false,timeLineEduExists=false;timeLineExpExists=(typeof timeLineExp!=="undefined"&&timeLineExp.length>0);timeLineEduExists=(typeof timeLineEdu!=="undefined"&&timeLineEdu.length>0);var firstExpYear,firstEduYear,lastExpYear,lastEduYear;if(timeLineExpExists){firstExpYear=getDateFromString(timeLineExp[timeLineExp.length-1].start_date).getFullYear();lastExpYear=getDateFromString(timeLineExp[0].end_date).getFullYear();}
if(timeLineEduExists){firstEduYear=getDateFromString(timeLineEdu[timeLineEdu.length-1].start_date).getFullYear();lastEduYear=getDateFromString(timeLineEdu[0].end_date).getFullYear();}
var firstYear,lastYear;if(timeLineExpExists&&timeLineEduExists){firstYear=firstExpYear>firstEduYear?firstEduYear:firstExpYear;lastYear=lastExpYear>lastEduYear?lastExpYear:lastEduYear;}else if(timeLineExpExists&&!timeLineEduExists){firstYear=firstExpYear;lastYear=lastExpYear;}else if(!timeLineExpExists&&timeLineEduExists){firstYear=firstEduYear;lastYear=lastEduYear;}else{return;}
var yearCount=(lastYear-firstYear)+1;var startY=0;var startX=dimensions.infographicPadding;var endX=dimensions.infographicWidth-dimensions.infographicPadding;var axisY=startY+dimensions.workHeight;var sectionHeight=40;var yearWidth=dimensions.timelineWidth/yearCount;var y,i;for(y=lastYear+1,i=0;y>firstYear;y--,i++){dimensions.years[i]={x:Math.round(endX-i*yearWidth),isVisible:(i%2===1),label:y};}
var fnCalculateBlocksGeometry=function(timeLine,reverse){var dayWidth=yearWidth/365;timeLine.sort(sortByRange).reverse();var timelineStartDate=new Date(firstYear,0,1);var timelineEndDate=new Date(lastYear,11,31);var blockHeight=dimensions.timelineBlockHeight;var i,j;for(i=0;i<timeLine.length;i++){var thisStartDate=getDateFromString(timeLine[i].start_date);var thisEndDate=getDateFromString(timeLine[i].end_date);var thisStartX=Math.floor(startX+((thisStartDate.getTime()-timelineStartDate.getTime())/86400000)*dayWidth);var thisWidth=Math.floor((timeLine[i].range/365)*yearWidth);var thisHeight=timeLine[i].height;timeLine[i].width=thisWidth;timeLine[i].center=thisStartX+(thisWidth/2);timeLine[i].x=thisStartX;timeLine[i].y=axisY-thisHeight;timeLine[i].fill=hues[3+(i%(hues.length-3))];timeLine[i].anchorX=timeLine[i].center;timeLine[i].anchorY=timeLine[i].y+blockHeight/2;if(reverse){timeLine[i].y=axisY;timeLine[i].anchorY=timeLine[i].y+blockHeight/2;if(timeLine[i].height===blockHeight){var approxLabelWidth=34;for(j=0;j<dimensions.years.length;j++){if(dimensions.years[j].isVisible&&timeLine[i].anchorX>dimensions.years[j].x-approxLabelWidth/2&&timeLine[i].anchorX<dimensions.years[j].x+approxLabelWidth/2){if(timeLine[i].anchorX<dimensions.years[j].x){timeLine[i].anchorX-=Math.abs(approxLabelWidth/2-(dimensions.years[j].x-timeLine[i].anchorX));}else{timeLine[i].anchorX+=Math.abs(approxLabelWidth/2-(timeLine[i].anchorX-dimensions.years[j].x));}}}}}}};var set=paper.set();if(timeLineExpExists){fnCalculateRange(timeLineExp);fnSetBlocksHeight(timeLineExp);fnCalculateBlocksGeometry(timeLineExp,false);for(i=0;i<timeLineExp.length;i++){var block=paper.rect(timeLineExp[i].x,timeLineExp[i].y,timeLineExp[i].width,timeLineExp[i].height).attr(mutedTemplateStyle.timeline.block.style).attr({fill:timeLineExp[i].fill});set.push(block);timeLineExp[i].title=timeLineExp[i].position;timeLineExp[i].desc=timeLineExp[i].company;timeLineExp[i].center=timeLineExp[i].anchorX;timeLineExp[i].apex=timeLineExp[i].anchorY+8;var tipText=getExperienceToolTip(timeLineExp[i]);drawTooltip(block.node,tipText);}}
if(timeLineEduExists){fnCalculateRange(timeLineEdu);fnSetBlocksHeight(timeLineEdu);fnCalculateBlocksGeometry(timeLineEdu,true);for(i=0;i<timeLineEdu.length;i++){var block=paper.rect(timeLineEdu[i].x,timeLineEdu[i].y,timeLineEdu[i].width,timeLineEdu[i].height).attr(mutedTemplateStyle.timeline.block.style).attr({fill:timeLineEdu[i].fill});set.push(block);timeLineEdu[i].title=timeLineEdu[i].degree;timeLineEdu[i].desc=timeLineEdu[i].school;timeLineEdu[i].center=timeLineEdu[i].anchorX;timeLineEdu[i].apex=timeLineEdu[i].anchorY-8;var tipText=getEducationToolTip(timeLineEdu[i]);drawTooltip(block.node,tipText);}}
set.push(paper.path("M"+startX+" "+axisY+" H"+endX).attr(mutedTemplateStyle.timeline.axis.style));for(i=0;i<dimensions.years.length;i++){if(dimensions.years[i].isVisible){set.push(drawTriangleNotch(paper,dimensions.years[i].x,axisY,10),paper.text(dimensions.years[i].x,axisY+15,dimensions.years[i].label).attr(mutedTemplateStyle.timeline.axis.yearLabel.style));}}
widget.drawLabels=function(){var downShift=paper.viz.scatterLabels(100,10,timeLineExp,{spacing:10,horz_spacing:10});paper.setSize(paper.width,paper.height+downShift);set.translate(0,downShift);var i;for(i=0;i<timeLineEdu.length;++i){timeLineEdu[i].apex+=downShift;}
paper.viz.scatterLabels(100,450+downShift,timeLineEdu,{spacing:5,horz_spacing:10,reverse:true});};return widget;});Viz.widget.register("viz.title",function(options){var widget=Viz.createTag("div"),opt=options||{},style=opt.style||{},textStyle=opt.textStyle||{},icon=opt.icon||"work circle",iconSize=opt.iconSize||null,color=opt.color||null,text=opt.text||"Title";widget.dom={"icon":Viz.widget.create("viz.icon",{icon:icon,size:iconSize,fill:color}),"text":Viz.createTag("span")};$(widget).css({'text-align':"left",'color':color});$(widget).css(style);$(widget.dom.text).html(text);$(widget.dom.text).css(textStyle);$(widget.dom.text).css({display:"inline-block",'vertical-align':"top",'line-height':widget.dom.icon.style.height,'margin-left':"4px"});if(iconSize){widget.dom.icon.scale(iconSize.width,iconSize.height);}
widget.appendChild(widget.dom.icon);widget.appendChild(widget.dom.text);return widget;});Viz.iconMap={"work circle":[null,42.283,42.282,{"cy":21.141,"r":21.141,"type":"circle","stroke":"none","fill":"#111","cx":21.141},{"type":"path","stroke":"none","fill":"#FFFFFF","path":"M33.282,13.781h-4v16h4c0.55,0,1-0.45,1-1v-14C34.282,14.231,33.832,13.781,33.282,13.781z"},{"type":"path","stroke":"none","fill":"#FFFFFF","path":"M27.283,13.781L27.283,13.781v-0.125v-0.875c0-1.949-1.547-3-3-3h-6.001c-1.947,0-3,1.546-3,3v1v0h-2v16 h15v-16H27.283z M25.283,13.781L25.283,13.781l-8.001,0v0v-1c0,0,0-1,1-1s6.001,0,6.001,0s1,0,1,1S25.283,13.781,25.283,13.781z"},{"type":"path","stroke":"none","fill":"#FFFFFF","path":"M12.282,13.781h-3c-0.55,0-1,0.45-1,1v14c0,0.55,0.45,1,1,1h3V13.781z"}]};Viz.widget.register("viz.icon",function(options){var widget=Viz.createTag("span"),opt=options||{},iconId=opt.icon||"work circle",size=opt.size||{width:32,height:32},color=opt.fill||"#111";if(!Viz.iconMap.hasOwnProperty(iconId)){throw"Icon '"+iconId+"' does not exist";}
widget.path=Viz.clone(Viz.iconMap[iconId]);widget.path[0]=widget;widget.iconWidth=widget.path[1];widget.iconHeight=widget.path[2];$(widget).css({display:"inline-block",width:widget.iconWidth+"px",height:widget.iconHeight+"px"});var paper=new Raphael(widget.path);widget.raphael=paper;return widget;});Viz.widget.register("viz.hr",function(options){var widget=Viz.createTag("div"),opt=options||{},line=opt.line||"1px solid #666";$(widget).css('margin-top',"8px");$(widget).css('margin-bottom',"8px");$(widget).css('border-bottom',line);return widget;});Viz.widget.register("viz.header",function(options){var widget=Viz.createTag("div"),opt=options||{},style=opt.style||{},nameStyle=opt.nameStyle||{},titleStyle=opt.titleStyle||{},summaryStyle=opt.summaryStyle||{};widget.dom={"name":Viz.createTag("div"),"title":Viz.createTag("div"),"summary":Viz.createTag("div")};if(vizData&&vizData.user_info&&vizData.user_info.first_name){$(widget.dom.name).html(vizData.user_info.first_name+" "+vizData.user_info.last_name);$(widget.dom.title).html(vizData.user_info.title);$(widget.dom.summary).html(vizData.user_info.summary);}
$(widget).css(style);$(widget.dom.name).css(nameStyle);$(widget.dom.title).css(titleStyle);$(widget.dom.summary).css(summaryStyle);widget.appendChild(widget.dom.name);widget.appendChild(widget.dom.title);widget.appendChild(widget.dom.summary);return widget;});Viz.widget.register("template7.header",function(options){var widget=Viz.createTag("div"),opt=options||{},style=opt.style||{},nameStyle=opt.nameStyle||{},titleStyle=opt.titleStyle||{},summaryStyle=opt.summaryStyle||{};widget.dom={"container":Viz.createTag("div"),"name":Viz.createTag("div"),"title":Viz.createTag("div"),"summary":Viz.createTag("div")};if(vizData&&vizData.user_info&&vizData.user_info.first_name){$(widget.dom.name).html(vizData.user_info.first_name+" "+vizData.user_info.last_name);$(widget.dom.title).html(vizData.user_info.title);$(widget.dom.summary).html(vizData.user_info.summary);}
$(widget.dom.container).css(style);$(widget.dom.name).css(nameStyle);$(widget.dom.title).css(titleStyle);$(widget.dom.summary).css(summaryStyle);widget.appendChild(widget.dom.container);widget.dom.container.appendChild(widget.dom.name);widget.dom.container.appendChild(widget.dom.title);widget.appendChild(widget.dom.summary);return widget;});
