/* customPicName is both ID and PicName */

function getOnOverButton( customPicName ) {
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	if ((version >= 5.5) && (document.body.filters)) {
		var menuButton = document.getElementById( customPicName );
		menuButton.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader"
								 + "(src='Media/tomassomedia/images/" + customPicName + "_on_over.png', sizingMethod='scale')"
	}else{
		var menuButton = document.getElementById( customPicName ).src = "Media/tomassomedia/images/" + customPicName + "_on_over.png";
	}	
}
/* customPicName is both ID and PicName */
function getButton( customPicName ) {
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	if ((version >= 5.5) && (document.body.filters)) {
		var menuButton = document.getElementById( customPicName );
		menuButton.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 + "(src='Media/tomassomedia/images/" + customPicName + ".png', sizingMethod='scale')"
	}else{
		var menuButton = document.getElementById( customPicName ).src = "Media/tomassomedia/images/" + customPicName + ".png";
	}	
}

    function checkindex(index, count)
    {
        if(index!=count)
        {
            if(index % 4 ==0)
            {
                document.write("<td><div class=\"cCenterSeparatorCol\" id='dvSeparator"+index.toString()+"'><img src=\"media/webcommon/pixel.gif\" width=\"5px\" height=\"1px\"/></div></td>");
            }
        }
    }
    
    function gup( 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];
	}
	
	function getSubmenuItem(objID)
	{
	    document.getElementById(objID).src='Media/tomassomedia/images/'+objID.toString()+'_on_over.png';
	    document.getElementById(objID).onmouseout=null;
        document.getElementById(objID).onmousemove=null;
	}


function closeBox(ID) {
 var boxObj = 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");
    fade.innerHTML = "<img src='media/tomassomedia/images/lightbox_back.png' height='" +  (sizes[1] + 50) + "' width='" + sizes[0] +"' style='width:100%;height:"+ (sizes[1] + 100)+"' />";
    
    
  }
}