/*
 * The namespace.
 */
bc.namespace("bc.module");

/**
 * This singleton class handles advertorial poll related functionality.
 * This is generic functionality of resizing an iframe and can be moved a 
 * more general place in the future
 *
 * @class
 */
bc.module.PollModule = new function() {}

/**
 * This method calculates the height of the iframe
 */ 
bc.module.PollModule.calcHeight = function(iframeId) 
{
     var pollFrame = document.getElementById(iframeId);
     if(pollFrame!=null)
     {
         //check for error
	     var error = pollFrame.contentWindow.document.getElementById('moduleError');
	     if(error==null)
	     {
		      //find the height of the internal page
			  var the_height=  pollFrame.contentWindow.document.body.scrollHeight+2;
		  } else
		  {
		     //there was an error collapse the iframe
		     var the_height=  0;
		  }
		   //change the height of the iframe
		  document.getElementById(iframeId).height=the_height;
	  }
}



