Commit 14fb1efa20c5fded7b306d37b739d6c386aaec47

Authored by Ahmed Owian
1 parent 3d21c3b19a
Exists in master

Added prototype

Updated .gitignore to ignore all log files
Removed enterprise from run.sh
... ... @@ -3,4 +3,4 @@
3 3 .settings/
4 4 target/
5 5 alf_data_dev/
6   -*.log
  6 +*.log*
... ...
prototype/alfresco-skype-uri.js
... ... @@ -0,0 +1,1735 @@
  1 +/*jshint -W003:true */
  2 +/*jshint -W107:true */
  3 +/*jshint -W057:true */
  4 +
  5 +var Skype = new function () {
  6 + this.name = null;
  7 + this.element = null;
  8 + this.participants = ["echo123"];
  9 + this.listParticipants = "false";
  10 + this.video = "false";
  11 + this.topic = null;
  12 + this.listTopic = "false";
  13 + this.imageSize = null;
  14 + this.imageColor = null;
  15 + this.useDetection = "true";
  16 + this.protocol = "skype:";
  17 + this.version = "1.1.7";
  18 + this.httpProtocol = window.location.protocol !== "https:" ? "http:" : "https:";
  19 + this.assetsDomain = this.httpProtocol + "//" + (this.httpProtocol !== "https:" ? "www.skypeassets.com" : "secure.skypeassets.com");
  20 + this.ui = l;
  21 + this.setImageAttributes = j;
  22 + this.trimString = o;
  23 + this.escapeString = b;
  24 + this.createDetectionFrame = h;
  25 + this.trySkypeUri_IE9_IE8 = n;
  26 + this.trySkypeUri_IOS_Safari = e;
  27 + this.trySkypeUri_Android_Chrome = a_androidchrome;
  28 + this.trySkypeUri_Android_Firefox = q;
  29 + this.trySkypeUri_Generic = a;
  30 + this.SkypeClientDownloadUrl = this.httpProtocol + "//www.skype.com/download";
  31 + this.installSkypeMsg = "Please install Skype application in order to make this call or send a message.";
  32 + this.displayNotSupportedMsg = f;
  33 + this.SkypeUriAssetMap = c;
  34 + this.SkypeUriAssetColorMap = g;
  35 + this.SkypeUriNameLinks = m;
  36 + this.assetPrefix = this.assetsDomain + "/i/scom/images/skype-buttons/";
  37 + this.assetSizeArray = [10, 12, 14, 16, 24, 32];
  38 + this.assetSizeDefault = 16;
  39 + this.assetMarginMinimum = 16;
  40 + this.assetSize = this.assetSizeDefault;
  41 + this.assetMargin = (this.assetSize >= this.assetMarginMinimum) ? this.assetSize : this.assetMarginMinimum;
  42 + this.assetColorPathWhite = "_trans_";
  43 + this.assetColorFontWhite = "white";
  44 + this.assetColorPathSkype = "_";
  45 + this.assetColorFontSkype = "#444444";
  46 + this.assetColorPathDefault = this.assetColorPathSkype;
  47 + this.assetColorFontDefault = this.assetColorFontSkype;
  48 + this.assetColor = new this.SkypeUriAssetColorMap(this.assetColorPathDefault, this.assetColorFontDefault);
  49 + this.assetSizeMap = {};
  50 + this.assetSizeMap.size10 = new this.SkypeUriAssetMap(10, -18);
  51 + this.assetSizeMap.size12 = new this.SkypeUriAssetMap(12, -19);
  52 + this.assetSizeMap.size14 = new this.SkypeUriAssetMap(14, -19);
  53 + this.assetSizeMap.size16 = new this.SkypeUriAssetMap(16, -20);
  54 + this.assetSizeMap.size24 = new this.SkypeUriAssetMap(24, -30);
  55 + this.assetSizeMap.size32 = new this.SkypeUriAssetMap(32, -41);
  56 + this.focusLinks = new this.SkypeUriNameLinks("", "");
  57 + this.callLinks = new this.SkypeUriNameLinks("call", "");
  58 + this.videoLinks = new this.SkypeUriNameLinks("call", "");
  59 + this.chatLinks = new this.SkypeUriNameLinks("chat", "");
  60 + this.multiChatLinks = new this.SkypeUriNameLinks("chat", "");
  61 + this.dropdownLinks = new this.SkypeUriNameLinks("dropdown", "");
  62 + this.setImageAttributes(this.assetSizeDefault, "");
  63 + this.analyzeSkypeUriInit = null;
  64 + this.analyzeSkypeUriAction = null;
  65 + this.analyzeSkypeUriRedirect = null;
  66 + this.analyzeSkypeUr = null;
  67 + this.analyzePreCrumbs = [];
  68 + this.analyzeCrumbs = [];
  69 + this.analyzeCrumbIndex = -1;
  70 + this.tryAnalyzeSkypeUri = k;
  71 + this.detectSkypeClientFrameId = null;
  72 + this.detectedPlatform = "unknown";
  73 + this.detectedBrowser = "unknown";
  74 + this.isWinXP = false;
  75 + this.isWinVista = false;
  76 + this.isWin7 = false;
  77 + this.isWin8 = false;
  78 + this.isOSX_SnowLeopard = false;
  79 + this.isOSX_MountainLion = false;
  80 + this.isLinux = false;
  81 + this.isWinPhone8 = false;
  82 + this.isAndroid = false;
  83 + this.isAndroid_Gingerbread = false;
  84 + this.isAndroid_IceCream = false;
  85 + this.isAndroid_JellyBean = false;
  86 + this.isIOS7 = false;
  87 + this.isIOS6 = false;
  88 + this.isIOS5 = false;
  89 + this.isIOS4 = false;
  90 + this.isIPhone = false;
  91 + this.isIPad = false;
  92 + this.isIPod = false;
  93 + this.isIE10 = false;
  94 + this.isIE9 = false;
  95 + this.isIE8 = false;
  96 + this.isIE7 = false;
  97 + this.isIE6 = false;
  98 + this.isFF = false;
  99 + this.isAndroidBrowser = false;
  100 + this.isChrome = false;
  101 + this.isSafari = false;
  102 + this.showDropdown = i;
  103 + this.hideDropdown = d;
  104 + this.analyzeScript = this.assetsDomain + "/i/scom/js/" + "skype-analytics.js";
  105 + this.includeJavascript = p;
  106 + this.includeJavascript(this.analyzeScript);
  107 + if (navigator.userAgent.indexOf("Windows NT 5.1") !== -1) {
  108 + this.isWinXP = true;
  109 + this.detectedPlatform = "Windows XP"
  110 + } else {
  111 + if (navigator.userAgent.indexOf("Windows NT 6.0") !== -1) {
  112 + this.isWinVista = true;
  113 + this.detectedPlatform = "Windows Vista"
  114 + } else {
  115 + if (navigator.userAgent.indexOf("Windows NT 6.1") !== -1) {
  116 + this.isWin7 = true;
  117 + this.detectedPlatform = "Windows 7"
  118 + } else {
  119 + if (navigator.userAgent.indexOf("Windows NT 6.2") !== -1) {
  120 + this.isWin8 = true;
  121 + this.detectedPlatform = "Windows 8"
  122 + } else {
  123 + if (navigator.userAgent.indexOf("Mac OS X 10_7") !== -1) {
  124 + this.isOSX_SnowLeopard = true;
  125 + this.detectedPlatform = "OSX 10.7"
  126 + } else {
  127 + if (navigator.userAgent.indexOf("Mac OS X 10.8") !== -1) {
  128 + this.isOSX_MountainLion = true;
  129 + this.detectedPlatform = "OSX 10.8"
  130 + } else {
  131 + if (navigator.userAgent.indexOf("Mac OS X 10_8") !== -1) {
  132 + this.isOSX_MountainLion = true;
  133 + this.detectedPlatform = "OSX 10.8"
  134 + } else {
  135 + if(navigator.userAgent.indexOf("Android") !== -1) {
  136 + this.isAndroid = true;
  137 + this.detectedPlatform = "Android"
  138 +
  139 + if (navigator.userAgent.indexOf("Android 2.3") !== -1) {
  140 + this.isAndroid_Gingerbread = true;
  141 + this.detectedPlatform = "Android 2.3"
  142 + }
  143 + else if(navigator.userAgent.indexOf("Android 4.0") !== -1) {
  144 + this.isAndroid_IceCream = true;
  145 + this.detectedPlatform = "Android 4.0"
  146 + }
  147 + else if(navigator.userAgent.indexOf("Android 4.1") !== -1) {
  148 + this.isAndroid_JellyBean = true;
  149 + this.detectedPlatform = "Android 4.1"
  150 + }
  151 + }
  152 + else if (navigator.userAgent.indexOf("Linux") !== -1) {
  153 + this.isLinux = true;
  154 + this.detectedPlatform = "Linux"
  155 + } else {
  156 + if (navigator.userAgent.indexOf("Windows Phone 8") !== -1) {
  157 + this.isWinPhone8 = true;
  158 + this.detectedPlatform = "Windows Phone 8"
  159 + } else {
  160 + if (navigator.userAgent.match(/OS 7_[0-9_]+ like Mac OS X/i)) {
  161 + this.isIOS7 = true;
  162 + this.detectedPlatform = "iOS7"
  163 + } else {
  164 + if (navigator.userAgent.match(/OS 6_[0-9_]+ like Mac OS X/i)) {
  165 + this.isIOS6 = true;
  166 + this.detectedPlatform = "iOS6"
  167 + } else {
  168 + if (navigator.userAgent.match(/OS 5_[0-9_]+ like Mac OS X/i)) {
  169 + this.isIOS5 = true;
  170 + this.detectedPlatform = "iOS5"
  171 + } else {
  172 + if (navigator.userAgent.match(/OS 4_[0-9_]+ like Mac OS X/i)) {
  173 + this.isIOS4 = true;
  174 + this.detectedPlatform = "iOS4"
  175 + }
  176 + }
  177 + }
  178 + }
  179 + }
  180 + }
  181 + }
  182 + }
  183 + }
  184 + }
  185 + }
  186 + }
  187 + } if (navigator.userAgent.indexOf("iPhone") !== -1) {
  188 + this.isIPhone = true;
  189 + this.detectedPlatform = "iPhone " + this.detectedPlatform
  190 + } else {
  191 + if (navigator.userAgent.indexOf("iPad") !== -1) {
  192 + this.IsPad = true;
  193 + this.detectedPlatform = "iPad " + this.detectedPlatform
  194 + } else {
  195 + if (navigator.userAgent.indexOf("iPod") !== -1) {
  196 + this.IsPod = true;
  197 + this.detectedPlatform = "iPod " + this.detectedPlatform
  198 + }
  199 + }
  200 + } if (navigator.userAgent.indexOf("MSIE 10") !== -1) {
  201 + this.isIE10 = true;
  202 + this.detectedBrowser = "Internet Explorer 10"
  203 + } else {
  204 + if (navigator.userAgent.indexOf("MSIE 9") !== -1) {
  205 + this.isIE9 = true;
  206 + this.detectedBrowser = "Internet Explorer 9"
  207 + } else {
  208 + if (navigator.userAgent.indexOf("MSIE 8") !== -1) {
  209 + this.isIE8 = true;
  210 + this.detectedBrowser = "Internet Explorer 8"
  211 + } else {
  212 + if (navigator.userAgent.indexOf("MSIE 7") !== -1) {
  213 + this.isIE7 = true;
  214 + this.detectedBrowser = "Internet Explorer 7"
  215 + } else {
  216 + if (navigator.userAgent.indexOf("MSIE 6") !== -1) {
  217 + this.isIE6 = true;
  218 + this.detectedBrowser = "Internet Explorer 6"
  219 + } else {
  220 + if (navigator.userAgent.indexOf("Firefox") !== -1) {
  221 + this.isFF = true;
  222 + this.detectedBrowser = "Firefox"
  223 + } else {
  224 + if (navigator.userAgent.indexOf("Chrome") !== -1) {
  225 + this.isChrome = true;
  226 + this.detectedBrowser = "Chrome"
  227 + } else {
  228 + if (navigator.userAgent.indexOf("Mobile Safari") !== -1 && this.isAndroid) {
  229 + this.isAndroidBrowser = true;
  230 + this.detectedBrowser = "Mobile Safari"
  231 + } else {
  232 + if (navigator.userAgent.indexOf("Safari") !== -1) {
  233 + this.isSafari = true;
  234 + this.detectedBrowser = "Safari"
  235 + }
  236 + }
  237 + }
  238 + }
  239 + }
  240 + }
  241 + }
  242 + }
  243 + } if (this.isLinux) {
  244 + this.useDetection = "false"
  245 + }
  246 + if (this.isAndroid) {
  247 + this.SkypeClientDownloadUrl = "market://details?id=com.skype.raider";
  248 + } else {
  249 + if (this.isIPhone || this.IsPod) {
  250 + this.SkypeClientDownloadUrl = "http://appstore.com/skypeforiphone";
  251 + } else {
  252 + if (this.IsPad) {
  253 + this.SkypeClientDownloadUrl = "http://appstore.com/skypeforipad";
  254 + }
  255 + }
  256 + }
  257 +
  258 + function f() {
  259 + alert("Sorry this device doesn't support Skype Buttons yet. Please add " + this.participants[0] + " as a contact in your Skype Client to MAKE this call.")
  260 + }
  261 +
  262 + function i(r) {
  263 + document.getElementById(r).style.display = "block";
  264 + if (typeof (window["timer_" + r]) !== "undefined") {
  265 + window.clearTimeout(window["timer_" + r])
  266 + }
  267 + window["timer_" + r] = null;
  268 + delete window["timer_" + r]
  269 + }
  270 +
  271 + function d(r) {
  272 + window["timer_" + r] = window.setTimeout(function () {
  273 + document.getElementById(r).style.display = "none"
  274 + }, 1000)
  275 + }
  276 +
  277 + function k(r, s) {
  278 + if (!this.analyzeSkypeUri && typeof analyzeSkypeUri === "function") {
  279 + this.analyzeSkypeUri = analyzeSkypeUri
  280 + }
  281 + if (typeof this.analyzeSkypeUri === "function") {
  282 + this.analyzeSkypeUri(r, s)
  283 + } else {
  284 + var t = {};
  285 + t.prop3 = "image size / color: " + this.imageSize + " / " + this.imageColor;
  286 + t.prop4 = "video / list participants / list topic: " + this.video + " / " + this.listParticipants + " / " + this.listTopic;
  287 + t.prop5 = "target(s): " + this.participants;
  288 + t.prop6 = "user agent: " + navigator.userAgent;
  289 + t.prop7 = "detected protocol: " + window.location.protocol;
  290 + t.prop8 = "detected platform: " + this.detectedPlatform;
  291 + t.prop9 = "detected browser: " + this.detectedBrowser;
  292 + t.prop10 = this.version + " (pre script load)";
  293 + if (r === "init") {
  294 + if (this.name === this.chatLinks.name) {
  295 + t.prop11 = "Chat Init"
  296 + } else {
  297 + if (this.name === this.callLinks.name) {
  298 + t.prop11 = "Call Init"
  299 + } else {
  300 + if (this.name === this.dropdownLinks.name) {
  301 + t.prop11 = "Dropdown Init"
  302 + }
  303 + }
  304 + }
  305 + t.prop12 = document.domain + " - Init"
  306 + } else {
  307 + if (r === "chat") {
  308 + t.prop11 = "Chat Action";
  309 + t.prop13 = document.domain + " - Chat"
  310 + } else {
  311 + if (r === "call") {
  312 + t.prop11 = "Call Action";
  313 + t.prop14 = document.domain + " - Call"
  314 + } else {
  315 + if (r === "dropdownChat") {
  316 + t.prop11 = "Dropdown Chat Action";
  317 + t.prop13 = document.domain + " - Chat"
  318 + } else {
  319 + if (r === "dropdownCall") {
  320 + t.prop11 = "Dropdown Call Action";
  321 + t.prop14 = document.domain + " - Call"
  322 + } else {
  323 + if (r === "redirect") {
  324 + t.prop11 = "Redirect"
  325 + }
  326 + }
  327 + }
  328 + }
  329 + }
  330 + }
  331 + this.analyzePreCrumbs.push(t)
  332 + }
  333 + }
  334 +
  335 + function p(s) {
  336 + var r = document.getElementsByTagName("head")[0];
  337 + var t = document.createElement("script");
  338 + t.setAttribute("type", "text/javascript");
  339 + t.setAttribute("src", s);
  340 + r.appendChild(t)
  341 + }
  342 +
  343 + function c(s, r) {
  344 + this.size = s;
  345 + this.verticalOffset = r
  346 + }
  347 +
  348 + function g(s, r) {
  349 + this.path = s;
  350 + this.font = r
  351 + }
  352 +
  353 + function m(r, s) {
  354 + this.name = r;
  355 + this.linkImage = s
  356 + }
  357 +
  358 + function l(L) {
  359 + this.name = null;
  360 + if ((L.name !== undefined) && (L.name !== null)) {
  361 + this.name = L.name
  362 + }
  363 + if ((L.element !== undefined) && (L.element !== null)) {
  364 + this.element = L.element
  365 + }
  366 + if ((L.participants !== undefined) && (L.participants !== null)) {
  367 + this.participants = L.participants
  368 + }
  369 + if ((L.listParticipants !== undefined) && (L.listParticipants !== null)) {
  370 + this.listParticipants = L.listParticipants
  371 + }
  372 + if ((L.video !== undefined) && (L.video !== null)) {
  373 + this.video = L.video
  374 + }
  375 + if ((L.topic !== undefined) && (L.topic !== null)) {
  376 + this.topic = L.topic
  377 + }
  378 + if ((L.listTopic !== undefined) && (L.listTopic !== null)) {
  379 + this.listTopic = L.listTopic
  380 + }
  381 + if ((L.imageSize !== undefined) && (L.imageSize !== null)) {
  382 + this.imageSize = L.imageSize
  383 + }
  384 + if ((L.imageColor !== undefined) && (L.imageColor !== null)) {
  385 + this.imageColor = L.imageColor
  386 + }
  387 + if ((L.useDetection !== undefined) && (L.useDetection !== null)) {
  388 + this.useDetection = L.useDetection
  389 + }
  390 + if (this.useDetection === "false") {
  391 + this.useDetection = false
  392 + } else {
  393 + if (this.useDetection === "true") {
  394 + this.useDetection = true
  395 + }
  396 + } if ((L.protocol !== undefined) && (L.protocol !== null)) {
  397 + this.protocol = L.protocol
  398 + } else {
  399 + this.protocol = "skype:"
  400 + }
  401 + var G = {};
  402 + G.prop0 = this.name;
  403 + G.prop3 = "image size / color: " + this.imageSize + " / " + this.imageColor;
  404 + G.prop4 = "video / list participants / list topic: " + this.video + " / " + this.listParticipants + " / " + this.listTopic;
  405 + G.prop5 = "target(s): " + this.participants;
  406 + G.prop6 = "user agent: " + navigator.userAgent;
  407 + G.prop7 = "detected protocol: " + window.location.protocol;
  408 + G.prop8 = "detected platform: " + this.detectedPlatform;
  409 + G.prop9 = "detected browser: " + this.detectedBrowser;
  410 + G.prop10 = this.version;
  411 + this.analyzeCrumbs.push(G);
  412 + this.analyzeCrumbIndex += 1;
  413 + var y;
  414 + var P;
  415 + y = this.trimString(L.element);
  416 + if (y.length !== 0) {
  417 + P = document.getElementById(y);
  418 + if (P === null) {
  419 + alert("Sorry! Could not find Skype URI parent element: " + y + " ('" + L.element + "')");
  420 + return (false)
  421 + } else {
  422 + if (((L.name !== undefined) && (L.name !== null)) && ((L.participants === undefined) || (L.participants === null))) {
  423 + alert("Error! Required member 'participants' omitted or specified as null");
  424 + return (false)
  425 + }
  426 + }
  427 + } else {
  428 + alert("Error! Required member 'element' (Skype URI parent element) omitted or specified as null");
  429 + return (false)
  430 + }
  431 + this.setImageAttributes(L.imageSize, this.trimString(L.imageColor));
  432 + if ((L.protocol !== undefined) && (L.protocol !== null)) {
  433 + this.protocol = L.protocol
  434 + }
  435 + var B = this.protocol;
  436 + var C = "";
  437 + var x = 0;
  438 + var u = false;
  439 + if ((L.participants !== undefined) && (L.participants !== null)) {
  440 + while (x < L.participants.length) {
  441 + if (L.participants[x] !== null) {
  442 + y = this.trimString(L.participants[x]);
  443 + if (y.length !== 0) {
  444 + if (x !== 0) {
  445 + B += ";";
  446 + C += ", ";
  447 + u = true
  448 + }
  449 + B += y;
  450 + C += y
  451 + }
  452 + }
  453 + x++
  454 + }
  455 + }
  456 + var H = this.focusLinks.name;
  457 + var w = this.focusLinks.linkImage;
  458 + var M = this.focusLinks.linkImageAltTag;
  459 + var F = this.focusLinks.role;
  460 + var D = false;
  461 + y = this.trimString(L.name);
  462 + if (y.length !== 0) {
  463 + H = y;
  464 + if (H === this.callLinks.name) {
  465 + D = true;
  466 + w = this.callLinks.linkImage;
  467 + M = this.callLinks.linkImageAltTag;
  468 + F = this.callLinks.role
  469 + } else {
  470 + if (H === this.chatLinks.name) {
  471 + if (u) {
  472 + w = this.multiChatLinks.linkImage;
  473 + M = this.multiChatLinks.linkImageAltTag;
  474 + F = this.multiChatLinks.role
  475 + } else {
  476 + w = this.chatLinks.linkImage;
  477 + M = this.chatLinks.linkImageAltTag;
  478 + F = this.chatLinks.role
  479 + }
  480 + } else {
  481 + if (H === this.dropdownLinks.name) {
  482 + w = this.dropdownLinks.linkImage;
  483 + M = this.dropdownLinks.linkImageAltTag;
  484 + F = this.dropdownLinks.role
  485 + } else {
  486 + alert("Unrecognized Skype URI name: " + H + " ('" + L.name + "') -- " + this.callLinks.name + "/" + this.chatLinks.name);
  487 + return (false)
  488 + }
  489 + }
  490 + }
  491 + B += "?" + H
  492 + } else {
  493 + if (C.length > 0) {
  494 + w = this.callLinks.linkImage;
  495 + M = this.callLinks.linkImageAltTag;
  496 + F = this.callLinks.role
  497 + }
  498 + } if (D) {
  499 + y = this.trimString(L.video);
  500 + if (y === "true") {
  501 + w = this.videoLinks.linkImage;
  502 + M = this.videoLinks.linkImageAltTag;
  503 + F = this.videoLinks.role;
  504 + B += "&video=" + y
  505 + }
  506 + }
  507 + var s = null;
  508 + if ((u) && ((D) || (H === this.chatLinks.name))) {
  509 + y = this.trimString(L.topic);
  510 + if (y.length > 0) {
  511 + s = y;
  512 + B += "&topic=" + b(s)
  513 + }
  514 + }
  515 + var N = document.createElement("a");
  516 + var v = "";
  517 + var A = "";
  518 + if (!this.useDetection || (this.isWin8 && this.isIE10) || this.isIE7 || this.isIE6) {
  519 + A = B
  520 + } else {
  521 + if ((this.isWinPhone8 && this.isIE10) || (this.isAndroid && this.isAndroidBrowser)) {
  522 + A = "javascript://";
  523 + v += " Skype.displayNotSupportedMsg();"
  524 + }
  525 + else if(this.isAndroid && this.isChrome)
  526 + {
  527 + v = "Skype.trySkypeUri_Android_Chrome('" + this.analyzeCrumbIndex + "');";
  528 + A = B
  529 + }
  530 + else {
  531 + y = "Skype.trySkypeUri_Generic";
  532 + if (this.isIE10 || this.isIE9 || this.isIE8) {
  533 + y = "Skype.trySkypeUri_IE9_IE8"
  534 + } else {
  535 + // Note: iOS8 handles Skype.trySkypeUri_Generic so no need to switch to Skype.trySkypeUri_IOS_Safari
  536 + if ((this.isIOS7 || this.isIOS6 || this.isIOS5 || this.isIOS4) && this.isSafari) {
  537 + y = "Skype.trySkypeUri_IOS_Safari"
  538 + } else {
  539 + if (this.isAndroid && this.isFF) {
  540 + y = "Skype.trySkypeUri_Android_Firefox"
  541 + }
  542 + }
  543 + } if (this.detectSkypeClientFrameId === null) {
  544 + this.createDetectionFrame(P);
  545 + }
  546 + A = "javascript://";
  547 + v += y + "('" + B + "', '" + this.detectSkypeClientFrameId + "', '" + this.analyzeCrumbIndex + "'); return false;"
  548 + }
  549 + }
  550 + var z = document.createElement("img");
  551 + z.setAttribute("src", w);
  552 + z.setAttribute("alt", M);
  553 + z.setAttribute("role", F);
  554 + z.setAttribute("style", ("border:0; margin:" + this.assetMargin + "px; vertical-align:" + this.assetSizeMap[("size" + this.assetSize)].verticalOffset + "px;"));
  555 + if (this.name === this.dropdownLinks.name) {
  556 + z.setAttribute("onmouseover", "Skype.showDropdown('dropdown_" + this.element + "'); return false;");
  557 + z.setAttribute("onmouseout", "Skype.hideDropdown('dropdown_" + this.element + "'); return false;");
  558 + N.setAttribute("style", "cursor: text;");
  559 + N.setAttribute("onfocus", "Skype.showDropdown('dropdown_" + this.element + "'); return false;");
  560 + N.setAttribute("onblur", "Skype.hideDropdown('dropdown_" + this.element + "'); return false;");
  561 + N.setAttribute("href", "javascript://");
  562 + N.setAttribute("onclick", "return false;")
  563 + } else {
  564 + if (this.name === this.chatLinks.name) {
  565 + v = "Skype.tryAnalyzeSkypeUri('chat', '" + this.analyzeCrumbIndex + "');" + v
  566 + } else {
  567 + v = "Skype.tryAnalyzeSkypeUri('call', '" + this.analyzeCrumbIndex + "');" + v
  568 + }
  569 + N.setAttribute("href", A);
  570 + N.setAttribute("onclick", v)
  571 + }
  572 + N.appendChild(z);
  573 + uriPara = document.createElement("p");
  574 + uriPara.setAttribute("id", (L.element + "_paraElement"));
  575 + uriPara.setAttribute("style", ("font-size:" + (this.assetSize - 2) + "px; color:" + this.assetColor.font));
  576 + uriPara.appendChild(N);
  577 + if (this.name === this.dropdownLinks.name) {
  578 + var O = "-10";
  579 + var J = "15";
  580 + if (this.assetSize === "10") {
  581 + J = "15"
  582 + } else {
  583 + if (this.assetSize === "12") {
  584 + J = "15"
  585 + } else {
  586 + if (this.assetSize === "14") {
  587 + J = "15"
  588 + } else {
  589 + if (this.assetSize === "16") {
  590 + J = "15"
  591 + } else {
  592 + if (this.assetSize === "24") {
  593 + O = "-20";
  594 + J = "25"
  595 + } else {
  596 + if (this.assetSize === "32") {
  597 + O = "-30";
  598 + J = "30"
  599 + }
  600 + }
  601 + }
  602 + }
  603 + }
  604 + }
  605 + var r = document.createElement("ul");
  606 + r.id = "dropdown_" + this.element;
  607 + r.setAttribute("style", "display: none; position: absolute; margin-top: " + O + "px; margin-left: " + J + "px; width: 200px; padding-left: 20px; padding-right: 20px; border: 2px solid #00AFF0; background-color: white; color: #00AFF0; line-height: 50px; list-style: none; list-style-type: none;");
  608 + r.setAttribute("onmouseover", "Skype.showDropdown('dropdown_" + this.element + "'); return false;");
  609 + r.setAttribute("onmouseout", "Skype.hideDropdown('dropdown_" + this.element + "'); return false;");
  610 + var t = document.createElement("li");
  611 + t.setAttribute("style", "list-style: none; list-style-type: none;");
  612 + var Q = document.createElement("li");
  613 + Q.setAttribute("style", "list-style: none; list-style-type: none;");
  614 + var K = "";
  615 + var I = document.createElement("a");
  616 + I.href = "javascript://";
  617 + I.setAttribute("style", "text-decoration: none; color: #00AFF0; font-size: 16px;");
  618 + I.setAttribute("href", A);
  619 + K = "Skype.tryAnalyzeSkypeUri('dropdownCall', '" + this.analyzeCrumbIndex + "');" + v;
  620 + I.setAttribute("onclick", K.replace("?" + this.dropdownLinks.name, "?" + this.callLinks.name));
  621 + I.setAttribute("onmouseover", "this.style.textDecoration = 'underline'");
  622 + I.setAttribute("onmouseout", "this.style.textDecoration = 'none'");
  623 + I.setAttribute("role", "Menu item");
  624 + I.setAttribute("onfocus", "Skype.showDropdown('dropdown_" + this.element + "'); return false;");
  625 + I.setAttribute("onblur", "Skype.hideDropdown('dropdown_" + this.element + "'); return false;");
  626 + var E = document.createElement("a");
  627 + E.href = "javascript://";
  628 + E.setAttribute("style", "text-decoration: none; color: #00AFF0; font-size: 16px;");
  629 + E.setAttribute("href", A);
  630 + K = "Skype.tryAnalyzeSkypeUri('dropdownChat', '" + this.analyzeCrumbIndex + "');" + v;
  631 + E.setAttribute("onclick", K.replace("?" + this.dropdownLinks.name, "?" + this.chatLinks.name));
  632 + E.setAttribute("onmouseover", "this.style.textDecoration = 'underline'");
  633 + E.setAttribute("onmouseout", "this.style.textDecoration = 'none'");
  634 + I.setAttribute("role", "Menu item");
  635 + E.setAttribute("onfocus", "Skype.showDropdown('dropdown_" + this.element + "'); return false;");
  636 + E.setAttribute("onblur", "Skype.hideDropdown('dropdown_" + this.element + "'); return false;");
  637 + I.innerHTML = "Call";
  638 + t.appendChild(I);
  639 + E.innerHTML = "Chat";
  640 + Q.appendChild(E);
  641 + r.appendChild(t);
  642 + r.appendChild(Q);
  643 + uriPara.appendChild(r)
  644 + }
  645 + y = null;
  646 + if (C.length !== 0) {
  647 + if (this.trimString(L.listParticipants) === "true") {
  648 + y = " " + C
  649 + }
  650 + if ((s !== null) && (this.trimString(L.listTopic) === "true")) {
  651 + if ((y === null) || (y.length === 0)) {
  652 + y = " RE: " + s
  653 + } else {
  654 + y += ("; RE: " + s)
  655 + }
  656 + }
  657 + if (y === null) {
  658 + y = ""
  659 + }
  660 + uriPara.appendChild(document.createTextNode(y))
  661 + }
  662 + P.appendChild(uriPara);
  663 + this.tryAnalyzeSkypeUri("init", this.analyzeCrumbIndex);
  664 + return (true)
  665 + }
  666 +
  667 + function j(u, r) {
  668 + this.assetSize = this.assetSizeDefault;
  669 + this.assetMargin = (this.assetSize >= this.assetMarginMinimum) ? this.assetSize : this.assetMarginMinimum;
  670 + var t;
  671 + var s = this.assetSizeArray.length;
  672 + for (t = 0; t < s; t++) {
  673 + if (u === this.assetSizeArray[t]) {
  674 + this.assetSize = u;
  675 + break
  676 + }
  677 + }
  678 + this.assetMargin = (this.assetSize >= this.assetMarginMinimum) ? this.assetSize : this.assetMarginMinimum;
  679 + this.assetColor.path = this.assetColorPathDefault;
  680 + this.assetColor.font = this.assetColorFontDefault;
  681 + if (r.length > 0) {
  682 + if (r === "skype") {
  683 + this.assetColor.path = this.assetColorPathSkype;
  684 + this.assetColor.font = this.assetColorFontSkype
  685 + } else {
  686 + if (r === "white") {
  687 + this.assetColor.path = this.assetColorPathWhite;
  688 + this.assetColor.font = this.assetColorFontWhite
  689 + }
  690 + }
  691 + }
  692 + this.focusLinks.linkImage = this.assetPrefix + "Skypeicon" + this.assetColor.path + this.assetSize + "px.png";
  693 + this.callLinks.linkImage = this.assetPrefix + "callbutton" + this.assetColor.path + this.assetSize + "px.png";
  694 + this.videoLinks.linkImage = this.assetPrefix + "callbutton" + this.assetColor.path + this.assetSize + "px.png";
  695 + this.chatLinks.linkImage = this.assetPrefix + "chatbutton" + this.assetColor.path + this.assetSize + "px.png";
  696 + this.multiChatLinks.linkImage = this.assetPrefix + "chatbutton" + this.assetColor.path + this.assetSize + "px.png";
  697 + this.dropdownLinks.linkImage = this.assetPrefix + "dropdowncallbutton" + this.assetColor.path + this.assetSize + "px.png";
  698 + this.focusLinks.linkImageAltTag = "Open Skype";
  699 + this.callLinks.linkImageAltTag = "Skype call";
  700 + this.videoLinks.linkImageAltTag = "Skype call";
  701 + this.chatLinks.linkImageAltTag = "Skype chat, instant message";
  702 + this.multiChatLinks.linkImageAltTag = "Skype chat, instant message";
  703 + this.dropdownLinks.linkImageAltTag = "Call options";
  704 + this.focusLinks.role = "Button";
  705 + this.callLinks.role = "Button";
  706 + this.videoLinks.role = "Button";
  707 + this.chatLinks.role = "Button";
  708 + this.multiChatLinks.role = "Button";
  709 + this.dropdownLinks.role = "Pop up menu"
  710 + }
  711 +
  712 + function o(t) {
  713 + if ((t === undefined) || (t === null)) {
  714 + return ("")
  715 + }
  716 + var u = t.length;
  717 + var s = u - 1;
  718 + var r = false;
  719 + while ((!r) && (u > 0)) {
  720 + switch (t[s]) {
  721 + case " ":
  722 + case "\t":
  723 + case "\n":
  724 + case "\r":
  725 + u--;
  726 + break;
  727 + default:
  728 + r = true;
  729 + break
  730 + }
  731 + s--
  732 + }
  733 + if (u > 0) {
  734 + return (t.substr(0, u))
  735 + }
  736 + return ("")
  737 + }
  738 +
  739 + function b(s) {
  740 + if ((s === undefined) || (s === null)) {
  741 + return ("")
  742 + }
  743 + var r = s.replace(/\s/g, "%20");
  744 + r = r.replace(/:/g, "%3A");
  745 + r = r.replace(/\x2F/g, "%2F");
  746 + return (r.replace(/\x5C/g, "%5C"))
  747 + }
  748 +
  749 + function h(r) {
  750 + if(!r) {
  751 + var divs = document.getElementsByTagName("div");
  752 + for(var i = 0; i < divs.length; i++) {
  753 + if(divs[i].id && divs[i].id.match("SkypeButton")) {
  754 + r = divs[i];
  755 + }
  756 + }
  757 + }
  758 + var t = new Date();
  759 + this.detectSkypeClientFrameId = "_detectSkypeClient_" + t.getTime().toString();
  760 + var s = document.createElement("iframe");
  761 + s.setAttribute("style", "display:none;");
  762 + s.setAttribute("id", this.detectSkypeClientFrameId);
  763 + r.appendChild(s);
  764 + }
  765 +
  766 + function n(s, w, u) {
  767 + var v = false;
  768 + var r = window.open("", "_blank", "width=100, height=100");
  769 + var t = r.document.createElement("iframe");
  770 + t.setAttribute("src", s);
  771 + r.document.body.appendChild(t);
  772 + setTimeout(function () {
  773 + try {
  774 + r.location.href;
  775 + v = true
  776 + } catch (x) {}
  777 + if (v) {
  778 + r.setTimeout("window.close()", 10)
  779 + } else {
  780 + r.close();
  781 + alert(Skype.installSkypeMsg);
  782 + Skype.tryAnalyzeSkypeUri("redirect", u);
  783 + window.location = Skype.SkypeClientDownloadUrl
  784 + }
  785 + }, 100)
  786 + }
  787 +
  788 + function e(s, v, t) {
  789 + var r = document.getElementById(v);
  790 + var u = true;
  791 + window.addEventListener("pagehide", function () {
  792 + u = false
  793 + }, false);
  794 + if (r !== null) {
  795 + r.src = s
  796 + }
  797 + setTimeout(function () {
  798 + if (u) {
  799 + alert(Skype.installSkypeMsg);
  800 + Skype.tryAnalyzeSkypeUri("redirect", t);
  801 + window.location = Skype.SkypeClientDownloadUrl
  802 + }
  803 + }, 2000)
  804 + }
  805 +
  806 + function q(s, v, u) {
  807 + var t = false;
  808 + var r = document.getElementById(v);
  809 + if (r !== null) {
  810 + try {
  811 + r.contentWindow.location.href = s;
  812 + t = true
  813 + } catch (w) {
  814 + t = false
  815 + }
  816 + }
  817 + setTimeout(function () {
  818 + if (!t) {
  819 + alert(Skype.installSkypeMsg);
  820 + Skype.tryAnalyzeSkypeUri("redirect", u);
  821 + window.location = Skype.SkypeClientDownloadUrl
  822 + }
  823 + }, 2000)
  824 + }
  825 +
  826 + function a(s, v, t) {
  827 + var u = true;
  828 + window.onblur = function () {
  829 + u = false;
  830 + };
  831 + var r = document.getElementById(v);
  832 + if (r !== null) {
  833 + r.src = s
  834 + }
  835 + setTimeout(function () {
  836 + if (u) {
  837 + alert(Skype.installSkypeMsg);
  838 + Skype.tryAnalyzeSkypeUri("redirect", t);
  839 + window.location = Skype.SkypeClientDownloadUrl
  840 + }
  841 + }, 2000)
  842 + }
  843 +
  844 + function a_androidchrome(analyzeCrumbIndex) {
  845 + var documentVisible = true;
  846 + var vizchangecb;
  847 +
  848 + document.addEventListener("visibilitychange", vizchangecb = function () {
  849 + documentVisible = !document.hidden;
  850 + });
  851 +
  852 + setTimeout(function () {
  853 +
  854 + if (documentVisible) {
  855 + alert(Skype.installSkypeMsg);
  856 + Skype.tryAnalyzeSkypeUri("redirect", analyzeCrumbIndex);
  857 + window.location = Skype.SkypeClientDownloadUrl
  858 + }
  859 +
  860 + document.removeEventListener("visibilitychange", vizchangecb);
  861 + }, 6000) // if Skype app is booting the Skype splash screen prevents the visibilitychange event firing
  862 + // until it is done, so we allow for a longer timeout in case we have to wait for it
  863 + }
  864 +}();
  865 +
  866 +/*jshint +W003:true */
  867 +/*jshint +W107:true */
  868 +/*jshint +W057:true *//*jshint -W003:true */
  869 +/*jshint -W107:true */
  870 +/*jshint -W057:true */
  871 +
  872 +var Skype = new function () {
  873 + this.name = null;
  874 + this.element = null;
  875 + this.participants = ["echo123"];
  876 + this.listParticipants = "false";
  877 + this.video = "false";
  878 + this.topic = null;
  879 + this.listTopic = "false";
  880 + this.imageSize = null;
  881 + this.imageColor = null;
  882 + this.useDetection = "true";
  883 + this.protocol = "skype:";
  884 + this.version = "1.1.7";
  885 + this.httpProtocol = window.location.protocol !== "https:" ? "http:" : "https:";
  886 + this.assetsDomain = this.httpProtocol + "//" + (this.httpProtocol !== "https:" ? "www.skypeassets.com" : "secure.skypeassets.com");
  887 + this.ui = l;
  888 + this.setImageAttributes = j;
  889 + this.trimString = o;
  890 + this.escapeString = b;
  891 + this.createDetectionFrame = h;
  892 + this.trySkypeUri_IE9_IE8 = n;
  893 + this.trySkypeUri_IOS_Safari = e;
  894 + this.trySkypeUri_Android_Chrome = a_androidchrome;
  895 + this.trySkypeUri_Android_Firefox = q;
  896 + this.trySkypeUri_Generic = a;
  897 + this.SkypeClientDownloadUrl = this.httpProtocol + "//www.skype.com/download";
  898 + this.installSkypeMsg = "Please install Skype application in order to make this call or send a message.";
  899 + this.displayNotSupportedMsg = f;
  900 + this.SkypeUriAssetMap = c;
  901 + this.SkypeUriAssetColorMap = g;
  902 + this.SkypeUriNameLinks = m;
  903 + this.assetPrefix = this.assetsDomain + "/i/scom/images/skype-buttons/";
  904 + this.assetSizeArray = [10, 12, 14, 16, 24, 32];
  905 + this.assetSizeDefault = 16;
  906 + this.assetMarginMinimum = 16;
  907 + this.assetSize = this.assetSizeDefault;
  908 + this.assetMargin = (this.assetSize >= this.assetMarginMinimum) ? this.assetSize : this.assetMarginMinimum;
  909 + this.assetColorPathWhite = "_trans_";
  910 + this.assetColorFontWhite = "white";
  911 + this.assetColorPathSkype = "_";
  912 + this.assetColorFontSkype = "#444444";
  913 + this.assetColorPathDefault = this.assetColorPathSkype;
  914 + this.assetColorFontDefault = this.assetColorFontSkype;
  915 + this.assetColor = new this.SkypeUriAssetColorMap(this.assetColorPathDefault, this.assetColorFontDefault);
  916 + this.assetSizeMap = {};
  917 + this.assetSizeMap.size10 = new this.SkypeUriAssetMap(10, -18);
  918 + this.assetSizeMap.size12 = new this.SkypeUriAssetMap(12, -19);
  919 + this.assetSizeMap.size14 = new this.SkypeUriAssetMap(14, -19);
  920 + this.assetSizeMap.size16 = new this.SkypeUriAssetMap(16, -20);
  921 + this.assetSizeMap.size24 = new this.SkypeUriAssetMap(24, -30);
  922 + this.assetSizeMap.size32 = new this.SkypeUriAssetMap(32, -41);
  923 + this.focusLinks = new this.SkypeUriNameLinks("", "");
  924 + this.callLinks = new this.SkypeUriNameLinks("call", "");
  925 + this.videoLinks = new this.SkypeUriNameLinks("call", "");
  926 + this.chatLinks = new this.SkypeUriNameLinks("chat", "");
  927 + this.multiChatLinks = new this.SkypeUriNameLinks("chat", "");
  928 + this.dropdownLinks = new this.SkypeUriNameLinks("dropdown", "");
  929 + this.setImageAttributes(this.assetSizeDefault, "");
  930 + this.analyzeSkypeUriInit = null;
  931 + this.analyzeSkypeUriAction = null;
  932 + this.analyzeSkypeUriRedirect = null;
  933 + this.analyzeSkypeUr = null;
  934 + this.analyzePreCrumbs = [];
  935 + this.analyzeCrumbs = [];
  936 + this.analyzeCrumbIndex = -1;
  937 + this.tryAnalyzeSkypeUri = k;
  938 + this.detectSkypeClientFrameId = null;
  939 + this.detectedPlatform = "unknown";
  940 + this.detectedBrowser = "unknown";
  941 + this.isWinXP = false;
  942 + this.isWinVista = false;
  943 + this.isWin7 = false;
  944 + this.isWin8 = false;
  945 + this.isOSX_SnowLeopard = false;
  946 + this.isOSX_MountainLion = false;
  947 + this.isLinux = false;
  948 + this.isWinPhone8 = false;
  949 + this.isAndroid = false;
  950 + this.isAndroid_Gingerbread = false;
  951 + this.isAndroid_IceCream = false;
  952 + this.isAndroid_JellyBean = false;
  953 + this.isIOS7 = false;
  954 + this.isIOS6 = false;
  955 + this.isIOS5 = false;
  956 + this.isIOS4 = false;
  957 + this.isIPhone = false;
  958 + this.isIPad = false;
  959 + this.isIPod = false;
  960 + this.isIE10 = false;
  961 + this.isIE9 = false;
  962 + this.isIE8 = false;
  963 + this.isIE7 = false;
  964 + this.isIE6 = false;
  965 + this.isFF = false;
  966 + this.isAndroidBrowser = false;
  967 + this.isChrome = false;
  968 + this.isSafari = false;
  969 + this.showDropdown = i;
  970 + this.hideDropdown = d;
  971 + this.analyzeScript = this.assetsDomain + "/i/scom/js/" + "skype-analytics.js";
  972 + this.includeJavascript = p;
  973 + this.includeJavascript(this.analyzeScript);
  974 + if (navigator.userAgent.indexOf("Windows NT 5.1") !== -1) {
  975 + this.isWinXP = true;
  976 + this.detectedPlatform = "Windows XP"
  977 + } else {
  978 + if (navigator.userAgent.indexOf("Windows NT 6.0") !== -1) {
  979 + this.isWinVista = true;
  980 + this.detectedPlatform = "Windows Vista"
  981 + } else {
  982 + if (navigator.userAgent.indexOf("Windows NT 6.1") !== -1) {
  983 + this.isWin7 = true;
  984 + this.detectedPlatform = "Windows 7"
  985 + } else {
  986 + if (navigator.userAgent.indexOf("Windows NT 6.2") !== -1) {
  987 + this.isWin8 = true;
  988 + this.detectedPlatform = "Windows 8"
  989 + } else {
  990 + if (navigator.userAgent.indexOf("Mac OS X 10_7") !== -1) {
  991 + this.isOSX_SnowLeopard = true;
  992 + this.detectedPlatform = "OSX 10.7"
  993 + } else {
  994 + if (navigator.userAgent.indexOf("Mac OS X 10.8") !== -1) {
  995 + this.isOSX_MountainLion = true;
  996 + this.detectedPlatform = "OSX 10.8"
  997 + } else {
  998 + if (navigator.userAgent.indexOf("Mac OS X 10_8") !== -1) {
  999 + this.isOSX_MountainLion = true;
  1000 + this.detectedPlatform = "OSX 10.8"
  1001 + } else {
  1002 + if(navigator.userAgent.indexOf("Android") !== -1) {
  1003 + this.isAndroid = true;
  1004 + this.detectedPlatform = "Android"
  1005 +
  1006 + if (navigator.userAgent.indexOf("Android 2.3") !== -1) {
  1007 + this.isAndroid_Gingerbread = true;
  1008 + this.detectedPlatform = "Android 2.3"
  1009 + }
  1010 + else if(navigator.userAgent.indexOf("Android 4.0") !== -1) {
  1011 + this.isAndroid_IceCream = true;
  1012 + this.detectedPlatform = "Android 4.0"
  1013 + }
  1014 + else if(navigator.userAgent.indexOf("Android 4.1") !== -1) {
  1015 + this.isAndroid_JellyBean = true;
  1016 + this.detectedPlatform = "Android 4.1"
  1017 + }
  1018 + }