﻿
// preload

enter_over = new Image;
enter_over.src = "elemek/kezdo/enter_over.jpg";
flash_over = new Image;
flash_over.src = "elemek/kezdo/flash_over.jpg";


function menuOver(ertek){

	azon = ertek.substring(0,5);
	document.getElementById(azon).src = "elemek/kezdo/"+ertek+".jpg";
		
}

function popupPicts(pictName){
	
	theURL = "picture.html?"+pictName;
	new_win = window.open(theURL, '_blank', 'width=178, height=178, location=no, menubar=no, scrollbars=no, resizable=no, toolbar=no, statusbar=no');
	return;
}

function flashObjH_changer(flashObjHeight) {

	document.flashMovie.height = flashObjHeight;
	
}

function writeFlash(file, w, h, color) {
	
	var params = window.location.search.substr(1);
	var flashStr = "";
	flashStr += '<object id="flashMovie" width="' + w + '" height="' + h + '"  ';
	flashStr += 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  ';
	flashStr += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">  ';
	flashStr += '<param name="allowScriptAccess" value="always"> ';
	flashStr += '<param name="movie" value="' + file + '">  ';
	flashStr += '<param name="flashvars" value="' + params + '">  ';
	flashStr += '<param name="salign" value="t" > ';
	flashStr += '<param name="quality" value="high">  ';
	flashStr += '<param name="menu" value="false">  ';
	flashStr += '<param name="scale" value="noscale">  ';
	flashStr += '<param name="bgcolor" value="' + color + '">  ';
	flashStr += '<embed src="' + file + '"  ';
	flashStr += '  salign="t"  ';
	flashStr += '  swLiveConnect="true" ';
	flashStr += '  flashvars="' + params + '"  ';
	flashStr += '  name="flashMovie"  ';
	flashStr += '  quality="high"  ';
	flashStr += '  allowScriptAccess="always" ';
	flashStr += '  menu="false"  ';
	flashStr += '  type="application/x-shockwave-flash"  ';
	flashStr += '  width="' + w + '"  ';
	flashStr += '  height="' + h + '"  ';
	flashStr += '  bgcolor="' + color + '"  ';
//	flashStr += '  scale="noscale"  ';	
	flashStr += '  pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">  ';
	flashStr += '</embed>  ';
	flashStr += '</object>';
	document.write(flashStr);

}

function pointer_poz(poz_x, poz_y) {
	
	document.getElementById('koordinata_x').value = poz_x;
	document.getElementById('koordinata_y').value = poz_y;
	
}
	
function check_form() {

	error_text = "";
		
	if(!document.getElementById('koordinata_x').value) {
		
		error_text += " - NINCS KOORDINÁTA KIJELÖLVE!!!\n\n";
		
	}
		
	if(document.getElementById('varos').value == "") {
		
		error_text += " - VÁROS\n";
		
	}

	if(document.getElementById('hely_nev').value == "") {
		
		error_text += " - HELY NEVE\n";
		
	}
		
	if(document.getElementById('hely_cim').value == "") {
		
		error_text += " - HELY CÍME\n";
		
	}
		
	if(document.getElementById('kezdes').value == "") {
		
		error_text += " - KEZDÉSI IDŐPONT\n";
		
	}
		
	if(document.getElementById('jelentkezes').value == "") {
		
		error_text += " - JELENTKEZNI LEHET (-tól, -ig)\n";
		
	}
		
	if(document.getElementById('oktato_nev').value == "") {
		
		error_text += " - OKTATÓ NEVE\n";
	
	}
		
	if(document.getElementById('oktato_tel').value == "") {
		
		error_text += " - OKTATÓ TELEFONSZÁMA\n";
		
	}
		
	if(document.getElementById('oktato_email').value == "") {
		
		error_text += " - OKTATÓ E-MAIL CÍME\n";
		
	}
		
	if(error_text != "") {
		
		alert("Hiányzó adatok:\n\n"+error_text);
		
	} else {
		
		document.form.submit();
	
	}

}
	
function fill_data(id, varos, hely_nev, hely_cim, kezdes, jelentkezes, oktato_nev, oktato_tel, oktato_email) {
	
	document.getElementById('id').value = id;
	document.getElementById('varos').value = varos;
	document.getElementById('hely_nev').value = hely_nev;
	document.getElementById('hely_cim').value = hely_cim;
	document.getElementById('kezdes').value = kezdes;
	document.getElementById('jelentkezes').value = jelentkezes;
	document.getElementById('oktato_nev').value = oktato_nev;
	document.getElementById('oktato_tel').value = oktato_tel;
	document.getElementById('oktato_email').value = oktato_email;
	
}

function confirmation(miben) {
	
	if (confirm('Biztos vagy benne, hogy ezt akarod?')) {

		document.location = miben;

	}
			
}

