
	// kepcserelgeto
	////////////////
	
	function changeImages() {
	  if (document.images) {
		 for (var i = 0; i < changeImages.arguments.length; i += 2) {
			 document[changeImages.arguments[i]].src = changeImages.arguments[i + 1];
		 }
	  }
	}
	
	
	// classcserelgeto
	//////////////////
	
	function changeClass(id, className) {
		obj = document.getElementById(id);
		if (obj) obj.className = className;
	}
	
	
	// common
	/////////
	
	function jumpTo(url) {
		window.location.href = url;
	}
	
	function displayPopup(theURL, winName, width, height, features) {
		var window_width = width;
		var window_height = height;
		var newfeatures = features;
		var window_top = (screen.height - window_height) / 2;
		var window_left = (screen.width - window_width) / 2;
		newWindow = window.open('' + theURL + '', ''+ winName + '', 'width = ' + window_width + ', height = ' + window_height + ', top = ' + window_top + ', left = ' + window_left + ', ' + newfeatures + '');
		newWindow.focus();
	}
	
	function includeFlash(movie, name, width, height) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '" id="' + name + '" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="' + movie + '" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="bgcolor" value="#ffffff" />');
		document.write('<embed src="' + movie + '" quality="high" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + name + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
	}
	
	
	// char converter
	/////////////////
	
	function fromCode(code) {
		return String.fromCharCode(code);
	}
	
	function convert(text) {
		flood = 0;
		while (text.indexOf("&#") != -1) {
			i = text.indexOf("&#") + 2;
			cserelendo = parseInt(text.substring(i,i+3));
			mire = fromCode(cserelendo);
			mit = text.substring(i-2,i+4);
			text = text.replace(mit, mire);
		}
		return text;
	}
	
	function toCode(code) {
		return code.charCodeAt(0);
	}
	
	function convertBack(text) {
	
		stdChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ0123456789 -!@#$%^&*(),./;'[]\?:{}|+_~";
		
		i = 0;
		while (i<text.length && !(i>1000)) {
			if (stdChars.indexOf(text.charAt(i)) < 0) {
				text = text.replace(text.charAt(i),"&#" + toCode(text.charAt(i)) + ";");
				i += 5;
			}
			i += 1;
		}
	
		return text;
	}
	
	
	// regisztracio
	///////////////

	function chkMail(mail) {
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(mail)) {
			return true;
		} else {
			return false;
		}
	}

	function isNum(sText) {
		var ValidChars = "0123456789";
		var IsNumber = true;
		var Char;
		
		for (i = 0; i < sText.length && IsNumber == true; i++) { 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) {
				IsNumber = false;
			}
		}
		return IsNumber;
	}
	
	function isFloat(sText) {
		var ValidChars = "0123456789,.";
		var IsNumber = true;
		var Char;
		
		for (i = 0; i < sText.length && IsNumber == true; i++) { 
			Char = sText.charAt(i); 
			if (ValidChars.indexOf(Char) == -1) {
				IsNumber = false;
			}
		}
		return IsNumber;
	}
	
	
	// datumellenorzo
	/////////////////
	
	var dtCh = "/"; // datum-elvalaszto char
	var minYear = 1910;
	var maxYear = 2000;
	
	function isInteger(s){
		var i;
		 for (i = 0; i < s.length; i++){   
			  // Check that current character is number.
			  var c = s.charAt(i);
			  if (((c < "0") || (c > "9"))) return false;
		 }
		 // All characters are numbers.
		 return true;
	}
	
	function stripCharsInBag(s, bag){
		var i;
		 var returnString = "";
		 // Search through string's characters one by one.
		 // If character is not in bag, append to returnString.
		 for (i = 0; i < s.length; i++){   
			  var c = s.charAt(i);
			  if (bag.indexOf(c) == -1) returnString += c;
		 }
		 return returnString;
	}
	
	function daysInFebruary (year){
		// February has 29 days in any year evenly divisible by four,
		 // EXCEPT for centurial years which are not also divisible by 400.
		 return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
	}
	function DaysArray(n) {
		for (var i = 1; i <= n; i++) {
			this[i] = 31
			if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
			if (i==2) {this[i] = 29}
		} 
		return this
	}
	
	function isDate(dtStr){
		var daysInMonth = DaysArray(12)
		var pos1=dtStr.indexOf(dtCh)
		var pos2=dtStr.indexOf(dtCh,pos1+1)
		var strMonth=dtStr.substring(0,pos1)
		var strDay=dtStr.substring(pos1+1,pos2)
		var strYear=dtStr.substring(pos2+1)
		strYr=strYear
		if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
		if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
		for (var i = 1; i <= 3; i++) {
			if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
		}
		month=parseInt(strMonth)
		day=parseInt(strDay)
		year=parseInt(strYr)
		if (pos1==-1 || pos2==-1){
			return false
		} else if (strMonth.length<1 || month<1 || month>12){
			return false
		} else if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
			return false
		} else if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
			return false
		} else if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
			return false
		} else return true;
	}
	
	function chkDate() {
		evStr = document.getElementById('szul_ev').value;
		hoStr = document.getElementById('szul_ho').value;
		napStr = document.getElementById('szul_nap').value;
		
		// minden mezo ki van toltve
		dt = hoStr + dtCh + napStr + dtCh + evStr;
		if (isDate(dt)) {
			// ervenyes datum
			return true;				
		} else {
			return false;
		}
	}
	
	
	
	
	
	
	
	
