//doc ready
var reemail=false;
$(function(){
	$("#imgdiv").css("position","relative");	   
	$(".sub").hide();

	$(".fomenu").mouseover(function(){
		$(this).find(".sub").show();
		$('.top_jc').css('z-index','0');
	});
	
	$(".fomenu").mouseout(function(){
		$(this).find(".sub").hide();
		});

  $("#tree").treeview({
	collapsed: true
	});

$(function() {
$(".top_jc").jCarouselLite({
    btnNext: ".right_bt",
    btnPrev: ".left_bt",
	visible:1,
	auto:10000,
	speed:1500
});

$("#szimulal").autocomplete("index.php?content=user&cmd=simulalusergen", { max:100000,minChars:0, matchSubset:1, matchContains:1, cacheLength:1, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 });
	
	$("#szimulal").result(function(event, data, formatted) {
		
		if (data)
			$("#szuser").val(data[2]);
	
	});

function selectItem(li) {
}

function formatItem(row) {
	return "<b>"+row[0] + "</b><br><i>" + row[1] + " ("+row[2]+")</i>";
	//return row[0];
}



});
$(function() {
$(".mini_jc").jCarouselLite({
    btnNext: ".next_bt",
    btnPrev: ".prev_bt"
});
});

$(function() {
$(".pici_jc_c").jCarouselLite({
    btnNext: ".next_pici",
    btnPrev: ".prev_pici",
	visible: 6
});
});

$(function() {
$(".pici_jc_c2").jCarouselLite({
    btnNext: ".next_pici2",
    btnPrev: ".prev_pici2"
});
});
/****************old**************************************/
		   
	if ($('#l_password').val()!='')
	  { $('#jelszofedel').hide();}
	  
    $.get("index.php?content=gettime",function(response) {
		
		 Today = new Date();
         Todays_Year = Today.getFullYear();
         Todays_Month = Today.getMonth();
         Server_Date = response;
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
		 diff=Todays_Date-Server_Date;
		//alert(diff);
		 intvalid=setInterval("timesync(diff)",1000);	
	});
      
    var ch = $.browser.msie ? $("#content img#border_bottom").attr("offsetTop") -383  : $("#content img#border_bottom").attr("y")-383;
    var rsh = $(".right_side").height();
    
	imgs = new Array("first");
	for(i = 0;i < imgs.length; i++) {
		eval("var tmp_img_" + i + " = new Image; tmp_img_" + i + ".src = 'images/" + imgs[i] +".gif';");	
	}
	
    if(ch < rsh) {
        if($.browser.msie && parseInt($.browser.version) < 7)
            {$(".center").height(rsh + 80);} 
        else if($.browser.msie)
            {$(".center").height(rsh + 60);}
        else
            {$(".center").height(rsh + 53);}
    } 
	
	$(".pagination table tr td:not('td#active')").hover(function(){ 
		$(this).css("border-color", "#646464");
	}, function() {
	    $(this).css("border-color", "#c9c9c9");
	});
	
    eval('$("#dialog").dialog({modal:true,resizable:false,title:"",autoOpen: false,overlay: {opacity: 0.2,background: "black"},buttons: {"'+_BEZARAS_GOMB+'": function() {$(this).dialog("close");}}})');
	eval('$("#dialog2").dialog({modal:true,resizable:false,title:"",autoOpen: false,overlay: {opacity: 0.2,background: "black"},buttons: {"'+_BEZARAS_GOMB+'": function() {$(this).dialog("close");}}})');
	eval('$("#dialog3").dialog({modal:true,resizable:false,title:"",autoOpen: false,overlay: {opacity: 0.2,background: "black"},buttons: {"'+_BEZARAS_GOMB+'": function() {$(this).dialog("close");}}})');
	
	$( "#dialog" ).bind( "dialogopen", function(event, ui) {
					   $(this).parent().children().children('.ui-dialog-titlebar-close').hide();							
                       $("button:contains('elküld')").html(_ELKULD_GOMB);
					   $("button:contains('bezárás')").html(_BEZARAS_GOMB);
					   $("button:contains('Tovább')").html(_TOVABB_GOMB);
					   $("button:contains('Foglalás')").html(_FOGLALAS);
					   $("button:contains('Megerősítés')").html(_MEGEROSITES);
					   $("button:contains('Módosít')").html(_MODOSIT_GOMB);
                 });
	$( "#dialog2" ).bind( "dialogopen", function(event, ui) {
					   $(this).parent().children().children('.ui-dialog-titlebar-close').hide();							
                       $("button:contains('elküld')").html(_ELKULD_GOMB);
					   $("button:contains('bezárás')").html(_BEZARAS_GOMB);
					   $("button:contains('Tovább')").html(_TOVABB_GOMB);
					   $("button:contains('Foglalás')").html(_FOGLALAS);
					   $("button:contains('Megerősítés')").html(_MEGEROSITES);
					   $("button:contains('Módosít')").html(_MODOSIT_GOMB);
                 });
	$( "#dialog3" ).bind( "dialogopen", function(event, ui) {
					   $(this).parent().children().children('.ui-dialog-titlebar-close').hide();							
                       $("button:contains('elküld')").html(_ELKULD_GOMB);
					   $("button:contains('bezárás')").html(_BEZARAS_GOMB);
					   $("button:contains('Tovább')").html(_TOVABB_GOMB);
					   $("button:contains('Foglalás')").html(_FOGLALAS);
					   $("button:contains('Megerősítés')").html(_MEGEROSITES);
					   $("button:contains('Módosít')").html(_MODOSIT_GOMB);
                 });
	
	$(".helpkattitle").click(function() {
		if ($(this).next().css("display")=="none")
		  {
		   $(this).css("background-image", "url(images/help_open.png)");
		   $(this).next().slideDown(200);
		  }
		else
		  {
			$(this).css("background-image", "url(images/help_close.png)");
		   $(this).next().slideUp(200);  
		  }
    })
	
	$(".helptitle").click(function() {
		if ($(this).next().css("display")=="none")
		  {
		   $(this).next().slideDown(200);
		  }
		else
		  {
		   $(this).next().slideUp(200);  
		  }					
    })
	
	$("#regformbox2 input").blur(function() {
        regform_validate();
    })
	
	$("#regbutton").hover(function(){
		$(this).css("background-image", "url(images/reg_button_over.png)");
	}, function() {
	    $(this).css("background-image", "url(images/reg_button.png)");
	});
	$("#loginbutton").hover(function(){
		$(this).css("background-image", "url(images/login_button_over.png)");
	}, function() {
	    $(this).css("background-image", "url(images/login_button.png)");
	});
	$("#regbuttonf").hover(function(){
		$(this).css("background-image", "url(images/reg_button_over.png)");
	}, function() {
	    $(this).css("background-image", "url(images/reg_button.png)");
	});
	$("#loginbuttonf").hover(function(){
		$(this).css("background-image", "url(images/login_button_over.png)");
	}, function() {
	    $(this).css("background-image", "url(images/login_button.png)");
	});
	
	$(".promorsor").hover(function(){
		$(this).attr("bgcolor", "#333333");
	}, function() {
	    $(this).attr("bgcolor", "none");
	});
    //$(".right_side").height(ch);
	
    /*$("#thumbs").jCarouselLite({
        speed: 500,
        btnNext: "#thumbnail a.pager_right",
        btnPrev: "#thumbnail a.pager_left",
        visible: 4,
        circular: false,
        setHeight: true        
    });*/
   
   $("#gthumbs").jCarouselLite({
        speed: 500,
        btnNext: "#gthumbnail a.pager_right",
        btnPrev: "#gthumbnail a.pager_left",
        visible: 4,
        circular: false,
        setHeight: true        
    });
   
 $('.fomenu_item').each(function() {
								 
				$('a', this).mouseover(function() {
								$(this).siblings('div.submenu_container:hidden').slideDown('fast');
				})
				$(this).hover(function() {
								
				},
				function() {
								$('div.submenu_container:visible', this)
												.slideUp('fast');
				})
	});

  $('#aktiv_fomenu_futo').each(function() {
								 
				$('a', this).mouseover(function() {
								$(this).siblings('div.submenu_container:hidden').slideDown('fast');
				})
				$(this).hover(function() {
								
				},
				function() {
								$('div.submenu_container:visible', this)
												.slideUp('fast');
				})
	});
  
  $('.side_mmenu').each(function() {
								 
				$('a', this).mouseover(function() {
								$(this).siblings('div.side_submenu_container:hidden').css("top","4px").css("left","128px").slideDown('fast');
				})
				$(this).hover(function() {
								
				},
				function() {
								$('div.side_submenu_container:visible', this)
												.slideUp('fast');
				})
	});
  
   var originalDh = $(document).height();
   $(window).resize(function(){ 
        	docHeight();
    	});	
   docHeight();
   menuWidth();
   
   fixPng();
   logBoxInput();
   
   $('#dialog_link0, #dialog_link1, #dialog_link2, #dialog_link3, #dialog_link4, #dialog_link5, #dialog_link6, #dialog_link7, #dialog_link8, #dialog_link9').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
  
  $.scrollTo.defaults.axis = 'xy';
  applyTextHeight();
});

function applyTextHeight() {
		var maxHeight = 0;
            maxHeight = 0;
            $(".ctcontent_s").each(function() {
                if($(this).height() > maxHeight)                                         
                    maxHeight = $(this).height();
            });
            $(".ctcontent_s").height(maxHeight);
	}
	
//doc ready end
$(window).load(function () {
  $("#header_image img").css("display","block");						 
  $("#header_image").cycle({fx:"fade",speed:5000});
});

function m()
{
	$('#tavtarto').height($(this).height()-$(this).parent().parent().height());	
	$(this).parent().parent().height($(this).height());
}

function cegmsz(i)
{
	$('.ceg').hide();$('.msz').hide();
	$('.'+i).show();
}

function clearSelection () {
if (document.selection)
document.selection.empty();
else if (window.getSelection)
window.getSelection().removeAllRanges();
}

function ua()
{
$("select[name=regorszagp]").val($("select[name=regorszagc]").val());
$("input[name=regirszamp]").val($("input[name=regirszamc]").val());
$("input[name=regutcap]").val($("input[name=regutcac]").val());
orszagvallt('regorszagp','regvarosp','regevarosp','regirszamp','varospdiv',true,"","");
}

function uaszamla()
{
$("select[name=orderorszagp]").val($("select[name=orderorszag]").val());
$("input[name=ordernevp]").val($("input[name=ordernev]").val());
$("input[name=orderirszamp]").val($("input[name=orderirszam]").val());
$("input[name=orderutcap]").val($("input[name=orderutca]").val());
orszagvallt('orderorszagp','ordervarosp','orderevarosp','orderirszamp','varospdiv',true);
}                                          


function effectMix()
{
var effect=new Array("curtainX","fade","turnUp","turnDown","slideY");
a=Math.random()*4;
//$("#header_image").cycle({fx:effect[a],speed:4000,after:effectMix});	
}

function logBoxInput() {
	ertek=$("#l_username").val();
    $("#l_username").bind("click focus", function() {
        if($(this).val() == ertek)
           { $(this).val("");}    
    }).blur(function() {
        if($(this).val() == "")
            {$(this).val(ertek);}
    });
    $("#jelszofedel").click(function() {
        $(this).hide();
        $("#l_password").focus();
    });
    $("#l_password").blur(function() {
        if($(this).val() == "") 
            {$("#jelszofedel").show();}
    }).focus(function() {
        $("#jelszofedel").hide();
    });
 }

$(window).load(function(){
				$("#thumbs").jCarouselLite({
        speed: 500,
        btnNext: "#thumbnail a.pager_right",
        btnPrev: "#thumbnail a.pager_left",
        visible: 4,
        circular: true,
		auto:15000,
        setHeight: true        
    });	   
					   });

function docHeight() {
      
	   if (window.innerHeight-window.document.height>0)	
  {$('#tavtarto').height(window.innerHeight-window.document.height-15);}	

    }
	
function menuWidth() {
    }	
	
function fixPng() {
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);

    if ((version >= 5.5 && version < 7) && (document.body.filters)) 
    {
       for(var i=0; i<document.images.length; i++)
       {
          var img = document.images[i];
          var imgName = img.src.toUpperCase();
		  
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : "";
             var imgClass = (img.className) ? "class='" + img.className + "' " : "";
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
             var imgStyle = "display:inline-block;" + img.style.cssText; 
             if (img.align == "left"){ imgStyle = "float:left;" + imgStyle;}
             if (img.align == "right"){ imgStyle = "float:right;" + imgStyle;}
             if (img.parentElement.href){ imgStyle = "cursor:hand;" + imgStyle;}
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"; 
             img.outerHTML = strNewHTML;
             i = i-1;
          }
       }
    }
}

function isFF3() {
    var qq = $.browser.version.replace(/\./g, "");
    if(parseInt(qq.substr(0,2)) > 18)
       { return true;}
    else
      {  return false;}
}

function showAlert(title, text, reload) {
    eval('$("#dialog").dialog({modal:true,resizable:false,height:300,title:title,overlay: {opacity: 0.2,background: "black" },buttons: {"'+_BEZARAS_GOMB+'": function() {$(this).dialog("close"); if(reload) window.location.reload();}}}).html(text).css({width:"auto", overflowX:"scroll"});');
	$("#dialog").dialog('open');	
}

function confirmWindow(title, text,url) {
   $("#dialog").dialog('option','modal',true);
   $("#dialog").dialog('option','resizable',false);
   //$("#dialog").dialog('option','width',600);
   $("#dialog").dialog('option','height',300);
   $("#dialog").dialog('option','title',title);
   $("#dialog").dialog('option','overlay',{opacity: 0.2,background: "black" });
   eval("$(\"#dialog\").dialog('option','buttons',{\"Ok\": function() {hopp(url);},\"Mégsem\": function() {$(this).dialog(\"close\");}});");
   $("#dialog").dialog().html(text).css({width:"auto", overflowX:"scroll"});
   $("#dialog").dialog('open');
}

function loadingWindow() {
   $("#dialog").dialog('option','modal',true);
   $("#dialog").dialog('option','resizable',false);
   $("#dialog").dialog('option','width',400);
   $("#dialog").dialog('option','height',200);
   $("#dialog").dialog('option','title',_LOADING_IN_PROGRESS);
   $("#dialog").dialog('option','overlay',{opacity: 0.2,background: "black" });
   $("#dialog").dialog('option','closeOnEscape',false);
   $("#dialog").bind( "dialogopen", function(event, ui) {
       $(this).parent().children().children('.ui-dialog-titlebar-close').hide();
    });
   
   eval("$(\"#dialog\").dialog('option','buttons',{\"Ok\": function() {$(this).dialog(\"close\");}});");
   $("#dialog").dialog().html('<table width="350"><tr><td align="center">'+_LOADING_IN_PROGRESS+'<br /><img src="images/loading.gif"/><img src="images/pixel.gif" width="1" height="50" align="middle"/></td></tr></table>').css({width:"auto", overflowX:"scroll"});
   $("#dialog").dialog('open');
}


