
function appendlocation(page_id,url,page_get_string) {
	page = page_id.options[page_id.selectedIndex].value;
	newlocation=url+"?page="+page;
	if (page_get_string) {
		newlocation=newlocation+page_get_string;
	}
	//alert();
	if (newlocation != "-") { document.location.href=newlocation;  }
}

function toggleHide(togglediv) {
	showlink="<a href=\"javascript:void(0)\" onclick=\"!showPopup('s"+togglediv+"',event); toggleShow('"+togglediv+"');newtogglediv('teas"+togglediv+"');\" onmouseover=\"message('show details'); return true;\">details &raquo;</a>";
	divtotoggle='m'+togglediv;
	controldiv='c'+togglediv;
	document.getElementById(divtotoggle).innerHTML=showlink;
	document.getElementById(controldiv).innerHTML='hidden';
}

function toggleShow(togglediv) {
	hidelink="<a href=\"javascript:void(0)\" onclick=\"!showPopup('s"+togglediv+"',event); toggleHide('"+togglediv+"');newtogglediv('teas"+togglediv+"');\" onmouseover=\"message('hide details'); return true;\">&laquo; details</a>";
	
	divtotoggle='m'+togglediv;
	controldiv='c'+togglediv;
	document.getElementById(divtotoggle).innerHTML=hidelink;
	document.getElementById(controldiv).innerHTML='visible';
	//alert(divtotoggle + hidelink);
}

function toggle(togglediv) {
	hidelink="<a href=\"javascript:void(0)\" onclick=\"!showPopup('s"+togglediv+"',event); toggleShow('"+togglediv+"');newtogglediv('teas"+togglediv+"');\" onmouseover=\"message('show details'); return true;\">details &raquo;</a>";
	showlink="<a href=\"javascript:void(0)\" onclick=\"!showPopup('s"+togglediv+"',event); toggleHide('"+togglediv+"');newtogglediv('teas"+togglediv+"');\" onmouseover=\"message('hide details'); return true;\">&laquo; details</a>";
	
	divtotoggle='m'+togglediv;
	controldiv='c'+togglediv;
	if (document.getElementById(controldiv).innerHTML.toLowerCase()=='visible') {
		document.getElementById(divtotoggle).innerHTML=hidelink;
		document.getElementById(controldiv).innerHTML='hidden';
	}
	
	else {
		document.getElementById(divtotoggle).innerHTML=showlink;
		document.getElementById(controldiv).innerHTML='visible';
	}
}

function newtogglediv(teasdivid) {
	var newstyleObject = getStyleObject(teasdivid);
	if (newstyleObject.display=='none') {
//		alert(newstyleObject.display);
		changeObjectVisibility(teasdivid,'block');
	}
	else {
//		alert(newstyleObject.display);
		changeObjectVisibility(teasdivid,'none');
	}
}

function message(txt) {
	window.status = txt;
}

function checknoneu() {
	if (registration_short.nationality[2].checked) {
		!showPopup('workpermit', event)
	}
	else {
		// alert('taint')
		hideCurrentPopup()
	}
}
// 2 functions with the same name ?? !! \\
function checknoneub(event) {
	if (document.forms['registration_short'].nationality[2].checked) {
		!showPopup('workpermit', event);
		//alert('showPopup');
	}
	else {
		// alert('taint')
		hideCurrentPopup();
	}
}

function checknoneuc() {
	if (registration_short.nationality[2].checked) {
		!showPopup('workpermit', event)
	}
	else {
		// alert('taint')
		hideCurrentPopup()
	}
}

function checkform () {
	if (document.forms['registration_short'].elements['userfile'].value=='') {
		document.getElementById('attachcv').innerHTML="<b>Attach CV</b><p class='attention'>If you are not uploading your CV please use our <a href='/forms/full_registration.html'>full registration form</a></p>";
		return false;
	}
	else {
		document.getElementById('attachcv').innerHTML='<b>Attach CV</b>';
	}
	// attachcv
}

function clearallkeywords() {
	document.forms['email_registration'].elements['keywords_a'].value='';
	document.forms['email_registration'].elements['keywords_b'].value='';
	document.forms['email_registration'].elements['keywords_c'].value='';
	document.forms['email_registration'].elements['keywords_d'].value='';
	document.forms['email_registration'].elements['keywords_e'].value='';
}

// FULL REGISTREATIO \\
function checknoneufull(event) {
	var styleObject = getStyleObject('workpermit');
//	alert(document.forms['apply_for_job'].name);
	
	if (document.forms['apply_for_job'].nationality[2].checked) {
		styleObject.display = 'block';
	}
	else {
		styleObject.display = 'none';
	}
}

function showThing(thingid) {
	document.getElementById(thingid).style.visibility='visible';
	document.getElementById(thingid).style.display='block';
}
function hideThing(thingid) {
	document.getElementById(thingid).style.visibility='hidden';
	document.getElementById(thingid).style.display='none';
}