// JavaScript Document
function addListener(element, type, expression, bubbling){
	bubbling = bubbling || false;
	if(window.addEventListener)	{// Standard
		element.addEventListener(type, expression, bubbling);
		return true;
	} else if(window.attachEvent) {// IE
		element.attachEvent('on' + type, expression);
		return true;
	} else return false;
}

addListener(window,'resize',setHeight)
addListener(window,'load',setHeight)

function setHeight() {
  var myWidth = 0, myHeight = 0, contentHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  iHeightDeduct = (parseInt(document.getElementById('TR1TD1').currentStyle.height)+parseInt(document.getElementById('TR3TD1').currentStyle.height))
  document.getElementById('TR2TD1').style.height = myHeight-iHeightDeduct+"px"

}

//Thumbnail Grid Displays
function getProductGrid(iKey,sTitle){
	location.href="StGroupProduct_ThumbGrid.asp?iGroupKey="+iKey+"&title="+sTitle
}
function getThemeGrid(iKey,sTitle){
	location.href="ThemeMstList_ThumbGrid.asp?iThemeKey="+iKey+"&title="+sTitle
}

function getGalleryGrid(iKey,sTitle){
	location.href="GalleryMstList_ThumbGrid.asp?iGalleryKey="+iKey+"&title="+sTitle
}

function zoomProduct(sRowId){
	location.href="StMastZoom.asp?RowId="+sRowId
}