<html><head></head><body id="iaBody"><div id="iaAndroidContainer"><script> 
(function() { 
  
 var ormmaview = window.ormmaview = {}; 
  
 var expandProperties = { 
 useBackground:false, 
 backgroundColor:'#ffffff', 
 backgroundOpacity:1.0, 
 lockOrientation:false, 
 useCustomClose:false 
 }; 
  
  
 var listeners = { }; 
  
  
 var nativeCallQueue = [ ]; 
  
 var nativeCallInFlight = false; 
  
 var timer; 
  
 var totalTime; 
  
 ormmaview.fireAssetReadyEvent = function( alias, URL ) { 
 var handlers = listeners["assetReady"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i]( alias, URL ); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.fireAssetRemovedEvent = function( alias ) { 
 var handlers = listeners["assetRemoved"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i]( alias ); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.fireAssetRetiredEvent = function( alias ) { 
 var handlers = listeners["assetRetired"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i]( alias ); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.fireChangeEvent = function( properties ) { 
 var handlers = listeners["change"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i]( properties ); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.fireErrorEvent = function( message, action ) { 
 var handlers = listeners["error"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i]( message, action ); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.fireShakeEvent = function() { 
 var handlers = listeners["shake"]; 
  
 if ( handlers != null ) { 
 for ( var i = 0; i < handlers.length; i++ ) { 
 handlers[i](); 
 } 
 } 
  
 return "OK"; 
 }; 
  
 ormmaview.nativeCallComplete = function( cmd ) { 
 if ( nativeCallQueue.length == 0 ) { 
 nativeCallInFlight = false; 
 return; 
 } 
  
 var bridgeCall = nativeCallQueue.pop(); 
 window.location = bridgeCall; 
  
 return "OK"; 
 }; 
  
 ormmaview.showAlert = function( message ) { 
 alert( message ); 
 }; 
  
 ormmaview.zeroPad = function( number ) { 
 var text = ""; 
 if ( number < 10 ) { 
 text += "0"; 
 } 
 text += number; 
 return text; 
 } 
  
 ormmaview.executeNativeCall = function( command ) { 
 var bridgeCall = "ormma://" + command; 
 var value; 
 var firstArg = true; 
  
 for ( var i = 1; i < arguments.length; i += 2 ) { 
 value = arguments[i + 1]; 
 if ( value == null ) { 
 continue; 
 } 
  
 if ( firstArg ) { 
 bridgeCall += "?"; 
 firstArg = false; 
 } else { 
 bridgeCall += "&"; 
 } 
 bridgeCall += arguments[i] + "=" + escape( value ); 
 } 
  
 if ( nativeCallInFlight ) { 
 nativeCallQueue.push( bridgeCall ); 
 } else { 
 nativeCallInFlight = true; 
 window.location = bridgeCall; 
 } 
 }; 
  
 ormmaview.activate = function( event ) { 
 }; 
  
 ormmaview.addEventListener = function( event, listener ) { 
 var handlers = listeners[event]; 
  
 if ( handlers == null ) { 
 listeners[event] = []; 
 handlers = listeners[event]; 
 } 
  
 for ( var handler in handlers ) { 
 if ( listener == handler ) { 
 return; 
 } 
 } 
  
 handlers.push( listener ); 
 }; 
  
 ormmaview.deactivate = function( event ) { 
 }; 
  
 ormmaview.removeEventListener = function( event, listener ) { 
 var handlers = listeners[event]; 
  
 if ( handlers != null ) { 
 handlers.remove( listener ); 
 } 
 }; 
  
 ormmaview.close = function() { 
        //this.executeNativeCall( "close" ); 
        ORMMADisplayControllerBridge.close(); 
 }; 
  
 ormmaview.expand = function( dimensions, URL ) { 
 try { 
        //this.executeNativeCall("expand", "url", URL, "adButton", expandProperties.useCustomClose); 
        ORMMADisplayControllerBridge.expand(URL, expandProperties.useCustomClose); 
 } catch ( e ) { 
        alert( "executeNativeExpand: " + e + ", cmd = " + cmd ); 
 } 
 }; 
  
 ormmaview.hide = function() { 
        //this.executeNativeCall( "hide" ); 
        ORMMADisplayControllerBridge.hide(); 
 }; 
  
 ormmaview.open = function( URL, controls ) { 
        //this.executeNativeCall("open", "url", URL); 
        ORMMADisplayControllerBridge.open(URL); 
 }; 
  
 ormmaview.openMap = function( URL, fullscreen ) { 
        this.executeNativeCall( "openMap",  "url", URL, "fullscreen", fullscreen ); 
 }; 
  
 ormmaview.resize = function( width, height ) { 
        //this.executeNativeCall( "resize", "w", width, "h", height ); 
        ORMMADisplayControllerBridge.resize(width, height); 
 }; 
  
 ormmaview.getExpandProperties = function(){ 
        return expandProperties; 
 } 
  
 ormmaview.setExpandProperties = function( properties ) { 
        expandProperties = properties; 
 }; 
  
 ormmaview.show = function() { 
        //this.executeNativeCall( "show" ); 
        ORMMADisplayControllerBridge.show(); 
 }; 
  
 ormmaview.playAudio = function( URL, properties ) { 
  
         var cmd = "this.executeNativeCall( 'playAudio'"; 
          
         cmd += ", 'url', '" + URL + "'"; 
          
         if ( properties != null ) { 
          
         if ( ( typeof properties.autoplay != "undefined" ) && ( properties.autoplay != null ) ) { 
         cmd += ", 'autoplay', 'Y'"; 
         } else { 
         cmd += ", 'autoplay', 'N'"; 
         } 
          
         if ( ( typeof properties.controls != "undefined" ) && ( properties.controls != null ) ) { 
         cmd += ", 'controls', 'Y'"; 
         } else{ 
         cmd += ", 'controls', 'N'"; 
         } 
          
         if ( ( typeof properties.loop != "undefined" ) && ( properties.loop != null ) ) { 
         cmd += ", 'loop', 'Y'"; 
         } else { 
         cmd += ", 'loop', 'N'"; 
         } 
          
         if ( ( typeof properties.position != "undefined" ) && ( properties.position != null ) ) { 
         cmd += ", 'position', 'Y'"; 
         } else { 
         cmd += ", 'position', 'N'"; 
         } 
          
         if ( ( typeof properties.startStyle != "undefined" ) && ( properties.startStyle != null ) ) { 
         cmd += ", 'startStyle', '" + properties.startStyle + "'"; 
         } else { 
         cmd += ", 'startStyle', 'normal'"; 
         } 
          
         if ( ( typeof properties.stopStyle != "undefined" ) && ( properties.stopStyle != null ) ) { 
         cmd += ", 'stopStyle', '" + properties.stopStyle + "'"; 
         } else{ 
         cmd += ", 'stopStyle', 'normal'"; 
         } 
          
         } 
          
         cmd += " );"; 
          
         eval( cmd ); 
 }; 
  
 ormmaview.playVideo = function( URL, properties ) { 
         var cmd = "this.executeNativeCall( 'playVideo'"; 
          
         cmd += ", 'url', '" + URL + "'"; 
          
         if ( properties != null ) { 
          
         if ( ( typeof properties.audio != "undefined" ) && ( properties.audio != null ) ) { 
         cmd += ", 'audioMuted', 'Y'"; 
         } else { 
         cmd += ", 'audioMuted', 'N'"; 
         } 
          
         if ( ( typeof properties.autoplay != "undefined" ) && ( properties.autoplay != null ) ) { 
         cmd += ", 'autoplay', 'Y'"; 
         } else { 
         cmd += ", 'autoplay', 'N'"; 
         } 
          
         if ( ( typeof properties.controls != "undefined" ) && ( properties.controls != null ) ) { 
         cmd += ", 'controls', 'Y'"; 
         } else { 
         cmd += ", 'controls', 'N'"; 
         } 
          
         if ( ( typeof properties.loop != "undefined" ) && ( properties.loop != null ) ) { 
         cmd += ", 'loop', 'Y'"; 
         } else { 
         cmd += ", 'loop', 'N'"; 
         } 
          
         if ( ( typeof properties.position != "undefined" ) && ( properties.position != null ) ) { 
         cmd += ", 'position_top', '" + properties.position.top + "'"; 
         cmd += ", 'position_left', '" + properties.position.left + "'"; 
         if ( ( typeof properties.width != "undefined" ) && ( properties.width != null ) ) { 
         cmd += ", 'position_width', '" + properties.width + "'"; 
         }  else { 
         } 
          
         if ( ( typeof properties.height != "undefined" ) && ( properties.height != null ) ) { 
         cmd += ", 'position_height', '" + properties.height + "'"; 
         } else { 
         } 
         } 
          
          
         if ( ( typeof properties.startStyle != "undefined" ) && ( properties.startStyle != null ) ) { 
         cmd += ", 'startStyle', '" + properties.startStyle + "'"; 
         } else { 
         cmd += ", 'startStyle', 'normal'"; 
         } 
          
         if ( ( typeof properties.stopStyle != "undefined" ) && ( properties.stopStyle != null ) ) { 
         cmd += ", 'stopStyle', '" + properties.stopStyle + "'"; 
         } else { 
         cmd += ", 'stopStyle', 'normal'"; 
         } 
          
         } 
          
         cmd += " );"; 
          
         eval( cmd ); 
  
 }; 
  
 ormmaview.createEvent = function( date, title, body ) { 
 var year = date.getFullYear(); 
 var month = date.getMonth() + 1; 
 var day = date.getDate(); 
 var hours = date.getHours(); 
 var minutes = date.getMinutes(); 
  
  
 var dateString = year + this.zeroPad( month ) + this.zeroPad( day ) + this.zeroPad( hours ) + this.zeroPad( minutes ); 
 this.executeNativeCall( "calendar","date", dateString,"title", title,"body", body ); 
 }; 
  
 ormmaview.makeCall = function( phoneNumber ) { 
 this.executeNativeCall( "phone","number", phoneNumber ); 
 }; 
  
 ormmaview.sendMail = function( recipient, subject, body ) { 
 this.executeNativeCall( "email","to", recipient,"subject", subject,"body", body, "html", "N" ); 
 }; 
  
 ormmaview.sendSMS = function( recipient, body ) { 
 this.executeNativeCall( "sms","to", recipient,"body", body ); 
 }; 
  
 ormmaview.setShakeProperties = function( properties ) { 
 }; 
  
 ormmaview.addAsset = function( URL, alias ) { 
 this.executeNativeCall( "addasset", "uri", url, "alias", alias ); 
 }; 
  
 ormmaview.request = function( URI, display ) { 
 this.executeNativeCall( "request", "uri", uri, "display", display ); 
 }; 
  
 ormmaview.removeAsset = function( alias ) { 
 this.executeNativeCall( "removeasset", "alias", alias ); 
 }; 
  
 })(); 
</script><script> 
(function() { 
  var ormma = window.ormma = {}; 
   
  var STATES = ormma.STATES = { 
  UNKNOWN     :'unknown', 
  LOADING               :'loading', 
  DEFAULT     :'default', 
  RESIZED     :'resized', 
  EXPANDED    :'expanded', 
  HIDDEN      :'hidden' 
  }; 
   
  var EVENTS = ormma.EVENTS = { 
  READY                         :'ready', 
  ASSETREADY          :'assetReady', 
  ASSETREMOVED        :'assetRemoved', 
  ASSETRETIRED        :'assetRetired', 
  ERROR               :'error', 
  INFO                :'info', 
  HEADINGCHANGE       :'headingChange', 
  KEYBOARDCHANGE      :'keyboardChange', 
  LOCATIONCHANGE      :'locationChange', 
  NETWORKCHANGE       :'networkChange', 
  ORIENTATIONCHANGE   :'orientationChange', 
  RESPONSE            :'response', 
  SCREENCHANGE        :'screenChange', 
  SHAKE               :'shake', 
  SIZECHANGE          :'sizeChange', 
  STATECHANGE         :'stateChange', 
  TILTCHANGE          :'tiltChange', 
  VIEWABLECHANGE      :'viewableChange' 
  }; 
   
  var CONTROLS = ormma.CONTROLS = { 
  BACK    :'back', 
  FORWARD :'forward', 
  REFRESH :'refresh', 
  ALL     :'all' 
  }; 
   
  var FEATURES = ormma.FEATURES = { 
  LEVEL1      :'level-1', 
  LEVEL2      :'level-2', 
  LEVEL3      :'level-3', 
  SCREEN      :'screen', 
  ORIENTATION :'orientation', 
  HEADING     :'heading', 
  LOCATION    :'location', 
  SHAKE       :'shake', 
  TILT        :'tilt', 
  NETWORK     :'network', 
  SMS         :'sms', 
  PHONE       :'phone', 
  EMAIL       :'email', 
  CALENDAR    :'calendar', 
  CAMERA      :'camera', 
  AUDIO       :'audio', 
  VIDEO       :'video', 
  MAP         :'map' 
  }; 
   
  var NETWORK = ormma.NETWORK = { 
  OFFLINE :'offline', 
  WIFI    :'wifi', 
  CELL    :'cell', 
  UNKNOWN :'unknown' 
  }; 
   
  var state = STATES.UNKNOWN; 
   
  var size = { 
  width:0, 
  height:0 
  }; 
   
  var defaultPosition = { 
  x:0, 
  y:0, 
  width:0, 
  height:0 
  }; 
   
  var maxSize = { 
  width:0, 
  height:0 
  }; 
   
  var expandProperties = { 
  width:0, 
  height:0, 
  useCustomClose:false, 
  isModal:true, 
  useBackground:false, 
  backgroundColor:0xffffff, 
  backgroundOpacity:1.0 
  }; 
   
  var supports = { 
  'level-1':true, 
  'level-2':true, 
  'level-3':true, 
  'screen':true, 
  'orientation':true, 
  'heading':true, 
  'location':true, 
  'shake':true, 
  'tilt':true, 
  'network':true, 
  'sms':true, 
  'phone':true, 
  'email':true, 
  'calendar':true, 
  'camera':true, 
  'audio':true, 
  'video':true, 
  'map':true 
  }; 
   
  var heading = -1; 
   
  var keyboardState = false; 
   
  var location = null; 
   
  var network = NETWORK.UNKNOWN; 
   
  var orientation = -1; 
   
  var screenSize = null; 
   
  var shakeProperties = null; 
   
  var tilt = null; 
   
  var assets = {}; 
   
  var cacheRemaining = -1; 
   
  var viewable = false; 
   
  var intervalID = null; 
  var timeoutID = null; 
  var readyTimeout = 10000; 
  var readyInterval = 750; 
  var readyDuration = 0; 
   
  function trim(str) { 
  return str.replace(/^\s+|\s+$/g,""); 
  } 
   
  var dimensionValidators = { 
  x:function(value) { return !isNaN(value); }, 
  y:function(value) { return !isNaN(value); }, 
  width:function(value) { return !isNaN(value) && value >= 0; }, 
  height:function(value) { return !isNaN(value) && value >= 0; } 
  }; 
   
  var sizeValidators = { 
  width:function(value) { return !isNaN(value) && value >= 0 && value <= maxSize.width; }, 
  height:function(value) { return !isNaN(value) && value >= 0 && value <= maxSize.height; } 
  }; 
   
  var expandPropertyValidators = { 
  useBackground:function(value) { return (value === true || value === false); }, 
  backgroundColor:function(value) { return (typeof value == 'string' && value.substr(0,1) == '#' && !isNaN(parseInt(value.substr(1), 16))); }, 
  backgroundOpacity:function(value) { return !isNaN(value) && value >= 0 && value <= 1; }, 
  lockOrientation:function(value) { return (value === true || value === false); }, 
  isModal:function(value) { return (value === true || value === false); }, 
  useCustomClose:function(value) { return (value === true || value === false); }, 
  width:function(value) { return !isNaN(value) && value >= 0; }, 
  height:function(value) { return !isNaN(value) && value >= 0; } 
  }; 
   
  var shakePropertyValidators = { 
  intensity:function(value) { return !isNaN(value); }, 
  interval:function(value) { return !isNaN(value); } 
  }; 
   
  var changeHandlers = { 
  state:function(val) { 
  if (state == STATES.UNKNOWN && val != STATES.UNKNOWN) { 
  intervalID = window.setInterval(window.ormma.signalReady, 20); 
  broadcastEvent(EVENTS.INFO, 'controller initialized, attempting callback'); 
  } 
  if (state == STATES.LOADING && val != STATES.LOADING) { 
  timeoutID = window.setTimeout(ormma.readyTimeout, readyTimeout); 
  intervalID = window.setInterval(ormma.signalReady, readyInterval); 
  broadcastEvent(EVENTS.INFO, 'controller ready, attempting callback'); 
  } else { 
  broadcastEvent(EVENTS.INFO, 'setting state to ' + stringify(val)); 
  state = val; 
  broadcastEvent(EVENTS.STATECHANGE, state); 
  } 
  }, 
  size:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting size to ' + stringify(val)); 
  size = val; 
  broadcastEvent(EVENTS.SIZECHANGE, size.width, size.height); 
  }, 
  defaultPosition:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting default position to ' + stringify(val)); 
  defaultPosition = val; 
  }, 
  maxSize:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting maxSize to ' + stringify(val)); 
  maxSize = val; 
  }, 
  expandProperties:function(val) { 
  broadcastEvent(EVENTS.INFO, 'merging expandProperties with ' + stringify(val)); 
  for (var i in val) { 
  expandProperties[i] = val[i]; 
  } 
  }, 
  supports:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting supports to ' + stringify(val)); 
  supports = {}; 
  for (var key in FEATURES) { 
  supports[FEATURES[key]] = contains(FEATURES[key], val); 
  } 
  }, 
  heading:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting heading to ' + stringify(val)); 
  heading = val; 
  broadcastEvent(EVENTS.HEADINGCHANGE, heading); 
  }, 
  keyboardState:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting keyboardState to ' + stringify(val)); 
  keyboardState = val; 
  broadcastEvent(EVENTS.KEYBOARDCHANGE, keyboardState); 
  }, 
  location:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting location to ' + stringify(val)); 
  location = val; 
  broadcastEvent(EVENTS.LOCATIONCHANGE, location.lat, location.lon, location.acc); 
  }, 
  network:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting network to ' + stringify(val)); 
  network = val; 
  broadcastEvent(EVENTS.NETWORKCHANGE, (network != NETWORK.OFFLINE && network != NETWORK.UNKNOWN), network); 
  }, 
  orientation:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting orientation to ' + stringify(val)); 
  orientation = val; 
  broadcastEvent(EVENTS.ORIENTATIONCHANGE, orientation); 
  }, 
  screenSize:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting screenSize to ' + stringify(val)); 
  screenSize = val; 
  broadcastEvent(EVENTS.SCREENCHANGE, screenSize.width, screenSize.height); 
  }, 
  shakeProperties:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting shakeProperties to ' + stringify(val)); 
  shakeProperties = val; 
  }, 
  tilt:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting tilt to ' + stringify(val)); 
  tilt = val; 
  broadcastEvent(EVENTS.TILTCHANGE, tilt.x, tilt.y, tilt.z); 
  }, 
  cacheRemaining:function(val) { 
  broadcastEvent(EVENTS.INFO, 'setting cacheRemaining to ' + stringify(val)); 
  cacheRemaining = val; 
  }, 
  viewable:function(val) { 
  broadcastEvent(EVENTS.VIEWABLECHANGE, 'setting viewable to ' + stringify(val)); 
  viewable = val; 
  } 
  }; 
   
  var listeners = {}; 
   
  var EventListeners = function(event) { 
  this.event = event; 
  this.count = 0; 
  var listeners = {}; 
   
  this.add = function(func) { 
  var id = String(func); 
  if (!listeners[id]) { 
  listeners[id] = func; 
  this.count++; 
  if (this.count == 1) { 
  broadcastEvent(EVENTS.INFO, 'activating ' + event); 
  ormmaview.activate(event); 
  } 
  } 
  }; 
  this.remove = function(func) { 
  var id = String(func); 
  if (listeners[id]) { 
  listeners[id] = null; 
  delete listeners[id]; 
  this.count--; 
  if (this.count == 0) { 
  broadcastEvent(EVENTS.INFO, 'deactivating ' + event); 
  ormmaview.deactivate(event); 
  } 
  return true; 
  } else { 
  return false; 
  } 
  }; 
  this.removeAll = function() { for (var id in listeners) this.remove(listeners[id]); }; 
  this.broadcast = function(args) { for (var id in listeners) listeners[id].apply({}, args); }; 
  this.toString = function() { 
  var out = [event,':']; 
  for (var id in listeners) out.push('|',id,'|'); 
  return out.join(''); 
  }; 
  }; 
   
  ormmaview.addEventListener('change', function(properties) { 
                             for (var property in properties) { 
                             var handler = changeHandlers[property]; 
                             handler(properties[property]); 
                             } 
                             }); 
   
  ormmaview.addEventListener('shake', function() { 
                             broadcastEvent(EVENTS.SHAKE); 
                             }); 
   
  ormmaview.addEventListener('error', function(message, action) { 
                             broadcastEvent(EVENTS.ERROR, message, action); 
                             }); 
   
  ormmaview.addEventListener('response', function(uri, response) { 
                             broadcastEvent(EVENTS.RESPONSE, uri, response); 
                             }); 
   
  ormmaview.addEventListener('assetReady', function(alias, URL) { 
                             assets[alias] = URL; 
                             broadcastEvent(EVENTS.ASSETREADY, alias); 
                             }); 
   
  ormmaview.addEventListener('assetRemoved', function(alias) { 
                             assets[alias] = null; 
                             delete assets[alias]; 
                             broadcastEvent(EVENTS.ASSETREMOVED, alias); 
                             }); 
   
  ormmaview.addEventListener('assetRetired', function(alias) { 
                             assets[alias] = null; 
                             delete assets[alias]; 
                             broadcastEvent(EVENTS.ASSETRETIRED, alias); 
                             }); 
   
  var clone = function(obj) { 
  var f = function() {}; 
  f.prototype = obj; 
  return new f(); 
  }; 
   
  var stringify = function(obj) { 
  if (typeof obj == 'object') { 
  if (obj.push) { 
  var out = []; 
  for (var p = 0; p < obj.length; p++) { 
  out.push(obj[p]); 
  } 
  return '[' + out.join(',') + ']'; 
  } else { 
  var out = []; 
  for (var p in obj) { 
  out.push('\''+p+'\':'+obj[p]); 
  } 
  return '{' + out.join(',') + '}'; 
  } 
  } else { 
  return String(obj); 
  } 
  }; 
   
  var valid = function(obj, validators, action, full) { 
  if (full) { 
  if (obj === undefined) { 
  broadcastEvent(EVENTS.ERROR, 'Required object missing.', action); 
  return false; 
  } else { 
  for (var i in validators) { 
  if (obj[i] === undefined) { 
  broadcastEvent(EVENTS.ERROR, 'Object missing required property ' + i, action); 
  return false; 
  } 
  } 
  } 
  } 
   
  for (var i in obj) { 
  if (!validators[i]) { 
  broadcastEvent(EVENTS.ERROR, 'Invalid property specified - ' + i + '.', action); 
  return false; 
  } else if (!validators[i](obj[i])) { 
  broadcastEvent(EVENTS.ERROR, 'Value of property ' + i + ' is not valid type.', action); 
  return false; 
  } 
  } 
  return true; 
  }; 
   
  var contains = function(value, array) { 
  for (var i in array) if (array[i] == value) return true; 
  return false; 
  }; 
   
  var broadcastEvent = function() { 
  var args = new Array(arguments.length); 
  for (var i = 0; i < arguments.length; i++) args[i] = arguments[i]; 
  var event = args.shift(); 
  if (listeners[event]) listeners[event].broadcast(args); 
  } 
   
  ormma.readyTimeout = function() { 
  window.clearInterval(intervalID); 
  window.clearTimeout(timeoutID); 
  if (!ormmaview.scriptFound) { 
  broadcastEvent(EVENTS.INFO, 'No ORMMAReady callback found (timeout of ' + readyTimeout + 'ms occurred), assume use of ready eventListener.'); 
  } 
  }; 
   
  ormma.signalReady = function() { 
  broadcastEvent(EVENTS.INFO, 'setting state to ' + stringify(STATES.DEFAULT)); 
  state = STATES.DEFAULT; 
  broadcastEvent(EVENTS.STATECHANGE, state); 
   
  broadcastEvent(EVENTS.INFO, 'ready eventListener triggered'); 
  broadcastEvent(EVENTS.READY, 'ormma ready event triggered'); 
   
  window.clearInterval(intervalID); 
  try { 
  ORMMAReady(); 
  window.clearTimeout(timeoutID); 
  broadcastEvent(EVENTS.INFO, 'ORMMA callback invoked'); 
  } catch (e) { 
  } 
  }; 
   
  ormma.info = function(message) { 
  broadcastEvent(EVENTS.INFO, message); 
  }; 
   
  ormma.error = function(message) { 
  broadcastEvent(EVENTS.ERROR, message); 
  }; 
   
  ormma.addEventListener = function(event, listener) { 
  if (!event || !listener) { 
  broadcastEvent(EVENTS.ERROR, 'Both event and listener are required.', 'addEventListener'); 
  } else if (!contains(event, EVENTS)) { 
  broadcastEvent(EVENTS.ERROR, 'Unknown event: ' + event, 'addEventListener'); 
  } else { 
  if (!listeners[event]) listeners[event] = new EventListeners(event); 
  listeners[event].add(listener); 
  } 
  }; 
   
  ormma.close = function() { 
  ormmaview.close(); 
  }; 
   
  ormma.expand = function(dimensions, URL) { 
  if (dimensions === undefined) { 
  dimensions = {width:ormma.getMaxSize().width, height:ormma.getMaxSize().height, x:0, y:0}; 
  } 
  broadcastEvent(EVENTS.INFO, 'expanding to ' + stringify(dimensions)); 
  if (valid(dimensions, dimensionValidators, 'expand', true)) { 
  ormmaview.expand(dimensions, URL); 
  } 
  }; 
   
  ormma.getDefaultPosition = function() { 
  return clone(defaultPosition); 
  }; 
   
  ormma.getExpandProperties = function() { 
  return clone(expandProperties); 
  }; 
   
  ormma.getMaxSize = function() { 
  return clone(maxSize); 
  }; 
   
  ormma.getSize = function() { 
  return clone(size); 
  }; 
   
  ormma.getState = function() { 
  return state; 
  }; 
   
  ormma.getVersion = function() { 
  return ("1.1.0"); 
  }; 
   
  ormma.hide = function() { 
  if (state == STATES.HIDDEN) { 
  broadcastEvent(EVENTS.ERROR, 'Ad is currently hidden.', 'hide'); 
  } else { 
  ormmaview.hide(); 
  } 
  }; 
   
  ormma.open = function(URL, controls) { 
  if (!URL) { 
  broadcastEvent(EVENTS.ERROR, 'URL is required.', 'open'); 
  } else { 
  ormmaview.open(URL, controls); 
  } 
  }; 
   
  ormma.openMap = function(POI, fullscreen) { 
  if (!POI) { 
  broadcastEvent(EVENTS.ERROR, 'POI is required.', 'openMap'); 
  } else { 
  ormmaview.openMap(POI, fullscreen); 
  } 
  }; 
   
  ormma.removeEventListener = function(event, listener) { 
        if (!event) { 
                broadcastEvent(EVENTS.ERROR, 'Must specify an event.', 'removeEventListener'); 
        } else { 
                if (listener && (!listeners[event] || !listeners[event].remove(listener))) { 
                        broadcastEvent(EVENTS.ERROR, 'Listener not currently registered for event', 'removeEventListener'); 
                        return; 
                } else { 
                        if (listeners[event]) { 
                                listeners[event].removeAll(); 
                        } 
                        if (listeners[event] && listeners[event].count === 0) { 
                                listeners[event] = null; 
                                delete listeners[event]; 
                        } 
                } 
        } 
  }; 
  
  ormma.resize = function(width, height) { 
  if (width == null || height == null || isNaN(width) || isNaN(height) || width < 0 || height < 0) { 
  broadcastEvent(EVENTS.ERROR, 'Requested size must be numeric values between 0 and maxSize.', 'resize'); 
  } else if (width > maxSize.width || height > maxSize.height) { 
  broadcastEvent(EVENTS.ERROR, 'Request (' + width + ' x ' + height + ') exceeds maximum allowable size of (' + maxSize.width +  ' x ' + maxSize.height + ')', 'resize'); 
  } else if (width == size.width && height == size.height) { 
  broadcastEvent(EVENTS.ERROR, 'Requested size equals current size.', 'resize'); 
  } else { 
  ormmaview.resize(width, height); 
  } 
  }; 
   
  ormma.setExpandProperties = function(properties) { 
  if (valid(properties, expandPropertyValidators, 'setExpandProperties')) { 
  ormmaview.setExpandProperties(properties); 
  } 
  }; 
   
  ormma.show = function() { 
  if (state != STATES.HIDDEN) { 
  broadcastEvent(EVENTS.ERROR, 'Ad is currently visible.', 'show'); 
  } else { 
  ormmaview.show(); 
  } 
  }; 
   
  ormma.playAudio = function(URL, properties) { 
  if (!supports[FEATURES.AUDIO]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'playAudio'); 
  } else if (!URL || typeof URL != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Request must specify a URL', 'playAudio'); 
  } else { 
  ormmaview.playAudio(URL, properties); 
  } 
  }; 
   
  ormma.playVideo = function(URL, properties) { 
  if (!supports[FEATURES.VIDEO]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'playVideo'); 
  } else if (!URL || typeof URL != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Request must specify a URL', 'playVideo'); 
  } else { 
  ormmaview.playVideo(URL, properties); 
  } 
  }; 
   
  ormma.useCustomClose = function(use) { 
  if (use){ 
  expandProperties.useCustomClose = true; 
  ormma.setExpandProperties(expandProperties); 
  } 
  }; 
   
  ormma.createEvent = function(date, title, body) { 
  title = trim(title); 
  body = trim(body); 
  if (!supports[FEATURES.CALENDAR]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'createEvent'); 
  } else if (!date || typeof date != 'object' || !date.getDate) { 
  broadcastEvent(EVENTS.ERROR, 'Valid date required.', 'createEvent'); 
  } else if (!title || typeof title != 'string' || title.length == 0) { 
  broadcastEvent(EVENTS.ERROR, 'Valid title required.', 'createEvent'); 
  }     else if (!body || typeof body != 'string' || body.length == 0) { 
  broadcastEvent(EVENTS.ERROR, 'Valid body required.', 'createEvent'); 
  } else { 
  ormmaview.createEvent(date, title, body); 
  } 
  }; 
   
  ormma.getHeading = function() { 
  if (!supports[FEATURES.HEADING]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getHeading'); 
  } 
  return heading; 
  }; 
   
  ormma.getKeyboardState = function() { 
  if (!supports[FEATURES.LEVEL2]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getKeyboardState'); 
  } 
  return keyboardState; 
  } 
   
  ormma.getLocation = function() { 
  if (!supports[FEATURES.LOCATION]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getLocation'); 
  } 
  return (null == location)?null:clone(location); 
  }; 
   
  ormma.getNetwork = function() { 
  if (!supports[FEATURES.NETWORK]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getNetwork'); 
  } 
  return network; 
  }; 
   
  ormma.getOrientation = function() { 
  if (!supports[FEATURES.ORIENTATION]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getOrientation'); 
  } 
  return orientation; 
  }; 
   
  ormma.getScreenSize = function() { 
  if (!supports[FEATURES.SCREEN]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getScreenSize'); 
  } else { 
  return (null == screenSize)?null:clone(screenSize); 
  } 
  }; 
   
  ormma.getShakeProperties = function() { 
  if (!supports[FEATURES.SHAKE]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getShakeProperties'); 
  } else { 
  return (null == shakeProperties)?null:clone(shakeProperties); 
  } 
  }; 
   
  ormma.getTilt = function() { 
  if (!supports[FEATURES.TILT]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getTilt'); 
  } else { 
  return (null == tilt)?null:clone(tilt); 
  } 
  }; 
   
  ormma.makeCall = function(number) { 
  if (!supports[FEATURES.PHONE]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'makeCall'); 
  } else if (!number || typeof number != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Request must provide a number to call.', 'makeCall'); 
  } else { 
  ormmaview.makeCall(number); 
  } 
  }; 
   
  ormma.sendMail = function(recipient, subject, body) { 
  if (!supports[FEATURES.EMAIL]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'sendMail'); 
  } else if (!recipient || typeof recipient != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Request must specify a recipient.', 'sendMail'); 
  } else { 
  ormmaview.sendMail(recipient, subject, body); 
  } 
  }; 
   
  ormma.sendSMS = function(recipient, body) { 
  if (!supports[FEATURES.SMS]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'sendSMS'); 
  } else if (!recipient || typeof recipient != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Request must specify a recipient.', 'sendSMS'); 
  } else { 
  ormmaview.sendSMS(recipient, body); 
  } 
  }; 
   
  ormma.setShakeProperties = function(properties) { 
  if (!supports[FEATURES.SHAKE]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'setShakeProperties'); 
  } else if (valid(properties, shakePropertyValidators, 'setShakeProperties')) { 
  ormmaview.setShakeProperties(properties); 
  } 
  }; 
   
  ormma.supports = function(feature) { 
  if (supports[feature]) { 
  return true; 
  } else { 
  return false; 
  } 
  }; 
   
  ormma.addAsset = function(URL, alias) { 
  if (!URL || !alias || typeof URL != 'string' || typeof alias != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'URL and alias are required.', 'addAsset'); 
  } else if (supports[FEATURES.LEVEL3]) { 
  ormmaview.addAsset(URL, alias); 
  } else if (URL.indexOf('ormma://') == 0) { 
  broadcastEvent(EVENTS.ERROR, 'Native device assets not supported by this client.', 'addAsset'); 
  } else { 
  assets[alias] = URL; 
  broadcastEvent(EVENTS.ASSETREADY, alias); 
  } 
  }; 
   
  ormma.addAssets = function(assets) { 
  for (var alias in assets) { 
  ormma.addAsset(assets[alias], alias); 
  } 
  }; 
   
  ormma.getAssetURL = function(alias) { 
  if (!assets[alias]) { 
  broadcastEvent(EVENTS.ERROR, 'Alias unknown.', 'getAssetURL'); 
  } 
  return assets[alias]; 
  }; 
   
  ormma.getCacheRemaining = function() { 
  if (!supports[FEATURES.LEVEL3]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'getCacheRemaining'); 
  } 
  return cacheRemaining; 
  }; 
   
  ormma.request = function(uri, display) { 
  if (!supports[FEATURES.LEVEL3]) { 
  broadcastEvent(EVENTS.ERROR, 'Method not supported by this client.', 'request'); 
  } else if (!uri || typeof uri != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'URI is required.', 'request'); 
  } else { 
  ormmaview.request(uri, display); 
  } 
  }; 
   
  ormma.removeAllAssets = function() { 
  for (var alias in assets) { 
  ormma.removeAsset(alias); 
  } 
  }; 
   
  ormma.removeAsset = function(alias) { 
  if (!alias || typeof alias != 'string') { 
  broadcastEvent(EVENTS.ERROR, 'Alias is required.', 'removeAsset'); 
  } else if (!assets[alias]) { 
  broadcastEvent(EVENTS.ERROR, 'Alias unknown.', 'removeAsset'); 
  } else if (supports[FEATURES.LEVEL3]) { 
  ormmaview.removeAsset(alias); 
  } else { 
  assets[alias] = null; 
  delete assets[alias]; 
  broadcastEvent(EVENTS.ASSETREMOVED, alias); 
  } 
  }; 
   
  ormma.getViewable = function() { 
  return viewable; 
  }; 
   
  ormma.getPlacementType = function() { 
  if (document.URL.indexOf("BannerOnly") != -1) 
  return "inline"; 
   
  return "interstitial"; 
  }; 
   
  ormma.isViewable = function() { 
  return true; 
  }; 
})(); 
</script> 
<script> 
(function() { 
        var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase()); 
        if (isIOS) { 
                console = {}; 
                console.log = function(log) { 
                var iframe = document.createElement('iframe'); 
                iframe.setAttribute('src', 'ios-log: ' + log); 
                document.documentElement.appendChild(iframe); 
                iframe.parentNode.removeChild(iframe); 
                iframe = null; 
        }; 
    console.debug = console.info = console.warn = console.error = console.log; 

}()); 
 
