

function onMenuResize(w, h){

	// Resize flash object/embed
	var menu = document.getElementById("AccountMenu");
	menu.style.height = h + "px";

	// Resize div wrapping Flash Menu
   	var menuDiv = document.getElementById("flashAccountMenu");
    menuDiv.style.height = h + "px";

}

function OpenProductWindow (url, name, windowsParams)
{
	var externalLinkRegEx = /^https?:[\/\\]{2}/i;
	var blnPopUpsOffScreen=0;
	var intTop=200;
	var intLeft=200;
	var intHeight=290;
	var intWidth=480;
		var cookieStr = document.cookie;
		var cookieWinRegEx = /CSOFFSCREENPOPUPSALLOWED=\d/i;
		var rxVal = /\d+/;
		try
		{
			if (cookieStr && cookieStr.match(cookieWinRegEx))
			{
				var strVal=cookieStr.match(cookieWinRegEx);
				if (strVal)
					blnPopUpsOffScreen=strVal.toString().match(rxVal);
				else
					blnPopUpsOffScreen = 0;
			}
			else
				blnPopUpsOffScreen=0;
		}
		catch (oErr)
		{
			blnPopUpsOffScreen=0;
		}
		if(blnPopUpsOffScreen==1)
		{
			intTop=window.screen.height - 9;
			intLeft=window.screen.width - 9;
			intHeight=1;
			intWidth=1;
		}
		else
		{
			intTop=(window.screen.height / 2) - 109;
			intLeft=(window.screen.width / 2) - 210;
			intHeight=218;
			intWidth=421;
		}
		if(!url.match(externalLinkRegEx) && url.indexOf('kurrentPageID') == -1)
		{
			try
			{
				if( url.indexOf ('?') == -1 )
					url = url + '?kurrentPageID=' + kurrentPageID;
				else
					url = url + '&kurrentPageID=' + kurrentPageID;
			}
			catch (oErr)
			{ /* Do Nothing */ }
		}
	var re = new RegExp();
	re = /&amp;/gi;
	url = url.replace(re,"&");
	if(url.search(/[\/\\]/g) >= 0 && blnPopUpsOffScreen==0)
	{
		if(document.CS_StaticURL && window.location.href.indexOf(document.CS_StaticURL) == -1)
			url = '/commonspot/utilities/longproc.cfm?onlyurlvars=1&url=' + escape(url);
	}
	var strWinOptions = windowsParams;
	if(arguments.length >= 2 && arguments[2])
	{
		var strOptions=arguments[2];
		var strTopPos=strOptions.match(/top=\s*(\d+)/i);
		if(strTopPos && strTopPos[1] >=0)
		{
			intTop=strTopPos[1];
			strOptions=strOptions.replace(/top=\s*\d+\s*,?/i,'')
		}
		var strLeftPos=strOptions.match(/left=\s*(\d+)/i);
		if(strLeftPos && strLeftPos[1] >=0)
		{
			intLeft=strLeftPos[1];
			strOptions=strOptions.replace(/left=\s*\d+\s*,?/i,'')
		}
		var strHeight=strOptions.match(/height=\s*(\d+)/i);
		if(strHeight && strHeight[1] >=0)
		{
			intHeight=strHeight[1];
			strOptions=strOptions.replace(/height=\s*\d+\s*,?/i,'')
		}
		var strWidth=strOptions.match(/width=\s*(\d+)/i);
		if(strWidth && strWidth[1] >=0)
		{
			intWidth=strWidth[1];
			strOptions=strOptions.replace(/width=\s*\d+\s*,?/i,'')
		}
		var strWinOptions = strOptions;
	}
	strWinOptions = strWinOptions + ',top='+ intTop + ',left=' + intLeft + ',height=' + intHeight + ',width=' + intWidth;
		var winWindow=window.open(url,name,strWinOptions);
	if (!winWindow)
		alert('Unable to open window - please make sure the pop-up blocker is disabled for this site');
	if(arguments.length==4 && arguments[3]==1 && winWindow)
		return winWindow;
}
