Function.prototype.bind=function(B){var A=this;return function(){return A.apply(B,arguments)}};
jQuery.fn.template=function(B,C){var A=B;if(C){jQuery.each(C,function(E,D){A=A.replace("${"+E+"}",D)})}this.each(function(){$(this).html(A)});return this};function clone(C){if(C==null||typeof (C)!="object"){return C}var A=new C.constructor();for(var B in C){A[B]=clone(C[B])}return A}Function.prototype.extend=function(C){C.prototype.constructor=C;var A=C.prototype.constructor;C.prototype.constructor=function(){};var D=clone(C.prototype);C.prototype.constructor=A;D.constructor=A;for(var B in D){if(typeof (this.prototype[B])=="undefined"){this.prototype[B]=D[B]}}this.prototype.parent=D;this.prototype.constructor=this;return this};ExtendCallback=function(B,A){if(typeof (B)=="function"){return function(){A();B()}}else{return A}};Observable=function(){this.binds={}};Observable.prototype={bindEvent:function(A,B){if(typeof (this.binds[A])=="undefined"){this.binds[A]=new Array()}this.binds[A].push(B)},unbindEvent:function(B,C){if(typeof (C)=="function"){var A=this;$.each(this.binds[B],function(D){if(this===C){A.binds[B].splice(D,1)}})}else{this.binds[B]=new Array()}},fireEvent:function(B){if(typeof (this.binds[B])!="undefined"){var A=this;$.each(A.binds[B],function(C){if(this(A)===false){A.binds[B].splice(C,1)}})}}};BusinessPanel={showTvcGraph:function(){$("#tvcGraph").show();$("#tvcGraphLink").hide();$("#tvcGraphLinkInactive").show();$("#pvGraph").hide();$("#pvGraphLink").show();$("#pvGraphLinkInactive").hide()},showPvGraph:function(){$("#tvcGraph").hide();$("#tvcGraphLink").show();$("#tvcGraphLinkInactive").hide();$("#pvGraph").show();$("#pvGraphLink").hide();$("#pvGraphLinkInactive").show()}};SplashPage={doAccept:function(){$("#accept").val(1);$("#acceptContractForm").submit()},doNotAccept:function(){$("#accept").val(0);$("#acceptContractForm").submit()}};function PopupForm(A){}PopupForm.prototype={setRefresh:function(A,B){$.modal.isSuccess=A||true;doReloadWindow=B||true;if(doReloadWindow){window.location.reload(false)}},disableMe:function(A){},_ajaxErrorHandler:function(D,C,A,B){if(typeof C.status=="number"){switch(C.status){case 403:$(this).html(localizedErrorMessages.noHaveAccess);break;default:$(this).html("Network error.  Code: "+C.status);break}}else{$(this).html("Network error")}},_popupCloseHandler:function(){if($.modal.isSuccess){window.location.reload(false)}},_ajaxSuccessHandler:function(){$("#popupWindow").modal({onClose:this._popupCloseHandler})},show:function(A,C){$.modal.isSuccess=false;var B=this;if(typeof C=="function"){C=ExtendCallback(C,function(){B._ajaxSuccessHandler()})}else{C=this._ajaxSuccessHandler}$("#popupWindowFrame").bind("ajaxError",this._ajaxErrorHandler);$("#popupWindowFrame").load(A.href,null,C);return false},submit:function(A,B){$(A).find("input[type=submit]").attr("disabled","disabled");if(B){$("#popupWindowFrame").load(A.action,$(A).serializeArray());return false}else{return true}},onChangePayType:function(A){if(A.value=="electronic"){$("#electronic-payment-selector").show();if("MERCAWAY"==$("#electronicPayType").val()){$("#last-4-credit-card-digits-field").show()}else{$("#last-4-credit-card-digits-field").hide()}}else{$("#electronic-payment-selector").hide();$("#last-4-credit-card-digits-field").hide()}},onChangeElectronicPayType:function(A){if(A.value=="MERCAWAY"){$("#last-4-credit-card-digits-field").show()}else{$("#last-4-credit-card-digits-field").hide()}}};BasicForm=new PopupForm();BasicForm.toggleAgree=function(){if($("#agree").attr("checked")){$("#submit-button").attr("disabled","")}else{$("#submit-button").attr("disabled","disabled")}};OrdersForm=new PopupForm();BuyAirpassForm=new PopupForm();BuyAirpassForm.onChangePayType=function(A){if("cheques"==A.value){$("#code-row").show()}else{$("#code-row").hide()}};OrdersVoucherForm=new PopupForm();OrdersSpecialPackForm=new PopupForm();ValidateForm={show:function(C,A,B){$("#popupWindow").modal();$("#popupWindowFrame").load(C.href);return false},validate:function(A){$("#popupWindowFrame").load(A.action,$(A).serializeArray());return false}};AirtimeForm={show:function(A,B){$("#popupWindow").modal({onClose:function(){window.location=window.location}});$("#popupWindowFrame").load(A.href,null,function(){$("#code").attr("value",B)});return false},validate:function(A){$("#popupWindowFrame").load(A.action,$(A).serializeArray());return false}};EmailVerifier={send:function(){$.ajax({type:"POST",url:"/ajax/verifyEmail/",data:{email:document.getElementById("email").value},complete:function(B,A){if(B.status==403){document.location.href=B.responseText}},success:function(C,B){var A="";if(""==C){A='<div class="legend green">Email sent</div>'}else{A='<div class="legend red">Email not sent</div>'}$("#emailVerificationResult").html(A)}})}};StartUpDialog={show:function(){$("#startUpDialog").modal({onClose:function(){$.ajax({type:"POST",url:"/ajax/startUp/",data:{doNotShowAgain:document.getElementById("doNotShowAgain").checked}})}})}};$(function(){$(".showdetails").click(function(){$(this).next().toggle()})});ChatSettings=function(){var A=this;this.sh=$("#save-history");this.al=$("#auto-login");this.sv=$("#save-button");this._hold("Loading...");this.values={};this.sv.click(this.save.bind(this));QuickChat.load(function(){A.values.saveHistory=JSChat.getInstance().app.autoHistory;A.sh.attr("checked",A.values.saveHistory);A.values.autoLogin=QuickChat.autoLogin;A.al.attr("checked",A.values.autoLogin);A._unhold()})};ChatSettings.prototype={save:function(){var B=this;this._hold("Saving...");var C=function(){B._unhold();B._saved()};if(this.sh.attr("checked")!=this.values.saveHistory){if(!this.sh.attr("checked")&&!confirm("This will remove all your chat history. Do it?")){this.sh.attr("checked",true)}else{this.values.saveHistory=this.sh.attr("checked");var A=C;C=function(){B.setSaveHistory(A)}}}if(this.al.attr("checked")!=this.values.autoLogin){this.values.autoLogin=this.al.attr("checked");var A=C;C=function(){B.setAutoLogin(A)}}C()},_hold:function(A){this.sh.attr("disabled",true);this.al.attr("disabled",true);this.sv.attr("disabled",true);this.sv.attr("value",A)},_unhold:function(){this.sh.attr("disabled",false);this.al.attr("disabled",false);this.sv.attr("disabled",false);this.sv.attr("value","Save")},_saved:function(){$(".saved").fadeIn(function(){setTimeout(function(){$(".saved").fadeOut()},5000)})},setSaveHistory:function(B){var A=this.values.saveHistory?"enableHistory":"disableHistory";JSChat.getInstance().app[A](B)},setAutoLogin:function(A){if(!this.values.autoLogin){QuickChat.disableAutoLogin()}$.post("/ajaxSetChatAutoLogin/",{value:this.values.autoLogin?"true":"false"},A)}};SignUpForm={prices:{},user_prices:{},delivery_type:"",submit:function(B,C){var A=new PopupForm();return A.submit(B,C)},newOnChangePayType:function(){var B=arguments[0];var A=arguments[1];$("#payMethod").val(B);if(arguments.length==2){$("#electronicPayType").val(A)}if($("#payMethod").val()!=""&&$("#deliveryType").val()!=""){$("#calculate-button-container").show()}else{$("#calculate-button-container").hide()}if(arguments.length==2){B=[B,A].join("_")}$("a[class=payMethodLink]").each(function(C){$("#"+this.id).replaceWith('<span class="payMethodLink" id="'+this.id+'">'+$("#"+this.id).text()+"</span>");if(B!=this.id){$("#"+this.id).addClass("inactiveItem")}else{$("#"+this.id).addClass("activeItem")}});if("MERCAWAY"==$("#electronicPayType").val()){$("#last-4-credit-card-digits-field").show()}else{$("#last-4-credit-card-digits-field").hide()}if("BONUSCODE"==$("#electronicPayType").val()){$("#bonuscode-field").show()}else{$("#bonuscode-field").hide()}$("#deliveryTypeContainer").show();return false},restorePostForm:function(){var B=postValues.partnerStatus;idx=1;var A=null;$.each(SignUpForm.prices,function(C,D){if(C==B){A=idx}idx++});this.partnerStatusChangeHandler("link_"+A);if(B!="TEAM MEMBER"){this.partnerDeliveryChangeHandler(postValues.deliveryType)}$("#payMethod").val(postValues.payMethod);$("#electronicPayType").val(postValues.electronicPayType);if($("#payMethod").val()!=""){this.newOnChangePayType($("#payMethod").val(),$("#electronicPayType").val())}this.partnerCalculateHandler();this.partnerAgreeHandler($("#isTermsAndConditionsApproved").get(0))},partnerAgreeHandler:function(A){if($("#"+A.id).attr("checked")){$("#submit-button").attr("disabled","")}else{$("#submit-button").attr("disabled","disabled")}},partnerCalculateHandler:function(){var A=parseFloat(SignUpForm.user_prices.signUp)+0.0001;var C=parseFloat(SignUpForm.user_prices.delivery)+0.0001;if(isNaN(C)||C<1){C=0}A=Math.round(10*A)/10;C=Math.round(10*C)/10;var B=Math.round(10*(A+C)/10);$("#packagePricePlaceholder").html(A.toString());$("#deliveryPricePlaceholder").html(C.toString());$("#totalPricePlaceholder").html(B.toString());$("#calculation-placeholder").show();$("#terms-content").show();$("#calculate").attr("disabled","disabled")},initCalculate:function(){$("#calculate-button-placeholder").show()},partnerDeliveryChangeHandler:function(A){el_=A;$("a[class=deliveryType]").each(function(D){$(this).replaceWith('<span class="deliveryType" id="'+this.id+'">'+$(this).text()+"</div>");if(A!=this.id){$("#"+this.id).addClass("inactiveItem")}else{$("#"+this.id).addClass("activeItem")}});A=el_;if(A.toLowerCase()=="dhl"||A.toLowerCase()=="local"||A.toLowerCase()=="onsite"||A.toLowerCase()=="onsiteaf"){$("#address-content").show()}if(A.toLowerCase()=="onsiteaf"||A.toLowerCase()=="onsite"){$("#deliveryPrice").text(ONSITE_PRICE)}var C=$("#partnerStatus").val();var B=SignUpForm.prices[C];SignUpForm.user_prices.delivery=B.delivery[A].price;SignUpForm.delivery_type=A;$("#deliveryType").val(A);this.initCalculate()},partnerStatusChangeHandler:function(A){el_=$("#"+A).attr("title");$("a[id^='link_']").each(function(C){$(this).replaceWith('<span class="selectPackage" id="'+this.id+'">'+$(this).text()+"</div>");if(A!=this.id){$("#"+this.id).addClass("inactiveItem")}else{$("#"+this.id).addClass("activeItem")}});A=el_;$("#partnerStatus").val(A);if(A==""){$("#signUp-price-container").hide()}else{var B=SignUpForm.prices[A];SignUpForm.user_prices.signUp=B.price;if(B.delivery.length!=0){$("#delivery-method").html("<label>"+SELECT_DELIVERY_OPTION+"</label><br/><br/>");$.each(B.delivery,function(F,E){var D="";var C="";$.each(E,function(G,H){if("label"==G){D=H}else{if("price"==G){C=H}}});deliveryTip="";if(F=="pickup"){deliveryTip='<br /><span class="legend">'+PICKUP_HINT+"</span>"}$("#delivery-method").append($("<div />").html('<a id="'+F+'" class="deliveryType" href="#" onclick="SignUpForm.partnerDeliveryChangeHandler(\''+F+"'); return false;\">"+D+"</a> ("+C+" TB)"+deliveryTip))})}else{SignUpForm.user_prices.delivery=0;SignUpForm.delivery_type="Download";$("#deliveryType").val("Download");this.initCalculate()}$("#delivery-method").show();$("#sign-up-content").show()}}};$(function(){var A=new PopupContactBubble();A.attach(document)});function roundCashInValueThisFunctionMustBeFixed(C,B){var A=new Number(C*B);return A.toFixed(2)}function showRoundCashInValueThisFunctionMustBeAlsoFixed(B,A){$("#price").html(roundCashInValueThisFunctionMustBeFixed(B,A))}userPublicProfile=function(){var B=$("#receiver").val();var C=$(".user-public-profile-msg").text();if(B.length>0){var A=$("<a />").attr("href","http://"+B+"."+Config.baseHost+"/profile/").text(C);$(".user-public-profile").html("");$(".user-public-profile").append(A)}else{$(".user-public-profile").text("")}};userPublicProfileCallback=function(){$("#receiver").change(userPublicProfile);$("#receiver").blur(userPublicProfile);$("#receiver").keyup(userPublicProfile)};ChatToggle=function(){var D="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=990,height=500,screenX=150,screenY=150,top=150,left=150";var A="ChatWindow";var B="/chatPopup/";var C=window.open("",A,D);if(!C||C.closed||!C.QuickChat){C=window.open(B,A,D);C.focus()}else{C.focus()}return false};if(typeof isPopup=="undefined"){var isPopup=false}var Storage;CustomerNetwork={load:function(A){$("#loaderDiv").prepend($("<img src='/static/image/ajax-loader.gif' style='position:absolute'/>")).load(A)}};checkChatStatus=function(){if(ChatPresence.checkIAmAlive()){var B=window.open("","ChatWindow");if(!B||B.closed||!B.QuickChat){B.close()}else{var A=B.QuickChat.getBasicInfo(Config.telmeUserNickname);if(A.presence=="online"){}else{}}}else{}};function closeUnreadMessagesBubble(){$("#unreadMessagesBubble").hide()}function showSmartphoneVersionHint(A){if(A){$("#smartphoneVersionHint").show()}else{$("#smartphoneVersionHint").hide()}return false}function onSubmitSaveMapLocation(){if(typeof (profileMap)!="object"){return false}var B=profileMap.getIsPresenceMarkerVisible();if(B){var A=profileMap.presenceMarker.getLatLng();$("#saveLocation").val(1);$("#latitude").val(A.lat());$("#longitude").val(A.lng())}}function enableMapLocationSearch(A,C,B){B.click(function(E){var D=C.val();if(!D){return }A.map.searchLocation(D,function(F){if(!F){alert("Location not found: "+D)}})});C.keypress(function(D){if(D.which==13){B.trigger("click");return false}})}function enableMapUserListSearch(A,C,B){B.click(function(F){var E=C.val();if(!E){return }var D=A.searchUserByNickname(E);if(!D){alert('User with nickname "'+E+'" not found')}});C.keypress(function(D){if(D.which==13){B.trigger("click");return false}})}function enableMapUserSearch(A,C,B){B.click(function(E){var D=C.val();if(!D){return }A.searchUserByNickname(D,function(F){if(!F){alert('User with nickname "'+D+'" not found')}})});C.keypress(function(D){if(D.which==13){B.trigger("click");return false}})}function enableShowHotspotsCheckbox(A,B){B.change(function(){if(B.attr("checked")){A.showHotspots()}else{A.hideHotspots()}});A.onChangeShowHotspots=function(C){if(C){B.attr("checked","checked")}else{B.attr("checked",null)}}}function enableShowUsersCheckbox(A,B){B.change(function(){if(B.attr("checked")){A.showUsers()}else{A.hideUsers()}});A.onChangeShowUsers=function(C){if(C){B.attr("checked","checked")}else{B.attr("checked",null)}}}function unspam(A){$(A).click(function(){window.setTimeout(function(){$(A).attr("disabled","disabled")},0);window.setTimeout(function(){$(A).attr("disabled",null)},30000)})};
ContactBubble={users:{},usersByNickname:{},products:{},getUserById:function(C){var B=null;$.each(ContactBubble.usersByNickname,function(){if(this.getId()==C){B=this;return false}});if(B){ContactBubble.users[C]=B;return B}if(typeof (ContactBubble.users[C])=="undefined"){var A=new ContactBubble.User();A.loadById(C);ContactBubble.users[C]=A}return ContactBubble.users[C]},getUserByNickname:function(B){var C=null;$.each(ContactBubble.users,function(){if(this.getNickname()==B){C=this;return false}});if(C){ContactBubble.usersByNickname[B]=C;return C}if(typeof (ContactBubble.usersByNickname[B])=="undefined"){var A=new ContactBubble.User();A.loadByNickname(B);ContactBubble.usersByNickname[B]=A}return ContactBubble.usersByNickname[B]},initHoverBubbles:function(A){if(typeof (A)=="undefined"){A="body"}$(".hoverContactBubble",A).each(function(){var B=$(this);var C=B.attr("rel");B.mouseover(function(){var D=ContactBubble.getUserById(C)})})},getStatusInfoByPresence:function(A){return{online:{status:"Online","class":"c-online"},chat:{status:"Free For Chat","class":"c-online"},away:{status:"Away","class":"c-away"},dnd:{status:"DND","class":"c-dnd"},xa:{status:"Extended Away","class":"c-xa"},offline:{status:"Offline","class":"c-off"}}[A]},getPresenceClasses:function(){return"c-online c-away c-xa c-dnd c-off"}};ContactBubble.User=function(){this.parent.constructor.call(this);this.id=null;this.nickname=null;this.inList=false;this.presence="offline";this.status=null};ContactBubble.User.prototype={isLoaded:false,dataLoaded:function(A){this.isLoaded=true;$.extend(this,A);this.fireEvent("data-loaded")},loadById:function(A){$.getJSON("/ajax/ajaxContactBubbleUser/id/"+A+"/",this.dataLoaded.bind(this))},loadByNickname:function(A){$.getJSON("/ajax/ajaxContactBubbleUser/nickname/"+A+"/",this.dataLoaded.bind(this))},getPresence:function(){return this.presence},setPresence:function(B,A){var C=false;if(typeof (B)!="undefined"&&this.presence!=B){this.presence=B;C=true}if(typeof (A)!="undefined"&&this.status!=A){this.status=A;C=true}if(C){this.fireEvent("presence-changed")}},getStatus:function(){return this.status},setStatus:function(A){if(this.status!=A){this.status=A;this.fireEvent("presence-changed")}},isInList:function(){return this.inList},setInList:function(A){if(this.inList!=A){this.inList=A;this.fireEvent("presence-changed")}},isOnline:function(){return this.presence!="offline"},getNickname:function(){return this.nickname},getTitle:function(){return this.title},getId:function(){return this.id}};ContactBubble.User.extend(Observable);$(function(){ContactBubble.initHoverBubbles()});ContactBubble.Views={};ContactBubble.Views.Abstract=function(A,B){this.dom=B;this.dom.avatar=this.dom.find(".GenericBubbleAvatar");this.dom.statusIcon=this.dom.find(".contactBubbleHeaderStatusIcon");this.dom.nickname=this.dom.find(".contactBubbleNickname");this.dom.status=this.dom.find(".contactBubbleBodyTitle");this.model=A;this.model.bindEvent("data-loaded",this.updateBubbleData.bind(this));this.model.bindEvent("presence-changed",this.updatePresence.bind(this))};ContactBubble.Views.Abstract.prototype={render:function(){var A=this;this.dom.find(".GenericBubbleAction.GBA-add").click(function(){QuickChat.addContact(A.model.getNickname())});this.dom.find(".GenericBubbleAction.GBA-remove").click(function(){if(confirm(ChatText.removeContact)){QuickChat.removeContact(A.model.getNickname())}});this.dom.find(".contactBubbleUserGmapFooterRightIcon.chatIcon").click(function(){QuickChat.chatWith(A.model.getNickname())});if(!this.model.isLoaded){this.dom.hide()}else{this.updateBubbleData()}return this.dom},remove:function(){this.dom.remove();this.model.unbindEvent("data-loaded",this.updateBubbleData.bind(this));this.model.unbindEvent("presence-changed",this.updatePresence.bind(this))},updateBubbleData:function(){this.dom.show();var B=this.model.isAvatarUploaded?Config.mediaHost+"avatar/"+this.model.avatar:this.dom.avatar.attr("src");this.dom.avatar.attr({src:B,alt:this.model.getNickname(),title:this.model.getNickname()});var A=this.model.getNickname();this.dom.nickname.text(A).attr("title",A);this.dom.find(".GenericBubbleText.userFullname").text(this.model.fullname).attr("title",this.model.fullname);this.updateTitle();this.updatePv();this.updatePresence()},updatePresence:function(){this.updateStatus();var B=this.dom.find(".GenericBubbleAction.GBA-add");var A=this.dom.find(".GenericBubbleAction.GBA-remove");if(this.model.isInList()){B.hide();A.show()}else{B.show();A.hide()}},updateStatus:function(){var B=ContactBubble.getStatusInfoByPresence(this.model.getPresence());this.dom.removeClass(ContactBubble.getPresenceClasses());this.dom.addClass(B["class"]);var A=this.model.getStatus();if(!A){A=B.status}this.dom.find(".GenericBubbleText.userStatus").text(A).attr("title",A);this.dom.nickname.attr("title",B.status)},updateTitle:function(){var A=this.dom.find(".treetitles");if(this.model.isDistributor){A.show();var D=this.model.getTitle();A.attr("title",D);var C=-117;var B={"PRESIDENT TEAM EXECUTIVE":-26,"INTERNATIONAL EXECUTIVE":-13,EXECUTIVE:-0,"INTERNATIONAL DIRECTOR":-65,"NATIONAL DIRECTOR":-52,DIRECTOR:-39,"NATIONAL MANAGER":-104,"REGIONAL MANAGER":-91,MANAGER:-78};if(typeof (B[D])!="undefined"){C=B[D]}A.css("backgroundPosition","-72px "+C+"px")}else{A.hide()}},updatePv:function(){var A=this.dom.find(".statusicon");if(this.model.isDistributor){var B=this.model.pv;var C=0;if(B<60){C=-18}else{if(B<120){C=-9}}A.css("backgroundPosition","0 "+C+"px")}else{A.hide()}}};
var ChatPresence;function ChatPresence(){}ChatPresence.prototype={_setCookie:function(A,B){return $.cookie("chat."+A,B,{path:"/",domain:"float.local",expires:0})},setIAmAlive:function(){var A=new Date;this._setCookie("chat_i_am_alive",parseInt(A.getTime()/1000))},setIDied:function(){var A=new Date;this._setCookie("chat_i_am_alive","")},checkIAmAlive:function(){var A=new Date;A=parseInt(A.getTime()/1000);var B=this._setCookie("chat_i_am_alive");if(!B){return false}B=parseInt(B);if(!B){return false}if((A-B)>1){return false}return true}};ChatPresence=new ChatPresence;
OrdersForm.prototype=new PopupForm();OrdersForm.buyHandler=[];OrdersForm.typeOnCange=function(A){};OrdersForm.open=function(A){OrdersForm.buyHandler={id:A.id,href:A.href};$(A).replaceWith('<a id="'+A.id+'" href="#" onclick="return false;">'+$(A).html()+"</a>");$("#availableProducts-container").hide();$("#orderedProducts-container").hide();$("#title-container").hide();$("#ajax-loader").show();$("#order-form-container").html("");$("#order-form-container").bind("ajaxError",this._ajaxErrorHandler);$("#order-form-container").load(A.href,null,this._ajaxSuccessHandler);$("#order-form-container").show();return false};OrdersForm._ajaxSuccessHandler=function(C,D,A){$("#ajax-loader").hide();var B=$("#product").val();$("#order-title-container h1").append(" ( "+parseFloat(priceTable[B].currentUserPrice)+" TB)")};OrdersForm.cancel=function(){$("#"+OrdersForm.buyHandler.id).replaceWith('<a id="'+OrdersForm.buyHandler.id+'" href="'+OrdersForm.buyHandler.href+'" onclick="return OrdersForm.open(this);">'+$("#"+OrdersForm.buyHandler.id).html()+"</a>");OrdersForm.buyHandler=[];$("#ajax-loader").hide();$("#order-form-container").hide();$("#availableProducts-container").show();$("#orderedProducts-container").show();$("#title-container").show()};OrdersForm.submit=function(B,C){var A=new PopupForm();A.submit(B,false);$("#ordering-container").show();if(C){$("#order-form-container").load(B.action,$(B).serializeArray());return false}else{return true}};OrdersForm.calculate=function(D){var F=$("#product").val();var H=parseInt($("#productsCount").val());if(H<1){alert("Wrong qty!");return false}var C=$("#deliveryType").val();var G=priceTable[F].delivery;if(C=="local"){var B=parseFloat(G[C].price)}else{var B=parseFloat(G[C].price)*H}if(isNaN(B)){B=0}if($("#forceDelivery").val()==1){$("#address-container").show()}var A=parseFloat(priceTable[F].currentUserPrice)*H;var E=A+B;$("#calculate-product-price").html(A);$("#calculate-delivery-price").html(B);$("#calculate-total-price").html(E);$("#calculate-table-container").show();$("#submit-button-container").show();$("#productsCount").attr("readonly","readonly");$("#payMethodField").attr("disabled","disabled");$(D).attr("disabled","disabled")};OrdersForm.agreeHandler=function(A){if($("#"+A.id).attr("checked")){$("#submit-button").attr("disabled","")}else{$("#submit-button").attr("disabled","disabled")}};OrdersForm.deliveryHandler=function(A){$("#deliveryType").val(A);if($("#payMethodField").val()!=""&&$("#deliveryType").val()!=""){$("#calculate-button-container").show()}else{$("#calculate-button-container").hide()}$("a[class=deliveryType]").each(function(B){$(this).replaceWith('<span class="deliveryType" id="'+this.id+'">'+$(this).text()+"</div>");if(A!=this.id){$("#"+this.id).addClass("inactiveItem")}else{$("#"+this.id).addClass("activeItem")}});if(A.toLowerCase()=="dhl"||A.toLowerCase()=="local"){$("#address-container").show()}return false};OrdersForm.newOnChangePayType=function(){var B=arguments[0];var A=arguments[1];$("#payMethod").val(B);if(arguments.length==2){$("#electronicPayType").val(A)}this.onChangePayType($("#payMethod").get(0));if($("#payMethod").val()!=""&&$("#deliveryType").val()!=""){$("#calculate-button-container").show()}else{$("#calculate-button-container").hide()}if(arguments.length==2){B=[B,A].join("_")}$("a[class=payMethodLink]").each(function(C){$("#"+this.id).replaceWith('<span class="payMethodLink" id="'+this.id+'">'+$("#"+this.id).text()+"</span>");if(B!=this.id){$("#"+this.id).addClass("inactiveItem")}else{$("#"+this.id).addClass("activeItem")}});$("#deliveryTypeContainer").show();return false};OrdersForm.restorePostForm=function(){$("#payMethod").val(postValues.payMethod);$("#electronicPayType").val(postValues.electronicPayType);if($("#payMethod").val()!=""){this.newOnChangePayType($("#payMethod").val(),$("#electronicPayType").val())}this.deliveryHandler(postValues.deliveryType);var A=$("#product").val();$("#order-title-container h1").append(" ("+parseFloat(priceTable[A].currentUserPrice)+" TB)")};
$(document).ready(function(){$("input[type=file]").keypress(function(C){var A=false;if(C.which==13){var B=$(this).parents("form");if(B.length){B.submit()}}else{A=true}return A})});
(function(A){A.extend(A.fx.step,{backgroundPosition:function(D){if(D.state==0&&typeof D.end=="string"){var F=A.curCSS(D.elem,"backgroundPosition");F=C(F);D.start=[F[0],F[2]];var B=C(D.end);D.end=[B[0],B[2]];D.unit=[B[1],B[3]]}var E=[];E[0]=((D.end[0]-D.start[0])*D.pos)+D.start[0]+D.unit[0];E[1]=((D.end[1]-D.start[1])*D.pos)+D.start[1]+D.unit[1];D.elem.style.backgroundPosition=E[0]+" "+E[1];function C(H){H=H.replace(/left|top/g,"0px");H=H.replace(/right|bottom/g,"100%");H=H.replace(/(\d+)(\s|\)|$)/g,"$1px$2");var G=H.match(/(\d+)(px|\%|em|pt)\s(\d+)(px|\%|em|pt)/);return[parseFloat(G[1]),G[2],parseFloat(G[3]),G[4]]}}})})(jQuery);
function replacePlaceholders(){var B=document.getElementsByTagName("a");for(i=0;i<B.length;i++){if(B[i].href.match(/^(.*)#$/gi)){if(B[i].onclick==null){var A=document.createElement("span");A.innerHTML='<span style="font-size: 50%; color: #ff8080;">X</span>';B[i].parentNode.insertBefore(A,B[i].nextSibling);B[i].onclick=function(){alert("Not implemented yet.");return false}}}}};
function localizeErrors(H){len=H.length;var D=new Array();for(var B=0;B<len;B++){var G=new String(localizedErrorMessages[H[B].code]);var F=G.match(/{\$([^}]+)}/gi);if(F!=null){var C=F.length;for(var A=0;A<C;A++){var E=F[A].replace(/(?:[\${}]+)/gi,"");G=G.replace(F[A],H[B].params[E])}}D.push(G)}return D};
(function(B){B.fn.jcarousel=function(D){return this.each(function(){new A(this,D)})};var C={vertical:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null};B.jcarousel=function(G,E){this.options=B.extend({},C,E||{});this.locked=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?"left":"top";var K="",I=G.className.split(" ");for(var F=0;F<I.length;F++){if(I[F].indexOf("jcarousel-skin")!=-1){B(G).removeClass(I[F]);var K=I[F];break}}if(G.nodeName=="UL"||G.nodeName=="OL"){this.list=B(G);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container")){this.container=this.container.wrap("<div></div>")}this.container=this.container.parent()}else{if(!this.container.hasClass("jcarousel-container")){this.container=this.list.wrap("<div></div>").parent()}}}else{this.container=B(G);this.list=B(G).find(">ul,>ol,div>ul,div>ol")}if(K!=""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+K+'"></div>')}this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip")){this.clip=this.list.wrap("<div></div>").parent()}this.buttonPrev=B(".jcarousel-prev",this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null){this.buttonPrev=this.clip.before(this.options.buttonPrevHTML).prev()}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=B(".jcarousel-next",this.container);if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null){this.buttonNext=this.clip.before(this.options.buttonNextHTML).prev()}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip"));this.list.addClass(this.className("jcarousel-list"));this.container.addClass(this.className("jcarousel-container"));var H=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var J=this.list.children("li");var L=this;if(J.size()>0){var D=0,F=this.options.offset;J.each(function(){L.format(this,F++);D+=L.dimension(this,H)});this.list.css(this.wh,D+"px");if(!E||E.size===undefined){this.options.size=J.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){L.next()};this.funcPrev=function(){L.prev()};this.funcResize=function(){L.reload()};if(this.options.initCallback!=null){this.options.initCallback(this,"init")}if(B.browser.safari){this.buttons(false,false);B(window).bind("load",function(){L.setup()})}else{this.setup()}};var A=B.jcarousel;A.fn=A.prototype={jcarousel:"0.2.3"};A.fn.extend=A.extend=B.extend;A.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;if(this.locked){return }this.list.css(this.lt,this.pos(this.options.offset)+"px");var D=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(D,false);B(window).unbind("resize",this.funcResize).bind("resize",this.funcResize)},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!=null){this.options.initCallback(this,"reset")}this.setup()},reload:function(){if(this.tail!=null&&this.inTail){this.list.css(this.lt,A.intval(this.list.css(this.lt))+this.tail)}this.tail=null;this.inTail=false;if(this.options.reloadCallback!=null){this.options.reloadCallback(this)}if(this.options.visible!=null){var F=this;var G=Math.ceil(this.clipping()/this.options.visible),E=0,D=0;B("li",this.list).each(function(H){E+=F.dimension(this,G);if(H+1<F.first){D=E}});this.list.css(this.wh,E+"px");this.list.css(this.lt,-D+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(D){if(D!=undefined){this.options.size=D;if(!this.locked){this.buttons()}}return this.options.size},has:function(E,F){if(F==undefined||!F){F=E}if(this.options.size!==null&&F>this.options.size){F=this.options.size}for(var D=E;D<=F;D++){var G=this.get(D);if(!G.length||G.hasClass("jcarousel-item-placeholder")){return false}}return true},get:function(D){return B(".jcarousel-item-"+D,this.list)},add:function(G,L){var H=this.get(G),E=0,K=0;if(H.length==0){var J,H=this.create(G),F=A.intval(G);while(J=this.get(--F)){if(F<=0||J.length){F<=0?this.list.prepend(H):J.after(H);break}}}else{E=this.dimension(H)}H.removeClass(this.className("jcarousel-item-placeholder"));typeof L=="string"?H.html(L):H.empty().append(L);var I=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var D=this.dimension(H,I);if(G>0&&G<this.first){this.list.css(this.lt,A.intval(this.list.css(this.lt))-D+"px")}this.list.css(this.wh,A.intval(this.list.css(this.wh))+D+"px");return H},register:function(E){var G=this.get(E);var F=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var D=this.dimension(G,F);if(E>0&&E<this.first){this.list.css(this.lt,A.intval(this.list.css(this.lt))-D+"px")}this.list.css(this.wh,A.intval(this.list.css(this.wh))+D+"px");return G},remove:function(D){var E=this.get(D);if(!E.length||(D>=this.first&&D<=this.last)){return }var F=this.dimension(E);if(D<this.first){this.list.css(this.lt,A.intval(this.list.css(this.lt))+F+"px")}E.remove();this.list.css(this.wh,A.intval(this.list.css(this.wh))-F+"px")},next:function(){this.stopAuto();if(this.tail!=null&&!this.inTail){this.scrollTail(false)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!=null&&this.last==this.options.size)?1:this.first+this.options.scroll)}},prev:function(){this.stopAuto();if(this.tail!=null&&this.inTail){this.scrollTail(true)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!=null&&this.first==1)?this.options.size:this.first-this.options.scroll)}},scrollTail:function(D){if(this.locked||this.animating||!this.tail){return }var E=A.intval(this.list.css(this.lt));!D?E-=this.tail:E+=this.tail;this.inTail=!D;this.prevFirst=this.first;this.prevLast=this.last;this.animate(E)},scroll:function(E,D){if(this.locked||this.animating){return }this.animate(this.pos(E),D)},pos:function(Q){if(this.locked||this.animating){return }if(this.options.wrap!="circular"){Q=Q<1?1:(this.options.size&&Q>this.options.size?this.options.size:Q)}var N=this.first>Q;var E=A.intval(this.list.css(this.lt));var R=this.options.wrap!="circular"&&this.first<=1?1:this.first;var U=N?this.get(R):this.get(this.last);var P=N?R:R-1;var S=null,O=0,L=false,T=0;while(N?--P>=Q:++P<Q){S=this.get(P);L=!S.length;if(S.length==0){S=this.create(P).addClass(this.className("jcarousel-item-placeholder"));U[N?"before":"after"](S)}U=S;T=this.dimension(S);if(L){O+=T}if(this.first!=null&&(this.options.wrap=="circular"||(P>=1&&(this.options.size==null||P<=this.options.size)))){E=N?E+T:E-T}}var I=this.clipping();var K=[];var D=0,P=Q,J=0;var U=this.get(Q-1);while(++D){S=this.get(P);L=!S.length;if(S.length==0){S=this.create(P).addClass(this.className("jcarousel-item-placeholder"));U.length==0?this.list.prepend(S):U[N?"before":"after"](S)}U=S;var T=this.dimension(S);if(T==0){alert("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");return 0}if(this.options.wrap!="circular"&&this.options.size!==null&&P>this.options.size){K.push(S)}else{if(L){O+=T}}J+=T;if(J>=I){break}P++}for(var H=0;H<K.length;H++){K[H].remove()}if(O>0){this.list.css(this.wh,this.dimension(this.list)+O+"px");if(N){E-=O;this.list.css(this.lt,A.intval(this.list.css(this.lt))-O+"px")}}var G=Q+D-1;if(this.options.wrap!="circular"&&this.options.size&&G>this.options.size){G=this.options.size}if(P>G){D=0,P=G,J=0;while(++D){var S=this.get(P--);if(!S.length){break}J+=this.dimension(S);if(J>=I){break}}}var F=G-D+1;if(this.options.wrap!="circular"&&F<1){F=1}if(this.inTail&&N){E+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&G==this.options.size&&(G-D+1)>=1){var M=A.margin(this.get(G),!this.options.vertical?"marginRight":"marginBottom");if((J-M)>I){this.tail=J-I-M}}while(Q-->F){E+=this.dimension(this.get(Q))}this.prevFirst=this.first;this.prevLast=this.last;this.first=F;this.last=G;return E},animate:function(G,D){if(this.locked||this.animating){return }this.animating=true;var E=this;var F=function(){E.animating=false;if(G==0){E.list.css(E.lt,0)}if(E.options.wrap=="both"||E.options.wrap=="last"||E.options.size==null||E.last<E.options.size){E.startAuto()}E.buttons();E.notify("onAfterAnimation")};this.notify("onBeforeAnimation");if(!this.options.animation||D==false){this.list.css(this.lt,G+"px");F()}else{var H=!this.options.vertical?{left:G}:{top:G};this.list.animate(H,this.options.animation,this.options.easing,F)}},startAuto:function(E){if(E!=undefined){this.options.auto=E}if(this.options.auto==0){return this.stopAuto()}if(this.timer!=null){return }var D=this;this.timer=setTimeout(function(){D.next()},this.options.auto*1000)},stopAuto:function(){if(this.timer==null){return }clearTimeout(this.timer);this.timer=null},buttons:function(F,E){if(F==undefined||F==null){var F=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="first")||this.options.size==null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!=null&&this.last>=this.options.size){F=this.tail!=null&&!this.inTail}}if(E==undefined||E==null){var E=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="last")||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!=null&&this.first==1){E=this.tail!=null&&this.inTail}}var D=this;this.buttonNext[F?"bind":"unbind"](this.options.buttonNextEvent,this.funcNext)[F?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",F?false:true);this.buttonPrev[E?"bind":"unbind"](this.options.buttonPrevEvent,this.funcPrev)[E?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",E?false:true);if(this.buttonNext.length>0&&(this.buttonNext[0].jcarouselstate==undefined||this.buttonNext[0].jcarouselstate!=F)&&this.options.buttonNextCallback!=null){this.buttonNext.each(function(){D.options.buttonNextCallback(D,this,F)});this.buttonNext[0].jcarouselstate=F}if(this.buttonPrev.length>0&&(this.buttonPrev[0].jcarouselstate==undefined||this.buttonPrev[0].jcarouselstate!=E)&&this.options.buttonPrevCallback!=null){this.buttonPrev.each(function(){D.options.buttonPrevCallback(D,this,E)});this.buttonPrev[0].jcarouselstate=E}},notify:function(D){var E=this.prevFirst==null?"init":(this.prevFirst<this.first?"next":"prev");this.callback("itemLoadCallback",D,E);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",D,E,this.first);this.callback("itemFirstOutCallback",D,E,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",D,E,this.last);this.callback("itemLastOutCallback",D,E,this.prevLast)}this.callback("itemVisibleInCallback",D,E,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",D,E,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(H,K,D,I,G,F,E){if(this.options[H]==undefined||(typeof this.options[H]!="object"&&K!="onAfterAnimation")){return }var L=typeof this.options[H]=="object"?this.options[H][K]:this.options[H];if(!B.isFunction(L)){return }var M=this;if(I===undefined){L(M,D,K)}else{if(G===undefined){this.get(I).each(function(){L(M,this,I,D,K)})}else{for(var J=I;J<=G;J++){if(J!==null&&!(J>=F&&J<=E)){this.get(J).each(function(){L(M,this,J,D,K)})}}}}},create:function(D){return this.format("<li></li>",D)},format:function(F,E){var D=B(F).addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+E));D.attr("jcarouselindex",E);return D},className:function(D){return D+" "+D+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(G,H){var F=G.jquery!=undefined?G[0]:G;var E=!this.options.vertical?F.offsetWidth+A.margin(F,"marginLeft")+A.margin(F,"marginRight"):F.offsetHeight+A.margin(F,"marginTop")+A.margin(F,"marginBottom");if(H==undefined||E==H){return E}var D=!this.options.vertical?H-A.margin(F,"marginLeft")-A.margin(F,"marginRight"):H-A.margin(F,"marginTop")-A.margin(F,"marginBottom");B(F).css(this.wh,D+"px");return this.dimension(F)},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-A.intval(this.clip.css("borderLeftWidth"))-A.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-A.intval(this.clip.css("borderTopWidth"))-A.intval(this.clip.css("borderBottomWidth"))},index:function(D,E){if(E==undefined){E=this.options.size}return Math.round((((D-1)/E)-Math.floor((D-1)/E))*E)+1}});A.extend({defaults:function(D){return B.extend(C,D||{})},margin:function(H,G){if(!H){return 0}var F=H.jquery!=undefined?H[0]:H;if(G=="marginRight"&&B.browser.safari){var E={display:"block","float":"none",width:"auto"},D,I;B.swap(F,E,function(){D=F.offsetWidth});E.marginRight=0;B.swap(F,E,function(){I=F.offsetWidth});return I-D}return A.intval(B.css(F,G))},intval:function(D){D=parseInt(D);return isNaN(D)?0:D}})})(jQuery);
jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};
jQuery.fn.highlightFade=function(D){var G=(D&&D.constructor==String)?{start:D}:D||{};var F=jQuery.highlightFade.defaults;var C=G.interval||F.interval;var A=G.attr||F.attr;var E={linear:function(I,J,H,K){return parseInt(I+(K/H)*(J-I))},sinusoidal:function(I,J,H,K){return parseInt(I+Math.sin(((K/H)*90)*(Math.PI/180))*(J-I))},exponential:function(I,J,H,K){return parseInt(I+(Math.pow(K/H,2))*(J-I))}};var B=(G.iterator&&G.iterator.constructor==Function)?G.iterator:E[G.iterator]||E[F.iterator]||E.linear;if(F.iterator&&F.iterator.constructor==Function){B=F.iterator}return this.each(function(){if(!this.highlighting){this.highlighting={}}var J=(this.highlighting[A])?this.highlighting[A].end:jQuery.highlightFade.getBaseValue(this,A)||[255,255,255];var K=jQuery.highlightFade.getRGB(G.start||G.colour||G.color||F.start||[255,255,128]);var H=jQuery.speed(G.speed||F.speed);var I=G["final"]||(this.highlighting[A]&&this.highlighting[A].orig)?this.highlighting[A].orig:jQuery.curCSS(this,A);if(G.end||F.end){I=jQuery.highlightFade.asRGBString(J=jQuery.highlightFade.getRGB(G.end||F.end))}if(typeof G["final"]!="undefined"){I=G["final"]}if(this.highlighting[A]&&this.highlighting[A].timer){window.clearInterval(this.highlighting[A].timer)}this.highlighting[A]={steps:((H.duration)/C),interval:C,currentStep:0,start:K,end:J,orig:I,attr:A};jQuery.highlightFade(this,A,G.complete,B)})};jQuery.highlightFade=function(C,A,D,B){C.highlighting[A].timer=window.setInterval(function(){var F=B(C.highlighting[A].start[0],C.highlighting[A].end[0],C.highlighting[A].steps,C.highlighting[A].currentStep);var E=B(C.highlighting[A].start[1],C.highlighting[A].end[1],C.highlighting[A].steps,C.highlighting[A].currentStep);var G=B(C.highlighting[A].start[2],C.highlighting[A].end[2],C.highlighting[A].steps,C.highlighting[A].currentStep);jQuery(C).css(A,jQuery.highlightFade.asRGBString([F,E,G]));if(C.highlighting[A].currentStep++>=C.highlighting[A].steps){jQuery(C).css(A,C.highlighting[A].orig||"");window.clearInterval(C.highlighting[A].timer);C.highlighting[A]=null;if(D&&D.constructor==Function){D.call(C)}}},C.highlighting[A].interval)};jQuery.highlightFade.defaults={start:[255,255,128],interval:50,speed:400,attr:"backgroundColor"};jQuery.highlightFade.getRGB=function(C,B){var A;if(C&&C.constructor==Array&&C.length==3){return C}if(A=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(C)){return[parseInt(A[1]),parseInt(A[2]),parseInt(A[3])]}else{if(A=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(C)){return[parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55]}else{if(A=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(C)){return[parseInt("0x"+A[1]),parseInt("0x"+A[2]),parseInt("0x"+A[3])]}else{if(A=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(C)){return[parseInt("0x"+A[1]+A[1]),parseInt("0x"+A[2]+A[2]),parseInt("0x"+A[3]+A[3])]}else{return jQuery.highlightFade.checkColorName(C)||B||null}}}}};jQuery.highlightFade.asRGBString=function(A){return"rgb("+A.join(",")+")"};jQuery.highlightFade.getBaseValue=function(E,B,A){var D,C;A=A||false;C=B=B||jQuery.highlightFade.defaults.attr;do{D=jQuery(E).css(C||"backgroundColor");if((D!=""&&D!="transparent")||(E.tagName.toLowerCase()=="body")||(!A&&E.highlighting&&E.highlighting[B]&&E.highlighting[B].end)){break}C=false}while(E=E.parentNode);if(!A&&E.highlighting&&E.highlighting[B]&&E.highlighting[B].end){D=E.highlighting[B].end}if(D==undefined||D==""||D=="transparent"){D=[255,255,255]}return jQuery.highlightFade.getRGB(D)};jQuery.highlightFade.checkColorName=function(A){if(!A){return null}switch(A.replace(/^\s*|\s*$/g,"").toLowerCase()){case"aqua":return[0,255,255];case"black":return[0,0,0];case"blue":return[0,0,255];case"fuchsia":return[255,0,255];case"gray":return[128,128,128];case"green":return[0,128,0];case"lime":return[0,255,0];case"maroon":return[128,0,0];case"navy":return[0,0,128];case"olive":return[128,128,0];case"purple":return[128,0,128];case"red":return[255,0,0];case"silver":return[192,192,192];case"teal":return[0,128,128];case"white":return[255,255,255];case"yellow":return[255,255,0]}};
(function(A){A.modal=function(C,B){return A.modal.impl.init(C,B)};A.modal.close=function(){A.modal.impl.close(true)};A.fn.modal=function(B){return A.modal.impl.init(this,B)};A.modal.defaults={overlay:50,overlayId:"modalOverlay",overlayCss:{},containerId:"modalContainer",containerCss:{},close:true,closeTitle:"Close",closeClass:"modalClose",persist:false,onOpen:null,onShow:null,onClose:null};A.modal.impl={opts:null,dialog:{},init:function(C,B){if(this.dialog.data){return false}this.opts=A.extend({},A.modal.defaults,B);if(typeof C=="object"){C=C instanceof jQuery?C:A(C);if(C.parent().parent().size()>0){this.dialog.parentNode=C.parent();if(!this.opts.persist){this.dialog.original=C.clone(true)}}}else{if(typeof C=="string"||typeof C=="number"){C=A("<div>").html(C)}else{if(console){}return false}}this.dialog.data=C.addClass("modalData");C=null;this.create();this.open();if(A.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog])}return this},create:function(){this.dialog.overlay=A("<div>").attr("id",this.opts.overlayId).addClass("modalOverlay").css(A.extend(this.opts.overlayCss,{opacity:this.opts.overlay/100,height:"100%",width:"100%",position:"fixed",left:0,top:0,zIndex:3000})).hide().appendTo("body");this.dialog.container=A("<div>").attr("id",this.opts.containerId).addClass("modalContainer").css(A.extend(this.opts.containerCss,{position:"fixed",zIndex:3100})).append(this.opts.close?'<a class="modalCloseImg '+this.opts.closeClass+'" title="'+this.opts.closeTitle+'"></a>':"").hide().appendTo("body");if(A.browser.msie&&(A.browser.version<7)){this.fixIE()}this.dialog.container.append(this.dialog.data.hide())},bindEvents:function(){var B=this;A("."+this.opts.closeClass).click(function(C){C.preventDefault();B.close()})},unbindEvents:function(){A("."+this.opts.closeClass).unbind("click")},fixIE:function(){var C=A(document.body).height()+"px";var B=A(document.body).width()+"px";this.dialog.overlay.css({position:"absolute",height:C,width:B});this.dialog.container.css({position:"absolute",width:"400px",height:"450px",padding:"0px",margin:"0px"});this.dialog.iframe=A('<iframe src="javascript:false;">').css(A.extend(this.opts.iframeCss,{opacity:0,position:"absolute",height:C,width:B,zIndex:1000,width:"100%",top:0,left:0})).hide().appendTo("body")},open:function(){if(this.dialog.iframe){this.dialog.iframe.show()}if(A.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog])}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show()}this.bindEvents()},close:function(B){if(!this.dialog.data){return false}if(A.isFunction(this.opts.onClose)&&!B){this.opts.onClose.apply(this,[this.dialog])}if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode)}else{this.dialog.data.remove();this.dialog.original.appendTo(this.dialog.parentNode)}}else{this.dialog.data.remove()}this.dialog.container.remove();this.dialog.overlay.remove();if(this.dialog.iframe){this.dialog.iframe.remove()}this.dialog={};this.unbindEvents()}}})(jQuery);
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
QuickChat=function(){this.parent.constructor.call(this);var A=this;$(function(){A.cookie("is_used",true);$(window).unload(function(){ChatPresence.setIDied()});$(".chatbutton").show();var B=A.cookie("loaded");if(B||A.autoLogin){if(!Config.telmeUserNickname){A.cookie("loaded",null);return }A.load()}})};QuickChat.prototype={turnedOn:true,isLoading:false,isInitialized:false,autoLogin:true,front:null,load:function(B){if(typeof (JSChat)==="undefined"){var A=this;setTimeout(function(){A.load(B)},500);return }else{if(!this.isInitialized){this.init(B);return }else{if(typeof (B)=="function"){B();return }}}},init:function(B){var A=this;B=ExtendCallback(B,function(){A.isInitialized=true});if(this.isInitialized){if(typeof (B)=="function"){B()}return }else{if(this.initializing){setTimeout(function(){A.init(B)},300);return }}this.initializing=true;JSChat.App.View=JSChat.Views.QuickChatApp;$("<div>").attr("id","chat-templates").addClass("template").html(A.fuckenTemplate).appendTo("body");setTimeout(function(){var C=JSChat.getInstance();C.app.bindEvent("presence-changed",function(){A.fireEvent("presence-changed")});C.connect(B)},1000);this.cookie("loaded",true)},chatWith:function(A){this.load(function(){JSChat.getInstance().chatWith(A)})},toggle:function(){QuickChat.load(function(){JSChat.getInstance().app.view.toggle()})},addContact:function(A){QuickChat.load(function(){JSChat.getInstance().addContact(A)})},removeContact:function(A){QuickChat.load(function(){JSChat.getInstance().removeContact(A)})},getBasicInfo:function(B){var A={};var C=JSChat.getInstance();if(B==Config.telmeUserNickname){var D=ContactBubble.getUserByNickname(B);D.presence=Storage.cookie("presence");A={isOnline:Storage.cookie("presence")=="online"?true:false,presence:Storage.cookie("presence"),reference:D,isInList:true}}else{$.each(C.contactList.contacts,function(){if(this.nickname==B){A={isOnline:this.isOnline(),presence:this.getPresence(),reference:ContactBubble.getUserByNickname(B),isInList:this.isInList()}}})}return A},isOnline:function(){if(this.isLoaded()){return JSChat.getInstance().isOnline()}return false},fail:function(){this.disableAutoLogin();JSChat.getInstance().app.view.hide();$(".chatbutton").removeClass("loading");$(".chatbutton a").attr("href","javascript:void(0);")},disableAutoLogin:function(){this.cookie("loaded",null)},cookie:function(A,B){return $.cookie("chat."+A,B,{path:"/",domain:Config.host,expires:0})},fuckenTemplate:' <div class="ContactList"><div class="cw1"><div class="cw2"> <div class="searchcontactlist"> <input type="text" /> <div class="cancel"></div> </div> <div class="status-selector"> <table class="status-table"> <tr> <td>Status:</td> <td class="status none">none</td> </tr> </table> <div class="status-field template"> <input type="text" class="status-field-input" /><br /> <input type="button" class="status-field-button" value="Change" /> <input type="button" class="status-field-cancel" value="Cancel" /> </div> <select> <option value="online">Online</option> <option value="chat">Free For Chat</option> <option value="away">Away</option> <option value="dnd">Dnd</option> <option value="xa">Extended Away</option> <option value="offline" selected="selected">Offline</option> </select> </div> <dl class="ChatContactList"> <dd> <ul></ul> </dd> </dl> </div></div></div> <div class="contact"> <li class="c-online"> <div class="contactBubbleCollapsed"> <a href="javascript:void(0)" class="contactBubbleNickname"></a> <span class="unreadMessages"></span> </div> <div class="contactBubbleExpanded"> <div class="GenericBubble template"> <div class="GenericBubbleInner"> <h3 class="GenericBubbleNick"><a href="javascript:void(0)" class="contactBubbleNickname"></a> <span class="unreadMessages"></span></h3> <img src="/static/image/defaultAvatar.png" class="GenericBubbleAvatar" alt="" /> <div class="treetitles"></div> <div class="statusicon"></div> <p class="GenericBubbleText userFullname"></p> <p class="GenericBubbleText userStatus"></p> <p class="GenericBubbleAction GBA-add"><a href="javascript:void(0)">Add Contact</a></p> <p class="GenericBubbleAction GBA-remove"><a href="javascript:void(0)">Remove Contact</a></p> <div class="GenericBubbleOpts"> <img class="contactBubbleUserGmapFooterRightIcon videoIcon" src="/static/image/icon_video_gray.png" alt=""/> <img class="contactBubbleUserGmapFooterRightIcon voiceIcon" src="/static/image/icon_voice_gray.png" alt=""/> <img class="contactBubbleUserGmapFooterRightIcon chatIcon" src="/static/image/icon_chat.png" alt=""/> </div> </div> </div> </div> </li> </div> <div class="quick-chat"> <div class="modalChatContainer"> <div style="" class="modalData"> <div class="popupbubble shadowTop"></div> <div class="popupbubble shadowRight"></div> <div class="popupbubble shadowBottom"></div> <div class="popupbubble shadowLeft"></div> <div class="shadowContent"><div class="popupWindowFrame"> <p class="ChatTopLinks"><a href="javascript:void(0)" class="chatclose">close</a><!-- | <a href="javascript:void(0)" class="messagecenter">message center</a--> </p> <div class="dialogs"></div> <ul class="contactsitalkto jcarousel jcarousel-skin-tango"> <li class="template"> <a href="javascript:void(0)" class="nickname"></a> <span class="unreadMessages"> <div class="close"><a href="javascript:void(0)"></a></div></span> </li> </ul> </div></div></div></div> </div> <div class="chat-dialog"> <div class="chat-log"> <dl> <dt class="author template"><strong class="nickname"></strong> <span class="time"></span></dt> <dd class="message template"></dd> <dd class="system-message template"></dd> </dl> </div> <p class="tosendblock"><textarea row="3" cols="50" class="tosend"></textarea><input type="image" src="/static/image/sendbutton.png" /></p> </div> '};QuickChat.extend(Observable);if(typeof isPopup=="undefined"){var isPopup=false}if(isPopup===true){QuickChat=new QuickChat}$(document).ready(function(){if(isPopup===false){$(".chatbutton").show()}});Storage=function(){};Storage.prototype={cookie:function(A,B){return $.cookie("chat."+A,B,{path:"/",domain:Config.host,expires:0})}};var Storage=new Storage;
function CoverageMap(A,B){this.map=new Map(A,B);this._contactBubble=new MapContactBubble(this.map.gmap);this._showHotspots=false;this._showUsers=false;this._pendingAjaxHotspots=null;this._pendingAjaxPresence=null;this._overlayAirCoverage=null;this._markersHotspots=[];this._markersUsers=[];this._listenerOnZoomChange=GEvent.bind(this.map.gmap,"zoomend",this,this._onZoomChange);this._listenerOnMoveEnd=GEvent.bind(this.map.gmap,"moveend",this,this._onMoveEnd);this.showUserInfowindowWhenAvailable=0;this.onChangeShowHotspots=null;this.onChangeShowUsers=null}CoverageMap.prototype.showHotspots=function(A){if(this._showHotspots){return }if(!A){var B=this.map.gmap.getZoom();if(B<Map.ZOOM_THRESHOLD){this._addAirCoverageOverlay()}else{this._loadHotspotMarkers()}}this._showHotspots=true;if(this.onChangeShowHotspots){this.onChangeShowHotspots(true)}};CoverageMap.prototype.hideHotspots=function(){if(!this._showHotspots){return }this._clearAirCoverageOverlay();this._clearHotspotMarkers();this._showHotspots=false;if(this.onChangeShowHotspots){this.onChangeShowHotspots(false)}};CoverageMap.prototype.showUsers=function(A){if(this._showUsers){return }if(!A){this._loadUserMarkers()}this._showUsers=true;if(this.onChangeShowUsers){this.onChangeShowUsers(true)}};CoverageMap.prototype.hideUsers=function(){if(!this._showUsers){return }this._clearUserMarkers();this._showUsers=false;if(this.onChangeShowUsers){this.onChangeShowUsers(false)}};CoverageMap.prototype.searchUserByNickname=function(A,C){var B="/ajaxFindUser/?nickname="+escape(A);$.ajax({url:B,dataType:"json",success:function(D){if(D=="not-found"){C(false);return }this.showUser(D.id,new GLatLng(D.lat,D.lng));C(true)}.bind(this)})};CoverageMap.prototype.showUser=function(B,A){this.showUsers();this.showUserInfowindowWhenAvailable=B;this.map.gmap.setCenter(A,17)};CoverageMap.prototype._addAirCoverageOverlay=function(){var A=new GTileLayer(new GCopyrightCollection("Telme Air Coverage"));A.getTileUrl=function(B,C){return Config.mediaHost+"gmap/tile_"+C+"_"+B.x+"_"+B.y+".png"};A.isPng=function(){return true};A.getOpacity=function(){return 1};this._overlayAirCoverage=new GTileLayerOverlay(A);this.map.gmap.addOverlay(this._overlayAirCoverage)};CoverageMap.prototype._clearAirCoverageOverlay=function(){if(this._overlayAirCoverage){this.map.gmap.removeOverlay(this._overlayAirCoverage);this._overlayAirCoverage=null}};CoverageMap.prototype._clearHotspotMarkers=function(){$.each(this._markersHotspots,function(B,A){this.map.gmap.removeOverlay(A)}.bind(this));this._markersHotspots=[]};CoverageMap.prototype._clearUserMarkers=function(){$.each(this._markersUsers,function(B,A){this.map.gmap.removeOverlay(A)}.bind(this));this._markersUsers=[]};CoverageMap.prototype._onZoomChange=function(B,A){if(B==A){return }if(A%2==0){return }this.map.gmap.clearOverlays();if(this._pendingAjaxHotspots){window.clearTimeout(this._pendingAjaxHotspots);this._pendingAjaxHotspots=null}if(this._pendingAjaxUsers){window.clearTimeout(this._pendingAjaxUsers);this._pendingAjaxUsers=null}if(this._showHotspots){if(A<Map.ZOOM_THRESHOLD){this._addAirCoverageOverlay()}else{this._loadHotspotMarkers()}}if(this._showUsers){this._loadUserMarkers()}};CoverageMap.prototype._onMoveEnd=function(){var A=this.map.gmap.getZoom();if(this._showHotspots){if(A>=Map.ZOOM_THRESHOLD){this._loadHotspotMarkers()}}if(this._showUsers){this._loadUserMarkers()}};CoverageMap.prototype._loadHotspotMarkers=function(){var C=this.map.gmap.getZoom();var B=this.map.gmap.getBounds();var D=B.getNorthEast();var A=B.getSouthWest();if(this._pendingAjaxHotspots){window.clearTimeout(this._pendingAjaxHotspots)}this._pendingAjaxHotspots=window.setTimeout(function(){this._pendingAjaxHotspots=null;$.get("/ajaxLoadHotspotMarkers/",{zoom:C,nwLon:A.lng(),nwLat:D.lat(),seLon:D.lng(),seLat:A.lat()},function(E){if(C!=this.map.gmap.getZoom()){return }this._loadHotspotMarkersCallback(E)}.bind(this),"json")}.bind(this),10)};CoverageMap.prototype._loadHotspotMarkersCallback=function(A){this._clearHotspotMarkers();$.each(A,function(E,D){var C=new GLatLng(D.lat,D.lng);var F=new GLatLng(D.seTargetLat,D.nwTargetLon);var B=new GLatLng(D.nwTargetLat,D.seTargetLon);switch(D.markerType){case"hotspot":this._addHotspotMarker(C,D.referenceId,D.type);break;case"hotspot-cluster":this._addHotspotClusterMarker(C,new GLatLngBounds(F,B));break;default:break}}.bind(this))};CoverageMap.prototype._loadUserMarkers=function(){var C=this.map.gmap.getZoom();var B=this.map.gmap.getBounds();var D=B.getNorthEast();var A=B.getSouthWest();if(this._pendingAjaxUsers){window.clearTimeout(this._pendingAjaxUsers)}this._pendingAjaxUsers=window.setTimeout(function(){this._pendingAjaxUsers=null;$.get("/ajaxLoadUserMarkers/",{zoom:C,nwLon:A.lng(),nwLat:D.lat(),seLon:D.lng(),seLat:A.lat()},function(E){if(C!=this.map.gmap.getZoom()){return }this._loadUserMarkersCallback(E)}.bind(this),"json")}.bind(this),100)};CoverageMap.prototype._loadUserMarkersCallback=function(A){this._ajaxUsers=null;this._clearUserMarkers();$.each(A,function(E,D){var C=new GLatLng(D.lat,D.lng);var F=new GLatLng(D.seTargetLat,D.nwTargetLon);var B=new GLatLng(D.nwTargetLat,D.seTargetLon);switch(D.markerType){case"presence":var G=D.type;if(D.referenceId==Config.telmeUserId){G="user"}this._addUserMarker(C,D.referenceId,G);break;case"presence-cluster":this._addUserClusterMarker(C,new GLatLngBounds(F,B));break;default:break}}.bind(this))};CoverageMap.prototype._addHotspotMarker=function(A,E,D){var C=this.map.getIcon(D);var B=new GMarker(A,{icon:C});GEvent.addListener(B,"click",function(){this.map.gmap.openInfoWindowHtml(B.getPoint(),"Loading...");var F="/ajaxGetProductOwner/"+E+"/";$.getJSON(F,function(J,I){var H=document.createElement("div");H.appendChild(document.createTextNode("This is an "+J.type+" of "));var G=document.createElement("a");G.setAttribute("href","#");$(G).click(function(){this.showUser(J.owner.id,new GLatLng(J.lat,J.lng))}.bind(this));G.appendChild(document.createTextNode(J.owner.nickname));H.appendChild(G);this.map.gmap.openInfoWindow(B.getPoint(),H)}.bind(this))}.bind(this));B.params={};B.params.productId=E;B.params.type=D;this.map.gmap.addOverlay(B);this._markersHotspots[this._markersHotspots.length]=B;return B};CoverageMap.prototype._addUserMarker=function(A,C,E){var D=this.map.getIcon(E);var B=new GMarker(A,{icon:D});GEvent.addListener(B,"click",function(){this._contactBubble.show(C,B)}.bind(this));B.params={};B.params.userId=C;B.params.type=E;this.map.gmap.addOverlay(B);this._markersUsers[this._markersUsers.length]=B;if(this.showUserInfowindowWhenAvailable==C){this.showUserInfowindowWhenAvailable=0;GEvent.trigger(B,"click")}return B};CoverageMap.prototype._addHotspotClusterMarker=function(B,F){var A=F.getCenter();var E=this.map.gmap.getBoundsZoomLevel(F);if(E%2==0){E--}var D=this.map.getIcon(Map.ICON_TYPE_GROUP_PRODUCT);var C=new GMarker(B,{icon:D});GEvent.addListener(C,"click",function(){this.map.gmap.setCenter(A,E)}.bind(this));this.map.gmap.addOverlay(C);this._markersHotspots[this._markersHotspots.length]=C;return C};CoverageMap.prototype._addUserClusterMarker=function(B,F){var A=F.getCenter();var E=this.map.gmap.getBoundsZoomLevel(F);if(E%2==0){E--}var D=this.map.getIcon(Map.ICON_TYPE_GROUP_USER);var C=new GMarker(B,{icon:D});GEvent.addListener(C,"click",function(){this.map.gmap.setCenter(A,E)}.bind(this));this.map.gmap.addOverlay(C);this._markersUsers[this._markersUsers.length]=C;return C};
function ProfileMap(A,C){this.map=new Map(A,C);this._clickTimeout=null;GEvent.bind(this.map.gmap,"click",this,this.onSingleClick);GEvent.bind(this.map.gmap,"dblclick",this,this.onDoubleClick);var B=this.map.getIcon(Map.ICON_TYPE_USER_MOVABLE);this.presenceMarker=new GMarker(new GLatLng(0,0),{icon:B,draggable:true});this._isPresenceMarkerVisible=false}ProfileMap.prototype.getIsPresenceMarkerVisible=function(){return this._isPresenceMarkerVisible};ProfileMap.prototype.setPresenceMarker=function(B,A){this.presenceMarker.setLatLng(new GLatLng(B,A));if(!this._isPresenceMarkerVisible){this.map.gmap.addOverlay(this.presenceMarker);this._isPresenceMarkerVisible=true}};ProfileMap.prototype.onSingleClick=function(B,A){this._cancelClickTimeout();if(!A){return }this._clickTimeout=window.setTimeout(function(){this.setPresenceMarker(A.lat(),A.lng())}.bind(this),250)};ProfileMap.prototype.onDoubleClick=function(B,A){this._cancelClickTimeout()};ProfileMap.prototype._cancelClickTimeout=function(){if(this._clickTimeout){window.clearTimeout(this._clickTimeout);this._clickTimeout=null}};
function Map(A,B){this.iconsDir=Config.mainHost+"static/image/map-icons/";this._iconTemplates={};$.extend(this,B);this.gmap=new GMap2(A);this.gmap.addControl(new GLargeMapControl());this.gmap.addControl(new GMapTypeControl());this.gmap.setCenter(new GLatLng(0,0),1);this.geocoder=new GClientGeocoder();GEvent.bind(this.gmap,"zoomend",this,this._restrictZoom)}Map.ZOOM_MIN=1;Map.ZOOM_MAX=17;Map.ZOOM_STEP=2;Map.ZOOM_THRESHOLD=7;Map.ICON_TYPE_ABSTRACT_DEFAULT="abstract-default";Map.ICON_TYPE_ABSTRACT_PRODUCT="abstract-product";Map.ICON_TYPE_ABSTRACT_PRODUCT_WIDE="abstract-product-wide";Map.ICON_TYPE_USER="user";Map.ICON_TYPE_USER_MOVABLE="user-movable";Map.ICON_TYPE_GROUP_USER="group-user";Map.ICON_TYPE_GROUP_PRODUCT="group-product";Map.ICON_TYPE_CUSTOMER="customer";Map.ICON_TYPE_TEAM_MEMBER="teammember";Map.ICON_TYPE_PARTNER="partner";Map.ICON_TYPE_TEAM_BUILDER="teambuilder";Map.ICON_TYPE_AIRGATE="airgate";Map.ICON_TYPE_AIRGATEMAX="airgatemax";Map.ICON_TYPE_AIRGATE_AIRBIZ="airgate-airbiz";Map.ICON_TYPE_AIRGATEMAX_AIRBIZ="airgatemax-airbiz";Map.prototype.getIcon=function(A){if(typeof (this._iconTemplates[A])=="undefined"){this._prepareIconTemplate(A)}return new GIcon(this._iconTemplates[A])};Map.prototype._prepareIconTemplate=function(A){var B=null;switch(A){case Map.ICON_TYPE_ABSTRACT_DEFAULT:var C=G_DEFAULT_ICON;B=this._prepareIconTemplateDefault(C);break;case Map.ICON_TYPE_ABSTRACT_PRODUCT:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateProduct(C);break;case Map.ICON_TYPE_ABSTRACT_PRODUCT_WIDE:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateProductWide(C);break;case Map.ICON_TYPE_USER:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"user.gif");break;case Map.ICON_TYPE_USER_MOVABLE:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"user-movable.gif");break;case Map.ICON_TYPE_USER_MOVABLE:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"user-movable.gif");break;case Map.ICON_TYPE_GROUP_USER:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"group-user.gif");break;case Map.ICON_TYPE_GROUP_PRODUCT:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_PRODUCT);B=this._prepareIconTemplateImage(C,"group-product.gif");break;case Map.ICON_TYPE_CUSTOMER:case Map.ICON_TYPE_TEAM_MEMBER:case Map.ICON_TYPE_PARTNER:case Map.ICON_TYPE_TEAM_BUILDER:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"teambuilder.gif");break;case Map.ICON_TYPE_AIRGATE:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_PRODUCT);B=this._prepareIconTemplateImage(C,"airgate.gif");break;case Map.ICON_TYPE_AIRGATEMAX:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_PRODUCT);B=this._prepareIconTemplateImage(C,"airgatemax.gif");break;case Map.ICON_TYPE_AIRGATE_AIRBIZ:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_PRODUCT_WIDE);B=this._prepareIconTemplateImage(C,"airgate-airbiz.gif");break;case Map.ICON_TYPE_AIRGATEMAX_AIRBIZ:var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_PRODUCT_WIDE);B=this._prepareIconTemplateImage(C,"airgatemax-airbiz.gif");break;default:console.log("unknown icon type (using teambuilder instead): ",A);var C=this.getIcon(Map.ICON_TYPE_ABSTRACT_DEFAULT);B=this._prepareIconTemplateImage(C,"teambuilder.gif")}this._iconTemplates[A]=B};Map.prototype._prepareIconTemplateDefault=function(B){var A=new GIcon(B);A.image=this.iconsDir+"teambuilder.gif";A.transparent=this.iconsDir+"transparent.png";A.iconSize=new GSize(26,35);A.iconAnchor=new GPoint(7,35);A.shadow=this.iconsDir+"shadow.png";A.shadowSize=new GSize(44,35);A.imageMap=[0,0,25,0,25,24,18,24,8,34,7,24,0,24];return A};Map.prototype._prepareIconTemplateProduct=function(B){var A=new GIcon(B);A.image=this.iconsDir+"airgate.gif";A.transparent=this.iconsDir+"transparent-product.png";A.iconSize=new GSize(31,35);A.shadow=this.iconsDir+"shadow-product.png";A.shadowSize=new GSize(49,35);A.imageMap=[0,0,30,0,30,24,18,24,8,34,7,24,0,24];return A};Map.prototype._prepareIconTemplateProductWide=function(B){var A=new GIcon(B);A.image=this.iconsDir+"airgate-airbiz.gif";A.transparent=this.iconsDir+"transparent-wide.png";A.iconSize=new GSize(54,35);A.shadow=this.iconsDir+"shadow-wide.png";A.shadowSize=new GSize(72,35);A.imageMap=[3,0,51,0,53,2,53,22,51,24,18,24,8,34,7,34,7,24,3,24,0,21,0,3];return A};Map.prototype._prepareIconTemplateImage=function(B,C){var A=new GIcon(B);A.image=this.iconsDir+C;return A};Map.prototype._restrictZoom=function(B,A){if(B==A){return }if(A<Map.ZOOM_MIN){this.gmap.setZoom(Map.ZOOM_MIN);return }if(A>Map.ZOOM_MAX){this.gmap.setZoom(Map.ZOOM_MAX);return }if(B>A){if(A%2==0){this.gmap.zoomOut();return }}else{if(A%2==0){this.gmap.zoomIn();return }}};Map.prototype.searchLocation=function(A,B){this.geocoder.getLatLng(A,function(C){if(C){this.gmap.setCenter(C,13)}if(typeof (B)=="function"){B(C)}}.bind(this))};
function UsersMap(A,B){this.map=new Map(A,B);this._contactBubble=new MapContactBubble(this.map.gmap);this._userMarkers=[]}UsersMap.prototype.addUserMarker=function(F,B,C,G){var E=G.type||Map.ICON_TYPE_CUSTOMER;var D=this.map.getIcon(E);var A=new GMarker(new GLatLng(F,B),{icon:D});GEvent.addListener(A,"click",function(){this._contactBubble.show(C,A)}.bind(this));A.params=G;A.params.userId=C;this.map.gmap.addOverlay(A);this._userMarkers[this._userMarkers.length]=A;return A};UsersMap.prototype.zoomToMarkers=function(){var C=new GLatLngBounds();$.each(this._userMarkers,function(E,D){C.extend(D.getLatLng())});var A=C.getCenter();var B=this.map.gmap.getBoundsZoomLevel(C);if(B%2==0){B--}if(this._userMarkers.length==1){B=13}this.map.gmap.setCenter(A,B)};UsersMap.prototype.searchUserByNickname=function(B){var A=null;$(this._userMarkers).each(function(D,C){if(C.params&&C.params.nickname&&C.params.nickname.indexOf(B)==0){A=C;return false}});if(!A){return false}GEvent.trigger(A,"click");return true};
function ContactBubble(){}ContactBubble._spinner=null;ContactBubble.getByUserId=function(A,D,B){var C=ContactBubble._prepareParams(B);$.get("/ajaxContactBubbleUser/id/"+A+"/"+C,function(E){ContactBubble.getCallback(E,D)})};ContactBubble.getByUserNickname=function(A,D,B){var C=ContactBubble._prepareParams(B);$.get("/ajaxContactBubbleUser/nickname/"+A+"/"+C,function(E){ContactBubble.getCallback(E,D)})};ContactBubble.getCallback=function(B,C){var A=$(B);$(ContactBubble).trigger("load",A);C(A)};ContactBubble._prepareParams=function(A){var B=[];if(A){B[B.length]="type="+escape(A)}if(B.length>0){B="?"+B.join("&")}else{B=""}return B};ContactBubble.showSpinner=function(A,B){if(ContactBubble._spinner){ContactBubble.hideSpinner()}ContactBubble._spinner=$('<div class="spinner">&nbsp;</div>');$("body").append(ContactBubble._spinner);ContactBubble._spinner.css("position","absolute");ContactBubble._spinner.css("left",A+"px");ContactBubble._spinner.css("top",B+"px")};ContactBubble.hideSpinner=function(){if(ContactBubble._spinner){ContactBubble._spinner.remove();ContactBubble._spinner=null}};ContactBubble.enableVoiceCall=function(B){var A=$(B).find(".voiceIconInactive");A.addClass("voiceIconActive");A.removeClass("voiceIconInactive")};ContactBubble.disableVoiceCall=function(B){var A=$(B).find(".voiceIconActive");A.addClass("voiceIconInactive");A.removeClass("voiceIconActive")};
function PopupContactBubble(){this._delayShow=200;this._delayHide=400;this._target=null;this._newTarget=null;this._timerOver=null;this._timerOut=null;this._popup=null;this._state=PopupContactBubble.STATE_HIDDEN}PopupContactBubble.STATE_HIDDEN="hidden";PopupContactBubble.STATE_LOADING="loading";PopupContactBubble.STATE_VISIBLE="visible";PopupContactBubble.prototype.attach=function(A){$(A).find(".TelmeUser").live("mouseover",this.onMouseOverTrigger.bind(this));$(A).find(".TelmeUser").live("mouseout",this.onMouseOutTrigger.bind(this))};PopupContactBubble.prototype.onMouseOverTrigger=function(B){var A=(this._target&&this._target!=B.target);if(this._state!=PopupContactBubble.STATE_HIDDEN&&!A){this._stopHideTimer()}else{this._newTarget=B.target;this._startShowTimer()}};PopupContactBubble.prototype.onMouseOutTrigger=function(B){var A=(this._target&&this._target!=B.target);if(this._state==PopupContactBubble.STATE_VISIBLE&&!A){this._startHideTimer()}else{this._stopShowTimer();this._hideSpinner();this._state=PopupContactBubble.STATE_HIDDEN}};PopupContactBubble.prototype.onMouseOverPopup=function(A){this._stopHideTimer()};PopupContactBubble.prototype.onMouseOutPopup=function(A){this._startHideTimer()};PopupContactBubble.prototype._startShowTimer=function(){this._timerOver=setTimeout(function(){this._timerOver=null;this.show()}.bind(this),this._delayShow)};PopupContactBubble.prototype._stopShowTimer=function(){if(this._timerOver){clearTimeout(this._timerOver);this._timerOver=null}};PopupContactBubble.prototype._startHideTimer=function(){this._timerOut=setTimeout(function(){this._timerOut=null;this.hide()}.bind(this),this._delayHide)};PopupContactBubble.prototype._stopHideTimer=function(){if(this._timerOut){clearTimeout(this._timerOut);this._timerOut=null}};PopupContactBubble.prototype.show=function(){if(this._state=PopupContactBubble.STATE_VISIBLE){this._stopHideTimer();this.hide()}this._state=PopupContactBubble.STATE_LOADING;this._target=this._newTarget;this._newTarget=null;var B=$(this._target);var A=B.text();ContactBubble.getByUserNickname(A,function(C){if(this._state!=PopupContactBubble.STATE_LOADING){return }this._state=PopupContactBubble.STATE_VISIBLE;this._hideSpinner();this._doShow(C)}.bind(this),"popup");this._showSpinner()};PopupContactBubble.prototype.hide=function(){this._state=PopupContactBubble.STATE_HIDDEN;this._hideSpinner();this._doHide();this._target=null};PopupContactBubble.prototype._doShow=function(C){var B=$(this._target);var A=B.offset().left+B.width();var D=B.offset().top;this._popup=$(C);this._popup.mouseover(this.onMouseOverPopup.bind(this));this._popup.mouseout(this.onMouseOutPopup.bind(this));$("body").append(this._popup);A-=39;D-=this._popup.children().height()+45;this._popup.css("left",A+"px");this._popup.css("top",D+"px")};PopupContactBubble.prototype._doHide=function(A){if(this._popup){this._popup.remove();this._popup=null}};PopupContactBubble.prototype._showSpinner=function(){if(!this._target){return }var B=$(this._target);var A=B.offset().left+B.width();var C=B.offset().top;ContactBubble.showSpinner(A,C)};PopupContactBubble.prototype._hideSpinner=function(){ContactBubble.hideSpinner()};
function MapContactBubble(A){this._map=A}MapContactBubble.prototype.show=function(B,A){ContactBubble.getByUserId(B,function(C){this._hideSpinner();this._doShow(B,A,C)}.bind(this));this._showSpinner(A)};MapContactBubble.prototype._doShow=function(E,C,D){var B=$(D);B.addClass("map-contact-bubble");var A=$("<div />");A.append(B);this._map.openInfoWindowHtml(C.getPoint(),A.html())};MapContactBubble.prototype._showSpinner=function(B){var C=this._map.fromLatLngToContainerPixel(B.getLatLng());var A=$(this._map.getContainer());C.x+=A.offset().left-7;C.y+=A.offset().top-8;ContactBubble.showSpinner(C.x,C.y)};MapContactBubble.prototype._hideSpinner=function(A){ContactBubble.hideSpinner()};
if(typeof (console)=="undefined"){console={log:function(){}}}var IS_PRODUCTION=true;var isFlashphoneJsReady=false;var isFlashphoneSwfReady=false;var isFlashphoneLoggedIn=false;var isFlashphoneInCall=false;function isFlashphoneContainerReady(){return isFlashphoneJsReady}function isFlashphoneReady(){return isFlashphoneJsReady}function setIsFlashphoneJsReadyTrue(){isFlashphoneJsReady=true}function getFlashphone(){if(navigator.appName.indexOf("Microsoft")!=-1){return window.flashphone}else{return document.flashphone}}function updateFlashphoneStatus(A){$("#flashphoneStatusDiv").html(A);console.log("status: "+A)}function setFlashphoneSWFIsReady(){updateFlashphoneStatus("SWF ready");if(IS_PRODUCTION){window.isFlashphoneSwfReady=true;if(Config.flashphoneAutoLogin=="true"){performLoginWithCookie(Config.telmeUserNickname)}}}function showFlashphone(A){if(A){console.log("show");$("#flashphoneDiv").css("margin-left","0px").css("width","450px").css("height","190px").css("z-index","10000").css("right","0px").css("visibility","inherit");if(!$("#grayLayer").length){var B=$('<div style="position: fixed; width:100%; height: 100%; background-color: #000; left:0; top:0; z-index:3500;" id="grayLayer"/>');B.css("opacity","0.5");$("#flashphoneDiv").after(B)}}else{console.log("hide");$("#grayLayer").remove();$("#flashphoneDiv").css("margin-right","-3200px").css("width","0px").css("height","0px").css("visibility","hidden")}}function createBackdrop(){if($("#overlayModal").attr("id")){return }backdropOverlay=$("<div>").attr("id","overlayModal").css({opacity:0.5,height:"100%",width:"100%",position:"fixed",backgroundColor:"black",left:0,top:0,zIndex:9998}).hide().appendTo("body");backdropContainer=$("<div>").attr("id","containerModal").css({position:"fixed",zIndex:9999}).append('<a class="modalCloseImg" title="close"></a>').hide().appendTo("body")}function showBackdrop(A){if(A){backdropOverlay.show();backdropContainer.show()}else{backdropOverlay.hide();backdropContainer.hide()}}function showCallPane(A){if(A){$("#callPane").show()}else{$("#overlayModal").hide();$("#callPane").hide()}}function showLoginPane(A){if(A){$("#flashphoneLoginPane").show()}else{$("#flashphoneLoginPane").hide()}}function notifyCallConnected(){updateFlashphoneStatus("connected")}function notifyCallFailed(A){updateFlashphoneStatus("Failed: "+A)}function notifyCallRinging(){updateFlashphoneStatus("ringing")}function notifyCallHangup(){updateFlashphoneStatus("hangup")}function notifyCallTrying(){updateFlashphoneStatus("call trying")}function notifyCallIncoming(){console.log("notifyCallIncoming");updateFlashphoneStatus("incoming call");window.isFlashphoneInCall=true;showFlashphone(true)}function notifyIngoreCall(){console.log("notifyIgnoreCall");window.isFlashphoneInCall=false;updateFlashphoneStatus("Call ignored");showFlashphone(false)}function notifyHangupCall(){updateFlashphoneStatus("Call hung up");console.log("notifyHangupCall");window.isFlashphoneInCall=false;showFlashphone(false)}function performLoginWithCookie(A){console.log("performLoginWithCookie");if(!window.isFlashphoneSwfReady){var B=300;console.log("SWF not ready yet, will try in ",B,"ms");window.setTimeout(function(){performLoginWithCookie(A)},B);return }var C=$.cookie("PHPSESSID");if(C){updateFlashphoneStatus("Logging in... as "+A+" with session ID "+C);performLogin(A,"WEBCLIENT-"+C)}else{updateFlashphoneStatus("Cannot log you in with session")}}function performLogin(A,B){console.log("performLogin");window.isFlashphoneLoggedIn=false;window.isFlashphoneInCall=false;updateFlashphoneStatus("Logging in... as "+A+"/"+B);getFlashphone().handleLogin(A,B)}function performLogout(){console.log("performLogout");window.isFlashphoneInCall=false;window.isFlashphoneLoggedIn=false;updateFlashphoneStatus("logging out");getFlashphone().handleLogout();updateFlashphoneStatus("logged out");showFlashphone(false);showLoginPane(true);showCallPane(false)}function notifyLoginSuccess(){window.isFlashphoneLoggedIn=true;console.log("notifyLoginSuccess");updateFlashphoneStatus("Logged in!");showLoginPane(false);showCallPane(true);showFlashphone(false)}function makeCall(A){if(!window.isFlashphoneInCall){window.isFlashphoneInCall=true;console.log("makeCall");showFlashphone(true);getFlashphone().handleMakeCall(A);updateFlashphoneStatus("New call "+A)}}function hangupCall(){console.log("hangupCall");window.isFlashphoneInCall=false;updateFlashphoneStatus("hanging call");getFlashphone().handleHangupCall()}function notifyClose(A){console.log("notifyClose");window.isFlashphoneInCall=false;updateFlashphoneStatus("Call closed");showFlashphone(false)}function closeFlashphone(){console.log("closeFlashphone");window.isFlashphoneInCall=false;getFlashphone().handleClose()}function startFlashphone(B){var A=1;var C="<a href='#'  style='color: black' onclick='closeFlashphone(); return false;'>close</a>"+AC_FL_RunContent("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0","width","435","height","170","src","flash phone","quality","high","pluginspage","http://www.macromedia.com/go/getflashplayer","play","true","loop","true","scale","noborder","FlashVars","seed="+A,"wmode","window","devicefont","false","id","flashphone","name","flashphone","menu","true","allowScriptAccess","always","movie",B,"salign","","bgcolor","#ffffff");$("#flashphoneDiv").html(C);setIsFlashphoneJsReadyTrue()}function flashphoneBeforeUnload(A){console.log("flashphoneBeforeUnload");if(window.isFlashphoneInCall&&!confirm("Navigating from this page will hang up your current call. Do you wish to continue?")){A.preventDefault()}}function flashphoneBindToContactBubble(D,C){console.log("flashphoneBindToContactBubble");var B=null;if(window.isFlashphoneLoggedIn){ContactBubble.enableVoiceCall(C);B=$(C).find(".voiceIconActive")}else{ContactBubble.disableVoiceCall(C);B=$(C).find(".voiceIconInactive")}var A=$(C).find(".contactBubbleNickname").html();B.live("click",function(){if(window.isFlashphoneLoggedIn){makeCall(A)}})}if(IS_PRODUCTION){$(function(){$(window).bind("beforeunload",flashphoneBeforeUnload);$(ContactBubble).bind("load",flashphoneBindToContactBubble)})};
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var A;var B;var C;try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");A=B.GetVariable("$version")}catch(C){}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");A="WIN 6,0,21,0";B.AllowScriptAccess="always";A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A="WIN 3,0,18,0"}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");A="WIN 2,0,0,11"}catch(C){A=-1}}return A}function GetSwfVer(){var G=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var F=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var A=navigator.plugins["Shockwave Flash"+F].description;var E=A.split(" ");var C=E[2].split(".");var H=C[0];var B=C[1];if(E[3]!=""){tempArrayMinor=E[3].split("r")}else{tempArrayMinor=E[4].split("r")}var D=tempArrayMinor[1]>0?tempArrayMinor[1]:0;var G=H+"."+B+"."+D}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){G=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){G=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){G=2}else{if(isIE&&isWin&&!isOpera){G=ControlVersion()}}}}}return G}function DetectFlashVer(F,D,C){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var E=versionArray[0];var A=versionArray[1];var B=versionArray[2];if(E>parseFloat(F)){return true}else{if(E==parseFloat(F)){if(A>parseFloat(D)){return true}else{if(A==parseFloat(D)){if(B>=parseFloat(C)){return true}}}}}return false}}}function AC_AddExtension(B,A){if(B.indexOf("?")!=-1){return B.replace(/\?/,A+"?")}else{return B+A}}function AC_Generateobj(E,D,A){var C="";if(isIE&&isWin&&!isOpera){C+="<object ";for(var B in E){C+=B+'="'+E[B]+'" '}for(var B in D){C+='><param name="'+B+'" value="'+D[B]+'" /> '}C+="></object>"}else{C+="<embed ";for(var B in A){C+=B+'="'+A[B]+'" '}C+="> </embed>"}return C}function AC_FL_RunContent(){var A=AC_GetArgs(arguments,"movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");return AC_Generateobj(A.objAttrs,A.params,A.embedAttrs)}function AC_GetArgs(B,F,D,G){var A=new Object();A.embedAttrs=new Object();A.params=new Object();A.objAttrs=new Object();for(var C=0;C<B.length;C=C+2){var E=B[C].toLowerCase();switch(E){case"classid":break;case"pluginspage":A.embedAttrs[B[C]]=B[C+1];break;case"src":case"movie":A.embedAttrs.src=B[C+1];A.params[F]=B[C+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":A.objAttrs[B[C]]=B[C+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":A.embedAttrs[B[C]]=A.objAttrs[B[C]]=B[C+1];break;default:A.embedAttrs[B[C]]=A.params[B[C]]=B[C+1]}}A.objAttrs.classid=D;if(G){A.embedAttrs.type=G}return A};
function goIntoTheSystem(A){checkJavaScriptLoaded();if(!errorFlag){document.location.replace(A)}};
