// misc.js
//
// Versions:
// 1.00 - 09/23/2009 - (Vik) Initial version

// ----------------------------------------------------------------------------------------------------
// CONSTANTS
var gk_MISC_CUSTOMER_GUEST = 1;
var gk_MISC_CUSTOMER_WALLSTREETCAFE = 2;
var gk_MISC_CUSTOMER_WEBROOT = 3;

// ----------------------------------------------------------------------------------------------------
// GLOBAL VARIABLES
var miscGvarSelection = 0; // the value of gk_FOOD_TYPEALL, defined in food.js 

// miscMultiDimensionalArray - returns an aray with iRows rows and iCols columns
function miscMultiDimensionalArray(iRows,iCols)
{
var i;
var j;
   var a = new Array(iRows);
   for (i=0; i < iRows; i++)
   {
       a[i] = new Array(iCols);
       for (j=0; j < iCols; j++)
       {
           a[i][j] = "";
       }
   }
   return(a);
}

// unusedGetCheckedValue - Return the value of the radio button that is checked
// return an empty string if none are checked, or there are no radio buttons
function miscGetCheckedValue(radioObj) {
    if(!radioObj)
	return "";
    
    var radioLength = radioObj.length;
    if(radioLength == undefined)
	if(radioObj.checked)
	    return eval(radioObj.value);
	else
	    return "";
	
    for(var i = 0; i < radioLength; i++) {
	if(radioObj[i].checked) {
	    return eval(radioObj[i].value);
	}
    }
    return "";
}

function unusedShowHideOrder(){
  // the name of the order form is hardcoded - if the name of the DIV (below) changes, then this code needs to be changed
  var divid = 'orderform';

  if(document.getElementById(divid).style.display == 'none'){
    document.getElementById(divid).style.display = 'block';
    // Call the Google Analytics code to track this step in the funnel:
    // var pageTracker = _gat._getTracker(gk_GOOGLE_ACCOUNT);
    // pageTracker._trackPageview("/content/bentoboxes/showorderform.html"); 
  }else{
    document.getElementById(divid).style.display = 'none';
  }
}

function unusedShowHideLayer(divid, surl){
  // divid: string - name of the DIV element to show or hide
  // surl: string - the URL to track in Google analytics
  // e.g. ShowHideLayer('divName','foo.html')
  if(document.getElementById(divid).style.display == 'none'){
    // show the div
    document.getElementById(divid).style.display = 'block';

    if (surl != ""){
      // In Google Analytics, track the display of All Boxes
      var pageTracker = _gat._getTracker(gk_GOOGLE_ACCOUNT);
      pageTracker._trackPageview(surl);}
  }else{
    // hide the div
    document.getElementById(divid).style.display = 'none';
  }
}