function buyprod(aid,szid,text) {
   $("#dialog").dialog('option','modal',true);
   $("#dialog").dialog('option','resizable',false);
   $("#dialog").dialog('option','width',600);
   $("#dialog").dialog('option','height',300);
   $("#dialog").dialog('option','title',_CONFIRM_BUY);
   $("#dialog").dialog('option','overlay',{opacity: 0.2,background: "black" });
   $("#dialog").dialog('option','buttons',{"Ok": function() {
		
		
		loadingWindow();
		$.get("index.php?content=user&cmd=profile&op=buystepitem&aid="+aid+"&szid="+szid, 
        function(response) {
			   
			   var myObject_x = eval('(' + response + ')');
			   if (myObject_x.success)
			     {
				  hopp('index.php?content=user&cmd=profile&op=orderstepitem&aid='+aid);	 
				 }
			   else
			     {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_BUY_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   $("#dialog").dialog().html(myObject_x.msg).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
				 }
        }   
    );	
		
														  
														  },"Mégsem": function() {$(this).dialog("close");}});
   $("#dialog").dialog().html(text).css({width:"auto", overflowX:"scroll"});
   $("#dialog").dialog('open');
}

function kosarba(wsid) {
	db=$("#db_"+wsid).val();
	if (document.getElementById("m_"+wsid))
	  m=$("#m_"+wsid).val();
	else
	  m=0;
	$.get("index.php?content=webshop&cmd=addCart&db="+db+"&wsid="+wsid+"&m="+m, 
	function(response) {
		   var myObject_x = eval('(' + response + ')');
		   if (myObject_x.success)
			 {
			  hopp('index.php?content=webshop&cmd=cart');	 
			 }
		   else
			 {
		   $("#dialog").dialog('option','modal',true);
		   $("#dialog").dialog('option','resizable',false);
		   $("#dialog").dialog('option','width',500);
		   $("#dialog").dialog('option','height',400);
		   $("#dialog").dialog('option','title',_BUY_TITLE);
		   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
		   $("#dialog").dialog().html(myObject_x.msg).css({width:"auto", overflowX:"scroll"});
		   $("#dialog").dialog('open');
			 }
	}   
);	
}

function modcart(wsid,m) {
	db=$("#db_"+wsid).val();
	$.get("index.php?content=webshop&cmd=modCart&db="+db+"&wsid="+wsid+"&m="+m, 
	function(response) {
		   var myObject_x = eval('(' + response + ')');
		   if (myObject_x.success)
			 {
			  hopp('index.php?content=webshop&cmd=cart');	 
			 }
		   else
			 {
		   $("#dialog").dialog('option','modal',true);
		   $("#dialog").dialog('option','resizable',false);
		   $("#dialog").dialog('option','width',500);
		   $("#dialog").dialog('option','height',400);
		   $("#dialog").dialog('option','title',_BUY_TITLE);
		   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
		   $("#dialog").dialog().html(myObject_x.msg).css({width:"auto", overflowX:"scroll"});
		   $("#dialog").dialog('open');
			 }
	}   
);	
}

function langmsg(url, text) {
    $("#dialog3").dialog('option','modal',true);
   $("#dialog3").dialog('option','resizable',false);
   //$("#dialog").dialog('option','width',600);
   $("#dialog3").dialog('option','height',300);
   $("#dialog3").dialog('option','title','');
   $("#dialog3").dialog('option','overlay',{opacity: 0.2,background: "black" });
   eval("$(\"#dialog3\").dialog('option','buttons',{\"bezárás\": function() {hopp(url);}});");
   $("#dialog3").dialog().html(text).css({width:"auto", overflowX:"scroll"});
   $("#dialog3").dialog('open');	
}

function showHelp(id){
	     
		$("#regbutton").hide();
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open'); 
	
		$.get("index.php?content=help&cmd=getHelp&id="+id, 
        function(response) {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_HELP);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");$.get(\"index.php?content=help&cmd=nullhelphystory\");}});");
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
        }   
    );	
}

function atpv(id){
	     
		$("#regbutton").hide();
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open'); 
	
		$.get("index.php?content=user&cmd=profile&op=atpv&aid="+id, 
        function(response) {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
        }   
    );	
}


function jcarusel_init(id)
{var ih;
$("#ad_leftx_"+id).remove();
$("#ad_rightx_"+id).remove();

$("#ad_imagecontainer_"+id+" ul li").each(function(){
						$(this).css("display","block");						
												});
if ($("#ad_imagecontainer_"+id+" ul").children().length>=1){ ih=true;} else{ ih=false;}

$("#ad_imagecontainer_"+id).jCarouselLite({
        speed: 500,
        btnNext: "#ad_right_"+id,
        btnPrev: "#ad_left_"+id,
        visible: 1,
        circular: ih,
        setHeight: false        
    })
CB_Init();
}

function voteit(id,pot){
	
   $("#dialog").dialog('option','modal',true);
   $("#dialog").dialog('option','resizable',false);
   $("#dialog").dialog('option','width',600);
   $("#dialog").dialog('option','height',400);
   $("#dialog").dialog('option','title', _FOGLALAS_FOLYMATBAN);
   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
   $("#dialog").dialog('open');
			   
   $.get("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, function(response) {
			
			if (response.indexOf('<!--ELLENOR-->')==-1)
			  {//Nincs hiba az oldalon
				if (response.indexOf('<!--NOREG-->')==-1)
			      {//Elofizető ág
			       if (response.indexOf('<!--FREE-->')==-1)
				     {//NEM ingyenes aukció
					  $("#dialog").dialog('option','modal',true);
					  $("#dialog").dialog('option','resizable',false);
					  $("#dialog").dialog('option','width',600);
					  $("#dialog").dialog('option','height',400);
					  $("#dialog").dialog('option','title',_MEGEROSITES);
					  $("#dialog").dialog('option','buttons',{                    
						 "Tovább": function() { 
							
							   $("#dialog").dialog('option','modal',true);
							   $("#dialog").dialog('option','resizable',false);
							   $("#dialog").dialog('option','width',600);
							   $("#dialog").dialog('option','height',400);
							   $("#dialog").dialog('option','title',_FOGLALAS_FOLYMATBAN);
							   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
							   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
							   $("#dialog").dialog('open');
							
							   $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
							   {darabos:1},
							   function(response) {			
								 if (response.indexOf('<!--ELLENOR-->')==-1)
								   {
							   $("#dialog").dialog('option','modal',true);
							   $("#dialog").dialog('option','resizable',false);
							   $("#dialog").dialog('option','width',600);
							   $("#dialog").dialog('option','height',400);
							   $("#dialog").dialog('option','title',_FOGLALAS_SZAMA);
							   $("#dialog").dialog('option','buttons',{ 
									"elküld": function() {
							   $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
								{ vegleges:1,
								  addarab:$("select[name=addarab]").val()
								},
								function(response) {			
								if (response.indexOf('<!--ELLENOR-->')==-1)
								  {
							   $("#dialog").dialog('option','modal',true);
							   $("#dialog").dialog('option','resizable',false);
							   $("#dialog").dialog('option','width',600);
							   $("#dialog").dialog('option','height',400);
							   $("#dialog").dialog('option','title',_FOGLALAS_SIKER);
							   $("#dialog").dialog('option','buttons',{ 
									 "bezárás": function() {
										 $(this).dialog("close");
										 window.location.reload();
									 } });
							   
							   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
							   $("#dialog").dialog('open');
							  }
							 else					   
							  {
							   $("#dialog").dialog('option','modal',true);
							   $("#dialog").dialog('option','resizable',false);
							   $("#dialog").dialog('option','width',600);
							   $("#dialog").dialog('option','height',400);
							   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
							   $("#dialog").dialog('option','buttons',{                    
									 "bezárás": function() { 
										 $(this).dialog("close");
									 } }); 
								 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
								 $("#dialog").dialog('open');
							  }
							
						}   
					);
									 },			   
									 "bezárás": function() {
										 $(this).dialog("close");
									 } });
							   
							   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
							   $("#dialog").dialog('open');
							  }
								 else					   
								   {
									   $("#dialog").dialog('option','modal',true);
									   $("#dialog").dialog('option','resizable',false);
									   $("#dialog").dialog('option','width',600);
									   $("#dialog").dialog('option','height',400);
									   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
									   $("#dialog").dialog('option','buttons',{                    
											 "bezárás": function() { 
												 $(this).dialog("close");
											 } }); 
										 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
										 $("#dialog").dialog('open');
									  }
							
							   });
						 },
						 "bezárás": function() { 
							 $(this).dialog("close");
						 } });
				   
					  $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
					  $("#dialog").dialog('open');
					 }
				   else
				     {//INGYENES aukció
					   if (response.indexOf('<!--LICITCENT-->')==-1)
						  {//NEM licitcent felhasználásos
						   $("#dialog").dialog('option','modal',true);
						   $("#dialog").dialog('option','resizable',false);
						   $("#dialog").dialog('option','width',600);
						   $("#dialog").dialog('option','height',400);
						   $("#dialog").dialog('option','title',_FOGLALAS_SZAMA);
						   $("#dialog").dialog('option','buttons',{ 
							   "Foglalás": function() {
							      $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
								     { vegleges:1,
								       addarab:$("select[name=addarab]").val()
								     },
								     function(response) {			
								          if (response.indexOf('<!--ELLENOR-->')==-1)
								            {
											   $("#dialog").dialog('option','modal',true);
											   $("#dialog").dialog('option','resizable',false);
											   $("#dialog").dialog('option','width',600);
											   $("#dialog").dialog('option','height',400);
											   $("#dialog").dialog('option','title',_FOGLALAS_SIKER);
											   $("#dialog").dialog('option','buttons',{ 
												 "bezárás": function() {
													 $(this).dialog("close");
													 window.location.reload();
												 } });
										   
											  $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
											  $("#dialog").dialog('open');
											 }
										   else					   
											 {
											   $("#dialog").dialog('option','modal',true);
											   $("#dialog").dialog('option','resizable',false);
											   $("#dialog").dialog('option','width',600);
											   $("#dialog").dialog('option','height',400);
											   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
											   $("#dialog").dialog('option','buttons',{                    
													 "bezárás": function() { 
														 $(this).dialog("close");
													 } }); 
											   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
											   $("#dialog").dialog('open');
											}
								  });
								 },			   
								 "bezárás": function() {
									 $(this).dialog("close");
								 } });
						   
						    $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
						    $("#dialog").dialog('open');
						   }
						  else 
						   {//licitcentfelhasználásos 
							
							$("#dialog").dialog('option','modal',true);
					        $("#dialog").dialog('option','resizable',false);
					        $("#dialog").dialog('option','width',600);
					        $("#dialog").dialog('option','height',400);
					        $("#dialog").dialog('option','title',_MEGEROSITES);
					        $("#dialog").dialog('option','buttons',{                    
										 "Tovább": function() { 
									
									   $("#dialog").dialog('option','modal',true);
									   $("#dialog").dialog('option','resizable',false);
									   $("#dialog").dialog('option','width',600);
									   $("#dialog").dialog('option','height',400);
									   $("#dialog").dialog('option','title',_FOGLALAS_FOLYMATBAN);
									   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
									   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
									   $("#dialog").dialog('open');
									
									   $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
									   {darabos:1},
									   function(response) {			
										 if (response.indexOf('<!--ELLENOR-->')==-1)
										   {
									   $("#dialog").dialog('option','modal',true);
									   $("#dialog").dialog('option','resizable',false);
									   $("#dialog").dialog('option','width',600);
									   $("#dialog").dialog('option','height',400);
									   $("#dialog").dialog('option','title',_FOGLALAS_SZAMA);
									   $("#dialog").dialog('option','buttons',{ 
											"elküld": function() {
									   $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
										{ vegleges:1,
										  addarab:$("select[name=addarab]").val()
										},
										function(response) {			
										if (response.indexOf('<!--ELLENOR-->')==-1)
										  {
									   $("#dialog").dialog('option','modal',true);
									   $("#dialog").dialog('option','resizable',false);
									   $("#dialog").dialog('option','width',600);
									   $("#dialog").dialog('option','height',400);
									   $("#dialog").dialog('option','title',_FOGLALAS_SIKER);
									   $("#dialog").dialog('option','buttons',{ 
											 "bezárás": function() {
												 $(this).dialog("close");
												 window.location.reload();
											 } });
									   
									   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
									   $("#dialog").dialog('open');
									  }
									 else					   
									  {
									   $("#dialog").dialog('option','modal',true);
									   $("#dialog").dialog('option','resizable',false);
									   $("#dialog").dialog('option','width',600);
									   $("#dialog").dialog('option','height',400);
									   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
									   $("#dialog").dialog('option','buttons',{                    
											 "bezárás": function() { 
												 $(this).dialog("close");
											 } }); 
										 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
										 $("#dialog").dialog('open');
									  }
									
								}   
							);
											 },			   
											 "bezárás": function() {
												 $(this).dialog("close");
											 } });
									   
									   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
									   $("#dialog").dialog('open');
									  }
										 else					   
										   {
											   $("#dialog").dialog('option','modal',true);
											   $("#dialog").dialog('option','resizable',false);
											   $("#dialog").dialog('option','width',600);
											   $("#dialog").dialog('option','height',400);
											   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
											   $("#dialog").dialog('option','buttons',{                    
													 "bezárás": function() { 
														 $(this).dialog("close");
													 } }); 
												 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
												 $("#dialog").dialog('open');
											  }
									
									   });
								 },
						         "bezárás": function() { 
						             	 $(this).dialog("close");
						    } });
				   
					        $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
					        $("#dialog").dialog('open');
							}
						  
					 }
				 }
				else
				  {//Free tag ág
				   $("#dialog").dialog('option','modal',true);
				   $("#dialog").dialog('option','resizable',false);
				   $("#dialog").dialog('option','width',600);
				   $("#dialog").dialog('option','height',400);
				   $("#dialog").dialog('option','title',_FOGLALAS);
				   $("#dialog").dialog('option','buttons',{                    
						"Tovább": function() { 
							   ajk=$("input[name=ajanlokod]").val();		
							   $("#dialog").dialog('option','modal',true);
							   $("#dialog").dialog('option','resizable',false);
							   $("#dialog").dialog('option','width',600);
							   $("#dialog").dialog('option','height',400);
							   $("#dialog").dialog('option','title',_FOGLALAS_FOLYMATBAN);
							   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
							   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
							   $("#dialog").dialog('open');
										
						       $.post("index.php?content=aukcio&cmd=aVote&aid="+id+"&pot="+pot, 
						           { spkod:1,
								     ajanlokod:ajk
								   },
								   function(response) {			
										if (response.indexOf('<!--NOREGELLENOR-->')==-1)
										  {//sikeres foglalás
										   $("#dialog").dialog('option','modal',true);
										   $("#dialog").dialog('option','resizable',false);
										   $("#dialog").dialog('option','width',600);
										   $("#dialog").dialog('option','height',400);
										   $("#dialog").dialog('option','title',_FOGLALAS_SZAMA);
										   $("#dialog").dialog('option','buttons',{ 
												 "bezárás": function() {
													 $(this).dialog("close");
												 } });
										   
										   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
										   $("#dialog").dialog('open');
										  }
										 else					   
										  {//foglalási hiba
										   $("#dialog").dialog('option','modal',true);
										   $("#dialog").dialog('option','resizable',false);
										   $("#dialog").dialog('option','width',600);
										   $("#dialog").dialog('option','height',400);
										   $("#dialog").dialog('option','title',_FOGLALAS_HIBA);
										   $("#dialog").dialog('option','buttons',{                    
												 "bezárás": function() { 
													 $(this).dialog("close");
												 } }); 
											 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
											 $("#dialog").dialog('open');
										  }
									});
						 },
						 "bezárás": function() { 
							 $(this).dialog("close");
						 } });
				   
				   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				   $("#dialog").dialog('open');
				  
				  
					 }
			  
			  }
			 else					   
			  {//foglalási hibaüzenet
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_FOGLALAS_JOGELLENORZES);
			   $("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");
                     } }); 
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
   });
}


