/*  MLMLeadSystemPRO(R) Website Javascript
 *  (c) 2008-2010 Upward Enterprises, LLC - http://www.mlmleadsystempro.com/
 *  
 *  Distribution of this script is strictly prohibited. 
 *--------------------------------------------------------------------------*/
var UA=navigator.userAgent.toLowerCase();var MLSPPopup=Class.create({Version:"1.7.7",client:{isIE:UA.indexOf("msie")>-1,isIE6:UA.indexOf("msie 6")>-1,isIE7:UA.indexOf("msie 7")>-1,isGecko:UA.indexOf("gecko")>-1&&UA.indexOf("safari")==-1,isWebkit:UA.indexOf("applewebkit/")>-1,isWindows:UA.indexOf("windows")>-1||UA.indexOf("win32")>-1,isMac:UA.indexOf("macintosh")>-1||UA.indexOf("mac os x")>-1,isLinux:UA.indexOf("linux")>-1},options:{popupWidth:500,popupHeight:500,resizeDuration:0,fadeDuration:0,animateFade:false,overlayColor:"#333333",initialHeight:300,initialWidth:300,displayNav:false,onClose:function(){},onFinish:function(){},onOpen:function(){},popupID:0,memberID:0,campaignID:0,campaignGroupID:0,userID:0,messageDiv:"popupMsg",debug:true},operations:{onSuccess:function(){},onFailure:function(){if(arguments.length>0){alert($A(arguments).first())}}},WRO:true,displayCount:0,initialize:function(b){var a=this._wr.bind(this);b=b||{};if(b){this._applyProps(this.options,b)}this._callCheck("dck",{host:location.host},{onSuccess:function(){},onFailure:a});Event.observe(window,"load",this._initShadowbox.bind(this))},_initShadowbox:function(){Shadowbox.init({skipSetup:true,adapter:"prototype",language:"en",useSizzle:false,enableKeys:false,displayNav:this.options.displayNav,overlayColor:this.options.overlayColor,resizeDuration:this.options.resizeDuration,animateFade:this.options.animateFade,fadeDuration:this.options.fadeDuration,initialHeight:this.options.initialHeight,initialWidth:this.options.initialWidth,onClose:this.options.onClose,onFinish:this.options.onFinish,onOpen:this.options.onOpen,players:["html","iframe"]})},showPopup:function(c){var a=this.options.popupWidth;var b=this.options.popupHeight;var d="html";if(!this.WRO){return}if(arguments.length>1){if(parseInt(arguments[1])>0){a=parseInt(arguments[1])}}if(arguments.length>2){if(parseInt(arguments[2])>0){b=parseInt(arguments[2])}}if(arguments.length>3){d=arguments[3]}if(d=="html"){Shadowbox.open({content:"<div class='sbWrapper' id='mlspPopup"+this.options.popupID+"'>"+c+"</div>",player:"html",title:"",width:a,height:b})}else{if(d=="iframe"){Shadowbox.open({content:c,player:"iframe",title:"",width:a,height:b})}}this.displayCount++;if((this.options.popupID>0)&&(this.displayCount==1)){this._callCheck("popupDisplay",{popupID:this.options.popupID,memberID:this.options.memberID,campaignID:this.options.campaignID,campaignGroupID:this.options.campaignGroupID,userID:this.options.userID},{onFailure:function(){}})}},closePopup:function(){Shadowbox.close()},_callCheck:function(d,c,b){var a=this._message.bind(this);c=c||{};b=b||{};c.rand=this._generateRandom();b=this._setProps(this.operations,b);new Ajax.Request("/ajax/"+d+"/",{method:"get",parameters:c,onSuccess:function(e){if(e.responseText.strip()=="success"){b.onSuccess()}else{b.onFailure(e.responseText)}},onFailure:function(e){b.onFailure(e.responseText)},onException:function(e){b.onFailure(e.responseText)}})},_wr:function(){this.WRO=false},_message:function(b){var a="";if(this.options.debug){a=$(this.options.messageDiv);if(a){a.update(b)}else{alert(b)}}},_generateRandom:function(){return parseInt(Math.random()*99999999)},_applyProps:function(c,a){for(var b in a){c[b]=a[b]}return c},_setProps:function(d,b){var a=Object.clone(d);for(var c in b){a[c]=b[c]}return a}});var MLSPMousePopup=Class.create(MLSPPopup,{yAxisOffset:30,xAxisOffset:40,lastDisplayTime:0,properties:{startDelaySecs:5,delayTimerSecs:20},initialize:function($super,a,b){$super(b);this.contentDiv=a;b=b||{};if(b){this._applyProps(this.properties,b)}},_checkMousePopUp:function(b){var d="";var a=new Date().getTime();var c=document.viewport.getScrollOffsets();if((Event.pointerY(b)<(this.yAxisOffset+c.top))&&(Event.pointerX(b)>this.xAxisOffset)&&(Event.pointerX(b)<(document.viewport.getWidth()-this.xAxisOffset))&&!Shadowbox.isOpen()){d=$(this.contentDiv);if(d){if(((a-this.lastDisplayTime)/1000)>this.properties.delayTimerSecs){this.lastDisplayTime=a;this.showPopup(d.innerHTML)}}}},start:function(){Event.observe(window,"load",this._enableMouseObserver.bind(this))},_enableMouseObserver:function(){this.lastDisplayTime=new Date().getTime()-(this.properties.delayTimerSecs*1000)+(this.properties.startDelaySecs*1000);Event.observe(document,"mousemove",this._checkMousePopUp.bind(this))}});var MLSPNavPopup=Class.create(MLSPPopup,{initialize:function($super,b,a,c){$super(c);this.contentDiv=b;this.cancelMsg=a},_checkNavPopUp:function(a){var b=$(this.contentDiv);if(b){this.showPopup(b.innerHTML);if(this.client.isIE){window.onbeforeunload=null}}return this.cancelMsg},_enableExits:function(c){var b=$$("a");var a=$$("input");if(b){b.each(function(d){d.observe("click",function(){window.onbeforeunload=null})})}if(a){a.each(function(g){var d=false;try{if((g.type.toLowerCase()=="submit")||(g.type.toLowerCase()=="image")){d=true}}catch(f){}if(d){g.observe("click",function(){window.onbeforeunload=null})}})}window.onbeforeunload=this._checkNavPopUp.bind(this)},start:function(){Event.observe(window,"load",this._enableExits.bind(this))}});