(function() { 
   // Establish the root mraidbridge object. 
        var mraidbridge = window.mraidbridge = {}; 
    
   // Listeners for bridge events. 
        var listeners = {}; 
    
   // Queue to track pending calls to the native SDK. 
        var nativeCallQueue = []; 
    
   // Whether a native call is currently in progress. 
        var nativeCallInFlight = false; 
    
   ////////////////////////////////////////////////////////////////////////////////////////////////// 
    
        mraidbridge.fireReadyEvent = function() { 
                mraidbridge.fireEvent('ready'); 
        }; 
    
        mraidbridge.fireChangeEvent = function(properties) { 
                mraidbridge.fireEvent('change', properties); 
        }; 
    
        mraidbridge.fireErrorEvent = function(message, action) { 
        mraidbridge.fireEvent('error', message, action); 
        }; 
    
        mraidbridge.fireEvent = function(type) { 
                var ls = listeners[type]; 
                if (ls) { 
                        var args = Array.prototype.slice.call(arguments); 
                        args.shift(); 
                        var l = ls.length; 
                        for (var i = 0; i < l; i++) { 
                                ls[i].apply(null, args); 
                        } 
                } 
        }; 
    
        mraidbridge.nativeCallComplete = function(command) { 
                if (nativeCallQueue.length === 0) { 
                        nativeCallInFlight = false; 
                        return; 
                } 
    
                var nextCall = nativeCallQueue.pop(); 
        window.location = nextCall; 
    }; 
    
        mraidbridge.executeNativeCall = function(command) { 
                var call = 'mraid://' + command; 
    
                var key, value; 
                var isFirstArgument = true; 
    
                for (var i = 1; i < arguments.length; i += 2) { 
                        key = arguments[i]; 
                        value = arguments[i + 1]; 
    
                        if (value === null) continue; 
    
                        if (isFirstArgument) { 
                                call += '?'; 
                                isFirstArgument = false; 
                        } else { 
                                call += '&'; 
                        } 
    
                        call += key + '=' + escape(value); 
        } 
    
                if (nativeCallInFlight) { 
                        nativeCallQueue.push(call); 
                } else { 
                        nativeCallInFlight = true; 
                        window.location = call; 
                } 
        }; 
    
   ////////////////////////////////////////////////////////////////////////////////////////////////// 
    
        mraidbridge.addEventListener = function(event, listener) { 
                var eventListeners; 
                listeners[event] = listeners[event] || []; 
        eventListeners = listeners[event]; 
    
                for (var l in eventListeners) { 
                        // Listener already registered, so no need to add it. 
                        if (listener === l) return; 
                } 
    
                eventListeners.push(listener); 
        }; 
    
        mraidbridge.removeEventListener = function(event, listener) { 
        if (listeners.hasOwnProperty(event)) { 
                        var eventListeners = listeners[event]; 
                        if (eventListeners) { 
                                var idx = eventListeners.indexOf(listener); 
                                if (idx !== -1) { 
                                        eventListeners.splice(idx, 1); 
                                } 
                        } 
                } 
        }; 
    
        mraidbridge.close = function () { 
                //this.executeNativeCall('close'); 
                MRAIDDisplayControllerBridge.close(); 
        }; 
    
        mraidbridge.open = function (URL) { 
                //this.executeNativeCall('open', 'url', URL); 
                MRAIDDisplayControllerBridge.open(URL); 
        }; 
    
        mraidbridge.useCustomClose = function (shouldUseCustomClose) { 
                //this.executeNativeCall('usecustomclose', 'shouldUseCustomClose', shouldUseCustomClose); 
                mraidExpandProperties.useCustomClose = shouldUseCustomClose; 
        }; 
  
        mraidbridge.expand = function (URL, expandProperties, hasSetCustomClose, hasSetCustomSize) { 
        /*var args = ['expand']; 
      
        if (hasSetCustomClose) { 
                args = args.concat(['shouldUseCustomClose', expandProperties.useCustomClose ? 'true' : 'false']); 
                } 
      
        if (hasSetCustomSize) { 
                if (expandProperties.width >= 0 && expandProperties.height >= 0) { 
                        args = args.concat(['w', expandProperties.width, 'h', expandProperties.height]); 
                } 
        } 
      
        if (typeof expandProperties.lockOrientation !== 'undefined') { 
                args = args.concat(['lockOrientation', expandProperties.lockOrientation]); 
        } 
      
        if (URL) { 
                args = args.concat(['url', URL]); 
        } 
  
                this.executeNativeCall.apply(this, args);*/ 
                MRAIDDisplayControllerBridge.mraidExpand(URL, expandProperties, expandProperties.useCustomClose, hasSetCustomSize); 
        }; 
  
        mraidbridge.resize = function (resizeProperties) { 
       /*this.executeNativeCall('mraidresize',   'width', resizeProperties.width, 
                                'height', resizeProperties.height, 
                                'customClosePos', resizeProperties.customClosePosition, 
                                'offsetX', resizeProperties.offsetX, 
                                'offsetY', resizeProperties.offsetY, 
                                'allowOffscreen', resizeProperties.allowOffscreen);*/ 
                 
                //This is WRONG! no params should be here. 
                //Patchy... 
                 
                MRAIDDisplayControllerBridge.setResizeProperties(JSON.stringify(resizeProperties)) 
                MRAIDDisplayControllerBridge.resize(); 
        }; 
    
        mraidbridge.setOrientationProperties = function(orientationProperties) { 
                /*this.executeNativeCall('changeOrientation', 
                                'allowOrientationChange', orientationProperties.allowOrientationChange, 
                                'forceOrientation', orientationProperties.forceOrientation);*/ 
                MRAIDDisplayControllerBridge.setOrientationProperties(orientationProperties.allowOrientationChange, orientationProperties.forceOrientation); 
        }; 
    
        mraidbridge.createCalendarEvent = function(val) { 
                //this.executeNativeCall('calendar', 'eventData', JSON.stringify(val)); 
                MRAIDDisplayControllerBridge.createCalendarEvent(JSON.stringify(val)); 
        }; 
    
        mraidbridge.playVideo = function(url) { 
                //this.executeNativeCall('playVideo', 'url', url); 
                MRAIDDisplayControllerBridge.playVideo(url); 
        }; 
    
        mraidbridge.storePicture = function(uri) { 
                //this.executeNativeCall('storePicture', 'uri', uri); 
                MRAIDDisplayControllerBridge.storePicture(uri); 
        }; 
}()); 
// End of bridge. //////////////////////////////////////////////////////////////////////////// 
</script><script> 
(function() { 
   var mraid = window.mraid = {}; 
   var bridge = window.mraidbridge; 
    
   // Constants. //////////////////////////////////////////////////////////////////////////////////// 
    
   var VERSION = mraid.VERSION = '2.0'; 
    
   var STATES = mraid.STATES = { 
                LOADING:        'loading',     // Initial state. 
                DEFAULT:        'default', 
                EXPANDED:       'expanded', 
                HIDDEN:         'hidden', 
                RESIZED:        'resized' 
   }; 
    
   var EVENTS = mraid.EVENTS = { 
                ERROR:                  'error', 
                INFO:                   'info', 
                READY:                  'ready', 
                STATECHANGE:    'stateChange', 
                VIEWABLECHANGE: 'viewableChange', 
                SIZECHANGE:             'sizeChange' 
   }; 
    
   var PLACEMENT_TYPES = mraid.PLACEMENT_TYPES = { 
                UNKNOWN:                'unknown', 
                INLINE:                 'inline', 
                INTERSTITIAL:   'interstitial' 
   }; 
    
   var MRAID_SUPPORTS = mraid.SUPPORTS = { 
       'sms'               : true, 
       'tel'               : true, 
       'calendar'          : true, 
       'storePicture'      : true, 
       'inlineVideo'       : true 
   }; 
    
   var currentPosition = { 
       x:0, 
       y:0, 
       width:0, 
       height:0 
   }; 
    
   var mraidDefaultPosition = { 
       x:0, 
       y:0, 
       width:0, 
       height:0 
   }; 
    
   var mraidMaxSize = { 
       width:0, 
       height:0 
   }; 
    
   var screenSize = { 
       width:0, 
       height:0 
   }; 
 
   var resizeProperties = { 
       width:0, 
       height:0, 
       customClosePosition:'top-right', 
       offsetX:0, 
       offsetY:0, 
       allowOffscreen:true 
   }; 
    
   var orientationProperties = { 
       allowOrientationChange:true, 
       forceOrientation:'none' 
   }; 
   // External MRAID state: may be directly or indirectly modified by the ad JS. //////////////////// 
    
   // Properties which define the behavior of an expandable ad. 
   var mraidExpandProperties = { 
       width: -1, 
       height: -1, 
       useCustomClose: false, 
       isModal: false, 
       lockOrientation: false 
   }; 
    
   var hasSetCustomSize = false; 
    
   var hasSetCustomClose = false; 
    
   var listeners = {}; 
    
   // Internal MRAID state. Modified by the native SDK. ///////////////////////////////////////////// 
    
   var state = STATES.LOADING; 
    
   var isViewable = false; 
    
   var screenSize = { width: -1, height: -1 }; 
    
   //var placementType = PLACEMENT_TYPES.UNKNOWN; 
   //on 4.1.2 the ad calls getPlacementType before we do the "set". 
   //So in some ads, the type will be wrong. Since most of our ads are banners, we put the default 
   //to "inline" instead of "unknown" to reduce the chances that we will fail here. 
   var placementType = PLACEMENT_TYPES.INLINE; 
    
   ////////////////////////////////////////////////////////////////////////////////////////////////// 
    
   var EventListeners = function(event) { 
       this.event = event; 
       this.count = 0; 
       var listeners = {}; 
        
       this.add = function(func) { 
           var id = String(func); 
           if (!listeners[id]) { 
                        listeners[id] = func; 
                        this.count++; 
           } 
       }; 
        
       this.remove = function(func) { 
           var id = String(func); 
           if (listeners[id]) { 
                        listeners[id] = null; 
                        delete listeners[id]; 
                        this.count--; 
                        return true; 
           } else { 
                        return false; 
           } 
       }; 
        
       this.removeAll = function() { 
           for (var id in listeners) { 
                        if (listeners.hasOwnProperty(id)) this.remove(listeners[id]); 
           } 
       }; 
        
       this.broadcast = function(args) { 
           for (var id in listeners) { 
                        if (listeners.hasOwnProperty(id)) listeners[id].apply({}, args); 
           } 
       }; 
        
       this.toString = function() { 
           var out = [event, ':']; 
           for (var id in listeners) { 
                        if (listeners.hasOwnProperty(id)) out.push('|', id, '|'); 
           } 
           return out.join(''); 
       }; 
   }; 
    
   var broadcastEvent = function() { 
       var args = new Array(arguments.length); 
       var l = arguments.length; 
       for (var i = 0; i < l; i++) 
                        args[i] = arguments[i]; 
       var event = args.shift(); 
       if (listeners[event]) 
                        listeners[event].broadcast(args); 
   }; 
    
   var contains = function(value, array) { 
       for (var i in array) { 
                if (array[i] === value) 
                                return true; 
       } 
       return false; 
   }; 
    
   var clone = function(obj) { 
       if (obj === null) 
                        return null; 
       var f = function() {}; 
       f.prototype = obj; 
       return new f(); 
   }; 
    
   var stringify = function(obj) { 
       if (typeof obj === 'object') { 
                var out = []; 
                if (obj.push) { 
                        // Array. 
                        for (var p in obj) out.push(obj[p]); 
                                return '[' + out.join(',') + ']'; 
                } else { 
                        // Other object. 
                        for (var p in obj) out.push("'" + p + "': " + obj[p]); 
                                return '{' + out.join(',') + '}'; 
                } 
       } else 
                        return String(obj); 
   }; 
    
   var trim = function(str) { 
                return str.replace(/^\s+|\s+$/g, ''); 
   }; 
    
   // Functions that will be invoked by the native SDK whenever a "change" event occurs. 
   var changeHandlers = { 
       state: function(val) { 
           if (state === STATES.LOADING) { 
                        broadcastEvent(EVENTS.INFO, 'Native SDK initialized.'); 
           } 
           state = val; 
           broadcastEvent(EVENTS.INFO, 'Set state to ' + stringify(val)); 
           broadcastEvent(EVENTS.STATECHANGE, state); 
       }, 
        
       viewable: function(val) { 
           isViewable = val; 
           broadcastEvent(EVENTS.INFO, 'Set isViewable to ' + stringify(val)); 
           broadcastEvent(EVENTS.VIEWABLECHANGE, isViewable); 
       }, 
        
       placementType: function(val) { 
           broadcastEvent(EVENTS.INFO, 'Set placementType to ' + stringify(val)); 
           placementType = val; 
       }, 
    
       screenSize: function(val) { 
                broadcastEvent(EVENTS.INFO, 'Set screenSize to ' + stringify(val)); 
                for (var key in val) { 
                        if (val.hasOwnProperty(key)) screenSize[key] = val[key]; 
                } 
        
           if (!hasSetCustomSize) { 
                        mraidExpandProperties['width'] = screenSize['width']; 
                        mraidExpandProperties['height'] = screenSize['height']; 
           } 
       }, 
    
                expandProperties: function(val) { 
                broadcastEvent(EVENTS.INFO, 'Merging mraidExpandProperties with ' + stringify(val)); 
                        for (var key in val) { 
                                if (val.hasOwnProperty(key)) { 
                                        mraidExpandProperties[key] = val[key]; 
                                } 
                        } 
                } 
   }; 
    
   var validate = function(obj, validators, action, merge) { 
       if (!merge) { 
                // Check to see if any required properties are missing. 
                if (obj === null) { 
                        broadcastEvent(EVENTS.ERROR, 'Required object not provided.', action); 
                        return false; 
                } else { 
                        for (var i in validators) { 
                                if (validators.hasOwnProperty(i) && obj[i] === undefined) { 
                                        broadcastEvent(EVENTS.ERROR, 'Object is missing required property: ' + i + '.', action); 
                                        return false; 
                                } 
                        } 
                } 
       } 
        
       for (var prop in obj) { 
                var validator = validators[prop]; 
                var value = obj[prop]; 
                if (validator && !validator(value)) { 
                        // Failed validation. 
                        broadcastEvent(EVENTS.ERROR, 'Value of property ' + prop + ' is invalid.', 
                      action); 
                        return false; 
                } 
       } 
       return true; 
   }; 
    
   var mraidExpandPropertyValidators = { 
          isModal:function(value) { return (value === true || value === false); }, 
          useCustomClose:function(value) { return (value === true || value === false); },  
          width:function(value) { return !isNaN(value) && value >= 0; },  
          height:function(value) { return !isNaN(value) && value >= 0; }      
  }; 
    
   ////////////////////////////////////////////////////////////////////////////////////////////////// 
    
   bridge.addEventListener('change', function(properties) { 
                           for (var p in properties) { 
                           if (properties.hasOwnProperty(p)) { 
                           var handler = changeHandlers[p]; 
                           handler(properties[p]); 
                           } 
                           } 
                           }); 
    
   bridge.addEventListener('error', function(message, action) { 
                           broadcastEvent(EVENTS.ERROR, message, action); 
                           }); 
    
   bridge.addEventListener('ready', function() { 
                           broadcastEvent(EVENTS.READY); 
                           }); 
    
   ////////////////////////////////////////////////////////////////////////////////////////////////// 
    
   mraid.addEventListener = function(event, listener) { 
       if (!event || !listener) { 
                broadcastEvent(EVENTS.ERROR, 'Both event and listener are required.', 'addEventListener'); 
       } else if (!contains(event, EVENTS)) { 
                broadcastEvent(EVENTS.ERROR, 'Unknown MRAID event: ' + event, 'addEventListener'); 
       } else { 
                if (!listeners[event]) listeners[event] = new EventListeners(event); 
                listeners[event].add(listener); 
       } 
   }; 
    
   mraid.close = function() { 
                if (state === STATES.HIDDEN) { 
                        broadcastEvent(EVENTS.ERROR, 'Ad cannot be closed when it is already hidden.', 
                  'close'); 
                } else 
                        bridge.close(); 
   }; 
    
   mraid.expand = function(URL) { 
                if (state !== STATES.DEFAULT) { 
                        broadcastEvent(EVENTS.ERROR, 'Ad can only be expanded from the default state. state = ' + state, 'expand'); 
                } else { 
                        bridge.expand(URL, mraidExpandProperties, hasSetCustomClose, hasSetCustomSize); 
        } 
   }; 
    
   mraid.getExpandProperties = function() { 
       var properties = { 
           width: mraidExpandProperties.width, 
           height: mraidExpandProperties.height, 
           useCustomClose: mraidExpandProperties.useCustomClose, 
           isModal: mraidExpandProperties.isModal 
       }; 
        
       return properties; 
   }; 
    
   mraid.getPlacementType = function() { 
                return placementType; 
   }; 
    
   mraid.getState = function() { 
                return state; 
   }; 
    
   mraid.getVersion = function() { 
                return mraid.VERSION; 
   }; 
    
   mraid.isViewable = function() { 
                return isViewable; 
   }; 
    
        mraid.open = function(URL) { 
                if (!URL) 
                        broadcastEvent(EVENTS.ERROR, 'URL is required.', 'open'); 
                else 
                        bridge.open(URL); 
   }; 
    
    mraid.removeEventListener = function(event, listener) { 
                if (!event) 
                        broadcastEvent(EVENTS.ERROR, 'Event is required.', 'removeEventListener'); 
                else { 
                        if (listener && (!listeners[event] || !listeners[event].remove(listener))) { 
                                broadcastEvent(EVENTS.ERROR, 'Listener not currently registered for event.', 
                  'removeEventListener'); 
                                return; 
                        } else 
                                if (listeners[event]) 
                                        listeners[event].removeAll(); 
    
                        if (listeners[event] && listeners[event].count === 0) { 
                                listeners[event] = null; 
                                delete listeners[event]; 
                        } 
                } 
   }; 
    
   mraid.setExpandProperties = function(properties) { 
                if (validate(properties, mraidExpandPropertyValidators, 'setMraidExpandProperties', true)) { 
                 
                        if (properties.hasOwnProperty('width') || properties.hasOwnProperty('height')) { 
                                hasSetCustomSize = true; 
                        } 
    
            if (properties.hasOwnProperty('useCustomClose')) hasSetCustomClose = true; 
        
            var desiredProperties = ['width', 'height', 'useCustomClose', 'lockOrientation']; 
            var length = desiredProperties.length; 
            for (var i = 0; i < length; i++) { 
                var propname = desiredProperties[i]; 
                if (properties.hasOwnProperty(propname)) { 
                    mraidExpandProperties[propname] = properties[propname]; 
                } 
            } 
             
                } 
   }; 
    
   mraid.useCustomClose = function(shouldUseCustomClose) { 
                mraidExpandProperties.useCustomClose = shouldUseCustomClose; 
                hasSetCustomClose = true; 
                //bridge.useCustomClose(shouldUseCustomClose); 
   }; 
    
   mraid.getOrientationProperties = function () { 
                return clone(orientationProperties); 
   }; 
    
   mraid.getCurrentPosition = function () { 
                return clone(currentPosition); 
   }; 
    
   mraid.setCurrentPosition = function (val) { 
                currentPosition = val; 
   }; 
    
   mraid.getMaxSize = function () { 
                return clone(mraidMaxSize); 
   }; 
    
   mraid.setMraidMaxSize = function (val) { 
                mraidMaxSize = val; 
   }; 
    
   mraid.getResizeProperties = function () { 
                return clone(resizeProperties); 
   }; 
    
   mraid.setResizeProperties = function (properties) { 
                resizeProperties = properties; 
   }; 
    
   mraid.resize = function () { 
       // TODO check state 
       if (resizeProperties.width != 0 && resizeProperties.height != 0) { 
           mraidbridge.resize(resizeProperties); 
       } 
   }; 
    
   mraid.sendChangeSizeEvent = function(width, height) { 
                broadcastEvent(EVENTS.SIZECHANGE, width, height); 
   }; 
    
   mraid.getScreenSize = function () { 
                return clone(screenSize); 
   }; 
    
   mraid.setScreenSize = function (val) { 
                screenSize = val; 
   }; 
    
   mraid.getDefaultPosition = function () { 
                return clone(mraidDefaultPosition); 
   }; 
    
   mraid.setMraidDefaultPosition = function (val) { 
                mraidDefaultPosition = val; 
   }; 
    
    
   mraid.setOrientationProperties = function (properties) { 
                orientationProperties = properties; 
                bridge.setOrientationProperties(orientationProperties); 
   }; 
    
   mraid.createCalendarEvent = function( val ) { 
                bridge.createCalendarEvent(val); 
   }; 
    
   mraid.supports = function(feature) { 
                return mraid.SUPPORTS[feature]; 
   }; 
    
   mraid.setSupportsFeature = function(feature, support) { 
                mraid.SUPPORTS[feature] = support; 
                return "OK"; 
   }; 
    
   mraid.playVideo = function(url) { 
                bridge.playVideo(url); 
   }; 
    
   mraid.storePicture = function(uri) { 
                bridge.storePicture(uri); 
   }; 
 
   }()); 