function hopp(target){
    window.location=target;
}

function hopp_up(target){
    window.parent.location=target;
}

function hoppn(target) {
window.open(target, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=560,height=600,left=0,top=0');
}

function wtp(uid)
{
kr=$('#ktip').html();	
hoppn('index.php?content=user&cmd=wtprint&cs='+kr+'&uid='+uid);	
}
function emailCheck (emailStr) {

var checkTLD=0;

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);

if (matchArray==null) {
//alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
//alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
//alert("Ths domain name contains invalid characters.");
return false;
   }
}

if (user.match(userPat)==null) {

//alert("The username doesn't seem to be valid.");
return false;
}

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
//alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
//alert("The domain name does not seem to be valid.");
return false;
   }
}

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
//alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

if (len<2) {
//alert("This address is missing a hostname!");
return false;
}

return true;
}

function regform_validate()
{
valasz=true;	
 
 $("input[name=regnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
 $("input[name=regnev]").attr({title:_NEMKOTELEZO_DEJO});
 $("input[name=regtel]").css({backgroundImage:"url(images/reg_pipa.png)"});
 $("input[name=regtel]").attr({title:_NEMKOTELEZO_DEJO});
 
 if (emailCheck($("input[name=regemail]").val()))
   	   {
		 $("input[name=regemail]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regemail]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		 $("input[name=regemail]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regemail]").attr({title:_EMAIL_NEMMEGFELEL}); 
		 valasz=false;
	   }

 if (String($("input[name=regpassword]").val()).length >=6)
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_OK});
	 if ($("input[name=regpasswordagain]").val()==$("input[name=regpassword]").val() )
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_OK});
	   }
	 else
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
		 valasz=false;
	   }
   }
 else
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_ELL_NUM});
	 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
	 valasz=false;
   }
 
 if ("helyes_" + $("input[name=megoldas]").val()==$("input[name=helyes]").val() )
   {
	 $("input[name=megoldas]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 $("input[name=megoldas]").attr({title:_ELL_OSSZEG_OK});
   }
 else
   {
	 $("input[name=megoldas]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=megoldas]").attr({title:_JELSZO_ELL_WRONG}); 
	 valasz=false;
   }
    
 a=$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1);
 
 return valasz;
}

function validateajalnat()
{
valasz=true;	
 
 
 if (emailCheck($("input[name=emailed]").val()))
   	   {
		   $("input[name=emailed]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=emailed]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		 $("input[name=emailed]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=emailed]").attr({title:_EMAIL_FORM_KOTELEZO}); 
		 valasz=false;
	   }
 if ($("input[name=neved]").val()!='')
   	   {
		  $("input[name=neved]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=neved]").attr({title:_NEVED_OK}); 
	   }
	 else
	   {
		 $("input[name=neved]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=neved]").attr({title:_NEVED_KOTELEZ}); 
		 valasz=false;
	   }
 
    
 
 return valasz;
}

function validatekapcs()
{
valasz=true;	
 
 if (emailCheck($("input[name=kemail]").val()))
   	   {
		   $("input[name=kemail]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=kemail]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		 $("input[name=kemail]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=kemail]").attr({title:_EMAIL_FORM_KOTELEZO}); 
		 valasz=false;
	   }
 if ($("input[name=knev]").val()!='')
   	   {
		  $("input[name=knev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=knev]").attr({title:_NEVED_OK}); 
	   }
	 else
	   {
		 $("input[name=knev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=knev]").attr({title:_NEVED_KOTELEZ}); 
		 valasz=false;
	   }
 return valasz;
}

function regsend(){
		
if (regform_validate())
  {     
		$("#regbutton").hide();
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=regpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregpassword:$("input[name=regpassword]").val(),
		  sregpasswordagain:$("input[name=regpasswordagain]").val(),
		  sregszuldat:$("select[name=regszuldat]").val(),
		  sregemail:$("input[name=regemail]").val(),
		  sregtel:$("input[name=regtel]").val(),
		  sregtel:$("input[name=regtel]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1)
		},
        function(response) {
			$("#regbutton").show();
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_SIKERES);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");window.location=\"index.php\";}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
  }
else
 {
  $.scrollTo('#main_content',500);	 
 }
}

function ajanljminket(){
		$.get("index.php?content=user&cmd=ajanlas", 
        function(response) {
			     $("#dialog").dialog('option','modal',true);
			$("#dialog").dialog('option','resizable',false);
			$("#dialog").dialog('option','width',400);
			$("#dialog").dialog('option','height',370);
			$("#dialog").dialog('option','title',_AJANLD_ISMEROSEIDNEK_TITLE);
			$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					"elküld": function() {
						 
						 if (validateajalnat())
						   {$("button:contains('elküld')").remove();
							$.post("index.php?content=user&cmd=ajanlaspost",
							{
							 nevm:$("input[name=neved]").val(),	
							 emailm:$("input[name=emailed]").val(),
							 nev1:$("input[name=nev1]").val(),
							 email1:$("input[name=email1]").val(),
							 nev2:$("input[name=nev2]").val(),
							 email2:$("input[name=email2]").val(),
							 nev3:$("input[name=nev3]").val(),
							 email3:$("input[name=email3]").val(),
							 nev4:$("input[name=nev4]").val(),
							 email4:$("input[name=email4]").val(),
							 nev5:$("input[name=nev5]").val(),
							 email5:$("input[name=email5]").val()
							}	,  
        function(response) {$("#dialog").html(response);});
						   }
						 }
						  
                } );
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#dialog").dialog('open');
			  }
    );

}

function licitcentinvitation(){
			
			$("#regbutton").hide();
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open'); 
			
			$.post("index.php?content=user&cmd=licitcentmeghivopost",
							{
							 nev1:$("input[name=nev1]").val(),
							 email1:$("input[name=email1]").val(),
							 nev2:$("input[name=nev2]").val(),
							 email2:$("input[name=email2]").val(),
							 nev3:$("input[name=nev3]").val(),
							 email3:$("input[name=email3]").val(),
							 nev4:$("input[name=nev4]").val(),
							 email4:$("input[name=email4]").val(),
							 nev5:$("input[name=nev5]").val(),
							 email5:$("input[name=email5]").val()
							}	,  
        function(response) {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',650);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");window.location.reload();}});");
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			
			});

}

function adomanyajanlo(id){
		$.get("index.php?content=aukcio&cmd=ajanlas&aid="+id, 
        function(response) {
			     $("#dialog").dialog('option','modal',true);
			$("#dialog").dialog('option','resizable',false);
			$("#dialog").dialog('option','width',400);
			$("#dialog").dialog('option','height',250);
			$("#dialog").dialog('option','title',_AJANLD_ISMEROSEIDNEK_AUKCIOSTARGY_TITLE);
			$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					"elküld": function() {
						 
						 if (validateajalnat())
						   {$("button:contains('elküld')").remove();
							$.post("index.php?content=aukcio&cmd=ajanlaspost&aid="+id,
							{
							 nevm:$("input[name=neved]").val(),	
							 emailm:$("input[name=emailed]").val(),
							 nev1:$("input[name=nev1]").val(),
							 email1:$("input[name=email1]").val()
							 
							}	,  
        function(response) { 
		                 $("#dialog").html(response);
                         
		});
						   }
						 }
						  
                } );
			
			
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#dialog").dialog('open');
			  }
    );

}


function partnerajanlo(){
		$.get("index.php?content=aukcio&cmd=partnerajanlas", 
        function(response) {
			     $("#dialog").dialog('option','modal',true);
			$("#dialog").dialog('option','resizable',false);
			$("#dialog").dialog('option','width',400);
			$("#dialog").dialog('option','height',250);
			$("#dialog").dialog('option','title',_PARTNERAJANLO_TITLE);
			$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					"elküld": function() {
						 $("button:contains('elküld')").remove();
							$.post("index.php?content=aukcio&cmd=partnerajanlaspost",
							{
								email1:$("input[name=email1]").val()							 
							}	,  
        function(response) { 
		                 $("#dialog").html(response);
		});
						   
						 }
						  
                } );
			
			
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#dialog").dialog('open');
			  }
    );

}


function kapcsolat(){
		$.get("index.php?content=user&cmd=kapcsolat", 
        function(response) {
			    $("#dialog").dialog('option','modal',true);
			    $("#dialog").dialog('option','resizable',false);
				$("#dialog").dialog('option','width',400);
				$("#dialog").dialog('option','height',370);
				$("#dialog").dialog('option','title',_KAPCSOLATFELVETEL_TITLE);
				$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					 "elküld": function() {
						 
						 if (validatekapcs())
						   {eval('$("button:contains('+_ELKULD_GOMB+')").remove()');
							$.post("index.php?content=user&cmd=kapcsolatpost",
							{
							 knev:$("input[name=knev]").val(),	
							 kemail:$("input[name=kemail]").val(),
							 ktel:$("input[name=ktel]").val(),
							 kmsg:$("textarea[name=kmsg]").val()
							}	,  
        function(response) { 
		                 $("#dialog").html(response);
                         
		});
						   }
						 }
						  
                });
				 
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#dialog").dialog('open');
			  }
    );

}

function hianypotlas(aid){
		$.get("index.php?content=user&cmd=hianypotlas&aid="+aid, 
        function(response) {
			    $("#dialog").dialog('option','modal',true);
			    $("#dialog").dialog('option','resizable',false);
				$("#dialog").dialog('option','width',550);
				$("#dialog").dialog('option','height',400);
				$("#dialog").dialog('option','title',_HIANYPOTLAS_TITLE);
				$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					 "elküld": function() {
						 
						 $("button:contains('elküld')").remove();
							$.post("index.php?content=user&cmd=hianypotlaspost&aid="+aid,
							{
							 kmsg:$("textarea[name=kmsg]").val()
							}	,  
        function(response) { 
		                 $("#dialog").html(response);
                         
		});
						  
						 }
						  
                });
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#dialog").dialog('open');
			  }
    );

}


function tagform_validate()
{
valasz=true;	
jo=true;
var ValidChars = "0123456789.";
var ValidCharsB = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ValidCharsBANK="0123456789";
if ($("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1)=="F")
  {

 if ($("input[name=regnev]").val()!="")
   	   {
		 $("input[name=regnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regnev]").attr({title:_NEV_OK}); 
	   }
	 else
	   {
		 $("input[name=regnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regnev]").attr({title:_NEV_KOT}); 
		 valasz=false;
	   }
/*
 if ($("input[name=regszemelyi]").val()!="")
   	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regszemelyi]").attr({title:_SZIG_OK}); 
	   }
	 else
	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regszemelyi]").attr({title:_SZIG_KOT}); 
		 valasz=false;
	   }

 if ($("input[name=regadoszm]").val()!="")
   	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadoszm]").attr({title:_ADOA_OK}); 
	   }
	 else
	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadoszm]").attr({title:_ADOA_KOT}); 
		 valasz=false;
	   }
*/

if ($("input[name=regirszam]").val()!="")
   	   {
		 $("input[name=regirszam]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszam]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszam]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszam]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvaros]").val()!="0" && $("select[name=regvaros]").val()!="-1")
   	   {
		 $("select[name=regvaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvaros]").attr({title:_VAROS_OK}); 
	   }
else
      {
	   if ($("select[name=regvaros]").val()=="-1")
          {
		  if ($("input[name=regevaros]").val()!="")
		    {
			 $("select[name=regvaros]").css({backgroundColor:"#5cbc67"});
		     $("select[name=regvaros]").attr({title:_VAROS_OK});	
		     $("input[name=regevaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevaros]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvaros]").css({backgroundColor:"#ed1f24"});
		    $("select[name=regvaros]").attr({title:_VAROS_KOT}); 
			$("input[name=regevaros]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevaros]").attr({title:_VAROS_KOT});
		    valasz=false;
	       }
	     }
	   else 
	   {
		 $("select[name=regvaros]").css({backgroundColor:"#ed1f24"});
		 $("select[name=regvaros]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }
	  }

if ($("input[name=regutca]").val()!="")
   	   {
		 $("input[name=regutca]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutca]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutca]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutca]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	   
/*
 if ($("input[name=regszlasz1]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz1]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz1]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz1]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
 
 if ($("input[name=regszlasz2]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz2]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz2]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz2]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
		  
	if ($("input[name=regszlasz3]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz3]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz3]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz3]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"});
	      }	  
 */
 
  } //msz ellenörzés vége
  else
  {  //ceg ellenörzés
	  
if ($("input[name=regcnev]").val()!="")
   	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcnev]").attr({title:_CEGN_OK}); 
	   }
	 else
	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcnev]").attr({title:_CEGN_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regcjsz]").val()!="")
   	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcjsz]").attr({title:_CEGSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcjsz]").attr({title:_CEGSZ_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regadosz]").val()!="")
   	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadosz]").attr({title:_ADO_OK}); 
	   }
	 else
	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadosz]").attr({title:_ADO_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regirszamc]").val()!="")
   	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosc]").val()!="0" && $("select[name=regvarosc]").val()!="-1")
   	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosc]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosc]").val()=="-1")
          {
		  if ($("input[name=regevarosc]").val()!="")
		    {
			 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosc]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosc]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosc]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }


if ($("input[name=regutcac]").val()!="")
   	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcac]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcac]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	   
if ($("input[name=regirszamp]").val()!="")
   	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosp]").val()!="0" && $("select[name=regvaroscp]").val()!="-1")
   	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosp]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosp]").val()=="-1")
          {
		  if ($("input[name=regevarosp]").val()!="")
		    {
			 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosp]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosp]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosp]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }


