// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

(function(f){if(!f.CFInstall){var g=function(a,b){return typeof a=="string"?(b||document).getElementById(a):a},h=function(){if(f.CFInstall._force)return f.CFInstall._forceValue;var a=navigator.userAgent.toLowerCase();if(a.indexOf("chromeframe")>=0)return true;if(typeof window.ActiveXObject!="undefined")try{var b=new ActiveXObject("ChromeTab.ChromeFrame");if(b)return true}catch(c){}return false},j=function(a){try{var b=document.createElement("style");b.setAttribute("type","text/css");if(b.styleSheet)b.styleSheet.cssText=
a;else b.appendChild(document.createTextNode(a));var c=document.getElementsByTagName("head")[0],d=c.firstChild;c.insertBefore(b,d)}catch(i){}},k=false,l=false,o=function(){if(!k){var a='.chromeFrameInstallDefaultStyle {width: 800px;height: 600px;position: absolute;left: 50%;top: 50%;margin-left: -400px;margin-top: -300px;}.chromeFrameOverlayContent {position: absolute;margin-left: -400px;margin-top: -300px;left: 50%;top: 50%;border: 1px solid #93B4D9;background-color: white;}.chromeFrameOverlayContent iframe {width: 800px;height: 600px;border: none;}.chromeFrameOverlayCloseBar {height: 1em;text-align: right;background-color: #CADEF4;}.chromeFrameOverlayUnderlay {position: absolute;width: 100%;height: 100%;background-color: white;opacity: 0.5;-moz-opacity: 0.5;-webkit-opacity: 0.5;-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter: alpha(opacity=50);}';
j(a);k=true}},m=function(){if(!l){var a=".chromeFrameOverlayContent { display: none; }.chromeFrameOverlayUnderlay { display: none; }";j(a);a=31536000000;document.cookie="disableGCFCheck=1;path=/;max-age="+a;l=true}},p=function(a,b){var c=g(b.node);a.id=b.id||(c?c.id||getUid(c):"");var d=b.cssText||"";a.style.cssText=" "+d;d=b.className||"";a.className=d;b=b.src||"about:blank";a.src=b;c&&c.parentNode.replaceChild(a,c)},n=function(a){var b=document.createElement("iframe");b.setAttribute("frameborder",
"0");b.setAttribute("border","0");p(b,a);return b},q=function(a){a.className="chromeFrameInstallDefaultStyle "+(a.className||"");a=n(a);if(!a.parentNode){var b=document.body.firstChild;document.body.insertBefore(a,b)}},r=function(a){if(!g("chromeFrameOverlayContent")){var b=document.createElement("span");b.innerHTML='<div class="chromeFrameOverlayUnderlay"></div><table class="chromeFrameOverlayContent"id="chromeFrameOverlayContent"cellpadding="0" cellspacing="0"><tr class="chromeFrameOverlayCloseBar"><td><button id="chromeFrameCloseButton">close</button></td></tr><tr><td id="chromeFrameIframeHolder"></td></tr></table>';
document.body.appendChild(b);a=n(a);g("chromeFrameIframeHolder").appendChild(a);g("chromeFrameCloseButton").onclick=m}},e={};e.check=function(a){a=a||{};var b=navigator.userAgent,c=/MSIE \S+; Windows NT/,d=false;if(c.test(b)){if(parseFloat(b.split(c)[1])<6&&b.indexOf("SV1")>=0)d=true}else d=true;if(!d){o();document.cookie.indexOf("disableGCFCheck=1")>=0&&m();b=document.location.protocol;b=b=="https:"?"https:":"http:";b=b+"//www.google.com/chromeframe";if(!h()){a.onmissing&&a.onmissing();a.src=a.url||
b;b=a.mode||"inline";c=a.preventPrompt||false;if(!c)if(b=="inline")q(a);else b=="overlay"?r(a):window.open(a.src);if(!a.preventInstallDetection)var i=setInterval(function(){if(h()){a.oninstall&&a.oninstall();clearInterval(i);window.location=a.destination||window.location}},2000)}}};e._force=false;e._forceValue=false;e.isAvailable=h;f.CFInstall=e}})(this.ChromeFrameInstallScope||this);

