 /**
 * Script is used to manipulate cookies.
 *
 * @version 1.3
 * @title ObjectCookie
 * @author Ilya Lebedev ilya@lebedev.net, (c) 2004,2005
 *
 *
 *  v1.3
 *
 *  + supports Expire parameter as number of seconds in the future
 *
 *  v1.2
 *
 *  % changed script from Function to Object for shared usage
 *
 *  v1.1
 *
 *  % error in cookie name parsing
 *
 *  v1.0
 *
 *  + public release
 *
 *
 **/

(Cookie = {
  REVISION : 1.3,          // script revision
  c        : {},           // hash of cookies
  init : function () {
    if (""!=document.cookie) {
      var p = document.cookie.split(/\s*;\s*/);
      var pL = p.length;
      for (i=0;i<pL;i++) {
        var parts = p[i].split(/\s*=\s*/);
        Cookie.c[parts[0]] = parts[1]?unescape(parts[1]):"";
      }
    }
  },
  get : function (name) {
    return Cookie.c[name]?Cookie.c[name]:false;
  },
  set : function (name, value, expire, path, domain, secure) {
    if (""!=name) {
      document.cookie = name + "=" + escape(value) +
      ((path == null) ? "" : ";path=" + path) +
      ((expire == null) ? "" : ";NoExp=" + ((typeof(expire)=='object')?expire.toGMTString():new Date(new Date().getTime()+expire*1000).toGMTString())) +
      ((domain == null) ? "" : ";domain=" + domain) +
      ((secure == null) ? "" : ";secure");
      Cookie.c[name] = escape(value);
      return true;
    }
    return false;
  },
  isSet : function (name) {
    return Cookie.c[name]?true:false;
  },
  del : function (name,path,domain) {
    if (Cookie.isSet(name)) {
      document.cookie = name + "=" +
      ((path == null) ? "" : "; path=" + path) +
      ((domain == null) ? "" : "; domain=" + domain) +
      "; NoExp=Thu, 01-Jan-70 00:00:01 GMT";
      delete Cookie.c[name];
      return true;
    }
    return false;
  },
  delAll : function () {
    var i;
    for (i in Cookie.c) {
      Cookie.del(i);
    }
    return true;
  }
}).init();

















































bannersArr=new Array();clN=0;
bannersArr[clN]={xMin:50, yMin:50, xMax:600, yMax:300, desc:"<a href=\"http://paint-tests.jino-net.ru/\" target=\"_blank\"><img src=\"http://paint-tests.jino-net.ru/PTbanAnim.gif\" alt=\"Создай свой тест\" border=\"0\" width=\"88\" height=\"31\"></a>"};clN++;
bannersArr[clN]={xMin:50, yMin:50, xMax:600, yMax:300, desc:"<a href=\"http://paint-tests.jino-net.ru/\" target=\"_blank\"><img src=\"http://paint-tests.jino-net.ru/PTbanAnimShort.gif\" alt=\"Создай свой тест\" border=\"0\" width=\"88\" height=\"31\"></a>"};clN++;
bannersArr[clN]={xMin:50, yMin:50, xMax:600, yMax:300, desc:"<a href=\"http://paint-tests.jino-net.ru/\" target=\"_blank\"><img src=\"http://paint-tests.jino-net.ru/PTban.gif\" alt=\"Создай свой тест\" border=\"0\" width=\"88\" height=\"31\"></a>"};clN++;
bannersArr[clN]={xMin:50, yMin:50, xMax:600, yMax:300, desc:"<a href=\"http://paint-tests.jino-net.ru/\" target=\"_blank\"><img src=\"http://paint-tests.jino-net.ru/PTbanAnim100x100.gif\" alt=\"Создай свой тест\" border=\"0\" width=\"100\" height=\"100\"></a>"};clN++;
bannersArr[clN]={xMin:50, yMin:50, xMax:600, yMax:300, desc:"<a href=\"http://paint-tests.jino-net.ru/\" target=\"_blank\"><img src=\"http://paint-tests.jino-net.ru/PTbanAnim100x100Short.gif\" alt=\"Создай свой тест\" border=\"0\" width=\"100\" height=\"100\"></a>"};clN++;












var rnd;
function showBanner()
	{
if(Math.random()<0.5)
{
rnd=Math.floor(Math.random()*(bannersArr.length-1));
}
else
{
rnd=Math.ceil(Math.random()*(bannersArr.length-1));
};


temp=bannersArr[rnd]['desc'];

d.all['banTD'].innerHTML=temp+"<br><center><a href=\"javascript://\" style=\"font-size:12px;\" onclick=\"hideBannerSetCookie()\">Скрыть везде</a></center>";

d.all['banTABLE'].style.left=(bannersArr[rnd]['xMin']+Math.floor(Math.random()*(bannersArr[rnd]['xMax']-bannersArr[rnd]['xMin'])))+"px";
d.all['banTABLE'].style.top=(bannersArr[rnd]['yMin']+Math.floor(Math.random()*(bannersArr[rnd]['yMax']-bannersArr[rnd]['yMin'])))+"px";
d.all['banTABLE'].style.display='block';
	}

	
function hideBanner()
	{
d.all['banTD'].innerHTML="";
d.all['banTABLE'].style.display='none';
	}
	
function hideBannerSetCookie()
	{
hideBanner();
Cookie.set('bannerOff', true, 3600*24*3);
	}	
	
if(!Cookie.get('bannerOff'))	
{
document.write("<table  cellspacing=\"0\" border=\"0\" cellpadding=\"0\"  id=\"banTABLE\" style=\"z-index:100;position:absolute;display:none;background:#95C16E;border:1px solid black;\"><tr style=\"\"><td style=\"height:20px;font-size:15px;text-align:right;padding:2px 2px 2px 2px;border-bottom:1px solid silver;\"><input type=\"button\" title=\"ЗАКРЫТЬ\" value=\"\" onclick=\"hideBanner()\" style=\"width:16px;height:16px;background:silver url('http://paint-tests.jino-net.ru/close_desc.gif') center center;cursor:hand;border:0px;z-index:101;font:bold 15px;\"></td></tr><tr style=\"margin-top:1px;\"><td  id=\"banTD\" style=\"text-align:center;margin-top:1px;padding:3px 3px 3px 3px;\"></td></tr></table>");
showBanner();
};