/* OLD SSL LOGIC from Real Branding

if (window.location.protocol == "https:" &&
   (location.host == "olive-garden-dev.realbranding-test.com" || location.host == "www.olivegarden.com" || location.host == "stage.olivegarden.com" || location.host == "demo.olivegarden.com")){
	if (location.pathname != "/company/contact_us/" && location.pathname != "/company/contact_us/default.asp" && location.pathname != "/marketplace/gift_card/default_cn.asp" && location.pathname != "/company/contact_us/feedbackpopup.asp"){
	  window.location = window.location.href.replace('https','http')
	}
}

if (window.location.protocol == "http:" &&
   (location.host == "olive-garden-dev.realbranding-test.com" || location.host == "www.olivegarden.com" || location.host == "stage.olivegarden.com" || location.host == "demo.olivegarden.com")){
	if (location.pathname == "/company/contact_us/" || location.pathname == "/company/contact_us/default.asp" || location.pathname == "/marketplace/gift_card/default_cn.asp" || location.pathname == "/company/contact_us/feedbackpopup.asp"){
	  window.location = window.location.href.replace('http','https')
	}
}
End of Old Logic
*/

if (location.search.indexOf('server_path') != -1){
   js_server_path = new String(location.search);
   js_server_path.replace("server_path=","");
   var js_pathparts = js_server_path.split("/");
}
else{
   var js_server_path = location.pathname.replace('.asp','');
   var js_pathparts = js_server_path.split("/");
}

var root_path = '';
if (location.host != "olive-garden-dev.realbranding-test.com" && location.host != "www.olivegarden.com" && location.host != "stage.olivegarden.com" && location.host != "demo.olivegarden.com"){
   root_path = "http://www.olivegarden.com";
//  line below commented SK 20060124 - site launch
//   root_path = "http://olive-garden-dev.realbranding-test.com";
}

//if (location.search == '?force_root_path') root_path = "http://"+location.host;
//if (root_path != '' && window.location.protocol == "https:") root_path = root_path.replace(/http:/, "https:");
//if (root_path != '' && location.search == '?check_root_path') alert(root_path);


// BEGIN HITBOX VARIABLES
if (location.host == "www.olivegarden.com" || location.host == "olivegarden.com"){
   // Hitbox Account Number (live)
   var hbx_account_number = "DM540930NKEA";
}
else{   
   // Hitbox Account Number (test)
   var hbx_account_number = "DM540930PJDM";
}
var content_cat = "";
if (location.host.indexOf('olivegarden.com') != -1 || location.host == "olive-garden-dev.realbranding-test.com"){
   var content_categories = new Object;
   content_categories['culinary'] = "Our Culinary Inspiration";
   content_categories['menus'] = "Our Menu";
   content_categories['wines'] = "Our Wines";
   content_categories['recipes'] = "Recipes";
   content_categories['marketplace'] = "Gift Cards";
   content_categories['company'] = "Company";
   content_categories['employment'] = "Employment";
   content_categories['community'] = "Community";
   content_categories['press'] = "Press";
   content_categories['invite'] = "Invite Your Friends";
   
   var top_level_directory;
   top_level_directory = js_pathparts[1];
   if (content_categories[top_level_directory]){
      content_cat = content_categories[top_level_directory];
   }
   else if (js_pathparts[1].indexOf('Default') != -1 || js_pathparts[1].indexOf('default') != -1){
      content_cat = "Home Page";
   }
   else if (js_pathparts[1].indexOf('sitemap') != -1){
      content_cat = "SiteMap";
   }
   else if (js_pathparts[2] == ""){
      content_cat = "Root";
   }
   else{
      content_cat = "Other";
   }
}
else if (location.host == "hospitaliano.olivegarden.com" && location.href.indexOf('invite') != -1){
   content_cat = "Invite a Friend";
}
else if (location.host == "hospitaliano.olivegarden.com"){
   content_cat = "Family Table Newsletter";
}
else if (location.host.indexOf('freefind') != -1){
   content_cat = "Search";
}
else if ((location.host.indexOf('locator') != -1 || location.host.indexOf('where2getit') != -1) && location.search.indexOf('invite') != -1){
   content_cat = "Invite a Friend";
}
else if (location.host.indexOf('locator') != -1 || location.host.indexOf('where2getit') != -1){
   content_cat = "Restaurant Locator";
}
else{
   content_cat = "Other (third party)";
}

