function addJob() {
	toggle_obj('add_job_form');
	var html = '<form action="action.php3" method="post" name="study_card">'+
					'<div class="head">'+
						'Наименование организации, салона, магазина:'+
					'</div>'+
					'<div class="text">'+
						'<input type="text" name="important_field" value="" size="50" style="position:absolute; left:-9000px;"/>'+
						'<input type="text" name="name" value="" size="50"/>'+
					'</div>'+
					'<div class="head">'+
						'Должность:'+
					'</div>'+
					'<div class="text">'+
						'<input type="text" name="position" value="" size="50"/>'+
					'</div>'+
					'<div class="head">'+
						'Оплата:'+
					'</div>'+
					'<div class="text">'+
						'<input type="text" name="payment" value="" size="50"/>'+
					'</div>'+
					'<div class="head">'+
						'График работы:'+
					'</div>'+
					'<div class="text">'+
						'<input type="text" name="work_time" value="" size="50"/>'+
					'</div>'+
					'<div class="head">'+
						'Обязаности:'+
					'</div>'+
					'<div class="text">'+
						'<textarea name="workflow" value="" cols="40" rows="3"></textarea>'+
					'</div>'+
					'<div class="head">'+
						'Адрес предлагаемой работы:'+
					'</div>'+
					'<div class="text">'+
						'<textarea  name="address" value="" cols="40" rows="3"></textarea>'+
					'</div>'+
					'<div class="head">'+
						'Контактный телефон:'+
					'</div>'+
					'<div class="text">'+
						'<input type="text" name="tel" value="" size="50"/>'+
					'</div>'+
					'<div class="text">'+
						'<input type="submit" value="Добавить"/>'+
					'</div>'+
					'<input type="hidden" name="action" value="dojobs"/>'+
					'<input type="hidden" name="mode" value="{/page/constants/mode_id}"/>'+
				'</form>';
				
	var form_block = document.getElementById('add_job_form');
	form_block.innerHTML = html;
}

function toggle_obj(Obj_id){
	
	var Obj = document.getElementById(Obj_id);
	var display = Obj.style.display;
	if (display == 'none' || !display)
		Obj.style.display = 'block';
	else
		Obj.style.display = 'none';
}

function pagenum(p, filename){
    document.forms["nav"].elements["page"].value = p;
    document.forms["nav"].elements["filename"].value = filename;
    document.forms["nav"].submit();
}

function my_confirm(to, what){
	if (confirm(what))
		document.location=to;
}
				
var foto_windows = new Array();
function open_foto(url, winname, width, height){
	foto_windows[foto_windows.length] = window.open(url,winname,'height='+height+',width='+width+',resizable=0,scrollbars=no,menubar=no,status=no');
	for(i = 0; foto_windows.length > i; i++){
		if(!foto_windows[i].closed)
			foto_windows[i].focus();
	}
}

function do_search(text){
	var search_line = document.getElementById('sline');
	search_line.value = text;
	document.forms['web'].submit();
}

function newWindow(url,w,h){
w = w + 18;
h = h + 27;
Win = window.open(url, "Win", "width=" + w + ",height=" + h + "location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0","top=0,left=0");}

function tableLinesOn(pos)
{
	if (!document.getElementById) return;
	var id1 = document.getElementById('id1' + pos );
	var id2 = document.getElementById('id2' + pos );
	var id3 = document.getElementById('id3' + pos );
	if(id1.className == 'number')
		id1.className = 'numberOn';
	if(id2.className == 'name')
		id2.className = 'nameOn';
	if(id3.className == 'price')
		id3.className = 'priceOn';
	}

function tableLinesOff(pos)
{
	if (!document.getElementById) return;
	var id1 = document.getElementById('id1' + pos );
	var id2 = document.getElementById('id2' + pos );
	var id3 = document.getElementById('id3' + pos );
	if(id1.className == 'numberOn')
		id1.className = 'number';
	if(id2.className == 'nameOn')
		id2.className = 'name';
	if(id3.className == 'priceOn')
		id3.className = 'price';
	
	}

function tableClick(host, mode, pos)
{
	alert("aa1");
	alert(host + mode + pos);
	}
