var prev = 0;
var pprev = 0;
function dId(ob) {return document.getElementById(ob);}

function menu(id){
	if(prev>0){ dId("menu"+prev).style.display='none'; dId("b"+prev).style.background = pstyle; } //
	if(prev!=id){ 
		dId("menu"+id).style.display='block';
		prev=id;
		pstyle = (dId("b"+id).style.background || "");
		dId("b"+id).style.background = "#656565";
	}
	else { 
		if(pprev != 0){ prev = pprev; dId("menu"+prev).style.display='block'; dId("b"+prev).style.background = "#656565"; }
		else prev = 0; 
	}
}
function resume(fid){
	dId('gform').fid.value = fid;
	ajx.query(
	'res.php?file=0',
	{ 'form': dId('gform') },
	function(responseJS,responseText) {
		rcont = responseJS.q;
		dId('l'+fid).innerHTML=rcont;
		dId('resume_but'+fid).style.display='none';
		//dId('sbm'+fid).onclick=resume_send;
		dId('rf'+fid).vacancy.value=vacanc[fid];
	},
	true
	);
}
function resume_send(fid){
	ajx.query(
	'res.php?file=1',
	{ 'form': dId('rf'+fid) },
	function(responseJS,responseText) {
		rcont = responseJS.q;
		dId('l'+fid).innerHTML=rcont;
		dId('resume_but'+fid).style.display='block';
	},
	true
	);
}
function search(){
	dId('search').submit();
}
function showsub(layer){
	s = dId('d'+layer).style.display;
	if(s == "" || s == "none"){
		dId('d'+layer).style.display = "block";
		dId('p'+layer).innerHTML = "-";
	}
	else {
		dId('d'+layer).style.display = "none";
		dId('p'+layer).innerHTML = "+";
	}
}