var tmpEmail = "ваш@e.mail";
function checkEmail(frm){
	fld = frm.email;
	if( !fld.value.length||fld.value==" "||fld.value==tmpEmail){
		alert("Укажите Ваш E-mail!");
		if(document.images){ fld.focus(); }
		return false;
		}
	posA = fld.value.indexOf("@");
	if( posA < 1 || posA == fld.value.length-1 ){
		alert("E-mail введен неверно!");
		if(document.images){ fld.focus(); }
		return false;
		}
	return true;
	}

var oldUrl = false;

function IE5opener(url,w,h){
	w = Math.abs(w)+7; h = Math.abs(h)+27;
	scrollYes = ( w > screen.availWidth || h > screen.availHeight ) ? 1 : 0;
	addScrollbarWidth = (scrollYes) ? 17 : 0;
	w = (w > screen.availWidth) ? screen.availWidth - 40 : w + addScrollbarWidth;
	h = (h > screen.availHeight) ? screen.availHeight - 40 : h + addScrollbarWidth;
var ver =navigator.appVersion;
ver = ver.substring(ver.indexOf("MSIE")+5, ver.length);
ver = parseFloat(ver.substring(0, ver.indexOf(";")));
if(ver >=5){
	if((url != oldUrl)||(WinObj.closed)){
	WinObj = showModelessDialog(url, window, "help: no; status: no; scroll:"+
	scrollYes+"; resizable: on; dialogWidth:"+w+"px; dialogHeight:"+h+"px; margin: 0");
		oldUrl = url;
		}else{
		if(!WinObj.closed){WinObj.focus();}
		}
	}else{
	OtherOpener(url,w,h);
	}
}

function OtherOpener(url,w,h){
	w = w+18; h = h +26;
	if(w > 750) { w = 750; }
	if(h > 400) { h = 400; }
	t = "in04_"+url.substring(url.indexOf("id=")+3, url.length);
	WinObj = window.open(url, t,"width="+w+",height="+h+",status=yes,scrollbars=no,resizable=yes", false);
	return false;
	}

function PopUp(url,w,h){
if( document.all ){
	IE5opener(url,w,h);
		}else{
		if(document.images){	OtherOpener(url,w,h);	}
		}
return false;
} 

function doc(elm){
	if(document.getElementById) return document.getElementById(elm);
	if(document.all) return document.all[elm];
	if(document.layers) return document.layers[elm];
	return null;
	}

function MarkObject(rID, jTotal, sTotal){
	if(cBox[rID]) { cBox[rID].disabled=false; cBox[rID].style.cursor="default"; cBox[rID].checked=true; }
	setCounter(jTotal, sTotal);
	}

function UnMarkObject(rID, jTotal, sTotal){
	if(cBox[rID]) { cBox[rID].disabled=false; cBox[rID].style.cursor="default"; cBox[rID].checked=false; }
	setCounter(jTotal, sTotal)
	}

function setCounter(jTotal, sTotal){
	doc("jobs_favorites_count").innerHTML=jTotal;
	doc("staff_favorites_count").innerHTML=sTotal;
	}

var cBox = new Array();
function clk(oElm){
	rID = oElm.name;
	if(document.all && !window.opera){
		if(event.ctrlKey && event.altKey){
			window.open("http://job.sibnet.ru/admin/#tab="+((typeof(vacancyPage)!="undefined" && vacancyPage==true) ? "staff" : "jobs")+"&id="+rID);
			oElm.style.backgroundColor="#B5B8BB";
			oElm.checked=(oElm.checked) ? true : false;
			return true;
			}
		}
	
	if(oElm.checked) { param = "addID=" } else { param = "remID="; }
	oDate = new Date();
	oSrc = "./favorites.php?"+param+rID+"&rand="+oDate.getTime();
	if( document.createElement && !(window.opera && !document.createProcessingInstruction) ){
		oElm.disabled=true; oElm.style.cursor="wait";
		cBox[rID]=oElm;
		with (document) { var span = createElement('SPAN'); span.style.display = 'none'; body.insertBefore(span, body.lastChild); span.innerHTML = '.<s'+'cript></' + 'script>'; setTimeout( function() { var s = span.getElementsByTagName('script')[0]; s.language = 'JavaScript'; if (s.setAttribute) { s.setAttribute('src', oSrc); } else { s.src = oSrc; } }, 10); }
		}else{
			window.open(oSrc+"&self=close",null,"height=10,width=10,status=no,toolbar=no,menubar=no,location=no");
			}
	return true;
	}

var oldcolor="";
function hv(elm, s){
if(s) { oldcolor = elm.bgColor; elm.bgColor="#E7E7E4"; }else{ elm.bgColor=oldcolor; }
}

window.onerror=function(){ return true; }