// <START> Macromedia rollover fucntionality
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];}
}
// <END> 0Macromedia rollover fucntionality
if(document.images){

   // BEGIN LOCATOR TAB BG PRELOADS

   zip_tab_bg = new Image(191,49);
   zip_tab_bg.src = root_path+"/images/find_tabs/zip_tab_form_bg.gif";

   info_tab_bg = new Image(191,226);
   info_tab_bg.src = root_path+"/images/find_tabs/info_tab_bg.gif";

   // END LOCATOR TAB BG PRELOADS

   // BEGIN MAIN NAVIGATION PRELOADS

   culinary = new Image(157,34);
   culinary.src = root_path+"/images/nav_main/culinary.gif";
   
   culinary_on = new Image(157,34);
   culinary_on.src = root_path+"/images/nav_main/culinary_on.gif";
   
   culinary_over = new Image(157,34);
   culinary_over.src = root_path+"/images/nav_main/culinary_over.gif";
   
   menus = new Image(74,34);
   menus.src = root_path+"/images/nav_main/menus.gif";
   
   menus_on = new Image(74,34);
   menus_on.src = root_path+"/images/nav_main/menus_on.gif";
   
   menus_over = new Image(74,34);
   menus_over.src = root_path+"/images/nav_main/menus_over.gif";
   
   wines = new Image(76,34);
   wines.src = root_path+"/images/nav_main/wines.gif";
   
   wines_on = new Image(76,34);
   wines_on.src = root_path+"/images/nav_main/wines_on.gif";
   
   wines_over = new Image(76,34);
   wines_over.src = root_path+"/images/nav_main/wines_over.gif";
   
   recipes = new Image(58,34);
   recipes.src = root_path+"/images/nav_main/recipes.gif";
   
   recipes_on = new Image(58,34);
   recipes_on.src = root_path+"/images/nav_main/recipes_on.gif";
   
   recipes_over = new Image(58,34);
   recipes_over.src = root_path+"/images/nav_main/recipes_over.gif";
   
   gift_card = new Image(74,34);
   gift_card.src = root_path+"/images/nav_main/gift_card.gif";
   
   gift_card_on = new Image(74,34);
   gift_card_on.src = root_path+"/images/nav_main/gift_card_on.gif";
   
   gift_card_over = new Image(74,34);
   gift_card_over.src = root_path+"/images/nav_main/gift_card_over.gif";
   
   // END MAIN NAVIGATION PRELOADS

   // BEGIN SUB-NAVIGATION PRELOADS

   if (js_pathparts[1] == "culinary"){
      // CULINARY INSPIRATION SUB-NAVIGATION PRELOADS

      inspired_entrees = new Image(140,13);
      inspired_entrees.src = root_path+"/images/nav_sub/inspired_entrees.gif";
      
      inspired_entrees_over = new Image(140,13);
      inspired_entrees_over.src = root_path+"/images/nav_sub/inspired_entrees_over.gif";

      cit = new Image(140,22);
      cit.src = root_path+"/images/nav_sub/cit.gif";
      
      cit_over = new Image(140,22);
      cit_over.src = root_path+"/images/nav_sub/cit_over.gif";

      italian_essentials = new Image(140,11);
      italian_essentials.src = root_path+"/images/nav_sub/italian_essentials.gif";
      
      italian_essentials_over = new Image(140,11);
      italian_essentials_over.src = root_path+"/images/nav_sub/italian_essentials_over.gif";
      
   }
   if (js_pathparts[1] == "menus"){

      // OUR MENU SUB-NAVIGATION PRELOADS
      specials = new Image(140,11);
      specials.src = root_path+"/images/nav_sub/specials.gif";
      
      specials_over = new Image(140,11);
      specials_over.src = root_path+"/images/nav_sub/specials_over.gif";
      
      lunch = new Image(140,11);
      lunch.src = root_path+"/images/nav_sub/lunch.gif";
      
      lunch_over = new Image(140,11);
      lunch_over.src = root_path+"/images/nav_sub/lunch_over.gif";
      
      dinner = new Image(140,11);
      dinner.src = root_path+"/images/nav_sub/dinner.gif";
      
      dinner_over = new Image(140,11);
      dinner_over.src = root_path+"/images/nav_sub/dinner_over.gif";
      
      beverage = new Image(140,11);
      beverage.src = root_path+"/images/nav_sub/beverage.gif";
      
      beverage_over = new Image(140,11);
      beverage_over.src = root_path+"/images/nav_sub/beverage_over.gif";
      
      to_go = new Image(140,11);
      to_go.src = root_path+"/images/nav_sub/to_go.gif";
      
      to_go_over = new Image(140,11);
      to_go_over.src = root_path+"/images/nav_sub/to_go_over.gif";
      
      dessert = new Image(140,11);
      dessert.src = root_path+"/images/nav_sub/dessert.gif";
      
      dessert_over = new Image(140,11);
      dessert_over.src = root_path+"/images/nav_sub/dessert_over.gif";
      
      garden_fare = new Image(140,11);
      garden_fare.src = root_path+"/images/nav_sub/garden_fare.gif";
      
      garden_fare_over = new Image(140,11);
      garden_fare_over.src = root_path+"/images/nav_sub/garden_fare_over.gif";
      
      kids = new Image(140,11);
      kids.src = root_path+"/images/nav_sub/kids.gif";
      
      kids_over = new Image(140,11);
      kids_over.src = root_path+"/images/nav_sub/kids_over.gif";
   }
   if (js_pathparts[1] == "wines"){
      // OUR WINES SUB-NAVIGATION PRELOADS

      wine_list = new Image(140,11);
      wine_list.src = root_path+"/images/nav_sub/wine_list.gif";
      
      wine_list_over = new Image(140,11);
      wine_list_over.src = root_path+"/images/nav_sub/wine_list_over.gif";
      
      food_wine = new Image(140,11);
      food_wine.src = root_path+"/images/nav_sub/food_wine.gif";
      
      food_wine_over = new Image(140,11);
      food_wine_over.src = root_path+"/images/nav_sub/food_wine_over.gif";
      
      wine_basics = new Image(140,11);
      wine_basics.src = root_path+"/images/nav_sub/wine_basics.gif";
      
      wine_basics_over = new Image(140,11);
      wine_basics_over.src = root_path+"/images/nav_sub/wine_basics_over.gif";
      
   }
   if (js_pathparts[1] == "recipes"){
      // RECIPES SUB-NAVIGATION PRELOADS

      featured_recipe = new Image(140,11);
      featured_recipe.src = root_path+"/images/nav_sub/featured_recipe.gif";
      
      featured_recipe_over = new Image(140,11);
      featured_recipe_over.src = root_path+"/images/nav_sub/featured_recipe_over.gif";
      
      recipe_search = new Image(140,11);
      recipe_search.src = root_path+"/images/nav_sub/recipe_search.gif";
      
      recipe_search_over = new Image(140,11);
      recipe_search_over.src = root_path+"/images/nav_sub/recipe_search_over.gif";
      
      demonstrations = new Image(140,11);
      demonstrations.src = root_path+"/images/nav_sub/demonstrations.gif";
      
      demonstrations_over = new Image(140,11);
      demonstrations_over.src = root_path+"/images/nav_sub/demonstrations_over.gif";


   }
   if (js_pathparts[1] == "company"){
      // COMPANY SUB-NAVIGATION PRELOADS

      our_story = new Image(140,11);
      our_story.src = root_path+"/images/nav_sub/our_story.gif";

      our_story_over = new Image(140,11);
      our_story_over.src = root_path+"/images/nav_sub/our_story_over.gif";

      principles_company = new Image(140,11);
      principles_company.src = root_path+"/images/nav_sub/principles_company.gif";

      principles_company_over = new Image(140,11);
      principles_company_over.src = root_path+"/images/nav_sub/principles_company_over.gif";

      diversity_company = new Image(140,11);
      diversity_company.src = root_path+"/images/nav_sub/diversity_company.gif";
      
      diversity_company_over = new Image(140,11);
      diversity_company_over.src = root_path+"/images/nav_sub/diversity_company_over.gif";

      employment = new Image(140,11);
      employment.src = root_path+"/images/nav_sub/employment.gif";

      employment_over = new Image(140,11);
      employment_over.src = root_path+"/images/nav_sub/employment_over.gif";

      community = new Image(140,11);
      community.src = root_path+"/images/nav_sub/community.gif";

      community_over = new Image(140,11);
      community_over.src = root_path+"/images/nav_sub/community_over.gif";

      press = new Image(140,11);
      press.src = root_path+"/images/nav_sub/press.gif";

      press_over = new Image(140,11);
      press_over.src = root_path+"/images/nav_sub/press_over.gif";

      investor_relations = new Image(140,11);
      investor_relations.src = root_path+"/images/nav_sub/investor_relations.gif";

      investor_relations_over = new Image(140,11);
      investor_relations_over.src = root_path+"/images/nav_sub/investor_relations_over.gif";

      contact_us = new Image(140,11);
      contact_us.src = root_path+"/images/nav_sub/contact_us.gif";

      contact_us_over = new Image(140,11);
      contact_us_over.src = root_path+"/images/nav_sub/contact_us_over.gif";
      
   }

   if (js_pathparts[1] == "employment"){
      // EMPLOYMENT SUB-NAVIGATION PRELOADS

      principles_employment = new Image(140,11);
      principles_employment.src = root_path+"/images/nav_sub/principles_employment.gif";

      principles_employment_over = new Image(140,11);
      principles_employment_over.src = root_path+"/images/nav_sub/principles_employment_over.gif";

      diversity_employment = new Image(140,11);
      diversity_employment.src = root_path+"/images/nav_sub/diversity_employment.gif";

      diversity_employment_over = new Image(140,11);
      diversity_employment_over.src = root_path+"/images/nav_sub/diversity_employment_over.gif";

      hourly = new Image(140,22);
      hourly.src = root_path+"/images/nav_sub/hourly.gif";

      hourly_over = new Image(140,22);
      hourly_over.src = root_path+"/images/nav_sub/hourly_over.gif";

      management = new Image(140,22);
      management.src = root_path+"/images/nav_sub/management.gif";

      management_over = new Image(140,22);
      management_over.src = root_path+"/images/nav_sub/management_over.gif";

      college = new Image(140,22);
      college.src = root_path+"/images/nav_sub/college.gif";

      college_over = new Image(140,22);
      college_over.src = root_path+"/images/nav_sub/college_over.gif";

      
   }


   if (js_pathparts[1] == "press"){
      // PRESS SUB-NAVIGATION PRELOADS

      news_releases = new Image(140,11);
      news_releases.src = root_path+"/images/nav_sub/news_releases.gif";
      
      news_releases_over = new Image(140,11);
      news_releases_over.src = root_path+"/images/nav_sub/news_releases_over.gif";
      
      espanol = new Image(140,11);
      espanol.src = root_path+"/images/nav_sub/espanol.gif";
      
      espanol_over = new Image(140,11);
      espanol_over.src = root_path+"/images/nav_sub/espanol_over.gif";
      
      fact_sheets = new Image(140,22);
      fact_sheets.src = root_path+"/images/nav_sub/fact_sheets.gif";
      
      fact_sheets_over = new Image(140,22);
      fact_sheets_over.src = root_path+"/images/nav_sub/fact_sheets_over.gif";

      awards = new Image(140,11);
      awards.src = root_path+"/images/nav_sub/awards.gif";
      
      awards_over = new Image(140,11);
      awards_over.src = root_path+"/images/nav_sub/awards_over.gif";

   }



   // END SUB-NAVIGATION PRELOADS

}




