function simplePreload() {
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
}

function showFlash(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=7,0,0,0" width="' + width + '" height="' + height + '" id="' + name + '">');
	document.write('<param name="movie" value="' + movie + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="menu" value="false" />');
	document.write('<embed src="' + movie + '" quality="high" width="' + width + '" height="' + height + '" name="' + name + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" menu="false" />');
	document.write('</object>');
}

// kepcserelgeto
////////////////

function newImage(arg) {
	if (document.images) {
	 rslt = new Image();
	 rslt.src = arg;
	 return rslt;
	}
}

function changeImages() {
	if (document.images) {
	 for (var i = 0; i < changeImages.arguments.length; i += 2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i + 1];
	 }
	}
}

// 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;
}

// popup
function popupWin(file, width, height) {
	 var window_width = width;
	 var window_height = height;
	 var window_top = (screen.height - window_height) / 2;
	 var window_left = (screen.width - window_width) / 2;
	 newWindow = window.open(file, '', 'width = ' + window_width + ', height = ' + window_height + ', top = ' + window_top + ', left = ' + window_left + '' + ', status = 0, scrollbars = yes, resizable = yes');
	 newWindow.focus();
}