﻿function gallery(maxi, opis)
{
    document.getElementById('targetimg').src='galeria/' + maxi;
    document.getElementById('titlebox').innerHTML='<p>' + opis + '</p>';
    return false;
}




function change_class(el_id, el_class) {
	var el = document.getElementById(el_id);
	el.className =  el_class;
	return false;	
}

function check_form(){

	var emailRegExp = /^[A-Za-z0-9._\-]+@[A-Za-z0-9]([A-Za-z0-9._\-]*\.)+[A-Za-z]+$/;
	var fileRegExp = /\.(doc)$/i;

	if (!document.form1.nazwisko.value){
		alert('Введите фамилию.');			
		document.form1.nazwisko.focus();
		return false;
	}

    if (document.form1.email.value!=""){
		if (!emailRegExp.test(document.form1.email.value)){
			alert('Введите адрес электронной почты! ');
			document.form1.email.focus();
			return false;
		}
	}	
	else{
		alert('Введите адрес электронной почты!');
		document.form1.email.focus();
		return false;
		}
	if (!document.form1.tresc.value){
		alert('Введите запрос.');			
		document.form1.tresc.focus();
		return false;
	}
	return true;
}
function okno_no_scroll(url, width, height) {
        width1=width/2;
		height1=height/2;
		x=screen.availWidth/2-width1;
		y=screen.availHeight/2-height1;
		var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0, scrollbars=0, menubar=no,status=1, left='+x+', top='+y );
		Win.focus();
};
