
<!--o

var args = getArgs();

function loadzit(){
	MM_preloadImages('images/build/home2.jpg','images/build/coup2.jpg','images/build/cont2.jpg','images/build/refer2.jpg','images/build/menu2.jpg','images/build/cater2.jpg','images/build/order2.jpg','images/build/emp1.jpg','images/build/comnt2.jpg','images/build/emp2.jpg');

}

function dosomething(){

   if(!isNaN(args.loci)){
		//alert('hola' + args.loci);
		var selObj = document.forms[0].menu1;
		selObj.selectedIndex = args.loci;
	}

}


/* * This function parses comma-separated name=value argument pairs from * the
query string of the URL. It stores the name=value pairs in  * properties of an
object and returns that object. */
function getArgs() {
	var args = new  Object();

	var query = location.search.substring(1);  // Get query string.
	var pairs = query.split('&');              // Break at &.
	//window.alert("query : " + query);
	//window.alert("pairs : " + pairs);
	for(var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');    // Look for "name=value".
		if (pos == -1) continue;               // If not found, skip.
			var argname = pairs[i].substring(0,pos);  // Extract the name.
			var value = pairs[i].substring(pos+1);	// Extract the value.
			args[argname] = unescape(value);          // Store as a property.
	}
	return args;         // Return the object.
}

function locid(){
	//depends on dropdown
	var selObj;
	if (!document.forms['menuleft']){
   	selObj = document.forms[0].menu1;
	}else{
      selObj = document.forms['menuleft'].menu1;
	}
	curval = selObj.options[selObj.selectedIndex].value;
	//alert(curval);
	var ar = curval.split('.');
	ar = ar[0].split('_');

	//alert(ar[1]);

	return ar[1];
}


function locidx(){
	var selObj = document.forms[0].menu1;
	curval = selObj.selectedIndex;
	return curval;
}

function loc_gozto(target,curloc,locix){
	if (curloc=='5000Wisc'){
		curloc = 'tenley';
		locix = 3;
		
	}
		
	switch(target){
		case 'index.html':
			loc =  'loc_' + curloc + '.html?loc=' + curloc ;
			break;			
		case 'menu':
			switch(curloc){
				case 'capitolhill':
					loc = 'mnu_' + curloc + '_new.html?loc=' + curloc;
					break;
				default:
					loc = 'mnu_' + curloc + '.html?loc=' + curloc;
			 }
			 break;
		case 'coupon':
			loc =  'cpn_' + curloc + '.html?loc=' + curloc;
			break;
		case 'cater':
			
			switch(curloc){
				case 'rockville':
				case 'bowie':
					loc =  'cat_' + curloc + '.html?loc=' + curloc;
					break;
				default:
					loc =  'loc_cater.html?loc=' + curloc;
			}
			break;
		case 'order':
			loc =  '';
			if (curloc.length>0){
				start_eolorders(curloc);
			}
			break;
		case 'refer':
			loc =  'loc_refer.html?loc=' + curloc;
			break;
		case 'comments':
			loc =  'loc_comment.html?loc=' + curloc;
			break;
		case 'employment':
			loc =  'loc_employment.html?loc=' + curloc;
			break;
		default:
			alert('error: ' + target + '/' + curloc);
	}

	if (loc.length>0){
		val = loc + '&loci=' +  locix;
		setCookie("eol__lastlocation",val,45);
		//alert(val);
		if (false){
			start_eolorders('skyline');
			}else{
			document.location = val;
		}
	}
}

function gozto(target){
	curloc = locid();
	idx = locidx();
	loc_gozto(target,curloc,idx);
}

function main_gozto(target,locname){
	idx = get_loci(locname);

	loc_gozto(target,locname,idx);
}

function get_loci(locname){
	switch(locname){
	case '19thstreet':
		ix = 2;
		break;
	case 'tenley':
	case '5000Wisc':
		ix = 3;
		break;
	case 'capitolhill':
		ix = 4;
		break;		
	case 'arlignton':
	case 'arlington':
		ix = 6;
		break;
	case 'burkex':
		ix = 7;
		break;
		
//	case 'centreville':
//		ix=8;
//		break;
		
	case 'silverspring':
		ix = 9;
		break;
	case 'rockville':
		ix = 10;
		break;
	case 'gaithersburg':
		ix = 11;
		break;
	case 'olney':
		ix = 12;
		break;
		
	case 'bowie':
		ix = 13;
		break;		
		
	case 'bethany':
		ix = 15;
		break;
		
	default:
		ix =0;
		alert('Error - eol order : ' + inloc);
	}
	return ix;

}

