function detect() {
	var agent		= navigator.userAgent.toLowerCase();
	var safariVer	= ( agent.indexOf( "safari/" ) != -1) ? parseInt( agent.split( "safari/" )[1] ) : 0;
	this.isMac	= ( agent.indexOf( "mac" ) != -1 );
	this.isWin	= ( agent.indexOf( "win" ) != -1 );
	this.isWin2k	= ( this.isWin && (
		agent.indexOf( "nt 5" ) != -1 ) );
	this.isWinSP2	= ( this.isWin && (
		agent.indexOf( "xp" ) != -1 || 
		agent.indexOf( "sv1" ) != -1 ) );
	this.isOther	= (
		agent.indexOf( "unix" ) != -1 || 
		agent.indexOf( "sunos" ) != -1 || 
		agent.indexOf( "bsd" ) != -1 ||
		agent.indexOf( "x11" ) != -1 || 
		agent.indexOf( "linux" ) != -1 );
	this.isSafari	= ( agent.indexOf( "safari" ) != -1 );
	this.isSafari2	= ( safariVer >= 312 );
	this.isOpera	= ( agent.indexOf( "opera" ) != -1 );
	this.isNN		= ( agent.indexOf( "netscape" ) != -1 );
	this.isIE		= ( agent.indexOf( "msie" ) != -1 );
}

var browser = new detect();
var str = "Search";
var q = document.getElementById( "q" );

if ( !browser.isSafari2 ) {
	q.style.color = "#80808c";
	q.value = str;
	q.onfocus = function() {
		if ( q.value == "Search" && ( q.style.color == "#80808c" || q.style.color == "rgb(128, 128, 140)" ) ) {
			q.value = "";
			q.style.color = "#000";
		}
	};
	q.onblur = function() {
		if ( q.value == "" ) {
			q.value = str;
			q.style.color = "#80808c";
		}
	};
} else {
	q.style.color = "#000";
	q.type = "search";
	//testq.setAttribute("autosave", "c2talk");
	q.setAttribute("results", "5");
	q.setAttribute("placeholder", "Search");
}
