function setFrameHeight()
{
	var dc = document.getElementById('CenterFrame');
	var dr = document.getElementById('RightFrame');
	var dl = document.getElementById('LeftFrame');

	if(dc!=null)
	{
		dc.style.height='';
		var maxHeight = dc.clientHeight;
		
		if (dr!=null && maxHeight<dr.clientHeight) maxHeight=dr.clientHeight;
		if (dl!=null && maxHeight<dl.clientHeight) maxHeight=dl.clientHeight;
		
		if(maxHeight > dc.clientHeight)
		{
			dc.style.height = maxHeight;
		}
	}
}

function popUpbuyNow(requestItem, type)
{
	popupWindow('buyItemNow.aspx?' + requestItem + '&Type=' + type);
}

function popupWindow(URL)
{
	id = 'pageBuyNow';
	eval("page" + id + "=window.open(URL, '" + id + "','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=740,height=410,left="+ (screen.availWidth-740)/2 +",top="+ (screen.availHeight-380)/2 +"');");
}

function formatTable(tbl)
{
	tbl.className = 'tableStyle';
	var b = true;
	for(var i=0; i<tbl.rows.length; i++)
	{
		if(tbl.rows[i].style.display!='none')
		{
			b=!b;
			tbl.rows[i].className = (b?'tableRow':'tableAlternate');
		}
	}
}

function IsValidEmail(em)
{
//filter  = /([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+>?$/; 
//filter = /\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi;
//filter = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
filter = /^([a-zA-Z0-9])([a-zA-Z0-9\._-])*@(([a-zA-Z0-9\._-])+(\.))+([a-zA-Z]{2,4})+$/;

//var isValid = em.match(filter);
var isValid = filter.test(em);
return isValid;
}

function removeComma(txt, replaceBy)
{
	if(!replaceBy)
		replaceBy='';
	return txt.replace(/\,/g, replaceBy);
}
