if(typeof(window.ContactMe=="undefined")){window.ContactMe={}}(function(){var c={lang:null,align:"left",valign:"middle",background_color:"#369",hover_color:null,z_index:10100000001,text:"Contact",label:null,showTab:true,app:null,debug:false},m=507,l=1000,g=ContactMe,b=("https:"==document.location.protocol?"https://d1uwd25yvxu96k.cloudfront.net":"http://static.contactme.com"),k=("https:"==document.location.protocol?"https://dbxh5oclzjf9l.cloudfront.net":"http://buttons.contactme.com"),f="http://www.contactme.com",a,i,t=false,j=false,v=document.createElement("div"),u=document.createElement("div"),w=new Date().getTime().toString(16)+parseInt(Math.random()*100000).toString(16);p(c,_cmo||{});if(typeof(c.form)!="string"||c.form.length<1){o("Invalid form specified.");return}if(c.hover_color==null){c.hover_color=c.background_color}c.align=d(c.align,["left","right"]);c.valign=d(c.valign,["middle","top","bottom"]);g.prepare=function(){if(t){return}v.id="contactme_overlay";v.onclick=function(){ContactMe.hide()};document.body.appendChild(v);u.id="contactme_dialog";u.innerHTML='<a id="contactme_dialog_close" onclick="ContactMe.hide();return false;"><span>Close Dialog</span></a><iframe frameborder="0" allowtransparency="true" src="'+f+"/"+c.form+"/modal?"+x()+'"></iframe>';document.body.appendChild(u);t=true};g.show=function(){if(!t){g.prepare()}n();v.style.display="block";u.style.display="block"};g.hide=function(){u.style.display="none";v.style.display="none"};function p(y,A){for(var z in A){y[z]=A[z]}return y}function d(B,z,A){if(!A){A=z}for(var y=0;y<z.length;y++){if(B===z[y]){return A[y]}}return A[0]}function o(y){y="ContactMe Error: "+y;if(typeof(console)!="undefined"&&typeof(console.error)=="function"){console.error(y,"")}else{if(c.debug){alert(y)}}}function n(){var A=(typeof(window.innerWidth)!=="undefined"?window.innerWidth:document.documentElement.clientWidth)||document.body.clientWidth,B=Math.max(document.body.scrollTop,document.documentElement.scrollTop),y=(A-m)/2,z=document.getElementById("contactme_dialog");z.style.top=(B+10)+"px";z.style.left=Math.max(0,y)+"px"}function s(y){return y==="right"?"left":"right"}function r(){if(j){return}j=true;var D=d(c.text,["Contact","Contact Me","Contact Us"],["contact","contact-me","contact-us"]),C=e(c.background_color)>235?"light":"dark",E=s(c.align),z,y="top:45%;",F=new RegExp("MSIE ([0-9]{1,}[.][0-9]{0,})").exec(navigator.userAgent)!=null&&parseFloat(RegExp.$1),B=F&&document.compatMode==="BackCompat"?"absolute":"fixed",A=document.getElementsByTagName("script")[0];z=k+"/widgets/tab/v1/"+(c.lang||"en")+"/"+D+"_"+c.align+"_"+C+".png?"+x();switch(c.valign){case"top":y="top:8%;";break;case"bottom":y="bottom:8%;";break;default:y="top:45%;margin-top:-73px;"}i="#contactme_tab,#contactme_tab:link{position:"+B+";display:block;margin:0;"+y+c.align+":0;width:40px;height:146px;z-index:"+c.z_index+";padding:0;text-decoration:none;}#contactme_tab_inner{display:block;left:0;position:absolute;width:40px;height:146px;}#contactme_tab_color{background-color:"+c.background_color+";z-index: "+(c.z_index+1)+";display: block;position: absolute;"+c.align+": 0;";if(F&&F<9){i+="height:136px;width:35px;top:5px;"}else{i+="height:138px;width:36px;top:4px;-webkit-border-top-"+E+"-radius: 5px;-webkit-border-bottom-"+E+"-radius: 5px;-moz-border-radius-top"+E+": 5px;-moz-border-radius-bottom"+E+": 5px;border-top-"+E+"-radius: 5px;border-bottom-"+E+"-radius: 5px;"}i+="}#contactme_tab:hover #contactme_tab_color{background-color:"+c.hover_color+";}#contactme_tab_text{z-index: "+(c.z_index+2)+";text-indent: -10000px;display: block;height: 146px;width: 40px;position: absolute;top:0;"+c.align+":0;";if(F&&F<7){i+="background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+z+"', sizingMethod='scale');"}else{i+="background: transparent url("+z+") top "+c.align+" no-repeat;"}i+="}#contactme_overlay{display:none;background-color:#000;position:"+B+";left:0;top:0;opacity:0.7;filter:alpha(opacity=70);width:100%;height:100%;z-index:"+(c.z_index+3)+";}#contactme_dialog{display:none;position:absolute;left:100px;top:100px;z-index:"+(c.z_index+4)+";}#contactme_dialog_close{background:transparent url("+b+"/widgets/tab/v1/close.png) 0 0 no-repeat;position:absolute;right:20px;top:21px;width:26px;height:26px;cursor:pointer;}#contactme_dialog_close span{display:none;}#contactme_dialog iframe{background:transparent;border:0;width:"+m+"px;height:"+l+"px;}";a=document.createElement("style");a.setAttribute("type","text/css");a.setAttribute("media","screen");if(a.styleSheet){a.styleSheet.cssText=i}else{a.appendChild(document.createTextNode(i))}A.parentNode.insertBefore(a,A);if(c.showTab){h()}}function h(){var y=document.createElement("a");y.href=f+"/"+c.form+"?"+x();y.id="contactme_tab";y.onmouseover=function(){ContactMe.prepare();return false};y.onclick=function(){ContactMe.show();return false};y.innerHTML='<span id="contactme_tab_inner"><span id="contactme_tab_color"></span><span id="contactme_tab_text">Contact</span></span>';document.body.appendChild(y)}function x(){var A=document.referrer,z=window.location,y=[],B=c.background_color;if(B.charAt(0)==="#"){B=B.substring(1)}if(c.lang){y.push("locale="+encodeURIComponent(c.lang))}if(A){y.push("r="+encodeURIComponent(A))}if(c.app){y.push("a="+encodeURIComponent(c.app))}y.push("u="+encodeURIComponent(z));y.push("f="+encodeURIComponent(c.form));y.push("ha="+encodeURIComponent(c.align));y.push("va="+encodeURIComponent(c.valign));y.push("tx="+encodeURIComponent(c.text));if(c.label){y.push("lb="+encodeURIComponent(c.label))}y.push("c="+encodeURIComponent(B));y.push("vid="+encodeURIComponent(w));return y.join("&")}function e(z){var y;if(z.charAt(0)==="#"){z=z.substring(1)}if(z.length===3){z=z.charAt(0)+z.charAt(0)+z.charAt(1)+z.charAt(1)+z.charAt(2)+z.charAt(2)}else{if(z.length!==6){z="ffffff"}}y=[parseInt(z.substring(0,2),16),parseInt(z.substring(2,4),16),parseInt(z.substring(4,6),16)];return 0.5*(Math.min(y[0],Math.min(y[1],y[2]))+Math.max(y[0],Math.max(y[1],y[2])))}function q(y){if(j){return}if(document.readyState==="complete"){y();return}if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);y()},false);window.addEventListener("load",function(){q(y)},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);y()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(j){return}try{document.documentElement.doScroll("left")}catch(z){setTimeout(arguments.callee,0);return}y()})()}}if(window.addEventListener){window.addEventListener("onload",y,false)}else{window.attachEvent("onload",y)}}}q(r)})();
