var Core = {
	version:200,
	last_key_pressed:-1
}


function onenter(cbk){
	try{
		var e = window.event ? event : e;
		lastKeyPressed = e.keyCode ? e.keyCode : e.charCode;
		if(lastKeyPressed==13 || lastKeyPressed==3) cbk();
	}catch(ex){
		//firefox does not work because it has no window.event property, and there is no way to pass the event object here as this method is called from
		//onkeypress="onenter(Obj.func)". so firefox users will not be able to press enter. it's silly to make long complex js calls to wire these up,
		//so we fake a window.event object for firefox at some point i guess
		if(Core.last_key_pressed==13 || Core.last_key_pressed==3) cbk();
	}
}



var Nav = {
	timer:null,
	open:function(id){
		if(block_hovers) return;
		if(this.timer != null) clearTimeout(this.timer);
		$$('.menu_inner').each(function(t){t.hide();});
		$('mi_'+id).show();
		$$('.menu_outer a').each(function(t){t.removeClassName('selected');});
		$('nlink_'+id).addClassName('selected');
	},
	release:function(id){
		if(block_hovers) return;
		this.timer = setTimeout(function(){
			$('mi_'+id).hide();
			$('nlink_'+id).removeClassName('selected');
			if(selected_nav_id != -1){
				$('mi_'+selected_nav_id).show();
				$('nlink_'+selected_nav_id).addClassName('selected');
			}
		}, 3000);
	},
	hold_open:function(id){
		if(block_hovers) return;
		if(this.timer != null) clearTimeout(this.timer);
	},
	unlock:function(id){
		if(block_hovers) return;
		this.timer = setTimeout(function(){
			$('mi_'+id).hide();
			$('nlink_'+id).removeClassName('selected');
			if(selected_nav_id != -1){
				$('mi_'+selected_nav_id).show();
				$('nlink_'+selected_nav_id).addClassName('selected');
			}
		}, 3000);
	}
}











var Search = {
	search:function(){
		var sf = $F('sftx');
		if(sf==''||sf=="Search..."){
			new Effect.Shake("search_box", {duration:0.5});
			return;
		}
		window.open('/search.html?s='+sf.gsub("'", '').gsub('"',''), '_self');
	},
	focus:function(o){
//		if($F(o)=="Search..."){
//			$(o).value = '';
//		}
	},
	blur:function(o){
//		if($F(o)==''){
//			$(o).value = 'Search...';
//		}
	}
}
















































