function ClientSideInclude()
{
	clientSideInclude("Top", "http://www.americarx.com/TopHtml.txt");
	clientSideInclude("Menu", "http://www.americarx.com/MenuLinks.txt");
	clientSideInclude("Bottom", "http://www.americarx.com/BottomHtml.txt");
}

function ClientSideInclude1()
{
	clientSideInclude("ShoppingCart", "http://www.americarx.com/ShoppingCart.aspx");
}

function ClientSideInclude2()
{
	clientSideInclude("ShoppingCart", "http://www.americarx.com/ShoppingCart.aspx");
}

function ClientSideInclude3()
{
	clientSideInclude("Top", "http://www.americarx.com/TopHtml.txt");
	clientSideInclude("Menu", "http://www.americarx.com/MenuLinks.txt");
	clientSideInclude("Bottom", "http://www.americarx.com/BottomHtml.txt");
	clientSideInclude("SearchMenu", "http://www.americarx.com/SearchMenu.txt");

		//clientSideInclude("JoinWithUs", "http://www.americarx.com/JoinWithUs.txt");
}


function clientSideInclude(id, url) {
//setCookie(cookieName, url);
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML = "";
  }
}


function setCookie(name, value) {
alert(value);
  var curCookie = name + "=" + escape(value);
  document.cookie = curCookie;
  alert('curCookie' + 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;
    alert(dc);
  return unescape(dc.substring(begin + prefix.length, end));
}