// Begin Rollover Highlight Function

	function hiLite(imgDocID,imgObjName) {
	   if( !document.images ) return;
	   var sitenav_section = js_pathparts[1];
	   if (sitenav_section == 'marketplace') sitenav_section = 'gift_card';
	//      alert(imgDocID+","+imgObjName+","+js_pathparts[2]+","+imgObjName.indexOf('_on'));
	   if ( (imgDocID == sitenav_section + '_button' || (imgDocID == js_pathparts[2] + '_button' && js_pathparts[2] != 'gift_card') )
			&& imgObjName.indexOf('_on') == -1 && imgObjName.indexOf('_over') == -1) return;
	   if (imgDocID == sitenav_section + '_button' && imgObjName.indexOf('_over') != -1) return;
	   if (document.images[imgDocID]) document.images[imgDocID].src = eval(imgObjName + ".src")
	}

	//begin mouseover for NEPB
		//detect browser:
		browserName = navigator.appName;
		browserVer = parseInt(navigator.appVersion);
		if (browserName == "Netscape" && browserVer >= 3) browserVer = "1";
		else if (browserName == "Microsoft Internet Explorer" && browserVer == 4) browserVer = "1";
		else browserVer = "2";
		
		//preload images:
		if (browserVer == 1) {
			c1_on = new Image(109,28);
			c1_on.src = root_path+"/images/misc/nepb_c_1_off.jpg";
		
			c1_off = new Image(109,28);
			c1_off.src = root_path+"/images/misc/nepb_c_1_on.jpg";			
		}
		
		//image swapping function:
		function swapImg(imgDocID, imgObjName, comment) {
			if (browserVer == 1) {
			document.images[imgDocID].src = eval(imgObjName + ".src");
			window.status = comment; return true;
		}}
	//end mouseover for NEPB


