var MMAppStore,MMBanner,MMBrand,MMBridgeObject,MMCachedVideo,MMCalendar,MMCommand,MMDevice,MMFileManager,MMInlineVideo,MMInterstitial,MMJS,MMJSUtils,MMMedia,MMNotification,MMPassbook,MMPasteboard,MMSDKInterface,MMSocial,MRAID,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor();child.__super__=parent.prototype;return child;};String.prototype.trim=function(){return this.replace(RegExp("^\\s+|\\s+$","g"),"");};String.prototype.titleCase=function(){return this.replace(RegExp("\\w\\S*","g"),function(str){return str.charAt(0).toUpperCase().concat(str.substr(1).toLowerCase());});};if(typeof MMJS===typeof void 0){MMJSUtils=(function(){function MMJSUtils(){} MMJSUtils.ios_version=null;MMJSUtils.platform=null;MMJSUtils.sdk_version=null;MMJSUtils.params=null;MMJSUtils.isBridgeEnabled=function(){if(MMDevice.readyState!=="unknown"){return true;} return false;};MMJSUtils.isPre46=function(a){if(this.isBridgeEnabled()===true){return false;} if(a==null){return true;} return this.underVersion(a,"4.6.0");};MMJSUtils.underVersion=function(versionString,minVersion){var i,res,result,v1,v2;if(versionString==null){return false;} v1=versionString.split(".");v2=minVersion.split(".");i=0;result=0;while(i0){url+="?"+query_args.join("&");}} MMJS.utils.consoleLog(url);this.url=url;this;} MMCommand.prototype.perform=function(){var iframe;this.utils.consoleLog("perform platform: "+this.platform);this.utils.consoleLog("current window.location: "+window.location);MMJS.executingCommand=true;this.utils.consoleLog("window.location: "+this.url);this.utils.consoleLog("Setting executingCommand = true: ");iframe=document.createElement("IFRAME");iframe.setAttribute("src",this.url);document.documentElement.appendChild(iframe);iframe.parentNode.removeChild(iframe);return iframe=null;};return MMCommand;})();MMBridgeObject=(function(){MMBridgeObject.className=null;function MMBridgeObject(){var m;this.utils=MMJS.utils;m=this.constructor.toString().match(/^\s*function\s+([^\s\(]+)/);if(m){this.className=m[1];}} MMBridgeObject.prototype.enqueue=function(method,params){MMJS.enqueueCommand(new MMCommand(this.className+"."+method,params));return true;};return MMBridgeObject;})();MMDevice=(function(_super){__extends(MMDevice,_super);function MMDevice(){return MMDevice.__super__.constructor.apply(this,arguments);} MMDevice.loadState="standby";MMDevice.loadTimeout=0;MMDevice.connection=null;MMDevice.prototype.setNetworkConnection=function(network){return this.connection=network;};MMDevice.prototype.setInfo=function(info){var evt,key,value;for(key in info){value=info[key];this[key]=value;} MMDevice.loadState="loaded";if(!this.utils.isWindows()){evt="deviceLoaded";this.utils.postEvent(evt);evt="deviceloaded";this.utils.postEvent(evt);} return true;};MMDevice.prototype.getInfo=function(callback){MMDevice.loadState="loading";return this.enqueue("getInfo",{callback:callback});};MMDevice.prototype.setMMDID=function(mmdid,callback){return this.enqueue("setMMDID",{mmdid:mmdid,callback:callback});};MMDevice.prototype.getAvailableSchemes=function(callback){return this.enqueue("getAvailableSchemes",{callback:callback});};MMDevice.prototype.isSchemeAvailable=function(scheme,callback){return this.enqueue("isSchemeAvailable",{scheme:scheme,callback:callback});};MMDevice.prototype.getAvailableSchemes=function(callback){return this.enqueue("getAvailableSchemes",{callback:callback});};MMDevice.prototype.getOrientation=function(callback){return this.enqueue("getOrientation",{callback:callback});};MMDevice.prototype.getLocation=function(callback){return this.enqueue("getLocation",{callback:callback});};MMDevice.prototype.showMap=function(location,callback){return this.enqueue("showMap",{location:location,callback:callback});};MMDevice.prototype.call=function(number,dial,callback){return this.enqueue("call",{number:number,callback:callback,dial:dial});};MMDevice.prototype.openUrl=function(url,callback){return this.enqueue("openUrl",{url:url,callback:callback});};MMDevice.prototype.openAppStore=function(appId,callback){return this.enqueue("openAppStore",{appId:appId,callback:callback});};MMDevice.prototype.composeSMS=function(number,message,callback){return this.composeSms(number,message,callback);};MMDevice.prototype.composeSms=function(number,message,callback){if(this.utils.isIOS()){return this.enqueue("composeSms",{number:number,message:message,callback:callback});}else{return this.enqueue("composeSms",{number:number,message:message,callback:callback});}};MMDevice.prototype.composeEmail=function(recipient,subject,message,callback){if(this.utils.isIOS()){return this.openUrl("mailto:?to="+encodeURIComponent(recipient)+"&subject="+encodeURIComponent(subject)+"&body="+encodeURIComponent(message),callback);}else{return this.enqueue("composeEmail",{recipient:recipient,subject:subject,message:message,callback:callback});}};MMDevice.prototype.getCompassHeading=function(callback){return this.enqueue("getCompassHeading",{callback:callback});};MMDevice.prototype.getBarometer=function(callback){return this.enqueue("getBarometer",{callback:callback});};MMDevice.prototype.enableHardwareAcceleration=function(enabled,callback){return this.enqueue("enableHardwareAcceleration",{enabled:enabled,callback:callback});};return MMDevice;})(MMBridgeObject);MMMedia=(function(_super){__extends(MMMedia,_super);function MMMedia(){return MMMedia.__super__.constructor.apply(this,arguments);} MMMedia.prototype.openFrontCamera=function(constrainWidth,constrainHeight,contentMode,callback){return this.enqueue("getPicture",{sourceType:'Camera',constrainWidth:constrainWidth,constrainHeight:constrainHeight,contentMode:contentMode,front:true,callback:callback});};MMMedia.prototype.openRearCamera=function(constrainWidth,constrainHeight,contentMode,callback){return this.enqueue("getPicture",{sourceType:'Camera',constrainWidth:constrainWidth,constrainHeight:constrainHeight,contentMode:contentMode,front:false,callback:callback});};MMMedia.prototype.getPicture=function(sourceType,constrainWidth,constrainHeight,contentMode,callback){return this.enqueue("getPicture",{sourceType:sourceType,constrainWidth:constrainWidth,constrainHeight:constrainHeight,contentMode:contentMode,callback:callback});};MMMedia.prototype.writeToPhotoLibrary=function(path,title,description,callback){return this.enqueue("writeToPhotoLibrary",{path:path,title:title,description:description,callback:callback});};MMMedia.prototype.isSourceTypeAvailable=function(sourceType,callback){return this.enqueue("isSourceTypeAvailable",{sourceType:sourceType,callback:callback});};MMMedia.prototype.availableSourceTypes=function(callback){return this.enqueue("availableSourceTypes",{callback:callback});};MMMedia.prototype.playVideo=function(path,callback){return this.enqueue("playVideo",{path:path,callback:callback});};MMMedia.prototype.playAudio=function(path,callback){return this.enqueue("playAudio",{path:path,"repeat":false,callback:callback});};MMMedia.prototype.playAudio=function(path,repeat,callback){return this.enqueue("playAudio",{path:path,repeat:repeat,callback:callback});};MMMedia.prototype.stopAudio=function(callback){return this.enqueue("stopAudio",{callback:callback});};MMMedia.prototype.playSound=function(path,callback){return this.enqueue("playSound",{path:path,callback:callback});};return MMMedia;})(MMBridgeObject);MMCalendar=(function(_super){__extends(MMCalendar,_super);function MMCalendar(){return MMCalendar.__super__.constructor.apply(this,arguments);} MMCalendar.prototype.addEvent=function(parameters,callback){return this.enqueue("addEvent",{"parameters":JSON.stringify(parameters),callback:callback});};return MMCalendar;})(MMBridgeObject);MMBanner=(function(_super){__extends(MMBanner,_super);function MMBanner(){return MMBanner.__super__.constructor.apply(this,arguments);} MMBanner.prototype.resize=function(parameters,callback){parameters["callback"]=callback;return this.enqueue("resize",parameters);};return MMBanner;})(MMBridgeObject);MMNotification=(function(_super){__extends(MMNotification,_super);function MMNotification(){return MMNotification.__super__.constructor.apply(this,arguments);} MMNotification.prototype.alert=function(title,message,cancelButton,buttons,callback){var params;params={title:title,message:message,cancelButton:cancelButton,callback:callback};if(buttons!=null){if(buttons!==""&&buttons!==null){params["buttons"]=buttons;}} return this.enqueue("alert",params);};MMNotification.prototype.vibrate=function(duration,callback){return this.enqueue("vibrate",{duration:duration,callback:callback});};return MMNotification;})(MMBridgeObject);MMFileManager=(function(_super){__extends(MMFileManager,_super);function MMFileManager(){return MMFileManager.__super__.constructor.apply(this,arguments);} MMFileManager.prototype.getFreeDiskSpace=function(callback){return this.enqueue("getFreeDiskSpace",{callback:callback});};MMFileManager.prototype.getDirectoryContents=function(path,callback){return this.enqueue("getDirectoryContents",{path:path,callback:callback});};MMFileManager.prototype.getFileContents=function(path,callback){return this.enqueue("getFileContents",{path:path,callback:callback});};MMFileManager.prototype.writeData=function(data,path,callback){return this.enqueue("writeData",{data:data,path:path,callback:callback});};MMFileManager.prototype.moveFile=function(fromPath,toPath,callback){return this.enqueue("moveFile",{fromPath:fromPath,toPath:toPath,callback:callback});};MMFileManager.prototype.removeAtPath=function(path,callback){return this.enqueue("removeAtPath",{path:path,callback:callback});};MMFileManager.prototype.downloadFile=function(url,path,callback){return this.enqueue("downloadFile",{url:url,path:path,callback:callback});};return MMFileManager;})(MMBridgeObject);MMInlineVideo=(function(_super){__extends(MMInlineVideo,_super);function MMInlineVideo(){return MMInlineVideo.__super__.constructor.apply(this,arguments);} MMInlineVideo.prototype.updateVideoSeekTime=function(currentSeekTime){if(this.timingCallback!=null){return this.timingCallback(currentSeekTime);}};MMInlineVideo.prototype.setTimingCallback=function(_timingCallback){return this.timingCallback=_timingCallback;};MMInlineVideo.prototype.playVideo=function(callback){return this.enqueue("playVideo",{callback:callback});};MMInlineVideo.prototype.stopVideo=function(callback){return this.enqueue("stopVideo",{callback:callback});};MMInlineVideo.prototype.pauseVideo=function(callback){return this.enqueue("pauseVideo",{callback:callback});};MMInlineVideo.prototype.resumeVideo=function(callback){return this.enqueue("resumeVideo",{callback:callback});};MMInlineVideo.prototype.removeVideo=function(callback){return this.enqueue("removeVideo",{callback:callback});};MMInlineVideo.prototype.setStreamVideoSource=function(streamVideoURI,callback){return this.enqueue("setStreamVideoSource",{streamVideoURI:streamVideoURI,callback:callback});};MMInlineVideo.prototype.adjustVideo=function(callback){return this.adjustVideoWithId('inlineVideo',callback);};MMInlineVideo.prototype.adjustVideoWithId=function(divId,callback){var frame,videoEl;videoEl=document.getElementById(divId);if(videoEl!=null){frame=this.calculateDivPosition(divId);frame["callback"]=callback;return this.enqueue("adjustVideo",frame);}else{return callback({"result":0,"response":"Div Id not found","class":"MMInlineVideo","call":"insertVideo"});}};MMInlineVideo.prototype.insertVideoWithId=function(divId,timingCallback,callback){var autoPlay,bodyHeight,bodyWidth,cachedVideoID,cachedVideoURI,frame,height,showControls,streamVideoURI,touchCallback,videoEl,width,x,y;videoEl=document.getElementById(divId);if(videoEl!=null){frame=this.calculateDivPosition(divId);if(timingCallback!=null){this.setTimingCallback(timingCallback);} x=frame['x'];y=frame['y'];width=frame['width'];height=frame['height'];bodyWidth=document.body.clientWidth;bodyHeight=document.body.clientHeight;cachedVideoURI=videoEl.getAttribute("cachedVideoURI");cachedVideoID =videoEl.getAttribute("cachedVideoID");touchCallback=videoEl.getAttribute("onTouch");streamVideoURI=videoEl.getAttribute("streamVideoURI");autoPlay=videoEl.getAttribute("autoPlay");showControls=videoEl.getAttribute("showControls");if(cachedVideoURI||streamVideoURI){return this.enqueue("insertVideo",{x:x,y:y,width:width,height:height,bodyWidth:bodyWidth,bodyHeight:bodyHeight,cachedVideoURI:cachedVideoURI,streamVideoURI:streamVideoURI,touchCallback:touchCallback,cachedVideoID:cachedVideoID,autoPlay:autoPlay,showControls:showControls,callback:callback});}else{return callback({"result":0,"response":"cachedVideoURI or streamVideoURI not found","class":"MMInlineVideo","call":"insertVideo"});}}else{return callback({"result":0,"response":"Div Id not found","class":"MMInlineVideo","call":"insertVideo"});}};MMInlineVideo.prototype.insertVideo=function(timingCallback,callback){return this.insertVideoWithId('inlineVideo',timingCallback,callback);};MMInlineVideo.prototype.calculateDivPosition=function(divId){var divEl,height,position,width,x,y;divEl=document.getElementById(divId);position=this.utils.offset(divEl);x=position[0];y=position[1];width=divEl.offsetWidth;height=divEl.offsetHeight;return{x:x,y:y,width:width,height:height};};return MMInlineVideo;})(MMBridgeObject);MMCachedVideo=(function(_super){__extends(MMCachedVideo,_super);function MMCachedVideo(){return MMCachedVideo.__super__.constructor.apply(this,arguments);} MMCachedVideo.timingCallback=null;MMCachedVideo.errorCallback=null;MMCachedVideo.prototype.updateVideoSeekTime=function(currentSeekTime){if(this.timingCallback!=null){return this.timingCallback(currentSeekTime);}};MMCachedVideo.prototype.setTimingCallback=function(timingCallback){return this.timingCallback=timingCallback;};MMCachedVideo.prototype.setError=function(error){if(this.errorCallback!=null){return this.errorCallback(error);}};MMCachedVideo.prototype.setErrorCallback=function(errorCallback){return this.errorCallback=errorCallback;};MMCachedVideo.prototype.restartVideo=function(callback){return this.enqueue("restartVideo",{callback:callback});};MMCachedVideo.prototype.endVideo=function(callback){return this.enqueue("endVideo",{callback:callback});};MMCachedVideo.prototype.pauseVideo=function(callback){return this.enqueue("pauseVideo",{callback:callback});};MMCachedVideo.prototype.playVideo=function(callback){return this.enqueue("playVideo",{callback:callback});};MMCachedVideo.prototype.availableCachedVideos=function(callback){return this.enqueue("availableCachedVideos",{callback:callback});};MMCachedVideo.prototype.playCachedVideo=function(videoId,callback){return this.enqueue("playCachedVideo",{videoId:videoId,callback:callback});};MMCachedVideo.prototype.cacheVideo=function(url,callback){return this.enqueue("cacheVideo",{url:url,callback:callback});};MMCachedVideo.prototype.videoIdExists=function(videoId,callback){return this.enqueue("videoIdExists",{videoId:videoId,callback:callback});};return MMCachedVideo;})(MMBridgeObject);MMInterstitial=(function(_super){__extends(MMInterstitial,_super);function MMInterstitial(){return MMInterstitial.__super__.constructor.apply(this,arguments);} MMInterstitial.animationTypes={"ios":["curl","flip","dissolve","slideup","none"],"android":["slideup","slidedown","explode","none"],"windows":["slideup","slidedown","explode","none"]};MMInterstitial.prototype.close=function(callback){return this.enqueue("close",{callback:callback});};MMInterstitial.prototype.open=function(url,callback){return this.enqueue("open",{url:url,callback:callback});};MMInterstitial.prototype.useCustomClose=function(useCustomClose,callback){return this.enqueue("useCustomClose",{useCustomClose:useCustomClose,callback:callback});}; MMInterstitial.prototype.setOrientation=function(properties,callback){properties["callback"]=callback;return this.enqueue("setOrientation",properties);};MMInterstitial.prototype.expandToExternalBrowser=function(url,callback){return this.enqueue("expandToExternalBrowser",{url:url,callback:callback});};MMInterstitial.prototype.expandWithProperties=function(url,properties,callback){var key,params,transitionType,value;params={callback:callback};if(url!=null){params["url"]=url;} MMJS.utils.consoleLog("expandWithProperties properties "+JSON.stringify(properties));if(properties!=null){for(key in properties){if(!__hasProp.call(properties,key))continue;value=properties[key];if(key==="transition"){transitionType=value;params[key]=transitionType;}else{params[key]=value;}}} return this.enqueue("expandWithProperties",params);};return MMInterstitial;})(MMBridgeObject);MMBrand=(function(_super){__extends(MMBrand,_super);function MMBrand(){return MMBrand.__super__.constructor.apply(this,arguments);} MMBrand.prototype.getInfo=function(callback){return this.enqueue("getInfo",{callback:callback});};return MMBrand;})(MMBridgeObject);MMAppStore=(function(_super){__extends(MMAppStore,_super);function MMAppStore(){return MMAppStore.__super__.constructor.apply(this,arguments);} MMAppStore.prototype.loadApp=function(appId,callback){return this.enqueue("loadApp",{appId:appId,callback:callback});};return MMAppStore;})(MMBridgeObject);MMPasteboard=(function(_super){__extends(MMPasteboard,_super);function MMPasteboard(){ return MMPasteboard.__super__.constructor.apply(this,arguments);} MMPasteboard.prototype.getPasteboardContents=function(pasteboardId,callback){var args;args={callback:callback};if(pasteboardId!=null){args["pasteboardId"]=pasteboardId;} return this.enqueue("getPasteboardContents",args);};MMPasteboard.prototype.writeToPasteboard=function(data,pasteboardId,callback){var args;args={data:data,callback:callback};if(pasteboardId!=null){args["pasteboardId"]=pasteboardId;} return this.enqueue("writeToPasteboard",args);};return MMPasteboard;})(MMBridgeObject);MMPassbook=(function(_super){__extends(MMPassbook,_super);function MMPassbook(){return MMPassbook.__super__.constructor.apply(this,arguments);} MMPassbook.prototype.isPassbookAvailable=function(callback){return this.enqueue("isPassbookAvailable",{callback:callback});};MMPassbook.prototype.addPassFromURL=function(url,callback){return this.enqueue("addPassFromURL",{url:url,callback:callback});};MMPassbook.prototype.isPassInstalled=function(url,identifier,serial,callback){if(url!=null){return this.enqueue("isPassInstalled",{url:url,callback:callback});}else{return this.enqueue("isPassInstalled",{identifier:identifier,serial:serial,callback:callback});}};MMPassbook.prototype.isPassURLInstalled=function(url,callback){return this.isPassInstalled(url,null,null,callback);};MMPassbook.prototype.isPassIdentifierInstalled=function(identifier,serial,callback){return this.isPassInstalled(null,identifier,serial,callback);};return MMPassbook;})(MMBridgeObject);MMSocial =(function(_super){__extends(MMSocial,_super);function MMSocial(){return MMSocial.__super__.constructor.apply(this,arguments);} MMSocial.prototype.tweet=function(message,callback){return this.enqueue("tweet",{message:message,callback:callback});};MMSocial.prototype.tweetWithContent=function(message,urls,images,callback){return this.enqueue("tweet",{message:message,"urls":urls.join(','),"images":images.join(','),callback:callback});};MMSocial.prototype.facebookPost=function(message,callback){return this.enqueue("facebookPost",{message:message,callback:callback});};MMSocial.prototype.facebookPostWithContent=function(message,urls,images,callback){return this.enqueue("facebookPost",{message:message,"urls":urls.join(','),"images":images.join(','),callback:callback});};MMSocial.prototype.authenticatedServices=function(callback){return this.enqueue("authenticatedServices",{callback:callback});};return MMSocial;})(MMBridgeObject);MRAID=(function(_super){__extends(MRAID,_super);function MRAID(){this.sdk=MMJS.sdk;this.utils=MMJS.utils;this.properties={width:null,height:null,useCustomClose:false,isModal:true};this.orientationProperties={allowOrientationChange:true,forceOrientation:'none'};this.resizeProperties={width:null,height:null,customClosePosition:'top-right',offsetX:0,offsetY:0,allowOffscreen:true};this.listeners={};} MRAID.prototype.getAdSize=function(){if(this.sdk.adSize!=null){this.utils.consoleLog("MRAID getAdSize "+JSON.stringify(this.sdk.adSize)); if(this.sdk.adSize["height"]>0&&this.sdk.adSize["width"]>0){return this.sdk.adSize;}} return null;};MRAID.prototype.callbackManager=function(response){var klass,method,response_data,result;result=response['result'];method=response['call'];response_data=response['response'];klass=response['class'];return this;};MRAID.prototype.getVersion=function(){return "2.0";};MRAID.prototype.close=function(){return MMJS.interstitial.close((function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Close failed","close");}}));};MRAID.prototype.expand=function(_url){var k,maxSize,props,v,_ref;this.utils.consoleLog('mraid.expand called with properties: '+JSON.stringify(this.getExpandProperties()));this.utils.consoleLog('mraid.expand url: '+_url);props=this.getExpandProperties();maxSize=this.getMaxSize();if((props!=null)&&(maxSize!=null)){if(props["height"]===maxSize["height"]&&props["width"]===maxSize["width"]){props["height"]=void 0;props["width"]=void 0;}} _ref=this.orientationProperties;for(k in _ref){v=_ref[k];props[k]=v;} return MMJS.interstitial.expandWithProperties(_url,props,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Expand failed","expand");}}));};MRAID.prototype.open=function(_url){return MMJS.interstitial.open(_url,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Open failed to open external url","open");}}));};MRAID.prototype.getExpandProperties=function(){var maxSize;maxSize=this.getMaxSize(); if(maxSize!=null){if(this.properties["height"]===null||this.properties["height"]===void 0){this.properties["height"]=maxSize["height"];} if(this.properties["width"]===null||this.properties["width"]===void 0){this.properties["width"]=maxSize["width"];} return this.properties;}else{return mraid.fireEventCallbacks("error","getExpandProperties failed","getExpandProperties");}};MRAID.prototype.setExpandProperties=function(_properties){this.utils.consoleLog('setExpandProperties: '+JSON.stringify(this.properties));return this.properties=_properties;};MRAID.prototype.getPlacementType=function(){return this.sdk.placementType;};MRAID.prototype.getState=function(){return this.sdk.state;};MRAID.prototype.useCustomClose=function(_customClose){this.properties["useCustomClose"]=_customClose;this.utils.consoleLog("Use Custom Close was called: "+_customClose);return MMJS.interstitial.useCustomClose(_customClose,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Use custom close failed to set","useCustomClose");}}));};MRAID.prototype.isViewable=function(){return this.sdk.viewable;};MRAID.prototype.removeEventListener=function(event,listener){var index;if(this.listeners[event]!=null){if(listener!=null){index=this.listeners[event].indexOf(listener);if(index<0){this.utils.consoleLog("Listner not found!");return false;}else{this.utils.consoleLog("'"+event+"' found listener: "+listener);} this.listeners[event].splice(index,1);return this.utils.consoleLog("'"+event+"' listeners: "+this.listeners[event]);}else{return delete this.listeners[event];}}};MRAID.prototype.addEventListener=function(event,listener){if(!(this.listeners[event]!=null)){this.listeners[event]=[];} this.utils.consoleLog("'"+event+"' added listener: "+listener);this.listeners[event].push(listener);return this.utils.consoleLog("'"+event+"' listeners: "+this.listeners[event]);};MRAID.prototype.fireEventCallbacks=function(eventName,parameter,action){var callback,_i,_len,_ref;this.utils.consoleLog("event callback: "+eventName);if(this.listeners[eventName]!=null){_ref=this.listeners[eventName];for(_i=0,_len=_ref.length;_i<_len;_i++){callback=_ref[_i];if(parameter!=null){if(action!=null){callback(parameter,action);}else{callback(parameter);}}else{callback();}}}};MRAID.prototype.resize=function(){var calledresizeProperties,maxSize;maxSize=this.getMaxSize();calledresizeProperties=this.getResizeProperties();if(calledresizeProperties["allowOffscreen"]===false){if(calledresizeProperties["width"]>maxSize["width"]||calledresizeProperties["height"]>maxSize["height"]){this.fireEventCallbacks("error","Resize is unsupported in this application.","resize");return;}} MMJS.banner.resize(calledresizeProperties,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Resize is unsupported in this application.","resize");}}));return null;};MRAID.prototype.getResizeProperties=function(){var adSize;adSize=this.getAdSize();if(adSize!=null){MMJS.utils.consoleLog("Ad Size was found");if(this.resizeProperties["height"]=== null){this.resizeProperties["height"]=adSize["height"];} if(this.resizeProperties["width"]===null){this.resizeProperties["width"]=adSize["width"];} return this.resizeProperties;}else{MMJS.utils.consoleLog("getResizeProperties failed");return mraid.fireEventCallbacks("error","getResizeProperties failed","getResizeProperties");}};MRAID.prototype.setResizeProperties=function(_properties){return this.resizeProperties=_properties;};MRAID.prototype.getCurrentPosition=function(){return this.sdk.adSize;};MRAID.prototype.getMaxSize=function(){if(this.sdk.adProperties["maxSize"]!=null){return{"height":this.sdk.adProperties["maxSize"]["height"],"width":this.sdk.adProperties["maxSize"]["width"]};}else{this.fireEventCallbacks("error","max size is unavailable","getMaxSize");} return null;};MRAID.prototype.getDefaultPosition=function(){return this.sdk.defaultPosition;};MRAID.prototype.getScreenSize=function(){MMJS.utils.consoleLog("getScreenSize: "+this.sdk.adProperties["screen"]);if(this.sdk.adProperties["screen"]!=null){return this.sdk.adProperties["screen"];}else{this.fireEventCallbacks("error","Screen size is unavailable","getScreenSize");} return null;};MRAID.prototype.supports=function(feature){if(feature!=null){return this.sdk.supportProperties[feature];}else{return this.sdk.supportProperties;}};MRAID.prototype.storePicture=function(URI){return MMJS.media.writeToPhotoLibrary(URI,"","",(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Error storing picture","storePicture");}}));};MRAID.prototype.createCalendarEvent =function(parameters){return MMJS.calendar.addEvent(parameters,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Error adding calendar event","createCalendarEvent");}}));};MRAID.prototype.playVideo=function(URI){return MMJS.media.playVideo(URI,(function(response){if(response['result']<1){return mraid.fireEventCallbacks("error","Error playing video","playVideo");}}));};MRAID.prototype.getOrientationProperties=function(){return this.orientationProperties;};MRAID.prototype.setOrientationProperties=function(properties){this.orientationProperties=properties;if((this.getState()==="expanded"&&this.getPlacementType()==="inline")||(this.getPlacementType()==="interstitial")){return MMJS.interstitial.setOrientation(this.orientationProperties,"mraid.callbackManager");}};return MRAID;})(MMBridgeObject);(function(){if(typeof MMJS.sdk===MMJS.TYPE_UNDEFINED){MMJS.sdk=new MMSDKInterface;} if(typeof MMJS.device===MMJS.TYPE_UNDEFINED){MMJS.device=new MMDevice;} if(typeof MMJS.media===MMJS.TYPE_UNDEFINED){MMJS.media=new MMMedia;} if(typeof MMJS.fileManager===MMJS.TYPE_UNDEFINED){MMJS.fileManager=new MMFileManager;} if(typeof MMJS.notification===MMJS.TYPE_UNDEFINED){MMJS.notification=new MMNotification;} if(typeof MMJS.interstitial===MMJS.TYPE_UNDEFINED){MMJS.interstitial=new MMInterstitial;} if(typeof MMJS.cachedVideo===MMJS.TYPE_UNDEFINED){MMJS.cachedVideo=new MMCachedVideo;} if(typeof MMJS.brand===MMJS.TYPE_UNDEFINED){MMJS.brand=new MMBrand;} if(typeof MMJS.inlineVideo===MMJS.TYPE_UNDEFINED){MMJS.inlineVideo=new MMInlineVideo;} if(typeof MMJS.social===MMJS.TYPE_UNDEFINED){MMJS.social=new MMSocial;} if(typeof MMJS.passbook===MMJS.TYPE_UNDEFINED){MMJS.passbook=new MMPassbook;} if(typeof MMJS.calendar===MMJS.TYPE_UNDEFINED){MMJS.calendar=new MMCalendar;} if(typeof MMJS.banner===MMJS.TYPE_UNDEFINED){MMJS.banner=new MMBanner;} if(typeof MMJS.appstore===MMJS.TYPE_UNDEFINED){MMJS.appstore=new MMAppStore;} MMJS.appStore=MMJS.appstore;if(typeof MMJS.pasteboard===MMJS.TYPE_UNDEFINED){MMJS.pasteboard=new MMPasteboard;} if(typeof window.MMSDK===MMJS.TYPE_UNDEFINED){window.MMSDK=MMJS;} if(typeof MMSDK.sdk===MMJS.TYPE_UNDEFINED){MMSDK.sdk=MMJS.sdk;} if(typeof MMSDK.device===MMJS.TYPE_UNDEFINED){MMSDK.device=MMJS.device;} if(typeof MMSDK.media===MMJS.TYPE_UNDEFINED){MMSDK.media=MMJS.media;} if(typeof MMSDK.fileManager===MMJS.TYPE_UNDEFINED){ MMSDK.fileManager=MMJS.fileManager;} if(typeof MMSDK.notification===MMJS.TYPE_UNDEFINED){MMSDK.notification=MMJS.notification;} if(typeof MMSDK.interstitial===MMJS.TYPE_UNDEFINED){MMSDK.interstitial=MMJS.interstitial;} if(typeof MMJS.cachedVideo===MMJS.TYPE_UNDEFINED){MMSDK.cachedVideo=MMJS.cachedVideo;} if(typeof MMSDK.brand===MMJS.TYPE_UNDEFINED){MMSDK.brand=MMJS.brand;} if(typeof MMSDK.inlineVideo===MMJS.TYPE_UNDEFINED){MMSDK.inlineVideo=MMJS.inlineVideo;} if(typeof MMSDK.social===MMJS.TYPE_UNDEFINED){MMSDK.social=MMJS.social;} if(typeof MMSDK.passbook===MMJS.TYPE_UNDEFINED){MMSDK.passbook=MMJS.passbook;} if(typeof MMSDK.calendar===MMJS.TYPE_UNDEFINED){MMSDK.calendar=MMJS.calendar;} if(typeof MMSDK.banner===MMJS.TYPE_UNDEFINED){MMSDK.banner=MMJS.banner;} if(typeof MMSDK.appstore===MMJS.TYPE_UNDEFINED){MMSDK.appstore=MMJS.appstore;} MMSDK.appStore=MMJS.appstore;if(typeof MMSDK.pasteboard===MMJS.TYPE_UNDEFINED){MMSDK.pasteboard=MMJS.pasteboard;} if(typeof window.mraid===MMJS.TYPE_UNDEFINED){window.mraid=new MRAID;} if(typeof window.MM===MMJS.TYPE_UNDEFINED){return window.MM=MMJS;}})();MMJS.utils.listenForBrowserReady((function(){var timer;return timer=setInterval(function(){var command;if(MMJS.sdk.state!=="loading"){if(MMJS.executingCommand===false&&MMJS.commandQueue.length>0&&MMJS.executingCommandDelay===0){command=MMJS.commandQueue.shift();MMJS.utils.consoleLog("running command: "+command.url);try{return command.perform();}catch(e){return MMJS.utils.consoleLog("Failed to run command: "+e.messagealert);}}}},1);})());}