</script>    <meta name="inneractive-cid" content="55274242975" />
        <meta name="inneractive-session" content="6687182212230465925" />
    <meta name="inneractive-error" content="Internal Error"/>
    <meta name="inneractive-ad-width" content="320" />
    <meta name="inneractive-ad-height" content="53" />
    <meta name="inneractive-ad-network" content="Inneractive 360" />
    <meta name="inneractive-ad-type" content="3"/>

        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta name="apple-touch-fullscreen" content="yes" />
        <meta name="HandheldFriendly" content="true" />
        <meta name="MobileOptimized" content="width" />

        <script language="javascript" src="http://cdn2.inner-active.mobi/wv-js/iagetters.js"></script>
<script>
</script>


<link rel="stylesheet" type="text/css" href="http://cdn2.inner-active.mobi/wv-css/prod/151211/b_style.css" />
    <link rel="stylesheet" type="text/css" href="http://cdn2.inner-active.mobi/wv-css/prod/151211/b_android.css" />
<div id="append"></div>

            <img id='iaIImpressionTrackingPixel' alt="" style='width:0px;height:0px;border:0px;margin:0px;float:left;'/>
            <script>
                document.getElementById('iaIImpressionTrackingPixel').src = "http://event.inner-active.mobi/simpleM2M/impressionTrackPixel?redirect=false&sessionId=6687182212230465925&cid=55274242975&aid=79818&v=2.1.0-Android-4.0.2.7&po=559&cip=190.239.77.11&ua=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+4.1.2%3B+es-us%3B+GT-I8190L+Build%2FJZO54K%29+AppleWebKit%2F534.30+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F534.30&re=9&l=0&cuid=55075813475&network=Inneractive+360";
            </script>