// End Rollover Highlight Function



// Begin Navigation Initialization Functions (to highlight the page/section being viewed)

function initSiteNav() {
   var sitenav_section = js_pathparts[1];
   if (sitenav_section == 'marketplace') sitenav_section = 'gift_card';
   var section_button_name = sitenav_section+'_button';
   var section_button_on = sitenav_section+'_on';
   if (document.images[section_button_name] && section_button_name){
      hiLite(section_button_name,section_button_on);
   }
}

function initSubNav() {
   var subsection_button_name = js_pathparts[2]+'_button';
   var subsection_button_over = js_pathparts[2]+'_over';
   if (document.images[subsection_button_name] && subsection_button_over){
//      alert(subsection_button_name+","+subsection_button_over);
      hiLite(subsection_button_name,subsection_button_over);
   }
   var subsection_nav_div = js_pathparts[1] + "_" + js_pathparts[2];
   if (document.getElementById(subsection_nav_div)){
      document.getElementById(subsection_nav_div).style.display='block';
   }
   var page_link_div = js_pathparts[2] + "_" + js_pathparts[3];
   if (document.getElementById(page_link_div)){
      document.getElementById(page_link_div).className='og_subnav_on';
   }
}

// End Navigation Initialization Functions




// Begin Simple Field-Clearing Function

