function callSearchFromPortal(QueryString) // this function call the Searchservice. 
{
	ChangeHiddenFields('QueryString',QueryString);
	ChangeHiddenFields('LastSearchString',QueryString);
	ChangeHiddenFields('ViewPart','1');
	ChangeHiddenFields('ListViewService','DKI3WebSearchV1');
	document.forms['Form-A1'].submit();
}

var SAPTop = null;
function getSAPTop() 
{
  if (SAPTop != null) return SAPTop;
  	var refDynamicTop = top;  
  	var testedFrame = window;  
  	try {
  		while(testedFrame != top && testedFrame.parent != null) {
  			try{
  				if(testedFrame.parent.EPCM != null) {
  					refDynamicTop = testedFrame.parent;
  				}
  			} catch(ex1) {}
  			testedFrame = testedFrame.parent; 
  		}
  	} catch(ex2) {}
  	SAPTop = refDynamicTop;
  	return refDynamicTop;
}  

function adjustHeightInPNF(heightOffset) //adjust height in new portal
{
	var CatHeight;
	var MainTable=document.getElementById("xDKIMainTable");
	
	if ((!heightOffset)||(parseInt(heightOffset)==NaN))
	{
		heightOffset=0;
	}
	
	try
	{
		CatHeight=parseInt(MainTable.scrollHeight+heightOffset+20);
	}catch(E)
	{
		CatHeight=parseInt(document.body.scrollHeight+heightOffset);
	}
	
		
		
	  //window.frameElement.style.height="400px"

 // CatHeight=parseInt(document.body.scrollHeight+heightOffset);	
	
	if (document.getElementById("ProductFotoDiv"))
	{
		var ProductFotoYPos=parseInt(document.getElementById("ProductFotoDiv").style.top);
		var ProductFotoHeight=parseInt(document.getElementById("ProductFotoDiv").scrollHeight);
		if (CatHeight<(ProductFotoYPos+ProductFotoHeight+10))
		{
			CatHeight = ProductFotoYPos+ProductFotoHeight+10;
		}
	}
		
	window.frameElement.style.height=CatHeight+20+'px'; 	  
}

function adjustHeightinPortal(heightOffset)
{	
	if (pnf=="true")
	{
		adjustHeightInPNF(heightOffset) 
	}else
	{
		EPCMPROXY.raiseEvent('com.festo.portal.sap55.y.ep.fr', 'adjustHeightInPortal');
	}
}

// THF:20040728   adjust height in portal
//window.onload = adjustHeightInPortal;
try{ 
	parent.EPCM.subscribeEvent('com.festo.portal.sap55.y.ep.fr', 'adjustHeightInPortal', xDKIadjustHeightInPortal)
	} catch(ex){} 
// THF:20040728

// adjust height in portal
function xDKIadjustHeightInPortal() {
	try {
		var isolatedWorkArea = parent.document.getElementById('isolatedWorkArea');
		if (isolatedWorkArea) {
			isolatedWorkArea.setAttribute('scrolling','no');
			document.body.scroll='no';
			document.body.style.overflow='hidden';
			
			//var height = parent.pageSupport._getHeight( window );
			var height = isolatedWorkArea.contentWindow.document.body.scrollHeight;
			
			if (document.getElementById("ProductFoto"))
			{
				var ProductFotoYPos=parseInt(document.getElementById("ProductFoto").style.top);
				var ProductFotoHeight=parseInt(document.getElementById("ProductFoto").scrollHeight);
				if (height<(ProductFotoYPos+ProductFotoHeight+10))
				{
					height = ProductFotoYPos+ProductFotoHeight+10;
				}
			}
		
			isolatedWorkArea.setAttribute('fullPage','false');
			isolatedWorkArea.setAttribute('height',height);
			isolatedWorkArea.setAttribute('minAutoHeight','0');
			isolatedWorkArea.setAttribute('maxAutoHeight','10000');
			parent.pageSupport.adjustHeight(isolatedWorkArea,height);
		}		
	} catch(e) {}
	

	try
	{
		var xDKIHiddenIView=globalSearchElement(getSAPTop(),"xDKIHiddenIView");
		xDKIHiddenIView.xDKIPortalRemoveWaitMessage();
		setServiceState(document.getElementById('ServiceState').value);
	}
	catch(e){}
}