if ($("input[name=regutcap]").val()!="")
   	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcap]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcap]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }	   
  
  } //ceges ellenörzés vége

if ($("input[name=regtel]").val()!="")
   	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regtel]").attr({title:_TEL_OK}); 
	   }
	 else
	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regtel]").attr({title:_TEL_KOT}); 
		 valasz=false;
	   }

 if ($("input[name=sponsorkod]").val()!="")
   	   { 
	     
        Char = $("input[name=sponsorkod]").val().charAt(0);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
        Char = $("input[name=sponsorkod]").val().charAt(1);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(2);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(3);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false; }  
		Char = $("input[name=sponsorkod]").val().charAt(4);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false;  } 
		Char = $("input[name=sponsorkod]").val().charAt(5);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false;  } 
   
		if (jo)
   	       {		   
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_OK}); 
	       }
	    else
	       {
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_WRONG}); 
		    valasz=false;
	       }		 
	   }

 a=$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1);
 
 return valasz;
}

function tagsend(){
		
if (tagform_validate())
  {     
		
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=profile&op=tagpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  
		  sregszuldat:$("select[name=regszuldat]").val(),
		  sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1)
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_MEGEROSITES);
			   $("#dialog").dialog('option','buttons',{                    
                     "Megerősítés": function() { 
                         $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
		$.post("index.php?content=user&cmd=profile&op=tagpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  
		  sregszuldat:$("select[name=regszuldat]").val(),
		  sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1),
		  vegleges:1
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_SIKERES);
			   $("#dialog").dialog('option','buttons',{                    
					 "bezárás": function() {
						 $(this).dialog("close");
					   hopp('index.php?content=user&cmd=profile');
                     } });
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   $("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");
                        
                     } }); 
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
                     },
					 "Módosít": function() { 
                         $(this).dialog("close");
                     } });
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   $("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");
                        
                     } }); 
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
  }
 else
  {
	
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',300);
			   $("#dialog").dialog('option','height',200);
			   $("#dialog").dialog('option','title',_HIANYZOADATOK_TITLE);
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){$(this).dialog("close");$.scrollTo('#profiltartalom',1000)}});
               $("#dialog").dialog().html(_HIANYZOADATOK_CONTENT);
			   $("#dialog").dialog('open');  
  }
 
}

function rptagform_validate()
{
valasz=true;	
jo=true;
var ValidChars = "0123456789.";
var ValidCharsB = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ValidCharsBANK="0123456789";
if (emailCheck($("input[name=regemail]").val()))
   	   {
		 $("input[name=regemail]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regemail]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		 $("input[name=regemail]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regemail]").attr({title:_EMAIL_NEMMEGFELEL}); 
		 valasz=false;
	   }

if ($("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1)=="F")
  {

 if ($("input[name=regnev]").val()!="")
   	   {
		 $("input[name=regnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regnev]").attr({title:_NEVED_OK}); 
	   }
	 else
	   {
		 $("input[name=regnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regnev]").attr({title:_NEVED_KOTELEZ}); 
		 valasz=false;
	   }

if (String($("input[name=regpassword]").val()).length >=6)
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_OK});
	 if ($("input[name=regpasswordagain]").val()==$("input[name=regpassword]").val() )
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_OK});
	   }
	 else
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
		 valasz=false;
	   }
   }
 else
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_ELL_NUM});
	 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
	 valasz=false;
   }
/*
 if ($("input[name=regszemelyi]").val()!="")
   	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regszemelyi]").attr({title:_SZIG_OK}); 
	   }
	 else
	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regszemelyi]").attr({title:_SZIG_KOT}); 
		 valasz=false;
	   }

 if ($("input[name=regadoszm]").val()!="")
   	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadoszm]").attr({title:_ADOA_OK}); 
	   }
	 else
	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadoszm]").attr({title:_ADOA_KOT}); 
		 valasz=false;
	   }
*/

if ($("input[name=regirszam]").val()!="")
   	   {
		 $("input[name=regirszam]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszam]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszam]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszam]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvaros]").val()!="0" && $("select[name=regvarosc]").val()!="-1")
   	   {
		 $("select[name=regvaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvaros]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvaros]").val()=="-1")
          {
		  if ($("input[name=regevaros]").val()!="")
		    {
			 $("select[name=regvaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvaros]").attr({title:_VAROS_OK});	
		     $("input[name=regevaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevaros]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvaros]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvaros]").attr({title:_VAROS_KOT}); 
			$("input[name=regevaros]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevaros]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvaros]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvaros]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regutca]").val()!="")
   	   {
		 $("input[name=regutca]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutca]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutca]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutca]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	   
/*
 if ($("input[name=regszlasz1]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz1]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz1]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz1]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
 
 if ($("input[name=regszlasz2]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz2]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz2]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz2]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
		  
	if ($("input[name=regszlasz3]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz3]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz3]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz3]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"});
	      }	  
 */
 
  } //msz ellenörzés vége
  else
  {  //ceg ellenörzés
	  
if ($("input[name=regcnev]").val()!="")
   	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcnev]").attr({title:_CEGN_OK}); 
	   }
	 else
	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcnev]").attr({title:_CEGN_KOT}); 
		 valasz=false;
	   }
if (String($("input[name=regpassword]").val()).length >=6)
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_OK});
	 if ($("input[name=regpasswordagain]").val()==$("input[name=regpassword]").val() )
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_OK});
	   }
	 else
	   {
		 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
		 valasz=false;
	   }
   }
 else
   {
	 $("input[name=regpassword]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpassword]").attr({title:_JELSZO_ELL_NUM});
	 $("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
	 $("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
	 valasz=false;
   }
if ($("input[name=regcjsz]").val()!="")
   	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcjsz]").attr({title:_CEGSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcjsz]").attr({title:_CEGSZ_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regadosz]").val()!="")
   	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadosz]").attr({title:_ADO_OK}); 
	   }
	 else
	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadosz]").attr({title:_ADO_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regirszamc]").val()!="")
   	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosc]").val()!="0" && $("select[name=regvarosc]").val()!="-1")
   	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosc]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosc]").val()=="-1")
          {
		  if ($("input[name=regevarosc]").val()!="")
		    {
			 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosc]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosc]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosc]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regutcac]").val()!="")
   	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcac]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcac]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	   
if ($("input[name=regirszamp]").val()!="")
   	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosp]").val()!="0" && $("select[name=regvarosp]").val()!="-1")
   	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosp]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosp]").val()=="-1")
          {
		  if ($("input[name=regevarosp]").val()!="")
		    {
			 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosp]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosp]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosp]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regutcap]").val()!="")
   	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcap]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcap]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }	   
  
  } //ceges ellenörzés vége

if ($("input[name=regtel]").val()!="")
   	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regtel]").attr({title:_TEL_OK}); 
	   }
	 else
	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regtel]").attr({title:_TEL_KOT}); 
		 valasz=false;
	   }

 if ($("input[name=sponsorkod]").val()!="")
   	   { 
	     
        Char = $("input[name=sponsorkod]").val().charAt(0);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
        Char = $("input[name=sponsorkod]").val().charAt(1);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(2);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(3);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false; }  
		Char = $("input[name=sponsorkod]").val().charAt(4);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false; }  
		Char = $("input[name=sponsorkod]").val().charAt(5);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false; }  
   
		if (jo)
   	       {		   
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_OK}); 
	       }
	    else
	       {
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_WRONG}); 
		    valasz=false;
	       }		 
	   }

 a=$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1);
 
 return valasz;
}

function rptagsend(){
		
if (rptagform_validate())
  {     
		
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=profile&op=regptagregpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  
		  sregemail:$("input[name=regemail]").val(),
		  sregpassword:$("input[name=regpassword]").val(),
		  sregpasswordagain:$("input[name=regpasswordagain]").val(),
		  
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  
		  sregszuldat:$("select[name=regszuldat]").val(),
		  sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1)
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_MEGEROSITES);
			   $("#dialog").dialog('option','buttons',{                    
                     "Megerősítés": function() { 
                         $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
		$.post("index.php?content=user&cmd=profile&op=regptagregpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  
		  sregemail:$("input[name=regemail]").val(),
		  sregpassword:$("input[name=regpassword]").val(),
		  sregpasswordagain:$("input[name=regpasswordagain]").val(),
		  sregszuldat:$("select[name=regszuldat]").val(),
		  sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1),
		  vegleges:1,
		  regpont:1
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_SIKERES);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");window.location.reload();}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});"); 
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
            
        }   
    );
                     },
					 "Módosít": function() { 
                         $(this).dialog("close");
                     } });
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
  }
 else
  {
	
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',300);
			   $("#dialog").dialog('option','height',200);
			   $("#dialog").dialog('option','title',_HIANYZOADATOK_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");$.scrollTo('#adatlapformbox',1000)}});");
               $("#dialog").dialog().html(_HIANYZOADATOK_CONTENT);
			   $("#dialog").dialog('open');  
  }
 
}

function setinfobubi(id,tipus,uzi)
{
if (tipus==1)
  {
	$('#'+id).html('<a class="reguzibubi_a" href="javascript:void(0);" onmouseover="$(\'#'+id+'_info\').show();" onmouseout="$(\'#'+id+'_info\').hide();"><img border="0" src="images/reg_pipa.png" alt="" /><div class="reguzibubi_p" id="'+id+'_info">'+uzi+'</div></a>');  
  }
else
  {
   /*$('#'+id).html('<a class="reguzibubi_a" href="javascript:void(0);" onmouseover="$(\'#'+id+'_info\').show();" onmouseout="$(\'#'+id+'_info\').hide();"><img border="0" src="images/reg_x.png" alt="" /><div class="reguzibubi_x" id="'+id+'_info">'+uzi+'</div></a>'); */
   $('#'+id).html('<font color="#f00">'+uzi+'</font>');
  }
	
}

function isDate(dtStr){
	
	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
}

	
	var dtCh= "/";
	var minYear=1900;
	var maxYear=2100;
	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){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
return true
}

function bovitett_tagform_validate()
{
valasz=true;	
jo=true;
var ValidChars = "0123456789.";
var ValidCharsB = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var ValidCharsBANK="0123456789";
if (emailCheck($("input[name=regemail]").val()))
   	   {setinfobubi('error6',1,_EMAIL_MEGFELEL);
		 //$("input[name=regemail]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  //$("input[name=regemail]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {setinfobubi('error6',2,_EMAIL_NEMMEGFELEL);
		 //$("input[name=regemail]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regemail]").attr({title:_EMAIL_NEMMEGFELEL}); 
		 valasz=false;
	   }
//
if (emailCheck($("input[name=regemailagain]").val()) && $("input[name=regemailagain]").val()==$("input[name=regemail]").val())
   	   {
		  setinfobubi('error7',1,_EMAIL_MEGFELEL);
		 // $("input[name=regemailagain]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 // $("input[name=regemailagain]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		if (emailCheck($("input[name=regemailagain]").val()))
		  {
		   setinfobubi('error7',2,_EMAIL_NEMEGYEZIK);
		  }
		else 
		 {
		  setinfobubi('error7',2,_EMAIL_NEMMEGFELEL);  
		 }
		// $("input[name=regemailagain]").css({backgroundImage:"url(images/reg_x.png)"});
		// $("input[name=regemailagain]").attr({title:_EMAIL_NEMMEGFELEL}); 
		 valasz=false;
	   }

if ("helyes_" + $("input[name=megoldas]").val()==$("input[name=helyes]").val() )
   {
	 setinfobubi('error27',1,_ELL_OSSZEG_OK);  
	 //$("input[name=megoldas]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 //$("input[name=megoldas]").attr({title:_ELL_OSSZEG_OK});
   }
 else
   {setinfobubi('error27',2,_JELSZO_ELL_WRONG);  
	// $("input[name=megoldas]").css({backgroundImage:"url(images/reg_x.png)"});
	// $("input[name=megoldas]").attr({title:_JELSZO_ELL_WRONG}); 
	 valasz=false;
   }
   
if (String($("input[name=regpassword]").val()).length >=6)
   {
	 setinfobubi('error8',1,_JELSZO_OK); 
	 //$("input[name=regpassword]").css({backgroundImage:"url(images/reg_pipa.png)"});
	 //$("input[name=regpassword]").attr({title:_JELSZO_OK});
	 
	 if ($("input[name=regpasswordagain]").val()==$("input[name=regpassword]").val() )
	   {  setinfobubi('error9',1,_JELSZO_ELL_OK);
		 //$("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 //$("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_OK});
	   }
	 else
	   { setinfobubi('error9',2,_JELSZO_ELL_EGYEZ);
		 //$("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
		 valasz=false;
	   }
   }
 else
   { setinfobubi('error8',2,_JELSZO_ELL_NUM);
	 setinfobubi('error9',2,_JELSZO_ELL_EGYEZ);
	 //$("input[name=regpassword]").css({backgroundImage:"url(images/reg_x.png)"});
	 //$("input[name=regpassword]").attr({title:_JELSZO_ELL_NUM});
	 //$("input[name=regpasswordagain]").css({backgroundImage:"url(images/reg_x.png)"});
	 //$("input[name=regpasswordagain]").attr({title:_JELSZO_ELL_EGYEZ}); 
	 valasz=false;
   }

//$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1)
if ($("input[name=regceg]").val()=="F")
  {
	

 if ($("input[name=regnev]").val()!="")
   	   {setinfobubi('error3',1,_NEV_OK);
		 //$("input[name=regnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 //$("input[name=regnev]").attr({title:_NEV_OK}); 
	   }
	 else
	   {setinfobubi('error3',2,_NEV_KOT);
		 //$("input[name=regnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regnev]").attr({title:_NEV_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regszuldat_ho]").val()=='' || $("select[name=regszuldat_ho]").val()=='' || $("select[name=regszuldat_ho]").val()=='')
 {
  setinfobubi('error12',2,_SZULDAT_KOT);	 
  valasz=false;
 }
else if (!isDate($("select[name=regszuldat_ho]").val()+'/'+$("select[name=regszuldat_nap]").val()+'/'+$("select[name=regszuldat]").val()))
{ 
 setinfobubi('error12',2,_SZULDAT_NOTVALID);
 valasz=false;
}
else if (
		 (parseInt($("input[name=xe]").val())-18<$("select[name=regszuldat]").val()) || 
		 (
		  parseInt($("input[name=xe]").val())-18==$("select[name=regszuldat]").val() && 
		  ( 
		   $("select[name=regszuldat_ho]").val()>parseInt($("input[name=xh]").val()) || 
		   ($("select[name=regszuldat_ho]").val()==parseInt($("input[name=xh]").val()) && $("select[name=regszuldat_nap]").val()>parseInt($("input[name=xn]").val()) )
		  )
		 )
		)
       {
		setinfobubi('error12',2,_SZULDAT_UNDER18);
        valasz=false;   
	   }
	 else
	   {
		setinfobubi('error12',1,_SZULDAT_OK);
	   }

/*
 if ($("input[name=regszemelyi]").val()!="")
   	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regszemelyi]").attr({title:_SZIG_OK}); 
	   }
	 else
	   {
		 $("input[name=regszemelyi]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regszemelyi]").attr({title:_SZIG_KOT}); 
		 valasz=false;
	   }

 if ($("input[name=regadoszm]").val()!="")
   	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadoszm]").attr({title:_ADOA_OK}); 
	   }
	 else
	   {
		 $("input[name=regadoszm]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadoszm]").attr({title:_ADOA_KOT}); 
		 valasz=false;
	   }
*/

/*
if ($("input[name=regirszam]").val()!="")
   	   {setinfobubi('error15',1,_IRSZ_OK);
		 //$("input[name=regirszam]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 //$("input[name=regirszam]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {setinfobubi('error15',2,_IRSZ_OK);
		 //$("input[name=regirszam]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regirszam]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }
*/
if ($("select[name=regorszag]").val()!="0" && $("select[name=regorszag]").val()!="-1")
   	   { setinfobubi('error13',1,_ORSZAG_OK);
		 //$("select[name=regvaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 // $("select[name=regvaros]").attr({title:_VAROS_OK}); 
	   }
else
        {setinfobubi('error13',2,_ORSZAG_KOT);
		 valasz=false;	
		}

/*
if ($("select[name=regvaros]").val()!="0" && $("select[name=regvaros]").val()!="")
   	   { setinfobubi('error14',1,_VAROS_OK);
		 //$("select[name=regvaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 // $("select[name=regvaros]").attr({title:_VAROS_OK}); 
	   }
else
      {
	   if ($("select[name=regvaros]").val()=="-1")
          {
		  if ($("input[name=regevaros]").val()!="")
		    {setinfobubi('error14',1,_VAROS_OK);
			 //$("select[name=regvaros]").css({backgroundColor:"#5cbc67"});
		     //$("select[name=regvaros]").attr({title:_VAROS_OK});	
		     //$("input[name=regevaros]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     //$("input[name=regevaros]").attr({title:_VAROS_OK}); 
			}
		  else
		   {setinfobubi('error14',2,_VAROS_KOT);
		    //$("select[name=regvaros]").css({backgroundColor:"#ed1f24"});
		    //$("select[name=regvaros]").attr({title:_VAROS_KOT}); 
			//$("input[name=regevaros]").css({backgroundImage:"url(images/reg_x.png)"});
		    //$("input[name=regevaros]").attr({title:_VAROS_KOT});
		    valasz=false;
	       }
	     }
	   else 
	   {setinfobubi('error14',2,_VAROS_KOT);
		 //$("select[name=regvaros]").css({backgroundColor:"#ed1f24"});
		 //$("select[name=regvaros]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }
	  }

if ($("input[name=regutca]").val()!="")
   	   {setinfobubi('error16',1,_UTCA_OK);
		  //$("input[name=regutca]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  //$("input[name=regutca]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {setinfobubi('error16',2,_UTCA_KOT);
		 //$("input[name=regutca]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regutca]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	*/   
/*
 if ($("input[name=regszlasz1]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz1]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz1]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz1]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz1]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz1]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
 
 if ($("input[name=regszlasz2]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz2]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz2]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz2]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz2]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz2]").attr({title:"A bankszámlaszám mező kitöltése kötelező!"}); 
		    valasz=false;
	      }
		  
	if ($("input[name=regszlasz3]").val()!="")
   	   { IsBank=true;
	     if ($("input[name=regszlasz3]").val().length!=8)
		    IsBank=false;
			
	     for (i = 0; i < $("input[name=regszlasz3]").val().length && IsBank == true; i++) 
           { 
            Char = $("input[name=regszlasz3]").val().charAt(i); 
            if (ValidCharsBANK.indexOf(Char) == -1) 
              {
               IsBank = false;
              }
           }		 
         if (IsBank)
		   {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"}); 
	       }
		else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám hibás formátumu!"}); 
		    valasz=false;
	      }
	   }
	    else
	       {
		    $("input[name=regszlasz3]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=regszlasz3]").attr({title:"A bankszámlaszám mező megfelelően ki van töltve!"});
	      }	  
 */
 
    
   } //msz ellenörzés vége
  else
  {  //ceg ellenörzés
	  
if ($("input[name=regcnev]").val()!="")
   	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcnev]").attr({title:_CEGN_OK}); 
	   }
	 else
	   {
		 $("input[name=regcnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcnev]").attr({title:_CEGN_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regcjsz]").val()!="")
   	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regcjsz]").attr({title:_CEGSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regcjsz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regcjsz]").attr({title:_CEGSZ_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regadosz]").val()!="")
   	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regadosz]").attr({title:_ADO_OK}); 
	   }
	 else
	   {
		 $("input[name=regadosz]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regadosz]").attr({title:_ADO_KOT}); 
		 valasz=false;
	   }

