function doIframe(){
	o = document.getElementById('DB_Div');
	
	//for(i=0;i<o.length;i++){
		//if (/\bautoHeight\b/.test(o[i].className))
		//{
			setHeight(o);		
			addEvent(o,'load', doIframe);
		//}
	//}
}

function setHeight(e)
{


	if(e.contentDocument)
	{
		//alert('1')
		e.style.height = e.contentDocument.body.offsetHeight-200;
		e.style.width = ((document.body.clientWidth - 270)+'px')// e.contentWindow.document.body.scrollHeight-200;
	}
	else 
	{
			//alert('2='+document.body.clientHeight);
			//alert('e.height'+(document.body.clientHeight - 300)+'px');
		e.style.height = ((document.body.clientHeight - 120)+'px')// e.contentWindow.document.body.scrollHeight-200;
		e.style.width = ((document.body.clientWidth - 270)+'px')// e.contentWindow.document.body.scrollHeight-200;
	}
}


function addEvent(obj, evType, fn)
{
	if(obj.addEventListener)
	{
	obj.addEventListener(evType, fn,false);
	return true;
	} else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
	return r;
	} else {
	return false;
	}
}

if (document.getElementById && document.createTextNode)
{
 	addEvent(window,'load', doIframe);	
  addEvent(window,'resize', doIframe);	
}