<div id='iawrapper'>
        <a href="http://wv.inner-active.mobi/simpleM2M/ClientUpdateStatus?cn=iHandyInc_PanelFlashlightAndroid_Android&v=2_1_0-Android-4_0_2_7&ci=55274242975&s=6687182212230465925&cip=190-239-77-11&po=559&re=9&lt=0&cc=PE&acp=&pcp=">
                <img id="iaAd" src="http://cdn1.inner-active.mobi/mnt/InnerActive/Resources/housead_Nov_12/320x53_a.png" />
        </a>
</div>

<script>
    function iaAddTrackingPixel(trackingPixelSrc, shouldSendArguments, argumentsObj) {
                if (trackingPixelSrc != '') {
                        var track = new Image();
            if (shouldSendArguments) {
                track.src = trackingPixelSrc + encodeURI(JSON.stringify(argumentsObj));
            } else {
                track.src = trackingPixelSrc;
            }
                        track.width = '1';
                        track.height = '1';

                        document.getElementById("track_href").appendChild(track);
           }
        }

                function redirect(hrefObj, argumentsObj) {
                        var timeout = setTimeout(function(){
                                                        mraid.open(hrefObj.href);
                   }, 400);
                }

                function iaAddTrackingPixelForClick(hrefObj) {
                }

                function reportOpen(hrefObj) {
                        try {
                                iaAddTrackingPixelForClick(hrefObj);
                        } catch(err) {
                        }

                        if (oldOnClick) {
                                oldOnClick.apply();
                        }
                        redirect(hrefObj);
                        return false;
                }

                function redirectToAdPage(adPageUrl){
                        top.location.href = adPageUrl;
                }

                function attachHrefHandler(hrefObj) {
                   if(hrefObj.id && hrefObj.id.substring(0,2) == 'ia') {
                                return false;
                   }
                   if (hrefObj.href.substring(0,10) == 'javascript') {
                                return false;
                   }

                   oldOnClick = hrefObj.onclick;
                   hrefObj.onclick=function(){
                                reportOpen(hrefObj, oldOnClick);

                                return false;
                        }
                }

                                function linkClicked(link, event){
                                        var iaServer = "http://wv.inner-active.mobi/simpleM2M/redirect/6687182212230465925/79818/55274242975/559/9/2_1_0-Android-4_0_2_7/0/?pcp=&acp=";
                                        var linkHref = link.href;
                                        if (linkHref.indexOf(iaServer + "&url=") == -1) {
                                            var originalURL = encodeURIComponent(linkHref);
                            var iaURL = iaServer;
                            iaURL += "&url=" + originalURL;
                            link.href = iaURL;
                                        }
                    }

                    var iaWrapperDiv = document.getElementById('iawrapper');
                    if (iaWrapperDiv != null) {
                        var elements = iaWrapperDiv.getElementsByTagName('a');
                        for(var i = 0, len = elements.length; i < len; i++) {
                            var currentElement = elements[i];
                            if (!(currentElement.href.indexOf("http://wv.inner-active.mobi/simpleM2M/") == 0)
                                    && (currentElement.href.indexOf("http") == 0)) {
                                if (currentElement.addEventListener){
                                    currentElement.addEventListener("click", function(event) {
                                                    linkClicked(this, event);
                                    });
                                } else if (currentElement.attachEvent) {
                                    currentElement.attachEvent("onclick", function(event) {
                                                    linkClicked(currentElement, event);
                                    });
                                } else {
                                }
                            }
                        }
                                }
</script>
<div id="track_href"></div>

    <div id="iaRichMediaBridge"></div>
        <script>
        </script>
</div>
<script>
        function setStyleCss() {
                document.getElementById('iaBody').style.height='100%';
                document.getElementById('iaBody').style.width='100%';
                document.getElementById('iaBody').style.textAlign='center';
                document.getElementById('iaBody').style.display='table';
                document.getElementById('iaBody').style.verticalAlign='middle';
                
                document.getElementById('iaAndroidContainer').style.display='table-cell';
                document.getElementById('iaAndroidContainer').style.verticalAlign='middle';
        }
setStyleCss()</script>
<script>
        function clearStyleCss() {
                document.getElementById('iaBody').style.height='';
                document.getElementById('iaBody').style.width='';
                document.getElementById('iaBody').style.textAlign='';
                document.getElementById('iaBody').style.display='';
                document.getElementById('iaBody').style.verticalAlign='';
                document.getElementById('iaAndroidContainer').style.display='';
                document.getElementById('iaAndroidContainer').style.verticalAlign='';
        }
</script>
</body></html>