var img_obj = new Array();

function showphoto(path, pic, width) {
	var photo = document.getElementById('mainphoto');
	img_obj[1] = new Image();
	photo.src = pic;
	photo.style.width = width;
}

function gotodir(tag) {
	var tagselect = document.getElementById('tagselect');
	document.location = "http://officenext.ru"+tagselect.value+"/?tag="+tag;
}

function translate() {
	var trn = document.getElementById('trn');
	location.href = trn.value;
}
function clearEmail(inp) {
	var input = document.getElementById(inp);
	input.value = '';
}
function restoreEmail(inp) {
	var input = document.getElementById(inp);
	input.value = 'поиск';
}

function pmenu(todo, div) {
	var d = document.getElementById(div);
	if(todo == 1)
		d.style.visibility = "visible";
	else if(todo == 0)
		d.style.visibility = "hidden";
}

function filtr(dir, f, id){
	var gotol = "http://projectnext.ru/";
	if(f == 1) {
		var d = document.getElementById("filtr1");
		var str = "?f1=";
	} else {
		var d = document.getElementById("filtr");
		var str = "?f=";
	}
	var ids = '';
	if((id != '')&&(id != '0')&&(id != 'undefined'))
		ids = '&id='+id+'#all';
	
	switch (dir) {
		case "events": {
			document.location = gotol+"events/"+str+d.value+"&ff="+f+ids;
			break;
		}
		case "competition": {
			document.location = gotol+"competition/"+str+d.value+ids;
			break;
		}
		case "exhibition": {
			document.location = gotol+"exhibition/"+str+d.value+ids;
			break;
		}
		case "conception": {
			document.location = gotol+"conception/"+str+d.value+ids;
			break;
		}
		case "club": {
			document.location = gotol+"club/"+str+d.value+ids;
			break;
		}
		case "education": {
			document.location = gotol+"education/"+str+d.value+ids;
			break;
		}
		case "travel": {
			document.location = gotol+"travel/"+str+d.value+ids;
			break;
		}
		case "postfactum": {
			document.location = gotol+"postfactum/"+str+d.value+ids;
			break;
		}
	}
}
