/* jquery.calendar.js Date: 2018-08-02 */ !function(t){t.fn.extend({addCalendar:function(e){e=t.extend({calType:"google,outlook,yahoo,iCal,windowlive",calText:{google:"Google Calendar",outlook:"Outlook Calendar",yahoo:"Yahoo! Calendar",iCal:"iCal Calendar",windowlive:"Window Live Calendar"},icsPath:"https://api.corporateshowcase.com/calendar/v2/lib/",left:0,top:0},e);return this.each(function(){t(this).bind("click",function(){return detailsObj={title:t(this).attr("data-title"),details:t(this).attr("data-details"),start:t(this).attr("data-start"),end:t(this).attr("data-end"),locationArea:t(this).attr("data-locationArea")},0==t(".calendarSelect").length?(t(this).after('
'),t(".calendarSelect .item .close").bind("click",function(){t(".calendarSelect").hide("drop",{direction:"up"},300,function(){t(".calendarSelect").remove(),t(".calOpenItem").removeClass("calOpenItem")})}),-1!=e.calType.indexOf("google")&&(t(".calendarSelect .item").append(addCalendarObj.createItem("google",detailsObj,e.calText.google)),t(".google_addCalendar").bind("click",function(){addCalendarObj.googlecal(t(this))})),-1!=e.calType.indexOf("outlook")&&(t(".calendarSelect .item").append(addCalendarObj.createItem("outlook",detailsObj,e.calText.outlook)),t(".outlook_addCalendar").bind("click",function(){addCalendarObj.icsCal(t(this),e.icsPath)})),-1!=e.calType.indexOf("iCal")&&(t(".calendarSelect .item").append(addCalendarObj.createItem("iCal",detailsObj,e.calText.iCal)),t(".iCal_addCalendar").bind("click",function(){addCalendarObj.icsCal(t(this),e.icsPath)})),-1!=e.calType.indexOf("yahoo")&&(t(".calendarSelect .item").append(addCalendarObj.createItem("yahoo",detailsObj,e.calText.yahoo)),t(".yahoo_addCalendar").bind("click",function(){addCalendarObj.yahoocal(t(this))})),-1!=e.calType.indexOf("windowlive")&&(t(".calendarSelect .item").append(addCalendarObj.createItem("windowlive",detailsObj,e.calText.windowlive)),t(".windowlive_addCalendar").bind("click",function(){addCalendarObj.windowlivecal(t(this))})),t(".calendarSelect").css({left:t(this).position().left-parseInt(t(".calendarSelect").outerWidth()/2)+parseInt(t(this).outerWidth()/2)+e.left,top:t(this).position().top+t(this).outerHeight()+e.top}).show("drop",{direction:"up"},300),t(this).addClass("calOpenItem"),console.log(t(this).height())):($this=t(this),t(".calendarSelect").hide("drop",{direction:"up"},300,function(){t(".calendarSelect").remove(),$this.hasClass("calOpenItem")?t(".calOpenItem").removeClass("calOpenItem"):(t(".calOpenItem").removeClass("calOpenItem"),$this.trigger("click"))})),!1})})}}),t.ajax({url:"https://www.google-analytics.com/collect",crossDomain:!0,data:t.param({payload_data:"",v:1,t:"pageview",tid:"UA-72765926-2",cid:"0798f34b-ee90-4a69-ab0d-66a9ad8914a3",dr:window.location.href,dl:"http://api.corporateshowcase.com",dt:"Add to Calendar API - "+window.location.href}),success:function(t){},error:function(){}})}(jQuery);var addCalendarObj={clickItem:{},createItem:function(t,e,a){return''+a+""},googlecal:function(t){var e=dateExtend.parseDate(t.attr("data-start")),a=dateExtend.parseDate(t.attr("data-end")),n=phpjs.date("Ymd",phpjs.jsDate2Timestamp(e))+"T"+phpjs.date("His",phpjs.jsDate2Timestamp(e)),r=phpjs.date("Ymd",phpjs.jsDate2Timestamp(a))+"T"+phpjs.date("His",phpjs.jsDate2Timestamp(a)),i={text:t.attr("data-title"),details:t.attr("data-details").replace(/\\n/g,"
"),dates:n+"/"+r,location:t.attr("data-locationArea")};googlecalLink="http://www.google.com/calendar/event?action=TEMPLATE&"+$.param(i),window.open(googlecalLink),evtLog.clickItem("Google")},icsCal:function(t,e){var a=dateExtend.parseDate(t.attr("data-start")),n=dateExtend.parseDate(t.attr("data-end")),r=phpjs.date("Ymd",phpjs.jsDate2Timestamp(a))+"T"+phpjs.date("His",phpjs.jsDate2Timestamp(a)),i=phpjs.date("Ymd",phpjs.jsDate2Timestamp(n))+"T"+phpjs.date("His",phpjs.jsDate2Timestamp(n)),o={title:t.attr("data-title"),details:t.attr("data-details"),start:r,end:i,location:t.attr("data-locationArea")};icsCalLink=e+"genics.php?"+$.param(o),window.location.href=icsCalLink,evtLog.clickItem("ics")},yahoocal:function(t){var e=dateExtend.parseDate(t.attr("data-start")),a=dateExtend.parseDate(t.attr("data-end")),n=phpjs.date("Ymd",phpjs.jsDate2Timestamp(e))+"T"+phpjs.date("His",phpjs.jsDate2Timestamp(e)),r={TITLE:t.attr("data-title"),DESC:t.attr("data-details"),ST:n,DUR:dateExtend.timeDiff("Hi",(a-e)/1e3),in_loc:t.attr("data-locationArea")};yahoocal="http://calendar.yahoo.com/?v=60&"+$.param(r),window.open(yahoocal),evtLog.clickItem("Yahoo")},windowlivecal:function(t){var e=dateExtend.parseDate(t.attr("data-start")),a=dateExtend.parseDate(t.attr("data-end")),n=phpjs.jsDate2Timestamp(e)-phpjs.date("Z",phpjs.jsDate2Timestamp(e)),r=phpjs.jsDate2Timestamp(a)-phpjs.date("Z",phpjs.jsDate2Timestamp(a)),i=phpjs.date("Ymd",n)+"T"+phpjs.date("His",n)+"Z",o=phpjs.date("Ymd",r)+"T"+phpjs.date("His",r)+"Z",d={subject:t.attr("data-title"),body:t.attr("data-details").replace(/\\n/g," "),startdt:i,enddt:o,location:t.attr("data-locationArea")};windowlivecalLink="https://outlook.live.com/owa/?path=/calendar/view/Month&rru=addevent&"+$.param(d),window.open(windowlivecalLink),evtLog.clickItem("Window Live")}},dateExtend={timeDiff:function(t,e){return e=Math.floor(e),hours=Math.floor(e/3600),e-=3600*hours,minutes=Math.floor(e/60),e-=60*minutes,hours<10&&(hours="0"+hours),minutes<10&&(minutes="0"+minutes),e<10&&(e="0"+e),outputString="Hi"==t?hours+minutes:hours+":"+minutes+":"+e,outputString},parseDate:function(t){return dateObj=new Date(t),"NaN"==dateObj&&(console.log("test"),dateArr=t.split(/[TZ\-\:]/),dateObj=new Date(Date.UTC(dateArr[0],dateArr[1]-1,dateArr[2],dateArr[3],dateArr[4],dateArr[5]))),dateObj}},phpjs={date:function(t,e){var a,n,r=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],i=/\\?(.?)/gi,o=function(t,e){return n[t]?n[t]():e},d=function(t,e){for(t=String(t);t.length9?-1:0)},Y:function(){return a.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return a.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var t=3600*a.getUTCHours(),e=60*a.getUTCMinutes(),n=a.getUTCSeconds();return d(Math.floor((t+e+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return a.getHours()},h:function(){return d(n.g(),2)},H:function(){return d(n.G(),2)},i:function(){return d(a.getMinutes(),2)},s:function(){return d(a.getSeconds(),2)},u:function(){return d(1e3*a.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var t=a.getTimezoneOffset(),e=Math.abs(t);return(t>0?"-":"+")+d(100*Math.floor(e/60)+e%60,4)},P:function(){var t=n.O();return t.substr(0,3)+":"+t.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-a.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(i,o)},r:function(){return"D, d M Y H:i:s O".replace(i,o)},U:function(){return a/1e3|0}},this.date=function(t,e){return this,a=void 0===e?new Date:e instanceof Date?new Date(e):new Date(1e3*e),t.replace(i,o)},this.date(t,e)},jsDate2Timestamp:function(t){return t.getTime()/1e3},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}},evtLog={clickItem:function(t){$.ajax({url:"https://www.google-analytics.com/collect",crossDomain:!0,data:$.param({payload_data:"",v:1,t:"event",tid:"UA-72765926-2",cid:"0798f34b-ee90-4a69-ab0d-66a9ad8914a3",dr:window.location.href,dl:"http://api.corporateshowcase.com",dt:"Add to Calendar API - "+window.location.href,ec:"Add to Calendar",ea:t,el:"Add to Calendar API - "+window.location.href}),success:function(t){},error:function(){}})}};