var flgHomePage = 0;
var pageGlobal;
var flg_IE = 0;
var addIE = 0;
var hDiff = 178;
var browserName=navigator.appName; 
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if (browserName=="Microsoft Internet Explorer" && version < 7)
{
 	flg_IE = 1;
 	addIE = 30;
 	
}
function onresizeWidth()
{
	end_product			= document.getElementById('endProduct');
	start_product		= document.getElementById('startProduct');
	col_UnderSearch		= document.getElementById('colUnderSearch');
	end_ColUnderSearch	= document.getElementById('endColUnderSearch');
	if(flgHomePage == 1)
	{
		
	}
	else
	{
		if( end_product.offsetTop > end_ColUnderSearch.offsetTop )
		{
			heightTo			= end_product.offsetTop - start_product.offsetTop + 15;
			$("#col03ProductDettail").css('height', heightTo);
			$("#colUnderSearch").css('height', heightTo);
			return;
		}
		else
		{
			heightTo			= end_ColUnderSearch.offsetTop - col_UnderSearch.offsetTop + 15;
			$("#colUnderSearch").css('height', heightTo);
			if( flg_IE == 1 )
			{
				$("#col03ProductDettail").css('height', end_ColUnderSearch.offsetTop);
			}
			else
			{
				$("#col03ProductDettail").css('height', heightTo);
			}
		}
	}		
}

function adjustHeights() 
{
	$("#colUnderSearch").css("height","auto"); 
	hNews = $("#colUnderSearch").height() + hDiff; // Get height
	switch(pageGlobal)
	{
		case 'brandSearch':
			$("#divBrandInfo").css("height","auto");
			hAdded 		= $("#divBrandSearch").height();
			hFeatures 	= $("#divBrandInfo").height() + hAdded; // Get height
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			$("#colUnderSearch").height(mHeight + 20 - hDiff);  // Set both to equal heights
			$("#divBrandInfo").height(mHeight + 8 - hAdded);
			break;
		case 'scentSearch':
			$("#divScentSearch").css("height","auto");
			hAdded 		= $("#divScentInfo").height();
			hFeatures 	= $("#divScentSearch").height() + hAdded; // Get height
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			$("#colUnderSearch").height(mHeight + 20 - hDiff);  // Set both to equal heights
			diffIE = 0;
			if( flg_IE )
			{
				diffIE = 10;
			}
			$("#divScentSearch").height(mHeight + 12 - hAdded + diffIE);
			break;
		case 'subCategory':
			$("#divSubCategorySearch").css("height","auto"); 
			hFeatures 	= $("#divSubCategorySearch").height(); // Get height
			//alert( hFeatures );alert( hNews );
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			diffIE = 0;
			if( flg_IE )
			{
				diffIE = 7;
			}
			$("#colUnderSearch").height(mHeight - hDiff);  // Set both to equal heights
			$("#divSubCategorySearch").height(mHeight + diffIE);
			break;
		case 'index':
			hNews			= hNews - hDiff;
			$("#divCol03Gift").css("height","auto"); 
			hAdded1 		= $("#divCol03NewProduct").height();
			hAdded2 		= $("#divCol03Promotion").height();
			hAdded3 		= $("#divCol03MyPham").height();
			hFeatures 		= $("#divCol03Gift").height() + hAdded1 + hAdded2 + hAdded3; // Get height
			
			//alert( hFeatures );alert( hNews );
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			$("#colUnderSearch").height(mHeight + 36 );  // Set both to equal heights
			$("#divCol03Gift").height(mHeight - hAdded1 - hAdded2 - hAdded3);
			break;
		case 'globalSearch':
			$("#divBrandSearch").css("height","auto"); 
			hAdded 		= $("#divBrandInfo").height();
			if( hAdded > 0 )
				hAdded = hAdded + 7;
			hFeatures 	= $("#divBrandSearch").height() + hAdded; // Get height
			//alert( hFeatures );alert( hNews );
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			diffIE = 0;
			if( flg_IE )
			{
				diffIE = 8;
			}
			$("#colUnderSearch").height(mHeight + 30 - hDiff);  // Set both to equal heights
			$("#divBrandSearch").height(mHeight + 30 - hAdded + diffIE);
			break;
		default:
			$("#col03ProductDettail").css("height","auto");
			hAdded1 	= $("#col03ProductDettail1").height();
			if(hAdded1 <= 0)
			{
				hAdded1 = -17;
			}
			diffIE = 0;
			if( flg_IE == 1 )
			{
				diffIE = 9;
			}
			hFeatures = $("#col03ProductDettail").height() + hAdded1; ; // Get height
			// alert( hFeatures );alert( hNews );
			mHeight = hNews > hFeatures ? hNews : hFeatures;  // Set mHeight to the larger of the two heights
			$("#colUnderSearch").height(mHeight + 28 - hDiff);  // Set both to equal heights
			$("#col03ProductDettail").height(mHeight - hAdded1 + diffIE);  // Set both to equal heights
			break;
	}
	
	return false;
}