/**
* 
*/

function adjustWindowParentWidth(parentFrameId) {
	var assistWin = window.parent.document.getElementById(parentFrameId);
 	if(document.body.scrollWidth!=null){
			assistWin.style.width = "840px";
			assistWin.style.paddingLeft = '20px';
	}
	assistWin.scrolling = "no";
	//alert('alert');
}
/*function adjustWindowOpenerHeight(parentFrameId) {
  	adjustWindowOpenerHeight(parentFrameId,25);
}*/
function adjustAddIframe(grandParent,parentWindow){
	var topWin = window.parent.parent.document.getElementById(grandParent);//top window
	var topWinH = parseInt(topWin.style.height);//top window height
	var parentWin = window.parent.document.getElementById(parentWindow);//frame
	var parentWinH = parseInt(parentWin.style.height);//frame height
	var documentH = parseInt(document.body.scrollHeight);//assign document height to frame height			
	if(parentWinH!=documentH){
		parentWin.style.height = documentH+"px";
		topWin.style.height = (documentH+topWinH)+"px";
	}
	topWin.style.width = "800px";
	
}
function adjustGrandChildIframe(mainIFrame,child,grandChild){
	var topWinMainIframe = window.parent.parent.parent.document.getElementById(mainIFrame);
	var topWinHMainFrame = parseInt(topWinMainIframe.style.height);
	var topWinChild = window.parent.parent.document.getElementById(child);
	var topWinHChild = parseInt(topWinChild.style.height);
	var topWinGrandChild = window.parent.document.getElementById(grandChild);
	var topWinHGrandChild = parseInt(topWinChild.style.height);
	var documentH = parseInt(document.body.scrollHeight);
	if(topWinHGrandChild!=documentH){
		topWinGrandChild.style.height = documentH+"px";
		topWinChild.style.height = (documentH+topWinHChild)+"px";
		topWinMainIframe.style.height = (documentH+topWinHMainFrame);
	}
	topWinMainIframe.style.width = "800px"
}

/*resize the parent frame window according to the closed iframe*/
function adjustClosedIframe(grandParent,parentWindow){
	try{
		var topWin = window.parent.parent.document.getElementById(grandParent);//top window
		var topWinH = parseInt(topWin.style.height);//top window height
		var parentWin = window.parent.document.getElementById(parentWindow);//frame
		var parentWinH = parseInt(parentWin.style.height);//frame height
		parentWin.style.height = "0px";
		topWin.style.height = (topWinH-parentWinH)+"px";
	}catch(err){
		//alert(err);
	}
}