function init_hs(){
	jQuery('#side_menu a').hover(
		function(){
			jQuery(this).addClass('hovered');
		},
		function(){
			jQuery(this).removeClass('hovered');
		}
	);
};

function database_form_init( doSEO, fURL, oURL ){
	if ( !doSEO ){
		return;
	}
	var jqForm = jQuery('#database_form');
	jqForm.submit( function(){
		var jqType = jqForm.find('#type');
		var gotoURL = oURL;
		if( jqType.val() == "Freighter" ){
			gotoURL = fURL;
		}
		window.location.href=gotoURL + '?searchfor=' + encodeURIComponent( jqForm.find('#searchfor').val() );
		return false;
	});
};

function init_paginator(paginator_id,curItemsPerPage){
	var maxw = 0;
	jQuery('#'+paginator_id+' .paginator-item').each(function(){
		var jqThis = jQuery(this);
		maxw = Math.max(maxw,jqThis.width());
		jqThis.hover(function(){jQuery(this).addClass("ui-state-hover");},function(){jQuery(this).removeClass("ui-state-hover")});
		jqThis.css('border-width','1px 0px');
	})
	.width(maxw);
	jQuery('#'+paginator_id+' .paginator-item:first').css('border-left-width','1px');
	jQuery('#'+paginator_id+' .paginator-item:last').css('border-right-width','1px');
	jQuery('#'+paginator_id+' span.paginator-pp-ctrl').click( function(){
		var expires = new Date();
		expires.setTime(expires.getTime()+31536000000); // 1000 * 60 * 60 * 24 * 365
		jQuery.cookie(paginator_id+"_pp",jQuery(this).text(),{"expiresAt": expires,"path":"/"});
		location.reload();
	});
};

function send(d,o){
	location.href=decipher(d,o);
};

function decipher(d,o){
	var c = d.split('.');
	var m = '';
	for (var i=0; i < c.length; i++){
		m+=String.fromCharCode(c[i]-o);
	}
	return m;
}; 