if ($("input[name=regirszamc]").val()!="")
   	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamc]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosc]").val()!="0" && $("select[name=regvaroscc]").val()!="-1")
   	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosc]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosc]").val()=="-1")
          {
		  if ($("input[name=regevarosc]").val()!="")
		    {
			 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosc]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosc]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosc]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosc]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosc]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosc]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }


if ($("input[name=regutcac]").val()!="")
   	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcac]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcac]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcac]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }
	   
if ($("input[name=regirszamp]").val()!="")
   	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_OK}); 
	   }
	 else
	   {
		 $("input[name=regirszamp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regirszamp]").attr({title:_IRSZ_KOT}); 
		 valasz=false;
	   }

if ($("select[name=regvarosp]").val()!="0" && $("select[name=regvaroscp]").val()!="-1")
   	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("select[name=regvarosp]").attr({title:_VAROS_OK}); 
	   }
	 else
	   if ($("select[name=regvarosp]").val()=="-1")
          {
		  if ($("input[name=regevarosp]").val()!="")
		    {
			 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("select[name=regvarosp]").attr({title:_VAROS_OK});	
		     $("input[name=regevarosp]").css({backgroundImage:"url(images/reg_pipa.png)"});
		     $("input[name=regevarosp]").attr({title:_VAROS_OK}); 
			}
		  else
		   {
		    $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
			$("input[name=regevarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=regevarosp]").attr({title:_VAROS_KOT});
		    valasz=false;
	   }
		  }
	   else 
	   {
		 $("select[name=regvarosp]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("select[name=regvarosp]").attr({title:_VAROS_KOT}); 
		 valasz=false;
	   }


if ($("input[name=regutcap]").val()!="")
   	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regutcap]").attr({title:_UTCA_OK}); 
	   }
	 else
	   {
		 $("input[name=regutcap]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regutcap]").attr({title:_UTCA_KOT}); 
		 valasz=false;
	   }	   
  
  } //ceges ellenörzés vége

/*if ($("input[name=regtel]").val()!="")
   	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=regtel]").attr({title:_TEL_OK}); 
	   }
	 else
	   {
		 $("input[name=regtel]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=regtel]").attr({title:_TEL_KOT}); 
		 valasz=false;
	   }*/
/*
 if ($("input[name=sponsorkod]").val()!="")
   	   { 
	     
        Char = $("input[name=sponsorkod]").val().charAt(0);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
        Char = $("input[name=sponsorkod]").val().charAt(1);		
        if (ValidCharsB.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(2);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false;}
		Char = $("input[name=sponsorkod]").val().charAt(3);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false; }  
		Char = $("input[name=sponsorkod]").val().charAt(4);		
        if (ValidChars.indexOf(Char) == -1) 
           {jo = false;  } 
		Char = $("input[name=sponsorkod]").val().charAt(5);		
        if (ValidChars.indexOf(Char) == -1) 
          { jo = false;  } 
   
		if (jo)
   	       {		   
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_pipa.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_OK}); 
	       }
	    else
	       {
		    $("input[name=sponsorkod]").css({backgroundImage:"url(images/reg_x.png)"});
		    $("input[name=sponsorkod]").attr({title:_AKOD_WRONG}); 
		    valasz=false;
	       }		 
	   }
*/

if ($("input[name=regnicknev]").val()!="")
   	   {setinfobubi('error5',1,_NICK_OK);
		 //$("input[name=regnick]").css({backgroundImage:"url(images/reg_pipa.png)"});
		 // $("input[name=regnick]").attr({title:_NICK_OK}); 
	   }
	 else
	   {setinfobubi('error5',2,_NICK_KOT);
		// $("input[name=regnick]").css({backgroundImage:"url(images/reg_x.png)"});
		 //$("input[name=regnick]").attr({title:_NICK_KOT}); 
		 valasz=false;
	   }

 a=$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1);
 
 return valasz;
}

function bovitett_tagsend(){
		
if (bovitett_tagform_validate())
  {
	       
		
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=regpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  
		  sregemail:$("input[name=regemail]").val(),
		  sregemailagain:$("input[name=regemailagain]").val(),
		  sregpassword:$("input[name=regpassword]").val(),
		  sregpasswordagain:$("input[name=regpasswordagain]").val(),
		  snicknev:$("input[name=regnicknev]").val(),
		  sregnem:$("input[name=regffino]").serialize().substring($("input[name=regffino]").serialize().indexOf('=')+1),
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  
		  sregszuldat_nap:$("select[name=regszuldat_nap]").val(),
		  sregszuldat_ho:$("select[name=regszuldat_ho]").val(),
		  sregszuldat:$("select[name=regszuldat]").val(),
		  //sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  megoldas:'helyes_'+$("input[name=megoldas]").val(),
		  helyes:$("input[name=helyes]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1)
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_MEGEROSITES);
			   $("#dialog").dialog('option','buttons',{                    
                     "Megerősítés": function() { 
                         $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_FOLYAMATBAN);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
		$.post("index.php?content=user&cmd=regpost", 
        { sregusername:$("input[name=regnev]").val(),
		  sregcnev:$("input[name=regcnev]").val(),
		  sregnem:$("input[name=regffino]").serialize().substring($("input[name=regffino]").serialize().indexOf('=')+1),
		  sregceg:$("input[name=regceg]").serialize().substring($("input[name=regceg]").serialize().indexOf('=')+1),
		  sregcjsz:$("input[name=regcjsz]").val(),
		  sregadosz:$("input[name=regadosz]").val(),
		  sregadoszm:$("input[name=regadoszm]").val(),
		  sregszemelyi:$("input[name=regszemelyi]").val(),
		  snicknev:$("input[name=regnicknev]").val(),
		  sregemail:$("input[name=regemail]").val(),
		  sregemailagain:$("input[name=regemailagain]").val(),
		  sregpassword:$("input[name=regpassword]").val(),
		  sregpasswordagain:$("input[name=regpasswordagain]").val(),
		  sregszuldat_nap:$("select[name=regszuldat_nap]").val(),
		  sregszuldat_ho:$("select[name=regszuldat_ho]").val(),
		  sregszuldat:$("select[name=regszuldat]").val(),
		  //sregajanlokod:$("input[name=sponsorkod]").val(),
		  
		  sregvaros:$("select[name=regvaros]").val(),
		  sregevaros:$("input[name=regevaros]").val(),
		  sregirszam:$("input[name=regirszam]").val(),
		  sregorszag:$("select[name=regorszag]").val(),
		  sregutca:$("input[name=regutca]").val(),
		  
		  megoldas:'helyes_'+$("input[name=megoldas]").val(),
		  helyes:$("input[name=helyes]").val(),

          sregvarosc:$("select[name=regvarosc]").val(),
		  sregevarosc:$("input[name=regevarosc]").val(),
		  sregirszamc:$("input[name=regirszamc]").val(),
		  sregorszagc:$("select[name=regorszagc]").val(),
		  sregutcac:$("input[name=regutcac]").val(),
		  
		  sregvarosp:$("select[name=regvarosp]").val(),
		  sregevarosp:$("input[name=regevarosp]").val(),
		  sregirszamp:$("input[name=regirszamp]").val(),
		  sregorszagp:$("select[name=regorszagp]").val(),
		  sregutcap:$("input[name=regutcap]").val(),

		  sregtel:$("input[name=regtel]").val(),
		  sregmobil:$("input[name=regmobil]").val(),
		  sregmit:$("input[name=regmit]").serialize().substring($("input[name=regmit]").serialize().indexOf('=')+1),
		  sreghol:$("input[name=reghol]").val(),
		  sregosszeg:$("input[name=regosszeg]").serialize().substring($("input[name=regosszeg]").serialize().indexOf('=')+1),
		  sregosszegb:$("input[name=regosszegb]").serialize().substring($("input[name=regosszegb]").serialize().indexOf('=')+1),
		  sregfizmod:$("input[name=regfizmod]").serialize().substring($("input[name=regfizmod]").serialize().indexOf('=')+1),
		  sregkedvezmeny:$("input[name=regkedvezmeny]").val(),
		  sregprivacy:$("input[name=regprivacy]").serialize().substring($("input[name=regprivacy]").serialize().indexOf('=')+1),
		  vegleges:1,
		  regpont:1
		},
        function(response) {
			
			if (response.indexOf('<!--HIBA-->')==-1)
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_SIKERES);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");hopp(\"index.php?content=user&cmd=login&regstatus=1\");}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});"); 
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
            
        }   
    );
                     },
					 "Módosít": function() { 
                         $(this).dialog("close");
                     } });
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_REGABLAK_TITLE_HIBA);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
	         
  }
 else
  {
	
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',300);
			   $("#dialog").dialog('option','height',200);
			   $("#dialog").dialog('option','title',_HIANYZOADATOK_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");$.scrollTo('#adatlapformbox',1000)}});");
               $("#dialog").dialog().html(_HIANYZOADATOK_CONTENT);
			   $("#dialog").dialog('open');  
  }
 
}

function telefonellenor()
{
	   $("#dialog").dialog('option','modal',true);
	   $("#dialog").dialog('option','resizable',false);
	   $("#dialog").dialog('option','width',600);
	   $("#dialog").dialog('option','height',400);
	   $("#dialog").dialog('option','title','');
	   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
	   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
	   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=profile&op=savetelell", 
        { 
		  telnum:$("input[name=regtel]").val()
		},
        function(response) {
			    
			   var myObject_x = eval('(' + response + ')');
			   
			   if (myObject_x.st=='1')
			     {
					$("#ellnumtel").show(); 
				 }
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',600);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
				 $("#dialog").dialog().html(myObject_x.msg).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
        }   
    );
}

function ellchk(num)
{
if ($("input[name=regtel]").val()==num)
  {
    $("#ellnumtel").hide();
	$("#elbutt").hide();
  }
else
  {
	$("#elbutt").show();
  }
}