var cleared = 0;
function clearField(field){
   if (cleared != 1){   
      field.value = "";
      cleared=1;
   }
   else{
      cleared = 0;
   } 
}

// End Simple Field-Clearing Function




// Begin Popup

function loadPopup(url, xw, xh, name, scroll){

   // SPECIFY THE POPUP WINDOW NAME
   var win_popup_name = name;

   // SPECIFY URL OF MAIN POPUP WINDOW
   var win_popup_url = url;

   // SPECIFY THE WINDOW HEIGHT AND WIDTH
   var win_width = xw;
   var win_height = xh;

   // SPECIFY THE LOCATION OF THE TOP-LEFT CORNER OF THE WINDOW
   var win_left = (screen.width - win_width) / 2;
   var win_top = (screen.height - win_height) / 2;
   var popup_window = window.open(win_popup_url,win_popup_name,'width=' + win_width + ',height=' + win_height + ',top=' + win_top + ',left=' + win_left + ',directories=no,location=no,menubar=no,scrollbars=' + scroll + ',status=no,toolbar=no,resizable=no')
   popup_window.focus();
}

// End Popup


// Begin New Window (for adjusting top, left)

function newWin(n,wn,w,h,t,l,s) { 
	new_window=window.open(n, wn, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+s+',resizable=1,width='+w+',height=' + h + ((t)?',screenX='+t+',top='+t:'') + ((l)?',screenY='+l+',left='+l:'')); if (new_window.opener==null) { new_window.opener=self; } if (window.focus) new_window.focus(); 
}

