/* rvb2.js */

rb = 'rentbuydata';

/* get the cookie required from a list of possible cookies */
function GetCookie (CookieName){
	var cname = CookieName + "=";
	var i = 0;
	while (i < document.cookie.length) {
		var j = i + cname.length;
		if (document.cookie.substring(i, j) == cname){
			var leng = document.cookie.indexOf (";", j);
			if (leng == -1) leng = document.cookie.length;
			return unescape(document.cookie.substring(j, leng));
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) 
		break;
	}
	return " ";
}

/* parses the cookie required returning the requested value - the value 
which is at the requested position within the specified cookie */

function parseCookie(cookieValue, citem){
	var indx = 0, citemlen =0;
	if (cookieValue == null) 
	return " "/* data has expired or never entered. */
	if (cookieValue == " ") 
	return " "/* data has expired or never entered. */
	for(var i=0; i < citem; i++) {
		indx = ( citem==0 )?0:cookieValue.indexOf("`", indx + 1)+1;
	}
	citemlen=(cookieValue.indexOf("`",indx)>0)?cookieValue.indexOf("`", indx+1):cookieValue.length;
	return cookieValue.substring(indx, citemlen);
}

function roundPen(n){
	if(n > 0){
	pennies = n*100;
	pennies = Math.round(pennies);
	strPennies = "" + pennies;
	len = strPennies.length;
	return strPennies.substring(0, len - 2) + "." + strPennies.substring(len -2, len);
	}else{ 
		return 0;
	}
}

rbuyData = GetCookie(rb);

function browTest(){
	if((navigator.appVersion.substring(0,3) == 3.0 || navigator.appVersion.substring(0,3) == 4.0)&& navigator.appName.substring(0,8)=="Netscape"){
		return true;
	}else{
		return false;
	}
}

