function randomNumber(limit){
	return Math.floor(Math.random()*limit);
	}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.focus();
}


function doSlideShow(cid, pid, startName){
// alert('yes');
	var ww = 640;
	var hh = 600;
	popUpWindow("slideshow.asp?cid=" + cid + "&pid=" + pid + "&startname=" + startName, (screen.availWidth-ww)/2, (screen.availHeight-hh)/2, ww, hh);
}

function getGPortHeight(){
alert(window.innerHeight + "px");
	return screen.availHeight + "px";
}

function stretchMain(){
	//alertSize();
	var actualBodyH = document.body.clientHeight;
	var actualWindowH = getInnerHeight(); //window.innerHeight; // not IE :-(
	//alert('actualBodyH=' + actualBodyH +", actualWindowH=" + actualWindowH);
	var placObj, subplacObj;
	if (actualBodyH<actualWindowH){
		bodyObj = document.getElementById("body");
		placObj = document.getElementById("placr");
		subplacObj = document.getElementById("subplacr");
		mainObj = document.getElementById("contl");
		mainObj.style.height = (actualWindowH - 274 - 34) + "px";
	//alert(mainObj.style.height);
		}
}

function getInnerHeight() {
  var myWidth = 0, myHeight = 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;
  }
  //window.alert( 'Width = ' + myWidth );
  return myHeight;
}