// End New Window

//begin link back to main window

function linkBack(url){
   window.opener.location = url;
//  window.opener.focus();
   window.close();
}

//end link back to main window


// Begin Locator Tab 

function openLocator(layer_id){
  // alert(layer_id);
   document.getElementById(layer_id).style.overflow = 'visible';
}

function closeLocator(layer_id){
  // alert(layer_id);
   document.getElementById(layer_id).style.overflow = 'hidden';
}

// End Locator Tab




// Begin Show and Hide Layers

function showLayer (layer_id) {
   document.getElementById(layer_id).style.display='block';
   if (layer_id == "email_page") {
      document.getElementById("locator_3").style.display='none';
   }
}

function hideLayer (layer_id) {
   document.getElementById(layer_id).style.display='none';
}

// End Show and Hide layers




// Begin basic functions for reading/writing cookies

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

function getCookie(cookiename) {
   var cookiestring=""+document.cookie;
   var index1=cookiestring.indexOf(cookiename);
   if (index1==-1 || cookiename=="") return ""; 
   var index2=cookiestring.indexOf(';',index1);
   if (index2==-1) index2=cookiestring.length;
   var cookie_value = unescape(cookiestring.substring(index1+cookiename.length+1,index2));
   cookie_value = cookie_value.replace(/\+/g, " ")
   return cookie_value
}

// End basic functions for reading/writing cookies

// Begin Third Party Locator Functions

function LocatorCheckCookie(){
   var RestaurantNum = getCookie("RestaurantNum");
   if (RestaurantNum == null || RestaurantNum == ""){
      // Make "My Olive Garden" layer invisible
      document.getElementById("locator_2").style.display='none';
   }
}

function LocatorAddress(){
   var str='';
   str+='<b>' + getCookie("Address1")+ '</b><br />';
   str+=getCookie("City") + ', ' + getCookie("StateCode") + '&nbsp;' + getCookie("ZipCode") + '<br />';
   str+='<b>Phone: ' + getCookie("PhoneNum") + '</b><br />';
   str+='Fax: ' + getCookie("FaxNum");
   str+='</div>';
   str+='<div class="og_tab_11_sans" style="margin: 7px 0px 0px 0px; text-align: center;">';
   str+='Sun - Thurs: ' + getCookie("STOpen") + ' - ' + getCookie("STClose") + '<br />';
   str+='Fri - Sat: ' + getCookie("FSOpen") + ' - ' + getCookie("FSClose");
   str+='</div>';
   str+='<div class="og_tab_link_10" style="margin: 8px 0px 8px 0px; text-align: center;">';
   str+='<a href="http://locator.olivegarden.com/cwc/apps/w2gi.php?template=moreinfo1&amp;client=oliveg&amp;W2GI_QFIELD=BusinessID&amp;W2GI_QVALUE=' + getCookie("RestaurantNum") + '"><b>Get Map and Driving Directions</b></a>';
   str+='</div>';
   document.write(str);
}

function LocatorGM(){
   var str='';
   str+='<div class="og_tab_subhead_14" style="margin: 0px 0px 5px 0px; text-align: center;"><b>' + getCookie("FirstName") + '<br \/>' + getCookie("LastName") + '<\/b><\/div>';
   str+='<div class="og_tab_link_10" style="text-align: center;">General Manager<\/div>';
   document.write(str);
}

function LocatorMyOG(){
   var str='';
   str+='<div class="og_tab_link_10" style="margin: 30px 0px 6px 0px; text-align: center;">';
   str+='<b><span style="color: #990000;">My Olive Garden:&#160;<\/span>';
   str+='<a href="javascript:void(0);" onclick="showLayer(\'locator_3\');"><span style="font-size: 9px;">' + getCookie("City") + '<\/b><\/span><\/a>';
   str+='<\/div><\/td>';
   document.write(str);
}

