

var tt_url = "index.cfm?fuseaction=rb.tooltip"; 
var isWorking = false;
var text_array = new Object;

function getTooltip(type_tt,prod_id) {
	if(http) {
		prod_now = prod_id;
		if(text_array[prod_now])
			return_txt = text_array[prod_now];
		if(prod_now > '' && text_array[prod_now] && return_txt.indexOf(prod_now) > 0) {
			return(return_txt);
		}
		else {
			var urlValues = tt_url + "&prod_id=" + prod_id + "&type=" + type_tt + "&bustcache=" + new Date().getTime(); 
			http.open("GET",urlValues, true); 
			http.onreadystatechange = handleHttpResponse;
			if (window.XMLHttpRequest) {
				http.send(null);
				isWorking = true;
			}
			else if (window.ActiveXObject) {
				http.send();
				isWorking = true;
			}
			return('Retrieving Data');
		}
	 }
}

function Get_Cookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) &&
	( name != document.cookie.substring( 0, name.length ) ) )
	{
	return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );
function Two_Get_Cookie( check_name ) {
	document.write('check name is ' & check_name);
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	document.write('here, all cookies is ' & a_all_cookies);
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		document.write('cookie name is ' & cookie_name & ', check name is ' & check_name);
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}				


function Set_Cookie( name, value, expires ) 	{

	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" + ";path=/" );
}
	

<!--- add fetch of cart count --->
function getCartCount2() {
	this_count = Get_Cookie('prod_count');
	current_text = document.getElementById("cart_quantity").innerHTML.value;
	if(this_count != null && current_text != this_count) {
		if (this_count > 1) {
			innerText = this_count + " Items";
		}
		else if (this_count > 0) {
			innerText = this_count + " Item";
		}
		else {
			innerText = "No items";
		}
		innerText = innerText + " in <a href='index.cfm?fuseaction=cart.home' style='text-decoration:underline;color:000000' target='_top' border='0'><img src='images/cart.gif' align='absmiddle' vspace='2' border='0' alt='Shopping Cart' width='26' height='15'> Cart</a>&nbsp;&nbsp;";
		document.getElementById("cart_quantity").innerHTML=innerText;
	}
}
		
function handleCountResponse() {
	if(count_http) {
		if (count_http.readyState == 4) { 
			if (count_http.responseText.indexOf('invalid') == -1) {
				count_text = count_http.responseText - 0;
				if (count_text > 1) {
					innerText = count_text + " Items";
				}
				else if (count_text > 0) {
					innerText = count_text + " Item";
				}
				else {
					innerText = "No items";
				}
				innerText = innerText + " in <a href='index.cfm?fuseaction=cart.home' style='text-decoration:underline;color:000000 target='_top' border='0'><img src='images/cart.gif' align='absmiddle' vspace='2' border='0' alt='Shopping Cart' width='26' height='15'> Cart</a>&nbsp;&nbsp;";
				document.getElementById("cart_quantity").innerHTML=innerText;
				<!--- return(info_text); --->
				isWorking = false;
			}
		} 
	}
}

function handleHttpResponse() {
	if(http) {
		if (http.readyState == 4) { 
			if (http.responseText.indexOf('invalid') == -1) {
				info_text = http.responseText;
				info_text = "<table width=\'100%\' cellpadding=\'5\' bgcolor=\'D2D4E3\'><tr><td><font style=\'font-size: smaller;\'>" + http.responseText + "</td></tr></table>";
				if(prod_now > '')
					text_array[prod_now] = info_text; 
				document.getElementById("dhtmltooltip").innerHTML = info_text;
				<!--- return(info_text); --->
				isWorking = false;
			}
		} 
	}
}




<!--- begin playaway_all get summary functions --->
function setID(sID) {
	GsID = sID;
	return GsID;	
	}
	
function clearSummary() {
	var clearS = "";
	var divSummarEl = document.getElementById(GsID);
	replaceText(divSummarEl,clearS);
	
	
	}


function getSummary() {
	if(summary_http) {
		var url = "index.cfm?fuseaction=rb.AJAXSummary";
		urlC = url + "&number=" + GsID;
		summary_http.open("GET",urlC, true); 

		summary_http.onreadystatechange = updatePage;
		
		if (window.XMLHttpRequest) {
			summary_http.send(null);
			isWorking = true;
		}
		else if (window.ActiveXObject) {
			summaryt_http.send();
			isWorking = true;
		}
		return('Retrieving Data');
	 }
	}
	


function updatePage() {
	if(summary_http) {
		if (summary_http.readyState == 4) { 
			if (summary_http.responseText.indexOf('invalid') == -1) {
	

	var summary = summary_http.responseText;

	var divSummarEl = document.getElementById(GsID);

	replaceText(divSummarEl,summary);	
	}
	
	}
	
	}
	}

function replaceText(el, text) {
  if (el != null) {
    clearText(el);
    var newNode = document.createTextNode(text);
    el.appendChild(newNode);
  }
}

function clearText(el) {
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var childNode = el.childNodes[i];
        el.removeChild(childNode);
      }
    }
  }
}

function getText(el) {
  var text = "";
  if (el != null) {
    if (el.childNodes) {
      for (var i = 0; i < el.childNodes.length; i++) {
        var childNode = el.childNodes[i];
        if (childNode.nodeValue != null) {
          text = text + childNode.nodeValue;
        }
      }
    }
  }
return text;
}


<!--- end playaway_all get summary functions --->



/* primary function to create request object */

function createRequestObject() {
    var ro;
    try {
      ro = window.XMLHttpRequest ? new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) {
      ro = false;
    }
    return ro;
}

function loadXMLDoc(url) 
{
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
		try {
	        req = new XMLHttpRequest();
		} catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else {
		if (window.ActiveXObject) {
			try {
	        	req = new ActiveXObject("Msxml2.XMLHTTP");
	       	} catch (e) {
		   		try {
	        		req = new ActiveXObject("Microsoft.XMLHTTP");
	      	 	} catch (e) {
					req = false;
				}
			}
		}
	}
	if (req) {
		req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send("");
	}
}
	
var http = createRequestObject();
var count_http = createRequestObject();
var summary_http = createRequestObject();
var prod_now = '';
var return_txt = '';

