function closeBox(ID) {
 var boxObj = parent.document.getElementById(ID);
 boxObj.style.display = "none"; 
}
function getPageSize(){
 
 var xScroll, yScroll;
 
 if (window.innerHeight && window.scrollMaxY) { 
  xScroll = document.body.scrollWidth;
  yScroll = window.innerHeight + window.scrollMaxY;
  //alert("if"+yScroll);
 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
  xScroll = document.body.scrollWidth;
  yScroll = document.body.scrollHeight;
  //alert("else if"  + yScroll);
 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
  xScroll = document.body.offsetWidth;
  yScroll = document.body.offsetHeight;
  //alert("else"+yScroll);
 }
 
 var windowWidth, windowHeight;
 if (self.innerHeight) { // all except Explorer
  windowWidth = self.innerWidth;
  windowHeight = self.innerHeight;
 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
  windowWidth = document.documentElement.clientWidth;
  windowHeight = document.documentElement.clientHeight;
 } else if (document.body) { // other Explorers
  windowWidth = document.body.clientWidth;
  windowHeight = document.body.clientHeight;
 } 
 
 // for small pages with total height less then height of the viewport
 if(yScroll < windowHeight){
  pageHeight = windowHeight;
 } else { 
  pageHeight = yScroll;
 }

 // for small pages with total width less then width of the viewport
 if(xScroll < windowWidth){ 
  pageWidth = windowWidth;
 } else {
  pageWidth = xScroll;
 }
 arrayPageSize = new Array(4);
 arrayPageSize[0] = pageWidth;
 arrayPageSize[1] = pageHeight;
 arrayPageSize[2] = windowWidth;
 arrayPageSize[3] = windowHeight;
 return arrayPageSize;
}

<!-- Cookies -->

function setCookie(name, value, expires, path, domain, secure) {
 if (!name || !value) return false;
 var exdate=new Date();
 exdate.setDate(exdate.getDate()+expires);
 var str = name + '=' + encodeURIComponent(value);
 if (expires) str += '; expires=' + exdate.toGMTString();
 if (path)    str += '; path=' + path;
 if (domain)  str += '; domain=' + domain;
 if (secure)  str += '; secure';
 
 document.cookie = str;
 
 return true;
}

function getCookie(name) {
 
 if(document.cookie.indexOf(name+'=Exists')>=0)
 {
  return true;
 }
 return false;
}

function deleteCookie(name, path, domain) {
 setCookie(name, null, new Date(0), path, domain);
 return true;
}



function checkCookie(name)
{
 cookieName = getCookie(name);
 if (cookieName == true) { // already exists
 
     document.getElementById('lightBox').style.display = "none";
   }
 else {

    setCookie('lightBoxExist','Exists', 365);
     
     
    var lightBox = document.getElementById('lightBox');
    var sizes = new Array(4);
    sizes[0] =  getPageSize()[0];
    sizes[1] =  getPageSize()[1]; //878
    
    sizes[2] =  getPageSize()[2];
    sizes[3] =  getPageSize()[3];
    lightBox.style.display='block';
    
    var fade = document.getElementById("fade");
    //alert(sizes[0]+"  "+sizes[1]);
    fade.innerHTML = "<img src='media/webcommon/lightbox_back.png' height='" +  (sizes[1] + 50) + "' width='" + sizes[0] +"' style='width:100%;height:"+ (sizes[1] + 200)+"' />";
    
    
  }
}

 function getTabID( name )
{
     name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
     var regexS = "[\\?&]"+name+"=([^&#]*)";
     var regex = new RegExp( regexS );
     var results = regex.exec( window.location.href );
     if( results == null )
     return "";
     else
     return results[1];
}