function EmailLink(){
   document.write('<a href="mailto:?subject=Check out Olive Garden&amp;body=Check this out: ' + location.href + '"><img style="margin: 54px 17px 0px 0px;" src="//www.olivegarden.com/images/core/email_page.gif" alt="Email this page" width="109" height="11" border="0" /></a><br />');
}

function HomeLink(){
   document.write('<a href="http://www.olivegarden.com/"><img style="margin: 7px 0px 5px 12px;" src="//www.olivegarden.com/images/core/logo.gif" alt="Olive Garden" width="118" height="60" border="0" /></a>');
}

// End Third Party Locator Functions

// Begin Query String Parsing Function

function parseQueryString (str) {
  str = str ? str : location.search;
  var query = str.charAt(0) == '?' ? str.substring(1) : str;
  var args = new Object();
  if (query)   {
    var fields = query.split('&amp;');
    for (var f = 0; f < fields.length; f++){
      var field = fields[f].split('=');
      args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' '));
    }
  }
  return args;
}
// End Query String Parsing Function

// Begin Function(s) for Email This Page

function emailpage(fobj){
   document.getElementById('mail_friend_status').innerHTML = "";
   document.getElementById('mail_friend_status').innerHTML = "Preparing to Send...";
   var emailFilter=/^.+@.+\..{2,3}$/;
   if (!(emailFilter.test(fobj.to.value)) || !(emailFilter.test(fobj.fromEmail.value))){
      document.getElementById('mail_friend_status').innerHTML = "";
      document.getElementById('mail_friend_status').innerHTML = "Error! You must enter both your email address and your friend's email address";
   }
   else{
      var query = "";
      query += "fromName="+escape(fobj.fromName.value);
      query += "&fromEmail="+escape(fobj.fromEmail.value);
      query += "&to="+escape(fobj.to.value);
      query += "&subject="+escape(fobj.subject.value); 
      query += "&emailBody="+escape(fobj.intro_text.value+"\r\n\r\n"+fobj.message.value); 
      query += "&returnPageURL="+escape("http://www.olivegarden.com/");
      var methd = "POST";
      var url = "/server_scripts/email_page.asp";
      document.getElementById('mail_friend_status').innerHTML = "";
      document.getElementById('mail_friend_status').innerHTML = "Sending...";
      sndReq(url, query, methd);
   }
}




// Begin Functions For AJAX

function createRequestObject() {
   var ro;
   var browser = navigator.appName;
   if(browser == "Microsoft Internet Explorer"){
      ro = new ActiveXObject("Microsoft.XMLHTTP");
   }else{
      ro = new XMLHttpRequest();
   }
   return ro;
}

if( http && http.readyState ){
   http.abort( );
   http = false;
}

var http = createRequestObject();

function sndReq(url, query, method) {
   switch(method){
      case "POST":
         http.open(method, url, true);
         http.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
         http.setRequestHeader( 'Content-length', query.length );
         http.send(query);
         break;
      case "GET":
         url = url + "?" + query;
         http.open(method, url, true);
         http.send(null);
         break;
   }
   http.onreadystatechange = handleResponse;
}

function handleResponse() {
   if(http.readyState == 4){
      if (http.status == 200){
         var response = http.responseText;
//         document.getElementById('response').innerHTML = response;
//         document.getElementById('mail_friend_status').innerHTML = "Status: success (readystate=" + http.readyState + ")";
         document.getElementById('mail_friend_status').innerHTML = "";
         document.getElementById('mail_friend_status').innerHTML = "Email Sent To " + document.email_page.to.value + "!";
         document.email_page.to.value = ""
         document.email_page.toName.value = ""
      }
      else{
//         document.getElementById('mail_friend_status').innerHTML = " failed (status="+http.status+", readystate=" + http.readyState + ", statustext=" + http.statusText + ")";
         document.getElementById('mail_friend_status').innerHTML = "";
         document.getElementById('mail_friend_status').innerHTML = "Error! Send failed.";
      }
   }
}

// End Functions For AJAX

