  function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  }
function MM_openWindow(theURL,winName,features) {    window.open(theURL,winName,features);  }
  function NewWindow(u,n,w,h,f,p,x,y) {

    var extension=u.split(".");
        extension=extension[extension.length-1];

    var stop=u.length - extension.length;
    stop -= 1;

    var file=u.substring(0,stop);

    var url=file+"."+extension;

    var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

    if(x) {
      window.location=x;
    }

    win=window.open(url,n,s);

    if(win.focus) {
      win.focus();
    }

  }

  function NewWindow1(u,n,w,h,f,p,x,y) {

    var extension=u.split(".");
        extension=extension[extension.length-1];

    var stop=u.length - extension.length;
    stop -= 1;

    var file=u.substring(0,stop);
        file=file.replace(/\/Small/, '');

    //var url=file+"tmp."+extension;
    var url=file+"_tmp."+extension;

    var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

    if(x) {
      window.location=x;
    }

    win=window.open(url,n,s);

    if(win.focus) {
      win.focus();
    }

  }

function PicWindow(u,n,w,h,f,p,x,y) {

  var extension=u.split(".");
      extension=extension[extension.length-1];

  var stop=u.length - extension.length;
  stop -= 1;

  var file=u.substring(0,stop);

      file=file.replace(/\/Small\//, "/Full/");

  var url=file+"."+extension;

  var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

  if(x) {
    window.location=x;
  }

  win=window.open(url,n,s);

  if(win.focus) {
    win.focus();
  }

}

function CarWindow(u,n,w,h,f,p,x,y) {

  var extension=u.split(".");
      extension=extension[extension.length-1];

  var stop=u.length - extension.length;
  stop -= 1;

  var file=u.substring(0,stop);

      file=file.replace(/\/Small\//, "/");

  var url=file+"_tmp."+extension;

  var ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,s='scrollbars,width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;

  if(x) {
    window.location=x;
  }

  win=window.open(url,n,s);

  if(win.focus) {
    win.focus();
  }

}
