
document.title = "REDBANA-don't just play it, live it!";

if (document.layers) {
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
}

document.onmouseover = hidestatus;
document.onmouseout = hidestatus;

function hidestatus(){
	window.status = "REDBANA-don't just play it, live it!";
	return true;
}

/*
 * String object prototype functions
 */
 
// trim
String.prototype.trim = function() {
	var retValue = this;

	var ch = retValue.substring(0, 1);
	while (ch == " ") {
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}

	ch = retValue.substring(retValue.length - 1, retValue.length);
	while (ch == " ") {
		retValue = retValue.substring(0, retValue.length - 1);
		ch = retValue.substring(retValue.length - 1, retValue.length);
	}

	return retValue;
}

/*
 * utility functions
 */
// trim
function trim(input) {
	if (typeof input != "string") return input;
	
	return input.trim();
}



// get cookie expire day
function getexpirydate(mins){
	var Today = new Date();
	var nomilli = Date.parse(Today);
	Today.setTime(nomilli + mins * 60 * 1000);
	return Today.toUTCString();
}

// get cookie value
function getcookie(cookiename) {
	var cookiestring = "" + document.cookie;

	// cookie first
	var index1 = cookiestring.indexOf(cookiename);
	if (index1 == -1 || cookiename == "") {
		return "";
	}

	// cookie end
	var index2 = cookiestring.indexOf(';',index1);
	if (index2 == -1) {
		index2 = cookiestring.length; 
	}
	return unescape(cookiestring.substring(index1+cookiename.length+1, index2));
}

// set cookie
function setcookie(name, value, mins){
	// make cookie string
	cookiestring = name + "=" + escape(value) + ";expires=" + getexpirydate(mins) + ";domain=redbana.com;path=/;";

	// write!
	document.cookie = cookiestring;
	if (!getcookie(name)){
		return false;
	} else {
		return true;
	}
}

