
function telepulesek( tel ){
	var x = createConnection( tel );
	//alert(x);
	//document.getElementById("varosSelect").innerHTML = x;
	document.getElementById("vd").innerHTML = x;

}

function createConnection( parameter ){
	var xmlhttp;
	var browser = navigator.userAgent;
	if ( browser.indexOf("Gecko") !=-1 || browser.indexOf("Firefox") !=-1 || browser.indexOf("Opera") !=-1 )
		xmlhttp = new XMLHttpRequest();
	if ( browser.indexOf("MSIE") !=-1 ) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");	
	}
	xmlhttp.open('POST', 'commons/countyList.php?megye='+parameter, false);
	xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;');
	xmlhttp.send(parameter);

	return xmlhttp.responseText;
}

function checkConsultant(){
	doc = document.forms.consultant;
	error = false;
	errorText = "HIBA A KITÖLTÉS SORÁN!\n\n";
	
	if( !doc.nev.value || doc.nev.value == "" ){
		error = true;
		errorText += "Nem adott meg nevet!\n";
	}	  
	if( !doc.varos || !doc.varos.value || doc.varos.value == "" ){
		error = true;
		errorText += "Nem adott meg várost!\n";
	}
	if( doc.varos.value == "_bp" ){
		error = true;
		errorText += "Nem adott meg kerületet!\n";
	}
	if( !doc.email1.value || doc.email1.value == "" ){
		error = true;
		errorText += "Nem adott meg e-mail címet!\n";
	}
	if( doc.email1.value != doc.email2.value ){
		error = true;
		errorText += "A két e-mail cím nem azonos!\n";
	}
	if( !doc.tel.value || doc.tel.value == "" ){
		error = true;
		errorText += "A telefon megadása kötelező!\n";
	}
	if( isNaN(doc.ar.value) ){
		error = true;
		errorText += "Az ár mezőbe csak számot írhat!\n";
	}
	if( isNaN(doc.hitel.value) ){
		error = true;
		errorText += "A hitel mezőbe csak számot írhat!\n";
	}

	if( error )	alert( errorText );	
	else doc.submit();
  
}

function video( vUrl, winName ){
	window.open( "/player.php?vid="+vUrl, winName, "width=400, height=350, toolbar=no, resizable=no, status=no, titlebar=no, scrollbars=no, directories=no, location=no, hotkeys=no" );
}

function sound( aUrl, winName ){
	window.open( "/audioplayer.php?aid="+aUrl, winName, "width=400, height=90, toolbar=no, resizable=no, status=no, titlebar=no, scrollbars=no, directories=no, location=no, hotkeys=no" );
}