function tombolaresend(tid)
{
 	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',250);
			   $("#dialog").dialog('option','title',_RESEND_IN_PROGRESS);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
	
	$.get("index.php?content=user&cmd=tombolaresend&tid="+tid, 
        function(response) {
			     $("#dialog").dialog('option','modal',true);
			$("#dialog").dialog('option','resizable',false);
			$("#dialog").dialog('option','width',400);
			$("#dialog").dialog('option','height',250);
			$("#dialog").dialog('option','title','Tombolajegy újraküldése!');
			eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
		    $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
			$("#dialog").dialog('open');
			  }
    );
	
}


function adomanyatszamol()
{
$("#adosszeg").html(parseInt($("select[name=addarab]").val())*parseInt($("#addbar").html()));
return false;
}

function setpublikus(id){
$.post("index.php?content=user&cmd=setpub&aid="+id,
        
        function(response) {
			window.location.reload();
			}	);
}

function onlynumber(id)
{
var s,sx;
var ValidChars = ".0123456789";
s=$("#"+id).val();	
sx="";
for (i = 0; i < s.length;i++) 
   { 
            Char = s.charAt(i); 
            if (ValidChars.indexOf(Char) != -1) 
              {
               sx=sx+Char;
              }
   }
$("#"+id).val(sx);
}

function tisztit(str)
{
var s,sx;
var ValidChars = ".0123456789";
s=str;	
sx="";
for (i = 0; i < s.length;i++) 
   { 
            Char = s.charAt(i); 
            if (ValidChars.indexOf(Char) != -1) 
              {
               sx=sx+Char;
              }
   }
return sx;
}

function tombolakalkulator(xid,id,arf,curr)
{var sid,t_e,t_szja,t_eho,t_vagyill,t_ajill,t_um,t_km,t_p2p,t_sumaj,t_sumszja,t_sumtert,t_jot,t_sumterteuro,t_szamitottktg;

t_e=parseInt(tisztit($("input[name=tertek]").val()));
t_szja=Math.round(t_e/100*32);
t_eho=0; //Math.round(t_e/100*11);
t_p2p=Math.round(t_e/100*25);
t_jot=Math.round(t_e/100*1);
t_x1=Math.round(t_e/100*5);  
//marketing
t_x2=Math.round(t_e/100*3);
//etc...
//summa 66%
t_km=30000;
sid=''+id;
switch (sid){
 case '1': t_vagyill = Math.round(t_e/100*8);
	
		if (t_e>35000000)
		  {t_ajill= Math.round((t_e-35000000)/100*30)+5370000;}
		else if (t_e>18000000)
		       {t_ajill= Math.round((t_e-18000000)/100*21)+1800000;}
			 else
			   {t_ajill= Math.round(t_e/100*10);}
         t_um=Math.round((t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_jot)/100*1);
		 
	t_sumszja=t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_um+t_jot;
	t_sumaj=0; //t_e+t_ajill+t_szja+t_p2p+t_km+t_um;
	
	$("input[name=tccm]").val("");
	$("input[name=tccm]").attr("readonly","readonly");
	$('#ccmsor').hide();
	$("#t_ajill").html(bepontoz(t_ajill,' ')+" "+curr);
	$("#t_sumaj").html(bepontoz(t_sumaj,' ')+" "+curr);
    if (t_sumszja>t_sumaj)
	  {t_sumtert=t_sumszja;}
    else
	  {t_sumtert=t_sumaj;}
		 break;
 case '2':
        t_vagyill =Math.round(t_e/100*10);
		
		if (t_e>35000000)
		 { t_ajill= Math.round((t_e-35000000)/100*40)+8880000;}
		else if (t_e>18000000)
		       {t_ajill= Math.round((t_e-18000000)/100*30)+3780000;}
			 else
			   {t_ajill= Math.round(t_e/100*21);}
 
    t_um=Math.round((t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_jot)/100*1);
	t_sumszja=t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_um+t_jot;
	t_sumaj=0; // t_e+t_ajill+t_szja+t_p2p+t_km+t_um;
	
	$("input[name=tccm]").val("");
	$('#ccmsor').hide();
	$("input[name=tccm]").attr("readonly","readonly");
	$("#t_ajill").html(bepontoz(t_ajill,' ')+" "+curr);
	$("#t_sumaj").html(bepontoz(t_sumaj,' ')+" "+curr);
    if (t_sumszja>t_sumaj)
	  {t_sumtert=t_sumszja;}
    else
	  {t_sumtert=t_sumaj;}
         break;
 case '3': 
        if (parseInt(tisztit($("input[name=tccm]").val()))>0)
		  {
		if (parseInt(tisztit($("input[name=tccm]").val()))>1889)
		  { t_vagyill = Math.round(parseInt(tisztit($("input[name=tccm]").val()))*24*2);}
		else
		  { t_vagyill = Math.round(parseInt(tisztit($("input[name=tccm]").val()))*18*2);}
		$('#ccmsor').show();
		if (!$("input[name=tertek]").attr("readonly"))
		  $("input[name=tccm]").attr("readonly","");
		$("input[name=tccm]").css("background","none");
	    $("#t_ajill").html("-");
        $("#t_sumaj").html("-");
	    t_um=Math.round((t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_jot)/100*1);
	    t_sumszja=t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_um+t_jot;
        t_sumtert=t_sumszja;  
		  }
		else
		  { $("input[name=tccm]").css("background-color","#ff0000");
		    if (!$("input[name=tertek]").attr("readonly"))
			  $("input[name=tccm]").attr("readonly","");
			$('#ccmsor').show();
			$("#t_ajill").html("-");
            $("#t_sumaj").html("-");
			t_vagyill=0; 
			t_um=0;
			t_sumszja=0;
			t_sumtert=0;
		  }
		break;
 case '4': 
        if (parseInt(tisztit($("input[name=tccm]").val()))>0)
		  {
		if (parseInt(tisztit($("input[name=tccm]").val()))>499)
		   {t_vagyill = Math.round(parseInt(tisztit($("input[name=tccm]").val()))*2*24);}
		else
		   {t_vagyill = Math.round(parseInt(tisztit($("input[name=tccm]").val()))*2*18);}
        if (!$("input[name=tertek]").attr("readonly"))
		  $("input[name=tccm]").attr("readonly",""); 
		$('#ccmsor').show();
	    $("input[name=tccm]").css("background","none");
		$("#t_ajill").html("-");
        $("#t_sumaj").html("-");
	    t_um=Math.round((t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_jot)/100*1);
	    t_sumszja=t_e+t_vagyill+t_eho+t_szja+t_p2p+t_km+t_um+t_jot;
        t_sumtert=t_sumszja;
		}
		else
		  { 
		  $("input[name=tccm]").css("background-color","#ff0000");
		  if (!$("input[name=tertek]").attr("readonly"))
		    $("input[name=tccm]").attr("readonly","");
		  $('#ccmsor').show();
			$("#t_ajill").html("-");
            $("#t_sumaj").html("-");
			t_vagyill=0; 
			t_um=0;
			t_sumszja=0;
			t_sumtert=0;
		  }
         break;
 case '5'://single, multi
    t_vagyill =0;
    t_sumszja=t_e+t_szja+t_p2p+t_x1+t_x2+t_jot;
	t_sumaj=0; // t_e+t_ajill+t_szja+t_p2p+t_km+t_um;
	
	$("input[name=tccm]").val("");
	$('#ccmsor').hide();
	$("input[name=tccm]").attr("readonly","readonly");
	$("#t_ajill").html(bepontoz(t_ajill,' ')+" "+curr);
	$("#t_sumaj").html(bepontoz(t_sumaj,' ')+" "+curr);
    if (t_sumszja>t_sumaj)
	  {t_sumtert=t_sumszja;}
    else
	  {t_sumtert=t_sumaj;}
         break;
 case '6'://steplisit
	     t_sumtert=Math.ceil(parseFloat(t_e*(1+($("input[name=thaszon]").val()/100))));
		 t_szamitottktg=Math.floor($("input[name=treklamktgalap]").val()/65)*65;
         break;
 case '7'://zero
    t_vagyill =0;
    t_sumszja=t_e+t_szja+t_p2p+t_x1+t_x2+t_jot;
	t_sumaj=0; // t_e+t_ajill+t_szja+t_p2p+t_km+t_um;
	
	$("input[name=tccm]").val("");
	$('#ccmsor').hide();
	$("input[name=tccm]").attr("readonly","readonly");
	$("#t_ajill").html(bepontoz(t_ajill,' ')+" "+curr);
	$("#t_sumaj").html(bepontoz(t_sumaj,' ')+" "+curr);
    if (t_sumszja>t_sumaj)
	  {t_sumtert=t_sumszja;}
    else
	  {t_sumtert=t_sumaj;}
         break;
}
//var kreditertek=180;
//var europerkredit=kreditertek/arf;
//t_sumterteuro=Math.round(t_sumtert/arf);
t_sumterteuro=t_sumtert;

//tombola kiszamitasa
if (!$("input[name=tertek]").attr("readonly"))
{
 /*if (xid=="tszam") 
   {
    $("input[name=tar]").val(roundNumber(t_sumterteuro/parseInt(tisztit($("input[name=tszam]").val())),2));	
   }
 else
   {*/
   if (sid==6)
     {
	  var tmpszam=Math.ceil(t_sumterteuro/65)*65;
      $("input[name=tszam]").val(tmpszam);
	  $("input[name=treklamktg]").val(t_szamitottktg);	
      $("#t_jatekalap").html(bepontoz(tmpszam-t_szamitottktg,' ')+" "+curr);
	 }
   else
     {
  	  var tmpszam=Math.ceil(t_sumterteuro/parseFloat(tisztit($("input[name=tar]").val())*arf));
      $("input[name=tszam]").val(tmpszam);	
	 }
   //}
}
// kiszamolt értékek kiiratása
$("input[name=tertek]").val(bepontoz($("input[name=tertek]").val(),' '));
$("input[name=tccm]").val(bepontoz($("input[name=tccm]").val(),' '));
$("input[name=tar]").val(bepontoz($("input[name=tar]").val(),' '));
$("input[name=tszam]").val(bepontoz($("input[name=tszam]").val(),' '));	
$("input[name=treklamktg]").val(t_szamitottktg);	



$("#t_szja").html(bepontoz(t_szja,' ')+" "+curr);
$("#t_eho").html(bepontoz(t_eho,' ')+" "+curr);
$("#t_vagyill").html(bepontoz(t_vagyill,' ')+" "+curr);
$("#t_um").html(bepontoz(t_um,' ')+" "+curr);
$("#t_km").html(bepontoz(t_km,' ')+" "+curr);
$("#t_p2p").html(bepontoz(t_p2p,' ')+" "+curr);
$("#t_jot").html(bepontoz(t_jot,' ')+" "+curr);
$("#t_sumtert").html(bepontoz(t_sumtert,' ')+" "+curr);
$("#t_sumterteuro").html(bepontoz(t_sumterteuro,' ')+curr);
$("#t_sumszja").html(bepontoz(t_sumszja,' ')+" "+curr);

}

function bepontoz2(Number, separator, CommaSeperaterList)
       {
               //My array
               if (CommaSeperaterList ==null )
			     CommaSeperaterList='3';
			   var myArray = CommaSeperaterList.split(',');

               var newNum = "";
               var newNum2 = "";
               var count = 0;

               //decimal number check
               if (Number.indexOf('.') != -1){ //number ends with a decimal point
               if (Number.indexOf('.') == Number.length-1){
               Number += "00";
               }
               if (Number.indexOf('.') == Number.length-2){ //number ends with asingle digit
               Number += "0";
               }

               var a = Number.split(".");
               Number = a[0]; //the part we will commaSeperation
               var end = '.' + a[1] //the decimal place we will ignore andadd back later
               }
               else {var end = "";}

               var q=0;
               //add the commas
               for (var k = Number.length-1; k >= 0; k--)
               {
                   ar = myArray[q]

                       var oneChar = Number.charAt(k);
                       if (count == ar)
                       {
                               newNum += separator;
                               newNum += oneChar;
                               count = 1;
                               q++;
                               continue;
                       }
                       else
                       {
                               newNum += oneChar;
                               count ++;
                       }
               } 
               //re-reverse the string
               for (var k = newNum.length-1; k >= 0; k--){
               var oneChar = newNum.charAt(k);
               newNum2 += oneChar;
       }

return newNum2 + end;
}

function bepontoz(nStr, sep)
{
	nStr += '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(nStr)) {
		nStr = nStr.replace(rgx, '$1' + sep + '$2');
	}
	return nStr;
}

function sendEnter(evt,code) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        eval(code);
        return true;
    } else {
        return false;
    }
}  

function ttrejtmutat()
{
if ($("select[name=promo]").val()=="tt")
 { $("#ttsor").show();}
else
 {$("#ttsor").hide();}
}