function get_eolcode(inloc){
	switch(inloc){
	case '19thstreet':
		ix = 567;
		break;
	case 'arlignton':
	case 'arlington':
		ix = 566;
		break;
	case 'burkex':
		ix = 577;
		break;
	case 'tenley':
		ix = 571;
		break;
	case '5000Wisc':
		ix = 571;
		break;
	case '5000wisc':
		ix = 571;
		break;
	case 'capitolhill':
		ix = 572;
		break;
	case 'silverspring':
		ix = 573;
		break;
	case 'rockville':
		ix = 581;
		break;
	case 'gaithersburg':
		ix = 575;
		break;
	case 'skyline':
		ix = 576;
		break;
	case 'centrevillex':
		ix = 578;
		break;
	case 'olney':
		ix = 579;
		break;
	case 'bowie':
		ix = 580;
		break;		
	default:
		ix =0;
		alert('Sorry online ordering not available for this location - eol order : ' + inloc);
	}
	return ix;

}

function start_eolorders(inloc){
	//alert('We are sorry.\n\nWe are experiencing some technical trouble with online ordering.\n We expect it to restored by tonight.');
	//return 0;
	if (get_eolcode(inloc)>0){
      	document.location = "http://www.eatsonline.net/eolclients/" + ix + "/eol.php";
		//document.location = "http://slyqk/eolclients/" + ix + "/eol.php";
		
	}
}

function orderitem(inID){
	//alert('We are sorry.\n\nWe are experiencing some technical trouble with online ordering.\n We expect it to restored by tonight.');
	//return 0;

	ix = get_eolcode(locid());
	l = "http://www.eatsonline.net/eolclients/" + ix + "/eol.php?inOrderID=" + inID;
	//l = "http://slyqk/eolclients/" + ix + "/eol.php?inOrderID=" + inID;
	//alert(l);
	document.location = l;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function loc_goto(targ,locfile,locname,locidx){
	val = locfile + "?loc=" + locname + "&loci=" + locidx;
	setCookie("eol__lastlocation",val,45);
	if (false){
			start_eolorders('skyline');
	}else{
		eval(targ + ".location='" + val + "'");
	}	
}

function loc_namegoto(locname){

	var loc_file = 'loc_' + locname + '.html';
	var loc_ix = get_loci(locname);

	loc_goto('this.document',loc_file,locname,loc_ix);

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	if (selObj.options[selObj.selectedIndex].value.length>0){
		var curloc = locid();
		//alert(selObj.options[selObj.selectedIndex].value);
		loc_goto(targ, selObj.options[selObj.selectedIndex].value,curloc,selObj.selectedIndex);
  		if (restore) selObj.selectedIndex=0;
   }else{
   		alert("Error: Invalid location");
		setCookie("eol__lastlocation","index.html",45);
		document.location = "index.html";

		
	}
}

function MM_cool(targ,selObj,restore){ //v3.0
      MM_jumpMenu(targ,selObj,restore);
}

function setCookie(NameOfCookie, value, expiredays, path, domain, secure)
{
  //the first lines in the function converts the number of days to a valid date.

  var ExpireDate = new Date();
  ExpireDate.setTime(ExpireDate.getTime() + (expiredays*24*3600*1000));

  //The next line stores the cookie, simple by assigning
  //the values to the document.cookie-object
  //Note the date is converted to Greenwich Meantime using
  //the 'toGMTstring()'-function

  document.cookie = NameOfCookie +"="+ escape(value) +
  ((expiredays == null)? "": ";expires="+ ExpireDate.toGMTString()) +
  ((path == null)? "": (";path=" + path)) +
  ((domain == null) ? "" : (";domain=" + domein)) +
  ((secure == true) ?";secure":"");
}



//-->

