// ---------------------- Alumni things START

function popupAlumni(i) {
	var page = 'http://fdiba.tu-sofia.bg/include/page_data/2.100.reg.'+i+'.php';
//alert (page); // debug
	windowprops = "height=500,width=500,location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
	window.open(page, "Popup", windowprops);
}

function SwitchAlumni(el_id){

	if(!document.getElementById) return true;

	el = document.getElementById(el_id);

	if(el.style.display == 'none'){
		el.style.display = '';
	}else{
		el.style.display = 'none';
	}

	return true;
}

function validateForm() {
//	alert ("namirame se predi pyrviq if"); // debug
	var tst; tst = "test";
	if (document.eintragen_form.pass1.value != document.eintragen_form.pass2.value) {
			alert("Beide Passwörter stimmen miteinander nicht! Bitte geben Sie diese erneut ein!");
			document.eintragen_form.pass1.value = "";
			document.eintragen_form.pass2.value = "";
		return false;
//		tst = false;
	}
//	alert ("tst sled 1-viq if = "+tst);// debug
	if (!isEmail(document.eintragen_form.priv_email.value)) {
			alert("Bitte geben Sie eine gültige Mail-Adresse ein!");
		return false;
//		tst = false;
	}
//	alert ("tst sled 2-viq if = "+tst);// debug
	if (document.eintragen_form.username.value == "" || document.eintragen_form.pass1.value ==  ""
		|| document.eintragen_form.pass2.value == "" || document.eintragen_form.vorname.value == ""
		|| document.eintragen_form.name.value == "" || document.eintragen_form.priv_email.value == "") {
		alert("Sie haben eine oder mehrere der notwendigen Felder nicht gefuelt");
		return false;
	}
	else {
		document.eintragen_form.eintragen_btn.disaled = true;
		document.eintragen_form.submit();
		return true;
	}
}

function isEmail(s)
{
//		alert ("in isMail! s = "+s); //debug
    if (isEmpty(s)) return false
    if ((s.charAt(0)< "a")||(s.charAt(0)> "z"))
    	if ((s.charAt(0)< "0")||(s.charAt(0)> "9"))
    		if (s.charAt(0)!="_") document.eintragen_form.username.value=''
    var i = 1, sLength = s.length
    while ((i < sLength) && (s.charAt(i) != "@")) i++
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2
    while ((i < sLength) && (s.charAt(i) != ".")) i++
    if ((i >= sLength - 2) || (s.charAt(i) != ".")) return false;
        else return true;
}

function isEmpty(s)
{
    return ((s == null) || (s.length == 0));
}

function alert_1() {
	alert("test");
}

// ---------------------- Alumni things END

// ---------------------- Map START
function popupMap(i) {
	var page = 'http://www.fdiba.tu-sofia.bg/include/maps.php?lang='+i;
//alert (page);
	windowprops = "height=435,width=420,location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
	window.open(page, "Popup", windowprops);
}
// ---------------------- Map END

// ---------------------- Programata START
// v momenta nqma nujda ot nego ...
function popupProgr() {
	var page = 'http://www.fdiba.tu-sofia.bg/programata';
//alert (page);
	windowprops = "height=250,width=420,location=no," + "scrollbars=no,menubars=no,toolbars=no,resizable=no";
	window.open(page, "Popup", windowprops);
}
// ---------------------- Programata END