
function openpopup(width,height,url,name){
popupwindow=window.open(url,name,"width="+width+",height="+height+",scrollbars=yes,resizable=yes");
popupwindow.focus();
}

function confirmd(message)
	{
	var is_confirmed = confirm(message);
	return is_confirmed;
	}

function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function toggleMenu(){
	MenuView=(MenuView?false:true);
	if(document.images['arrow'])
		{
	document.images['arrow'].src=(MenuView?'/images/calculators/1rightarrow.png':'/images/calculators/1leftarrow.png');
		}
	var now = new Date();
	now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
	setCookie("MenuView",(MenuView?"true":"false"),now);
	parent.document.body.cols = (MenuView?"0,*":"175,*");
}

function reloadMenu()
{
parent.leftFrame.location="/betting-calculators/?frame=menu";
return true;
}

function reloadCalc()
{
parent.mainFrame.eq.submit_var.value = 'submit';
parent.mainFrame.eq.submit();
return true;
}

var MenuView = getCookie("MenuView");
//if(MenuView == null) alert("dogs"); //MenuView = true;
//alert("Menu View is " + (MenuView?"dogs":"cats"));

if(MenuView == "true")
	{
	MenuView = false;
	//alert("toggle");
	toggleMenu();
	}
else MenuView = false;
