// JavaScript Document
function hiddenbn () {
		pat2='btop';
//		a = document.getElementById(pat2);
//		a.className = 'off-left';
		}

function vac (id) {
		for (i=1;i<=4;i++) {
		pat2='bl_'+i;
        a = document.getElementById(pat2);
		a.className = 'off-left';
		document.getElementById("top_"+i).className="top_in_black";
		}
		document.getElementById("top_"+id).className="top_in_black_focus";
		
		
		
		pat2='bl_'+id;
        a = document.getElementById(pat2);
		if (a.className=='active') a.className = 'off-left';
		else a.className = 'active';
	    return false;
		}



function more_search (id) {
		pat2='bl_'+id;
        a = document.getElementById(pat2);
		if (a.className=='active') a.className = 'off-left';
		else a.className = 'active';
	    return false;
		}
		
		
function vac_an (id) {
		pat='bl_'+id;
        a = document.getElementById(pat);
		if (a.className=='active') a.className = 'off-left';
		else a.className = 'active';

		pat2='actia_'+id;
        a = document.getElementById(pat2);
		if (a.className=='text_dot') a.className = 'activeG';
		else a.className = 'text_dot';
	    return false;
		}



function vac_cn (id) {
		pat2='bl_'+id;
        a = document.getElementById(pat2);
		if (a.className=='active') a.className = 'off-left';
		else a.className = 'active';
	    return false;
		}
		

function vacm (id) {
		for (i=1;i<=4;i++) {
		pat2='blm_'+i;
		pat3='bls_'+i;
        a = document.getElementById(pat2);
		a.className = 'off-left';
        a = document.getElementById(pat3);
		a.className = 'text_miniG_pad';
		}
		
		pat2='blm_'+id;
		pat3='bls_'+id;
        a = document.getElementById(pat2);
		a.className = 'active';
        a = document.getElementById(pat3);
		a.className = 'text_miniG_pada';
	    return false;
		}

function change_main_pages (id) {
		for (i=1;i<=3;i++) {
		pat2='blm_'+i;
		pat3='bls_'+i;
        a = document.getElementById(pat2);
		a.className = 'off-left';
        a = document.getElementById(pat3);
		a.className = 'div_vkladki_knopka';
		}
		
		pat2='blm_'+id;
		pat3='bls_'+id;
        a = document.getElementById(pat2);
		a.className = 'active';
        a = document.getElementById(pat3);
		a.className = 'div_vkladki_knopkaA';
	    return false;
		alert(id);
		}
		
		
function vacjob (id) {
		for (i=1;i<=2;i++) {
		pat='bljob_'+i;
		pat2='blj_'+i;
        a = document.getElementById(pat);
		a.className = 'off-left';
        a = document.getElementById(pat2);
		a.className = 'text_miniG_pad';
		}
		
		pat='bljob_'+id;
		pat2='blj_'+id;
        a = document.getElementById(pat);
		a.className = 'active';
        a = document.getElementById(pat2);
		a.className = 'text_miniG_pada';
	    return false;
		}
		

function searchcheck (id) {
		for (i=1;i<=3;i++) {
		pat2='blsch_'+i;
        a = document.getElementById(pat2);
		a.className = 'text_miniG_pad';
		}
		
		document.formsearch.RG1.value="job";
		if (id=="2") document.formsearch.RG1.value="res";
		if (id=="3") document.formsearch.RG1.value="university";
		
		pat2='blsch_'+id;
        a = document.getElementById(pat2);
		a.className = 'text_miniG_pada';
	    return false;

		}
		
		
function BorderOff(id) { id.className='chcolor'  }
function BorderOnMP(id) { id.className='nullcolor' }


function chONclick() {
	if (document.formsubscribe.name_mail.value =="") 	{
	alert ("Не правильн введено поле");
	document.formsubscribe.name_mail.focus(); 
	return false;
	}
	
	if (document.formsubscribe.email_mail.value.indexOf("@",0) ==-1) 	{
	alert ("Не правильн введено поле e-mail");
	document.formsubscribe.email_mail.focus(); 
	return false;
	}
	
}

