var pagepeel = new Object();

pagepeel.ad_url = escape('http://buzilka.ru/'); //ссылка, на которую будет вести баннер

pagepeel.small_path = './pagepeel/small.swf'; // путь к файлу small.swf
pagepeel.small_image = escape('./pagepeel/images/small.jpg'); // путь к маленькому изображению уголка (до наведения мышью на баннер) (поддерживаются форматы - .jpg, .gif, .png, .swf) - 75X75
pagepeel.small_width = '100'+'px';
pagepeel.small_height = '100'+'px';
pagepeel.small_params = 'ico=' + pagepeel.small_image;

pagepeel.big_path = './pagepeel/big.swf'; // путь к файлу big.swf
pagepeel.big_image = escape('./pagepeel/images/big.jpg'); // путь к большому изображению уголка (при наведении )(.jpg, .gif, .png, .swf) - 500X500
pagepeel.big_width = '650';
pagepeel.big_height = '650';
pagepeel.big_params = 'big=' + pagepeel.big_image + '&ad_url=' + pagepeel.ad_url;

function sizeup987(){
  document.getElementById('PagePeelBig').style.top = '0px';
  document.getElementById('PagePeelSmall').style.top = '-1000px';
}

function sizedown987(){
  document.getElementById("PagePeelSmall").style.top = "0px";
  document.getElementById("PagePeelBig").style.top = "-1000px";
}


// скрипт Коробкина Дмитрия aka Octane [ www.codeisart.ru / www.js-core.ru]
function insertFlash(node, url, width, height, params) {
  var object, param, key;
  function newParam(name, value) {
    if(0 /*@cc_on + 1 @*/) return ['<param name="', name, '" value="', value, '" />'].join('');
    else {
      param = document.createElement('param');
      param.name = name;
      param.value = value;
      return param;
    }
  }
  if(0 /*@cc_on + 1 @*/) {
    object = ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="', width, '" height="', height, '"><param name="movie" value="', url, '" />'];
    if(params) for(key in params) if(params.hasOwnProperty(key)) object.push(newParam(key, params[key]));
    object.push('<\/object>');
    node.innerHTML = object.join('');
  }
  else {
    object = document.createElement('object');
    object.type = 'application/x-shockwave-flash';
    object.data = url;
    object.width = width;
    object.height = height;
    if(params) for(key in params) if(params.hasOwnProperty(key)) object.appendChild(newParam(key, params[key]));
    while(node.firstChild) node.removeChild(node.firstChild);
    node.appendChild(object);
  }
}
    
window.onload = function() {
  
  var bigFlash = document.createElement('div');
  bigFlash.id = 'PagePeelBig';
  bigFlash.style.position = 'absolute';
  bigFlash.style.top = '-1000px';
  bigFlash.style.right = '0px';
  bigFlash.style.zIndex = '9999';
  bigFlash.style.width = pagepeel.big_width;
  bigFlash.style.height= pagepeel.big_height;
  document.body.appendChild(bigFlash);
  
  var flash2 = document.getElementById('PagePeelBig');
  var url2 = pagepeel.big_path + '?' + pagepeel.big_params;
  var width2 = pagepeel.big_width;
  var height2 = pagepeel.big_height;
  var parametrs2 = {
    wmode: 'transparent',
    quality: 'high'
  };
  
  var smallFlash = document.createElement('div');
  smallFlash.id = 'PagePeelSmall';
  smallFlash.style.position = 'absolute';
  smallFlash.style.top = '0px';
  smallFlash.style.right = '0px';
  smallFlash.style.zIndex = '9999';
  smallFlash.style.width = pagepeel.small_width;
  smallFlash.style.height= pagepeel.small_height;
  document.body.appendChild(smallFlash);
      
  var flash = document.getElementById('PagePeelSmall');
  var url = pagepeel.small_path + '?' + pagepeel.small_params;
  var width = pagepeel.small_width;
  var height = pagepeel.small_height;
  var parametrs = {
    wmode: 'transparent',
    quality: 'high'
  };
  
  
  insertFlash(flash2, url2, width2, height2, parametrs2);
  insertFlash(flash, url, width, height, parametrs);
  
};
