	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);
		apopup.window.focus(apopup);
	}

	// 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 = '';
	}

    
	// 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;
    }

	// 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-send-page');
		div.style.display = 'block';
		div.style.height = '60px';
	}


// CASARObol hoztam at

	// TRIM() -  :)
	function trim(str) 
	{
		while (str.substring(0,1) == ' ')
		{
			str = str.substring(1, str.length);
		}

		while (str.substring(str.length-1, str.length) == ' ')
		{
			str = str.substring(0,str.length-1);
		}
		return str;
	}

	// kiuriti a TEXT clipboardot
	function emptyClipboard()
	{
		window.clipboardData.setData('text','');
	}

	// visszaadja a TEXT clipboardot
	function getClipboardText()
	{
		return window.clipboardData.getData('text');
	}

    
	function saveClip()
    {
        text = getClipboardText();
        if((null == text) || (trim(text) == ''))
            return;

        // The REQUEST
        var url = 'index.php';
        var pars = 'area=ajax_request&op=sc';
        pars += '&text=' + text;
        var method = 'post';

        var myAjax = new Ajax.Updater(
                                        '', 
                                        url, 
                                        {
                                            method: method,
                                            parameters: pars
                                        }
                                     );
    }

