function vzw_encode(elm){
  var href = $(elm).attr('href');
  if(!href.match(/^http:\/\/(www\.)?(verizonwireless|vzw)\.com(\/)?$/)){
    return;
  }
  if(href.match(/phandroid/)){
    return;
  }
  if($(elm).parent("textarea")){
    return;
  }

  new_href = 'http://phandroid.com/verizon.php?vrr=1&url=' + encodeURI(href);
  $(elm).attr('href',new_href);
  $(elm).attr('target','_blank');
  
}


jQuery("a").live("hover",function(){
  if(!$(this).attr('href')){
    return;
  }
  vzw_encode($(this));
});


function vzw_encode_all(){
  jQuery("a").each(function(ii,elm){
    if(!$(elm).attr('href')){
      return;
    }
    vzw_encode(elm);
  });

}

jQuery(document).ready(function(){
  vzw_encode_all();
});

