//    Toggles between Expand and Collapse for one section of code (between DIVs)
function doExpand(paraNum,arrowNum) 
{
	var paraName = document.getElementById(paraNum);
	var arrowName = document.getElementById(arrowNum);
	//alert(paraName.style.display);
   if (paraName.style.display=="none") 
   {
      paraName.style.display="block";
      arrowName.src="/images/collapse-sign-12px.gif";
   }
   else
   {
      paraName.style.display="none";
      arrowName.src="/images/expand-sign-12px.gif";
   }
	//alert(paraName.style.display);
}

//    Expands all sections of code (between DIVs)
function doExpandAll(paraNum,arrowNum) 
{
	var paraName = document.getElementById(paraNum);
	var arrowName = document.getElementById(arrowNum);
	paraName.style.display="block";
	arrowName.src="/images/collapse-sign-12px.gif";
}

//    Collapses all sections of code (between DIVs)
function doCollapseAll(paraNum,arrowNum) 
{
	var paraName = document.getElementById(paraNum);
	var arrowName = document.getElementById(arrowNum);
   paraName.style.display="none";
   arrowName.src="/images/expand-sign-12px.gif";
}

 //    Converts data into mailto:email_address to subvert spammers
function eParser(ext,dom,who)
{
	document.write("<a class=\"elink\" href=\"mailto");
	document.write(":" + who + "@" + dom + "." + ext + "\">");
}

//    Places a closing </a> on the email Parser above
function ePEnd()
{
	document.write("<\/a>");
}

//    Creates popup window non-maximized
function wopen(url, name, w, h, resize)
{
	// Fudge factors for window decoration space.
	// should work well on all platforms and browsers
	w += 32;
	h += 96;
	if (resize.toUpperCase()=='FIXED' || resize.toUpperCase=='NO')
	{	resize = 'no'}
	else
	{	resize = 'yes'}
		
	var win = window.open(url, name, 'width=' + w + ', height=' + h + ', ' + 
	   'location=no, menubar=yes, status=yes, toolbar=no, scrollbars=' + resize + ', resizable=' + resize + ', ' +
	   'screenX=250, screenY=250');
	win.resizeTo(w, h);
	win.focus();
}  

//		Print Tracking Script -- from MealsAndDeals.com
var url = "print_tracker.php?client=58&coupon=52"; // The server-side script

function print_me() {
  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
  http.send(null);
}

function handleHttpResponse() {
  if (http.readyState == 4) {
    results = http.responseText;
    //if(results == "") results = "Username <i>"+name+"</i> Is Available...";
    //alert(results + " hi");
	window.print();
  }
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object