function promoelonezet()
{
if ($("select[name=promo]").val()=="0")
  {
	$("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',250);
			   $("#dialog").dialog('option','title',_PROMO_PREVIEW_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html(_PROMO_NOSABLON_CONTENT);
			   $("#dialog").dialog('open');  
  }
else
 {
	$("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_PREVIEW_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_PROMO_SABLONVIEW_CONTENT);
			   $("#dialog").dialog('open');  
			   
	$.post("index.php?content=user&cmd=promopreview",
							{
							 promo:$("select[name=promo]").val(),	
							 hangnem:$("select[name=hangnem]").val(),
							 tt:$("input[name=tombolatargy]").serialize(),
							 cimek:$("textarea[name=cimlista]").val()
							}	,  
        function(response) { 
		       $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_PREVIEW_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
		
			   
			   $("#dialog").dialog('open');  
                         
		});
 }
}

function sendpromo()
{ 
   if ($("select[name=promo]").val()!='0' && $("textarea[name=cimlista]").val()!='')
     {
	$("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_SEND_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_PROMO_SEND_CONTENT);
			   $("#dialog").dialog('open');  
			   
	$.post("index.php?content=user&cmd=sendpromo",
							{
							 promo:$("select[name=promo]").val(),	
							 hangnem:$("select[name=hangnem]").val(),
							 tt:$("input[name=tombolatargy]").serialize(),
							 cimek:$("textarea[name=cimlista]").val()
							}	,  
        function(response) { 
		       $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_SEND_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");window.location.reload();}});");
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
			   $("#dialog").dialog('open');  
                         
		});
	 }
else
 {
	$("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_SEND_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html(_PROMO_SENDHIBA_CONTENT);
			   $("#dialog").dialog('open');
	 
 }
}

function promoreszletek(pid)
{
	$("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_DETAIL_TITLE);
               eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_PROMO_DETAIL_CONTENT);
			   $("#dialog").dialog('open');  
			   
	$.post("index.php?content=user&cmd=promoreszletek",
							{
							 promoid:pid
							}	,  
        function(response) { 
		       $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',800);
			   $("#dialog").dialog('option','height',550);
			   $("#dialog").dialog('option','bgiframe',true);
			   $("#dialog").dialog('option','title',_PROMO_DETAIL_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
			   $("#dialog").dialog('open');  
                         
		});
}

function decode(l,shift)
{
	g = "";c = "";
	for ( i=0;i < l.length;i++)
	{c = l.charAt(i);g += String.fromCharCode( c.charCodeAt(0) - shift );}
	return g;
}

function nyilset(aktmenu)
{
 osszhossz=0;  
	 for (i=0;i<(aktmenu-1);i++)
		{   osszhossz=osszhossz+$("#"+$(".fomenu").children()[i].id).width()+2;}
    osszhossz=osszhossz+Math.round($("#"+$(".fomenu").children()[(aktmenu-1)].id).width()/2)-5;
	$(".arrd").css("marginLeft",osszhossz);
}   

function mailreg()
{
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title',_PROMO_EMAILREG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   
		$.post("includes/mailgenerator.php", 
        {},
        function(response) {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title',_PROMO_EMAILREG_TITLE);
			   eval('$("#dialog").dialog(\'option\',\'buttons\',{"'+_ELKULD_GOMB+'": function() {mailgeneratorsend($("input[name=account]").val(),$("input[name=password]").val(),$("input[name=passworda]").val())},"bezárás": function() {$(this).dialog("close");}});');
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  
            
        }   
    );
  
 
}

function mailgeneratorsend(em,p,p2)
{
 
               $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title',_PROMO_EMAILREG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
               $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
			   $("#dialog").dialog('open');
			   emil=em+"@abf.hu";
			   
		$.post("includes/mailgenerator.php?cmd=save", 
        { saccount:em,
		  spassword:p,
		  spassworda:p2
		},
        function(response) {
			
			if (response.indexOf('<!--OK-->')!=-1)
			  {$("input[name=regemail]").val(emil);
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title',_PROMO_EMAILREG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
			 else					   
			  {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title',_PROMO_EMAILREG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_ELKULD_GOMB+"\": function() {mailgeneratorsend($(\"input[name=account]\").val(),$(\"input[name=password]\").val(),$(\"input[name=passworda]\").val())},\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   
               $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			  }
            
        }   
    );
                     	
}

function bgSwap(aid,k)
{
	
if (k=='')
  {
	if ($('#adomany_'+aid).css("display")=="block")
	 { $('#adomanyt_'+aid+' .adomanytitle').css("background-image", "url(images/aukciok_info_over_active.png)");}
	else
	 {$('#adomanyt_'+aid+' .adomanytitle').css("background-image", "url(images/aukciok_info.png)");}
  }
else
if (k==2)
  {
	if ($('#adomany_'+aid).css("display")=="block")
	 { $('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_free_info_over_active.jpg)");    }
	else
	 {$('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_free_info.jpg)");}
  }
else
if (k==4)
  {
	if ($('#adomany_'+aid).css("display")=="block")
	 { $('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_closed_over.jpg)");    }
	else
	 {$('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_closed.jpg)");}
  }
else  
  {
	if ($('#adomany_'+aid).css("display")=="block")
	 { $('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_open_over.jpg)");    }
	else
	 {$('#adomanyt_'+aid+' .adomanytitle'+k).css("background-image", "url(images/aukcio_open.jpg)");}
  }
}

function orszagvallt(om,_vm1,_vm2,_im,vdiv,masol){
  $("#"+vdiv+"").html('<img src="images/loading1.gif" width="16" height="16">');
  $.post("index.php?content=user&cmd=orszagvallt", 
        { orszag:$("select[name="+om+"]").val(),
		  vm1:_vm1,
		  vm2:_vm2,
		  im:_im
		},
        function(response) {$("#"+vdiv+"").html(response);
		if (masol)
		  {$("select[name=regvarosp]").val($("select[name=regvarosc]").val());
		   $("input[name=regevarosp]").val($("input[name=regevarosc]").val());
		   $("select[name=ordervarosp]").val($("select[name=ordervaros]").val());
		   $("input[name=orderevarosp]").val($("input[name=orderevaros]").val());
		  }
		}   
    );	
}

function varosvallt(vm1,vm2,im){
  if ($("select[name="+vm1+"]").val()=='-1')
    {
	 $("input[name="+vm2+"]").show();	
	 $("input[name="+im+"]").val("");
	}
  else
    {
	$("input[name="+vm2+"]").hide();	
	$("input[name="+im+"]").val($("select[name="+vm1+"] option[value="+$("select[name="+vm1+"]").val()+"]").attr("irszam"));
	} 
}

function elofizugen(om,vdiv,t){
  $("#"+vdiv+"").html('<img src="images/loading1.gif" width="16" height="16">');
  $.post("index.php?content=user&cmd=elofizugen", 
        { orszag:$("select[name="+om+"]").val(),
		  bt:t
		},
        function(response) {$("#"+vdiv+"").html(response);
		}   
    );	
}

function rejtmutat(id)
 {
	if ($(id).css("display")=="none")
	  {$(id).show();}
	else  
	  {$(id).hide();} 
 }
 
 function ajaxFileUpload()
	{
		$("#loading")
		.ajaxStart(function(){
			$(this).show();
		})
		.ajaxComplete(function(){
			$(this).hide();
		});

		$.ajaxFileUpload
		(
			{
				url:'index.php?content=user&cmd=profile&op=fileupload',
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{//alert(data.msg);
					     $.post("index.php?content=user&cmd=profile&op=keplista", 
                         {alapkep:$("input[name=alapkep]").serialize().substring($("input[name=alapkep]").serialize().indexOf('=')+1)},
                         function(response) {$("#au_kepcontainer").html(response);});
						 
						}
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)
		
		return false;

	}



function au_keptorles(id)
{
$.post("index.php?content=user&cmd=profile&op=keplista&op2=del&id="+id, 
                         {},
                         function(response) {$("#au_kepcontainer").html(response);});	
}

function aukciotipusvalt(csokk)
{
var id=$('#aukciott').val();	
$.post("index.php?content=user&cmd=profile&op=adattoltes&id="+id+"&csokk="+csokk,{},function(response) {$("#au_adatok").html(response);});
}

function kalkulatorvalt(input,input2,csokk)
{
//alert(input);	
id=$('#'+input).val();
tt=$('#'+input2).val();

$.post("index.php?content=user&cmd=profile&op=kalktoltes",{
	   id:id,
	   tt:tt,
	   csokk:csokk
	   },function(response) {$("#au_kalk").html(response);});

}

function consolload(id)
{ 
  $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   $("#dialog").dialog('option','buttons',{});
			   $("#dialog").dialog().html('<table width="350"><tr><td align="center"><img src="images/loading.gif"/><img src="images/pixel.gif" width="1" height="250" align="middle"/></td></tr></table>').css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			   
  $.get("index.php?content=aukcio&cmd=consolinit&aid="+id, 
        function(response) {hopp('index.php?content=aukcio&cmd=consol');}   
    );	
}

function langchg()
{ 
  $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_SELECT_LANG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   $("#dialog").dialog().html('<table width="350"><tr><td align="center"><img src="images/loading.gif"/><img src="images/pixel.gif" width="1" height="250" align="middle"/></td></tr></table>').css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
  
  $.get("index.php?content=chlg", 
        function(response) {
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title',_SELECT_LANG_TITLE);
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
        }   
    );	
}

function ak_test(ajanlokod,varos,nomsgwin)
{
  $.post("index.php?content=user&cmd=aktest",
							{
							 ak:ajanlokod,	
							 v:varos
							}	,  
        function(response) { 
		       
			   if (response.indexOf('<!--HIBA-->')==-1 || nomsgwin)
			     {
				   return true; 	 
				 }
			   else
			     {
				   $("#dialog").dialog('option','modal',true);
				   $("#dialog").dialog('option','resizable',false);
				   $("#dialog").dialog('option','width',800);
				   $("#dialog").dialog('option','height',550);
				   $("#dialog").dialog('option','bgiframe',true);
				   $("#dialog").dialog('option','title',_AJANLOKOD_ELLENORZES);
				   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
				   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				   $("#dialog").dialog('open'); 
				   return true;
				 }
		});	
}


var vlicit_array=new Array();
var licitszam_fut=0;
var licitszam_nincsvege=true;
var trigger_call=false;
var licitszam_leker_fut=false;
function licitszaminit(direct)
{
 if (((licitszam_fut==0 && licitszam_nincsvege ) || direct) && !licitszam_leker_fut)
   {
	licitszam_fut+=1;
	
	$('#frisskep').attr("src","images/loading3.gif");	
    $('#consol').contents().find('frisskep').attr("src","images/loading3.gif");
	
	licitszam_leker_fut=true;
	
	$.get("site/consolrq.php",function(response) {
		//json értelmezése
		var myObject_x = eval('(' + response + ')');				
		//ha vége akkor nem kell tovább lekérdezni 
		if (myObject_x.vege)
		  {
			licitszam_nincsvege=false;
			return false;
		  }
		//megtett licitek számának kiiratása  
		$('#licitszaminit').css("width",myObject_x.bidnum+'px');	
		$('#consol').contents().find('#licitszaminit').css("width",myObject_x.bidnum+'px');
	    //top licitálók kirakása
		$('#topbidder').html("");
		for (x in myObject_x.t)
		  {
			$('#topbidder').append("<p class=\"topbidder"+(parseInt(x)+1)+"\">"+myObject_x.t[x].user+"</p>");  
		  }
		  
		//megváltozott licitek kezelése  
		if (myObject_x.v!='')
		  {//van megváltozott licit
		   
		   vlicitinit(myObject_x.v);
		   
		   $('#valtozas').html(vlicitkirak(vlicit_array));
		   /*
		   for (x in vlicit_array)
		     {//alert("x__"+vlicit_array[x].l)
			  $('#licitid_'+vlicit_array[x].l).attr("class","bid_state"+vlicit_array[x].s);
		     }*/
		   for (x in myObject_x.x)
		     {//alert("x__"+vlicit_array[x].l)
			  $('#licitid_'+myObject_x.x[x].l).attr("class","bid_state"+myObject_x.x[x].s);
		     }
		  }
		else
		  { //nincs megváltozott licit, tömb és box ürítése
		    vlicit_array=new Array();
			$('#valtozas').html("");  
		  }
		//frissítés kép visszaállítása  
		$('#frisskep').attr("src","images/arrow_refresh.png");	
        $('#consol').contents().find('frisskep').attr("src","images/arrow_refresh.png"); 
		licitszam_leker_fut=false;
		});	
   }
else
 { //mennyi időközönként fusson le a lekérdezés
   if (licitszam_fut<10) 
     licitszam_fut+=1;	 
   else
     licitszam_fut=0;
 }

 
}

function vlicitinit(v)
{var volt=false;
 
 for (x in v)
   {volt=false;    
	//alert(v[x].b);
	for (y in vlicit_array)
	   {//alert('y-'+vlicit_array[y].b);
		if (vlicit_array[y].b==v[x].b)
		  {volt=true;
		   vlicit_array[y].s=v[x].s;
		  }
	   }
	if (! volt)
	   {vlicit_array.push(v[x]);} 
	
   }
   
 var v_t=vlicit_array;  
 for (x in vlicit_array)
   {//alert('x-'+vlicit_array[x].b);
	volt=false;    
	if (!vlicit_array[x].a)
	  {
	   vlicit_array.splice(x,1);
	  }
	else
	  {
	for (y in v)
	   {
		if (vlicit_array[x].b==v[y].b)
		  volt=true; 
	   }
	if (! volt)
	  {
	   vlicit_array.splice(x,1);
	  }
	  }
   }  
   
}

function vlicitkirak(v)
{ var elso=true;
  var ret='';
  for(x in v)
   {if (v[x].a)
	 if (elso)
	   {
		ret=ret+' <span id=\"jlid_'+v[x].l+'\" onclick=\"swchl('+v[x].l+','+v[x].s+');\">'+v[x].b+'</span>';
		elso=false;
	   }
	 else
	   {
		ret=ret+' &bull; <span id=\"jlid_'+v[x].l+'\" onclick=\"swchl('+v[x].l+','+v[x].s+');\">'+v[x].b+'</span>';   
	   }
   }
 return ret;  
}

function swchl(id,state)
{for(x in vlicit_array)
   if (vlicit_array[x].l==id)
	   vlicit_array[x].a=false;
 for (x in vlicit_array)
    $('#licitid_'+vlicit_array[x].l).attr("class","bid_state"+vlicit_array[x].s);
 $('#valtozas').html(vlicitkirak(vlicit_array));
 $('#licitek2').stop().scrollTo(  '#licitid_'+id, 100, {offset:-122,axis:'y'} );	
 $('#consol').contents().find('#licitek2').stop().scrollTo(  '#licitid_'+id, 100, {offset:-122,axis:'y'} );
 
 $('#chindicator').show();
 $.get("index.php?content=aukcio&cmd=swchl&id="+id+"&st="+state,function(response) {$('#chindicator').hide();}); 
}

function timesync(ts)
{
 Today = new Date();
 Todays_Year = Today.getFullYear();
 Todays_Month = Today.getMonth();
 Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();	
  //alert(Todays_Date);
  //alert(ts);
var diff=Todays_Date-ts;
//alert(diff);
var today=new Date();

today.setTime(diff);
var ora=today.getHours();
var perc=today.getMinutes();
var mp=today.getSeconds();

var ev=today.getFullYear();
var ho=today.getMonth()+1; //(today.getMonth()+1)%12
var nap=today.getDate();
mp=checkTime(mp);
perc=checkTime(perc);
ora=checkTime(ora);
ho=checkTime(ho);
nap=checkTime(nap);
var txt="<span class=\"tfdatum\">"+ev+"."+ho+"."+nap+"</span><span class=\"tftime\">"+ora+":"+perc+":"+mp+"</span>";
// add a zero in front of numbers<10
 $('#timeff').html(txt); 
}

var STR_PAD_LEFT = 1;
var STR_PAD_RIGHT = 2;
var STR_PAD_BOTH = 3;
 
function pad(str, len, pad, dir) {
 
	if (typeof(len) == "undefined") { var len = 0; }
	if (typeof(pad) == "undefined") { var pad = ' '; }
	if (typeof(dir) == "undefined") { var dir = STR_PAD_LEFT; }
 
	if (len + 1 >= str.length) {
 
		switch (dir){
 
			case STR_PAD_LEFT:
				str = Array(len + 1 - str.length).join(pad) + str;
			break;
 
			case STR_PAD_BOTH:
				var right = Math.ceil((padlen = len - str.length) / 2);
				var left = padlen - right;
				str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
			break;
 
			default:
				str = str + Array(len + 1 - str.length).join(pad);
			break;
 
		} // switch
 
	}
 
	return str;
 
}
function countdown_clock(year, month, day, hour, minute,servertimestamp, format)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear();
         Todays_Month = Today.getMonth();
		 
         //Computes the time difference between the client computer and the server.
         Server_Date = servertimestamp;
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
		 var tzo=(new Date().getTimezoneOffset()+60)*60000;
         //alert(month);
         countdown(year, month, day, hour, minute, (Todays_Date - Server_Date - tzo), format);
         }
		 
function countdown(year, month, day, hour, minute, time_difference, format)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear();
         Todays_Month = Today.getMonth();

         //Convert today's date and the target date into miliseconds.

         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
         Target_Date = (new Date(year, month-1, day, hour, minute, 00)).getTime();

         //Find their difference, and convert that into seconds.
         //Taking into account the time differential between the client computer and the server.
        
		 Time_Left = Math.round((Target_Date - Todays_Date + time_difference) / 1000);
         //Time_Left = Math.round((Target_Date - time_difference) / 1000);
         var ok=true;
		 if(Time_Left < 0)
           {ok=false;
		    if (!trigger_call)
			  {trigger_call=true;
		       $.get("index.php?content=aukcio&cmd=openclosetrigger",function(response) {
			      hopp_up('index.php?content=aukcio&cmd=consol');
		        });
			  }
			else
			  hopp_up('index.php?content=aukcio&cmd=consol');
			  
			Time_Left = 0;
		   }
         switch(format)
               {
               case 0:
                    //The simplest way to display the time left.
                    $('#consol').contents().find('#countdown').html(Time_Left + ' seconds');
					$('#countdown').html(Time_Left + ' seconds');
                    break;
               case 1:
                    //More datailed.
                    days = Math.floor(Time_Left / (60 * 60 * 24));
                    Time_Left %= (60 * 60 * 24);
                    hours = Math.floor(Time_Left / (60 * 60));
                    Time_Left %= (60 * 60);
                    minutes = Math.floor(Time_Left / 60);
                    Time_Left %= 60;
                    seconds = Time_Left;

                    dps = 's'; hps = 's'; mps = 's'; sps = 's';
                    //ps is short for plural suffix.
                    if(days == 1) dps ='';
                    if(hours == 1) hps ='';
                    if(minutes == 1) mps ='';
                    if(seconds == 1) sps ='';

                    $('#consol').contents().find('#countdown').html( days + ' nap '+pad(''+hours,2,'0') + ':'+ pad(''+minutes,2,'0') + ':'+ pad(''+seconds,2,'0'));
					$('#countdown').html( days + ' nap '+pad(''+hours,2,'0') + ':'+ pad(''+minutes,2,'0') + ':'+ pad(''+seconds,2,'0'));
                    break;
               default:
                    $('#consol').contents().find('#countdown').html(Time_Left + ' seconds');
					$('#countdown').html(Time_Left + ' seconds');
               }

         //Recursive call, keeps the clock ticking.
         if (ok)
		   {
		   setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' +
                     time_difference + ', ' + format + ');', 1000);
		 
		   licitszaminit(false);
		   }
         }
		 
function countdown_clock2(year, month, day, hour, minute,sec,servertimestamp, format,target)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear();
         Todays_Month = Today.getMonth();
         //Computes the time difference between the client computer and the server.
         Server_Date = servertimestamp;
         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
		 var tzo=(new Date().getTimezoneOffset()+60)*60000;
          
         countdown2(year, month, day, hour, minute,sec, (Todays_Date - Server_Date - tzo), format,target);
         }
		 
function countdown2(year, month, day, hour, minute,sec, time_difference, format,target)
         {
         Today = new Date();
         Todays_Year = Today.getFullYear();
         Todays_Month = Today.getMonth()+1;

         //Convert today's date and the target date into miliseconds.

         Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(),
                                 Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();
         Target_Date = (new Date(year, month-1, day, hour, minute, sec)).getTime();

         //Find their difference, and convert that into seconds.
         //Taking into account the time differential between the client computer and the server.
        
		 Time_Left = Math.round((Target_Date - Todays_Date + time_difference) / 1000);
         
		 //Time_Left = Math.round((Target_Date - time_difference) / 1000);
         if(Time_Left < 0)
            Time_Left = 0;

         switch(format)
               {
               case 0:
                    //The simplest way to display the time left.
					$('#'+target).html(Time_Left + ' seconds');
                    break;
               case 1:
                    //More datailed.
                    days = Math.floor(Time_Left / (60 * 60 * 24));
                    Time_Left %= (60 * 60 * 24);
                    hours = Math.floor(Time_Left / (60 * 60));
                    Time_Left %= (60 * 60);
                    minutes = Math.floor(Time_Left / 60);
                    Time_Left %= 60;
                    seconds = Time_Left;

                    dps = 's'; hps = 's'; mps = 's'; sps = 's';
                    //ps is short for plural suffix.
                    if(days == 1) dps ='';
                    if(hours == 1) hps ='';
                    if(minutes == 1) mps ='';
                    if(seconds == 1) sps ='';
					$('#'+target).html( days + ' nap '+pad(''+hours,2,'0') + ':'+ pad(''+minutes,2,'0') + ':'+ pad(''+seconds,2,'0'));
                    break;
               default:
					$('#'+target).html(Time_Left + ' seconds');
               }

         //Recursive call, keeps the clock ticking.
         setTimeout('countdown2(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + sec + ',' +
                     time_difference + ', ' + format + ', \'' + target + '\');', 1000);
         }		 
		 
function sendbid()		 
{ var bidx=$('#bid').val();
  $('#bid').val("");
  $('#consol').contents().find('#bid').val("");
  vlicit_array=new Array();
 $.post("index.php?content=aukcio&cmd=sendbid",
							{
							 bid:bidx	
							}	,  
        function(response) { 
			   //var myObject = JSON.parse(response);
			   var myObject = eval('(' + response + ')');
			   if (myObject.success)
			     {
				   $('.licitlista').html("");
				   $('#consol').contents().find('.licitlista').html("");
				   lastszam=0;lastindikator=true;
				   for (x in myObject.l)
				     {
					  if (myObject.l[x].last)
					    {classplusz=" bigbid ";lastindikator=false;}
					  else
					    {classplusz="";
						 if(lastindikator)
						   {
							lastszam++;   
						   }
						}
				      
					  $('.licitlista').append("<li class=\"bid_state"+myObject.l[x].state+" "+classplusz+"\" id=\"licitid_"+myObject.l[x].lid+"\">"+myObject.l[x].bid+"</li>");
					  $('#consol').contents().find('.licitlista').append("<li class=\"bid_state"+myObject.l[x].state+" "+classplusz+"\">"+myObject.l[x].bid+"</li>");
					  
					 }
				   
				   $('#megtettproba').html(myObject.pl);
				   $('#megtettlicit').html(myObject.lsz);
				   
				   $('#consol').contents().find('#megtettproba').html(myObject.pl);
				   $('#consol').contents().find('#megtettlicit').html(myObject.lsz);
				   if (myObject.proba)
				     {
						 $('.consol_bid_button span').html(_PROBALICIT);
						 $('#consol').contents().find('.consol_bid_button span').html(_PROBALICIT);
					 }
				   else
				     {
						$('.consol_bid_button span').html(_LICIT); 
						$('#consol').contents().find('.consol_bid_button span').html(_LICIT);
					 }
				   $('#esemenykontenter1').append("<p>"+myObject.e+"</p>");
				   $('#esemenykontenter').stop().scrollTo(  '#esemenykontenter2', 1000, {axis:'y'} );
				   
				   $('#consol').contents().find('#esemenykontenter1').append("<p>"+myObject.e+"</p>");
				   $('#consol').contents().find('#esemenykontenter').stop().scrollTo(  '#esemenykontenter2', 1000, {axis:'y'} );
				   //alert(lastszam);
				   lastszam=lastszam*24;
				   //alert(lastszam);
				   $('#licitek').stop().scrollTo(  lastszam+'px', 100, {axis:'y'} );
				   $('#licitek2').stop().scrollTo(  lastszam+'px', 100, {axis:'y'} );
				   
				   $('#bid').focus();
				   $('#consol').contents().find('#licitek').stop().scrollTo(  lastszam+'px', 100, {axis:'y'} );
				   $('#consol').contents().find('#licitek2').stop().scrollTo(  lastszam+'px', 100, {axis:'y'} );
				   $('#consol').contents().find('#bid').focus();
				   
				 }
			   else
			     {
				  $('#esemenykontenter1').append("<p>"+myObject.error+"</p>");
				  $('#esemenykontenter').stop().scrollTo(  '#esemenykontenter2', 1000, {axis:'y'} );
				  $('#bid').focus();
				  $('#consol').contents().find('#esemenykontenter1').append("<p>"+myObject.error+"</p>");
				  $('#consol').contents().find('#esemenykontenter').stop().scrollTo(  '#esemenykontenter2', 1000, {axis:'y'} );
				  $('#consol').contents().find('#bid').focus();
				  
				  if(myObject.extra=='tiltas')
				    {
					 
					 $('#bid').attr("readonly","readonly");	
					 $('.consol_bid_bl').click(function(){alert(_MARMINDENLICITETMEGTETTEL);});
					 $('#bid').onkeyup(function(){alert(_MARMINDENLICITETMEGTETTEL);});
					 
					 
					 $('#consol').contents().find('#bid').attr("readonly","readonly");	
					 $('#consol').contents().find('.consol_bid_bl').click(function(){alert(_MARMINDENLICITETMEGTETTEL);});
					 $('#consol').contents().find('#bid').onkeyup(function(){alert(_MARMINDENLICITETMEGTETTEL);});
					}
				  }
		});		
 	
}
function sendEnter(evt,code) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) {
        eval(code);
        return true;
    } else {
        return false;
    }
} 

function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function loadingindicator() {
    
} 

function movieupplay(id,w,h)
{
  
	           $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',w+20);
			   $("#dialog").dialog('option','height',h+100);
			   $("#dialog").dialog('option','title','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(\"#dialog\").dialog().html(\"\");$(this).dialog(\"close\");}});");
               $("#dialog").dialog().html('<center><div style="width: '+w+'px; height: '+h+'px;" id="player"></div></center>');
			   //$("#dialog").dialog().html('<center><div style="width: 720px; height: 452px;" id="player"><object width="100%" height="100%" type="application/x-shockwave-flash" data="includes/media/flowplayer-3.0.7.swf" id="player_api"><param name="movie" value="includes/media/flowplayer-3.0.7.swf"/><param value="true" name="allowfullscreen"/><param value="always" name="allowscriptaccess"/><param value="high" name="quality"/><param value="#000000" name="bgcolor"/><param value=\'config={"clip":{"url":"'+id+'"},"playlist":[{"url":"'+id+'"}]}\' name="flashvars"/></object></div></center>');
			   
			   $("#dialog").dialog('open'); 
              flowplayer("player", "includes/media/flowplayer-3.0.7.swf",id); 
}


function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}

function inq(cls,id)
{
$('.'+cls).hide();
if (id!='')
  {
	$('#'+id).show();  
  }
}

function sendform(form)
{
$('#'+form).submit();	
}

function noCTRL(evt)
{ 
 

  switch (event.keyCode) {
    case 82:
        if(event.ctrlKey) {
            alert("aaaa");    
        }
        break;
  }
} 

function paymethodselect(id)
{$('#paymentmode_CC').hide();
 $('#paymentmode_PP').hide();
 $('#paymentmode_WT').hide();
 $('#paymentmode_'+id).show();
	
}

function setfizmod(id)
{
$('#paymentmode_CC').hide();
 $('#paymentmode_PP').hide();
 $('#paymentmode_WT').hide();
 $('#paymentmode_'+id).show();	
$('#paymenttype_'+id).attr("checked","checked");	
}

function setcredit(id,p,amt)
{
$('#'+id).attr("checked","checked");
$('#psms1').hide();
$('#psms2').hide();
$('#psms3').hide();
$('#pbank').hide();
$('#'+p).show();
$('#ktip').html(''+amt);
}

function consolload(id)
{ 
  $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',400);
			   $("#dialog").dialog('option','title','');
			   $("#dialog").dialog('option','buttons',{});
			   $("#dialog").dialog().html('<table width="350"><tr><td align="center"><img src="images/loading.gif"/><img src="images/pixel.gif" width="1" height="250" align="middle"/></td></tr></table>').css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			   
  $.get("index.php?content=aukcio&cmd=consolinit&aid="+id, 
        function(response) {hopp('index.php?content=aukcio&cmd=consol');}   
    );	
}
var nick="";
function nickreq(id,tipus)
{ 
  loadingWindow();
  if (id==1)
    {
     $.get("index.php?content=user&cmd=nickreq&op=1&tip="+tipus, 
        function(response) {
			
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',400);
			   $("#dialog").dialog('option','height',300);
			   $("#dialog").dialog('option','title','');
			   $("#dialog").dialog('option','buttons',{"Elküld":function(){nick=$("input[name=nickname]").val();orszag=$("select[name=orszag]").val();nickreq(2,tipus);}});
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
			
			
			}   
       );	
    }
  else
    {
     $.post("index.php?content=user&cmd=nickreq&op=2&tip="+tipus,
			{
			 nick:nick,
			 orszag:orszag
			},
        function(response) {
			
			  if (response.indexOf('<!--ERROR-->')==-1)
			    {$("#dialog").dialog("close");
				 $("#dialog").dialog('option','modal',true);
			     $("#dialog").dialog('option','resizable',false);
			     $("#dialog").dialog('option','width',400);
			     $("#dialog").dialog('option','height',300);
			     $("#dialog").dialog('option','title','');
			     $("#dialog").dialog('option','buttons',{"Bezár":function(){$("#dialog").dialog('close');}});
			     $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			     $("#dialog").dialog('open');
				}
			 else
			    {$("#dialog").dialog("close");
				 $("#dialog").dialog('option','modal',true);
			     $("#dialog").dialog('option','resizable',false);
			     $("#dialog").dialog('option','width',400);
			     $("#dialog").dialog('option','height',300);
			     $("#dialog").dialog('option','title','');
			     $("#dialog").dialog('option','buttons',{"Elküld":function(){nick=$("input[name=nickname]").val();orszag=$("select[name=orszag]").val();nickreq(2,tipus);}});
			     $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			     $("#dialog").dialog('open');
				}
			
			}   
       );	
    }
}
/**********************SIMULATOR******************************/
var siminit=false;

function init_simulation()
{
var Today = new Date();
var d = new Date(Today.getTime()+180000);

Todays_Year = d.getFullYear();
Todays_Month = d.getMonth();	
countdown_simulator(Todays_Year, Todays_Month+1, d.getDate(), d.getHours(), d.getMinutes(), 0, 1);
siminit=true;
}

function onloadfv()
{
	//FB.Canvas.setAutoResize();
}

function shownormallogin()
{
 $("#loginopen").hide();	
 $("#fblogin").hide();	
 $("#normallogin").show();	
}

function showfblogin()
{
 $("#loginopen").show();	
 $("#fblogin").hide();	
 $("#normallogin").hide();	
}

