requestTag = "../requests/fastTag.php";
rightArrow.src = "../resources/images/go.png"; 

registerOnload(function () {
	browser = new BrowseMenu();
});

function BrowseMenu() {
	this.pos = findPos($('BrowseBtn'));
	
	this.obj = document.createElement("div");
	this.obj.className = "tagBrowser";
	this.obj.style.left = this.pos[0]+"px";
	this.obj.style.top = (this.pos[0]-14)+"px";
	
	var func = function (id, name) {
		if (window.location.toString().indexOf('?') == -1)
			window.location += "?tag[]="+id;
		else 
			window.location += "&tag[]="+id; 
	}
	this.selector = new TagSelector(func, false);
}
BrowseMenu.prototype.open = function () {
	document.body.insertBefore(this.obj, document.body.firstChild);
	this.obj.appendChild(this.selector.getObj());
	this.selector.start();
	this.opened = true;
}
BrowseMenu.prototype.close = function () {
	this.obj.removeChild(this.selector.getObj());
	document.body.removeChild(this.obj);
	this.opened = false;
}

function browse() {
	if (!browser.opened)
		browser.open();
	else
		browser.close();
}


function sort() {
	
}

