var OPR = window.opera ? true : false;
var SF2 = navigator.userAgent.match( /AppleWebKit\/[456789]\d{2}?/g ) ? true : false;
var SF1 = navigator.userAgent.match( /AppleWebKit\/3\d{2}?/g ) ? true : false;
var MOZ = !document.all && document.getElementById && !SF1 && !SF2 && !OPR ? true : false;
var IE7 = typeof( document.documentElement.style.msInterpolationMode != "undefined" ) ? true : false;
var IE6 = document.uniqueID && !IE7 ? true : false;

function $( ) {
	var elems = new Array( );
	for( var i = 0; i < arguments.length; i++ ) {
		var elem = arguments[ i ];
		if( typeof elem == 'string' ) elem = document.getElementById( elem );
		if( arguments.length == 1 ) return elem;
		elems.push( elem );
	}
	return elems;
}

if( typeof jp == "undefined" ) var jp = new Object( );
if( typeof jp.fhn == "undefined" ) jp.fhn = new Object( );

jp.fhn.WP = function( obj ) {
	this.identifier  = obj.identifier;
	this.searchForm  = obj.searchForm;
	this.searchBox   = obj.searchBox;
}
jp.fhn.WP.prototype = {
	safariDispatcher: function( ) {
		if( $( this.searchForm ) && $( this.searchBox ).tagName == 'INPUT' ) {
			var o = { type:'search', placeholder:'search', autosave:this.identifier, results:5 };
			for( i in o ) {
				$( this.searchBox ).setAttribute( String( i ), o[ i ] );
			}
		}
	},
	init: function( ) {
		if( $(this.searchForm) && ( SF1 || SF2 ) ) this.safariDispatcher( );
	}
};

var FHN_OBJ = {
	identifier:'YOUR.DOMAIN.HERE',
	searchForm:'searchform',
	searchBox:'s'
};

var FHN = new jp.fhn.WP( FHN_OBJ );
this.onload = function( ) {
	FHN.init( );
}