function check_send_otziv() {
			if (document.form_ot.name_ot.value =="") 	{
			alert("Укажите имя!"); 
			document.form_ot.name_ot.focus(); 
			return false;}
			
			if (document.form_ot.info_ot.value =="") 	{
			alert("Напишите сообщение!"); 
			document.form_ot.info_ot.focus(); 
			return false;}
		}
		
		
function replace_menu_image(src, text1, href1) {
	url=src;
	text=text1;
	href=href1;
	a=document.getElementById("image_menu");
	k=false;
	i=1;
	goopacity('image_menu', url, text, href);
	//a.style.backgroundImage="url(/images/article/"+src+")";
	
}

function str_replace(search, replace, subject) {
return subject.split(search).join(replace);
}

function goopacity(id, url, text1, href1) {
	idTimeout=id;
	text=text1;
	href=href1;
    src=url;
	invisibleMenu = document.getElementById(id);
	articleImageName=document.getElementById("article_image_name");
	articleImageHref=document.getElementById("article_image_url");
	if (k==false) {
		i=i-0.05;
		
		invisibleMenu.style.filter="alpha(opacity="+ i*200 +")";	
		invisibleMenu.style.opacity = i;
		timeout=setTimeout("goopacity('image_menu', src, text, href)", 30);
	
		if (i>1 || i<0) { 
			k=true;
			clearTimeout(timeout); 
			timeout=setTimeout("goopacity('image_menu', src, text, href)", 30);
		} 
	} else {
		invisibleMenu.style.backgroundImage="url(/images/article/"+src+")";
		articleImageName.innerHTML=text;
		articleImageHref.href=href;
		i=i+0.05;
		
		
		invisibleMenu.style.filter="alpha(opacity="+ i*200 +")";	
		invisibleMenu.style.opacity = i;
		timeout=setTimeout("goopacity('image_menu', src, text, href)", 30);
	
		if (i>1 || i<0) { 
			clearTimeout(timeout); 
		}	
	}
	

}

function update_action(k) {
		staticHeight=109;
		step=1;	
		interval_actions=15;
		invervalStop=3000;
		allHeight=570;
		
		
		var actions=document.getElementById("actions");
		var actions3=document.getElementById("actions3");
		
		if (k==true) e_actions=e_actions+step;
		else { 
		y0=0;
		e_actions=0;
		do {
	    	y0  += actions3.offsetTop;
		} while (actions3 = actions3.offsetParent);
			
		}
		
		e2_actions=e_actions+staticHeight;
		if  (e_actions%staticHeight==0 || e_actions%staticHeight==staticHeight) interval_actions=invervalStop;
		
		
		
		
		actions.style.clip="rect("+e_actions+"px, auto, "+e2_actions+"px, auto)";
		actions.style.top=y0-e_actions+"px";
		
		timeout_actions=setTimeout("update_action(true)", interval_actions);
		if (e_actions>=550) { e_actions=-step; }
		return interval_actions;
		 
}

function update_news(k) {
		staticHeight=109;
		step=1;	
		interval_news=15;
		invervalStop=3000;
		allHeight=570;
				
		
		
		var news=document.getElementById("news");
		var news3=document.getElementById("news3");
		
		if (k==true) e_news=e_news+step;
		else { 
		y1=0;
		e_news=0;
		do {
	    	y1  += news3.offsetTop;
		} while (news3 = news3.offsetParent);
			
		}
		
		e2_news=e_news+staticHeight;
		if  (e_news%staticHeight==0 || e_news%staticHeight==staticHeight) interval_news=invervalStop;
		
		
		
		
		news.style.clip="rect("+e_news+"px, auto, "+e2_news+"px, auto)";
		news.style.top=y1-e_news+"px";
		
		timeout_news=setTimeout("update_news(true)", interval_news);
		if (e_news>=450) { e_news=-step; }
		return interval_news;
}

function open_menu(id1) {
	id=id1;
	open_this=setTimeout('document.getElementById(id).style.display=""', 250);
	return open_this;
	}

function close_menu(id1) {
	id=id1;
	close_this=setTimeout('document.getElementById(id).style.display="none"', 1000);
	return close_this;
	}
