// JavaScript Document
function setHeight() {
	var containerHeight=getWindowHeight()-173;
	var winY = screen.height;
	
	if(document.getElementById("ui_Box1Content")) {
		/* To stretch the layout of the main screen to 100% height */
		document.getElementById("ui_Box1Content").style.height=containerHeight+'px';
	}
	
	/*
	
	Not needed because the "ui_Box1Content " which holds the left panel is anyways stretching the layout
	
	if(document.getElementById("ui_Box2Content")) {
		document.getElementById("ui_Box2Content").style.height=containerHeight+'px';	
	}
	
	*/


	if (document.getElementById("ui_Content")) {
		/* This is to stretch the Height of the Break-out screen to 100%,
		   There must be a dynamic way to find the height of the current pop-up window and 
		   then subtract some pixels from it to get the 445px value - but will figure that
		   out later 
		   -rajesh .n. talageri - 01-Sep-05      
		 */
		   
		document.getElementById("ui_Content").style.height="545px";
	}
	//document.tableHeightController_2.height=getWindowHeight()-173;

}

function getWindowHeight() {
  var windowHeight=0;
  if (typeof(window.innerHeight)=='number') {
    windowHeight=window.innerHeight;
  }
  else {
    if (document.documentElement&&
      document.documentElement.clientHeight) {
        windowHeight=
          document.documentElement.clientHeight;
    }
    else {
      if (document.body&&document.body.clientHeight) {
        windowHeight=document.body.clientHeight;
      }
    }
  }
  return windowHeight;
}

function resize_iframe()
{
  //resize the iframe according to the size of the
  //window (all these should be on the same line)
  if(document.getElementById("previewFrame")) {			  
  	document.getElementById("previewFrame").height=document.body.offsetHeight-document.getElementById("previewFrame").offsetTop-329;
  } else {
	  return;
  }
}

window.onload= function() {
	setHeight();
	setSkinSrc("default");
	
	/* This function is used to resize the iframe to 100% height in the email paradigm */
	resize_iframe(); 
}

window.onresize = function() {
	setHeight();
	
	// this will resize the iframe every
	// time you change the size of the window.
	window.onresize=resize_iframe(); 

		//Instead of using this you can use: 
		//	<BODY onresize="resize_iframe()">

}

