function setCookie(name, value, expire) {
          document.cookie = name + "=" + escape(value)
          + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
    return true;
}

function getCookie(Name) {
          var search = Name + "="
          if (document.cookie.length > 0) { // if there are any cookies
                    offset = document.cookie.indexOf(search) 
                    if (offset != -1) { // if cookie exists 
                              offset += search.length 
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset) 
                              // set index of end of cookie value
                              if (end == -1) 
                                        end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    } 
          }
          return null;
}

function openPopup(s, n, width, height, top, left)
{
   var winProperty = 'resizable=1,scrollbars=1,dependent=1,titlebar=yes,menubar=no,toolbar=yes,location=no'
                   + ',width='+width+',height='+height+',top='+top+',left='+left;
   var newWin = open(s,n,winProperty);
   newWin.focus();
}

function openFull(s, n) {
   openPopup(s, n, screen.width-10, screen.height-100, 0, 0);
}

function ShowButton(objName, ImageName) {
	objName.src=ImageName
}

function showImage(imageName, imageFile) {
	document.images[imageName].src = imageFile;
}

function PreloadImages() {
  if(document.images)
    { if (!document.tmpImages)
         document.tmpImages=new Array();
      with(document) {
       var
          i,j=tmpImages.length,
          a=PreloadImages.arguments;

       for(i=0; i<a.length; i++)
          if (a[i].indexOf("#")!=0) {
             tmpImages[j]=new Image;
             tmpImages[j++].src=a[i];
          }
      }
    }
}

/*function openPopup(s, n, width, height, top, left)
{
   var winProperty = 'resizable=1,scrollbars=1,titlebar=yes,menubar=no,toolbar=no,location=no'
                   + ',width='+width+',height='+height+',top='+top+',left='+left;
   var newWin = open(s,n,winProperty);
   newWin.focus();
}*/
