OPERADOR DE TRATOR MALUCO
Autor: Victor Santtos | Publicado: 2011-09-24T07:17:00-07:00


 object#player { position:relative; }


LOL


 var playCheck = false;
 var adsStarted = false;
 var adaptvCompanionAdTag = '';

    function displayPlayer(autoplay) {
         var playerVersion = swfobject.getFlashPlayerVersion();
  var playerSWFname;
  var playerVersionNumber = playerVersion.major + playerVersion.minor / 10;
  if (playerVersionNumber < 10 ) {
   playerSWFname = "player.swf";
  } else if (playerVersionNumber >= 10 && playerVersionNumber < 10.2) {
   playerSWFname = "player_10_0.swf";
  } else {
   playerSWFname = "player_10_2.swf";
  }  
        var autoplay = typeof(autoplay) != 'undefined' ? autoplay : true;
        var flashvars = {};
        flashvars.autoplay = autoplay;
        flashvars.video_url = 'http://' + 'cdn1.videos.videobash.com/201008/27/2684/480_2684.mp4?ir%3D-1%26sr%3D1500%26int%3D10%25';
        flashvars.related_url = 'http://' + 'www.videobash.com/video/player_related' + '?id=2684';
        flashvars.link_url = 'http://' + 'www.videobash.com/video_show/crazy-combine-operator-2684';
                flashvars.up_next = "%5B%22http%3A%5C%2F%5C%2Fwww.videobash.com%5C%2Fvideo_show%5C%2Fdogs-are-so-funny-772%22%2C%22http%3A%5C%2F%5C%2Fcdn1.images.videobash.com%5C%2Fthumbs%5C%2F000%5C%2F000%5C%2F772%5C%2F137x77%5C%2F137x77_1.jpg%22%2C%22Dogs+are+so+funny%22%2C%22496089%22%5D";
                flashvars.video_title = "Crazy combine operator";
        //flashvars.isFavorite = '0';
        //flashvars.favorite_js = 'addFavorite(2684)';
        //flashvars.embed_js = "playerEmbed()";
        flashvars.end_js = "nextVideo()";
        flashvars.like_js = "rateItemPlayer()";
        flashvars.tj_zone_url = "http://ads.videobash.com/ads?zone_id=918&site_id=26";
        flashvars.hash_tag = "Funny_Videos";
        flashvars.postroll_url = "show";
        flashvars.disablePauseroll = "true";
                flashvars.fbEnable = "true";
          playCheck = true;
        var params = {};
        params.allowfullscreen = "true";
        params.allowScriptAccess = "always";
        params.wmode = "transparent";
        swfobject.embedSWF("http://resources.videobash.com/flash/" + playerSWFname, "player", "636", "386", "9.0.115", "", flashvars, params);
            }


function playAd(tryAgain){
 $("#player").html(''); 
 
 var adap = __adaptv__;
 var myvpaidad = new adap.ads.vpaid.VPAIDAd('player');
 var Event = adap.ads.vpaid.VPAIDEvent;
                   
 var onEvent = function(e) {
   switch (e.type) {
     case Event.AdLoaded:
       myvpaidad.startAd();
       break;
     case Event.AdStarted:
       adsStarted = true;
       break;
     case Event.AdCompanionDisplay:
       break;
     case Event.AdClickThru:
       setTimeout(displayPlayer, 1000);
       break;
     case Event.AdStopped:
       if (adsStarted) {
         displayPlayer();
       }
       else { //no ads
         if(tryAgain){
           playAd(false);
   }
   else{
          $("#companion").html(adaptvCompanionAdTag);
          displayPlayer();
   }
       }
       break;
     case Event.AdError:
      if(tryAgain){
         playAd(false);
  }
  else{
         $("#companion").html(adaptvCompanionAdTag);
      displayPlayer();
  }
        break;
   }
 };
         
 for (var evtname in Event) {
   if (Event.hasOwnProperty(evtname)) {
     myvpaidad.on(Event[evtname], onEvent)
   }
 }
 var flashvars_adap = {
   key: "manwin",               // Your publisher key provided by Adap.tv
   zid: "default",                    // Name of the zone for this videoview. Defaults to "default"
   videoPlayerId: "player",    // Div of the player
   id: tryAgain ? "2684" : "prerolls_30",              // The unique identifier of the video (limit 64 chars)
   companionId: "companion",      // The id attribute of the div to contain the companion ad
   categories: "funny,other",
   context: {allowlong: tryAgain ? 0 : 1}
    };
 myvpaidad.initAd(600, 386, flashvars_adap);
}
playAd(true);


 function checkAdd() {
  if(adsStarted == false && playCheck == false) {                            
     $("#companion").html(adaptvCompanionAdTag);
     displayPlayer();
  };
 };
 $(document).ready(function() {      
  setTimeout(checkAdd, 6000);
 });


 var loadCounter = 3;
 function nextVideo(){
  var autoplay = $("#nextvideo").attr('checked');
  if(autoplay){
   if(loadCounter <= 0){
    nextVideoGo();
   }
   else{
    $("#loadCounter").html('&nbsp;&nbsp; Loading in .. ' + loadCounter);
    loadCounter--;
    setTimeout(nextVideo, 1000);
   }
  }
 }
 function nextVideoGo(){
    window.location = "http://www.videobash.com/video_show/dogs-are-so-funny-772";
   }
 function setNextVideo(){
  var autoplay = $("#nextvideo").attr('checked') ? 1 : 0;
  $.post('http://www.videobash.com/video/autoplay_click',{'autoplay':autoplay},function(response) {});  
 }
 
 function rateItemPlayer(){
  rateItem(2684, 1);
 }