function showReserve(_langId)
{
  var winWidth = 380;
  var winHeight = 300;
	var x = window.open('../reserve_popup.php?l=' + _langId, "reserveWin", "width=" + winWidth + ",height=" + winHeight + ",toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top="+(screen.availHeight - winHeight)/2+",left="+(screen.availWidth - winWidth)/2);
	x.focus();
}

function showPromo(_promoId, _langId)
{
  var winWidth = 600;
  var winHeight = 500;
	var x = window.open('../promo_popup.php?p=' + _promoId + '&l=' + _langId, "promoWin", "width=" + winWidth + ",height=" + winHeight + ",toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top="+(screen.availHeight - winHeight)/2+",left="+(screen.availWidth - winWidth)/2);
	x.focus();
}

function LTrim(str)
{
   if( str == null ){ return null; }
   for(var i = 0; str.charAt(i) == " "; i++);
   return str.substring(i, str.length);
}

function RTrim(str)
{
   if( str == null ){return null;}
   for(var i = str.length-1; str.charAt(i)==" "; i--);
   return str.substring(0, i+1);
}

function Trim(str){ return LTrim(RTrim(str)); }

function validForm(_arrReqFlds, _msg)
{
	for( x = 0, y = _arrReqFlds.length; x < y; x++ )
	{
		if( Trim(document.getElementById(_arrReqFlds[x]).value).length < 1 )
		{
			alert(_msg);
			document.getElementById(_arrReqFlds[x]).focus();
			document.getElementById(_arrReqFlds[x]).select();
			return false;
		}
	}

	return true;
}
