function advertChange(x) {
    var pardod = document.getElementById("pardod");
    var dazadi = document.getElementById("dazadi");
    var perk = document.getElementById("perk");
    var pardodButton = document.getElementById("pardodButton");
    var dazadiButton = document.getElementById("dazadiButton");
    var perkButton = document.getElementById("perkButton");
    if (x == 'pardod') {
        pardod.style.display = 'block';
        dazadi.style.display = 'none';
        perk.style.display = 'none';
        pardodButton.className='advertActive';
        dazadiButton.className='advertInactive';
        perkButton.className='advertInactive';
        pardodButton.blur();
    }
    if (x == 'dazadi') {
        pardod.style.display = 'none';
        dazadi.style.display = 'block';
        perk.style.display = 'none';
        pardodButton.className='advertInactive';
        dazadiButton.className='advertActive';
        perkButton.className='advertInactive';
        dazadiButton.blur();
    }
    if (x == 'perk') {
        pardod.style.display = 'none';
        dazadi.style.display = 'none';
        perk.style.display = 'block';
        pardodButton.className='advertInactive';
        dazadiButton.className='advertInactive';
        perkButton.className='advertActive';
        perkButton.blur();
    }
    return false;
}

function popup(mylink, windowname, width, height, menu) {
    var newwindow;
    newwindow=window.open(mylink, windowname, 'width='+width+',height='+height+',scrollbars=no,menubar='+menu);
    if (window.focus) {newwindow.focus()}
}

function workPop(mylink) {
    var newwindow;
    newwindow=window.open(mylink, 'vakance', 'width=650,height=600,scrollbars=yes,menubar=yes');
    if (window.focus) {newwindow.focus()}
}

function chatPop(myform, windowname) {
    if (! window.focus)return true;
    window.open('', 'chat', 'top=100,left=100,height=550,width=700,location=no,resizable=yes,scrollbars=no,status=no');
    myform.target=windowname;
    return true;
}
function show_hide_help(x) {
	var x = document.getElementById(x);
	if (x.style.display == 'block') {
		x.style.display = 'none';
	} else {
		x.style.display = 'block';
	}
	return false;
}
function check_job_form() {
	if (document.getElementById('formAmats').value == '' || document.getElementById('formT2s').value == '' || document.getElementById('formKontakti').value == '' || document.getElementById('formFirma').value == '') {
		alert('Nav aizpildīti obligātie lauki !');
		return false;
	} else {
		return true;
	}
}
