	//resizeolja az aktualis ablakot
	function resizeOuterTo(w,h)
	{
		 if (parseInt(navigator.appVersion)>3) {
		   if (navigator.appName=="Netscape") {
			top.outerWidth=w;
			top.outerHeight=h;
		   }
		   else top.resizeTo(w,h);
		 }
	}


	// uj popup ablak nyitasa
	function OpenPage(url,wndname,width,height,center,scrollbars,resize) 
	{ 
		var left = 25; 
		var top = 25; 

		if(center == true) 
		{ 
			left = (screen.width - width)/2; 
			top = (screen.height - height)/2; 
		} 

		scrollbars = ( (scrollbars == undefined) || (scrollbars == false) ) ? 0 : 1;
		resize = ( (resize == undefined) || (resize == false) ) ? 0 : 1;

		var winStats='toolbar=no,location=no,directories=no,menubar=0,'; 
		winStats+='scrollbars='+scrollbars+',resizable='+resize+',width='+width+',height='+height; 
		if (navigator.appName.indexOf("Microsoft")>=0) 
		{ 
			winStats+=',left='+left+',top='+top; 
		} 
		else 
		{ 
			winStats+=',screenX='+left+',screenY='+top; 
		} 

		apopup=window.open(url,wndname,winStats);
		if (apopup.opener == null)
			apopup.opener = self;
		apopup.window.focus(apopup);
	}


	function PT_toggleDIV(divID)
	{
		if($(divID).style.display != 'block')
			$(divID).style.display = 'block';
		else
			$(divID).style.display = 'none';

	}

	
	// e-mail ellenorzo REGEXP
	var emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|hu|co.hu|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/

	// telefonszam ellenorzo REGEXP
    // var phoneRe = /^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/


	// lellenorzi, hogy helyes karakterek vannak-e a megadott telefonszamban
    function check_phonenumber(TheNumber)
    {
        var valid = 1
        var GoodChars = "0123456789()-+ "
        var i = 0

        if (TheNumber=="") {
        // Return false if number is empty
        valid = 0
        }
        for (i =0; i <= TheNumber.length -1; i++) {
        if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {
        // Note: Remove the comments from the following line to see this
        // for loop in action.
        // alert(TheNumber.charAt(i) + " is no good.")
        valid = 0
        } // End if statement
        } // End for loop
        return valid;
    }

	// lellenorzi, hogy helyes keruletet irt-e be
    function check_district(District)
    {
         var valid = 1;
         var GoodChars = "0123456789.XIVMCL";
         var i = 0;

         if(District=="")
	         valid = 0;

         for(i=0; i<= District.length-1; i++)
			if(GoodChars.indexOf(District.charAt(i)) == -1)
				valid = 0

         return valid;
    }

	// _act es _act nelkuli képállapotok cseréje
	function toggleIcon(id)
	{
		var img = document.getElementById(id);
		if( img )
		{
		  if( img.src.indexOf('_act.') == -1 )
			  img.src = img.src.replace('.gif','_act.gif');
		  else
			  img.src = img.src.replace('_act.gif','.gif');
		}
	}

	// elintezi a rollover kepek OVER és OUT állapotát
	function rollover_img(img, status, str_ext)
	{
		if(str_ext == undefined)
			str_ext = 'jpg';

		// alert(str_ext);
		str_ext = '.' + str_ext;

		var src = img.src;
		var pos = src.indexOf(str_ext);

		switch(status)
		{
			case 'over' : img.src = src.substr(0, pos) + '_a' + str_ext;
						  break;

			case 'out' : img.src = src.substr(0, pos-2) + str_ext;
						 break;
		}
	}

	// * MAR NEM SZABAD HASZNALNI, EFOLOTT VAN A FRANKO FUGGVENY * elintezi a rollover kepek OVER és OUT állapotát
	function rollover_jpg(img, status)
	{
		str_ext = '.jpg';

		var src = img.src;
		var pos = src.indexOf(str_ext);

		switch(status)
		{
			case 'over' : img.src = src.substr(0, pos) + '_a' + str_ext;
						  break;

			case 'out' : img.src = src.substr(0, pos-2) + str_ext;
						 break;
		}
	}

	// lenyitja az aloldal kuldese emailben DIVet
	function show_send_pageurl()
	{
		div = document.getElementById('div-tellafriend');
		div.style.display = 'block';
		div.style.height = '140px';
	}

	// Tipikus internetes effekt: ha egy input field-re klikkelnek es ott a default szoveg van beirva, akkor kinullaza a szoveget belole.
	// OnFocus-ra es OnBlur-re erdemes meghivni
	function msg_in_input(field, def_value)
	{
		if(field.value == '')
			field.value = def_value;
		else
			if(field.value == def_value)
				field.value = '';
	}
