//doc ready
var reemail=false;
//var curvyCornersNoAutoScan = true;
//var curvyCornersVerbose = 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();
		});
	
    $(".topcikkcycle").cycle({fx:"fade",timeout:5000,speed:2000});
/*
    $("#regszuldat").datepicker();
	$('#regszuldat').datepicker('option', 'dateFormat', 'yy.mm.dd');
	$('#regszuldat').datepicker('option', 'monthNames', ['Január','Február','Marcuis','Április','Május','Június','Július','Augusztus','Szeptember','Október','November','December']);
	$('#regszuldat').datepicker('option', 'monthNamesShort', ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Szept','Okt','Nov','Dec']);
	$('#regszuldat').datepicker('option', 'dayNames', ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat']);
	$('#regszuldat').datepicker('option', 'dayNamesMin', ['V', 'H', 'K', 'Sz', 'Cs', 'P', 'Szo']);
	$('#regszuldat').datepicker('option', 'dayNamesShort', ['V', 'H', 'K', 'Sz', 'Cs', 'P', 'Szo']);
	$('#regszuldat').datepicker('option', 'firstDay', 1);
	$('#regszuldat').datepicker('option', 'maxDate', '+0m +0w');
	$('#regszuldat').datepicker('option', 'changeMonth', true);
	$('#regszuldat').datepicker('option', 'changeYear', true);
*/
/****************old**************************************/
		   
	if ($('#l_password').val()!='')
	  { $('#jelszofedel').hide();}
	  
    if ($('#l_password2').val()!='')
	  { $('#jelszofedel2').hide();} 
 
    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('$("#dialog3").dialog({modal:true,resizable:false,title:"",autoOpen: false,overlay: {opacity: 0.2,background: "black"},buttons: {"'+_BEZARAS_GOMB+'": function() {$(this).dialog("close");}}})');
	
	$(".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");
	});
	
   $("#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');
				})
	});

   
								 
				$('.menuflack', this).mouseover(function() {
								$("#floatmenu").css("z-index", "3");
								$(".menuflack").css("background-image", "url(images/bal_menu_02.png)");	
								$("#mnugomb").css("background-image", "url(images/bal_menu_01.png)");
								$(this).children('div#floatmenuelem:hidden').slideDown('fast');
				})
				$('.menuflack').hover(function() {
								
				},
				function() {    
				                $(".menuflack").css("background-image", "none");
				                $("#mnugomb").css("background-image", "none");
								$(this).children('div#floatmenuelem:visible', this)
												.hide();
								$("#floatmenu").css("z-index", "1");
				})

         $('#center_cont', this).mouseover(function() {
								if ($("div#floatmenuelem").css("display")=='block')
								  {
								$(".menuflack").css("background-image", "none");
				                $("#mnugomb").css("background-image", "none");
								$('.menuflack').children('div#floatmenuelem:visible', this).hide();
								$("#floatmenu").css("z-index", "1");
								  }
				})
		 $('#right_cont', this).mouseover(function() {
								if ($("div#floatmenuelem").css("display")=='block')
								  {
								$(".menuflack").css("background-image", "none");
				                $("#mnugomb").css("background-image", "none");
								$('.menuflack').children('div#floatmenuelem:visible', this).hide();
								$("#floatmenu").css("z-index", "1");
								  }
				})
         $('#t_container', this).mouseover(function() {
								if ($("div#floatmenuelem").css("display")=='block')
								  {
								$(".menuflack").css("background-image", "none");
				                $("#mnugomb").css("background-image", "none");
								$('.menuflack').children('div#floatmenuelem:visible', this).hide();
								$("#floatmenu").css("z-index", "1");
								  }
				})

  $('#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();
   
   fixPng();
   logBoxInput();
   nlBoxInput();
   
  $.scrollTo.defaults.axis = 'xy';
  var loc=window.location+'';
  var locs=loc.substring(loc.length-9).toUpperCase();
  if (locs!='INDEX.PHP' && locs!='NDEX.PHP?' && locs!='ICIT.COM/' && locs!='LICIT.COM')
    $.scrollTo('#content',1000, {'offset': {'top':-30, 'left':0} });
});

$(window).scroll(function () { 
    var ns = (navigator.appName.indexOf("Netscape") != -1);
	var IE = document.all?true:false
	//var y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
	var y = !IE ? pageYOffset  : document.documentElement.scrollTop ;	
	  if (y>530)
	    {
	     var y1=y-530+40;
		}
	  else
	    {
		 var y1=40;	
		}
		$("#floatmenu").stop().animate({ 
              top: y1+"px"
  }, 200 );
		     
    });

function playerinit()
{
	/*document.getElementById("mp3player").SetVariable("player:jsUrl", "mediatar/ml_cse.mp3");
	$("#big_img").mouseover(function(){
		   document.getElementById("mp3player").SetVariable("player:jsPlay", "");
		});
	$("#big_img").mouseout(function(){
		   document.getElementById("mp3player").SetVariable("player:jsStop", "");
		});*/
	
}
function playsignal()
{
		   document.getElementById("mp3player").SetVariable("player:jsUrl", "http://www.multilicit.com/mediatar/ml_jingle.mp3");
		   document.getElementById("mp3player").SetVariable("player:jsPlay", "");
}

function applyTextHeight() {
		var maxHeight = 0;
            maxHeight = 0;
            $(".ctcontent_s").each(function() {
                if($(this).height() > maxHeight)                                         
                    maxHeight = $(this).height();
            });
            $(".ctcontent_s").height(maxHeight);
	}

function m()
{
	$('#tavtarto').height($(this).height()-$(this).parent().parent().height());	
	$(this).parent().parent().height($(this).height());
}

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 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);}
    });
    
	ertek2=$("#l_username2").val();
    $("#l_username2").bind("click focus", function() {
        if($(this).val() == ertek2)
           { $(this).val("");}    
    }).blur(function() {
        if($(this).val() == "")
            {$(this).val(ertek2);}
    });
	
	$("#jelszofedel").click(function() {
        $(this).hide();
        $("#l_password").focus();
    });
    $("#l_password").blur(function() {
        if($(this).val() == "") 
            {$("#jelszofedel").show();}
    }).focus(function() {
        $("#jelszofedel").hide();
    });
	
	$("#jelszofedel2").click(function() {
        $(this).hide();
        $("#l_password2").focus();
    });
	
    $("#l_password2").blur(function() {
        if($(this).val() == "") 
            {$("#jelszofedel2").show();}
    }).focus(function() {
        $("#jelszofedel2").hide();
    });
 }
function nlBoxInput() {
	erteknl=$("#nl_nev").val();
    $("#nl_nev").bind("click focus", function() {
        if($(this).val() == erteknl)
           { $(this).val("");}    
    }).blur(function() {
        if($(this).val() == "")
            {$(this).val(erteknl);}
    });
    
	ertek2nl=$("#nl_email").val();
    $("#nl_email").bind("click focus", function() {
        if($(this).val() == ertek2nl)
           { $(this).val("");}    
    }).blur(function() {
        if($(this).val() == "")
            {$(this).val(ertek2nl);}
    });
 }
 
function docHeight() {
      
	   if (window.innerHeight-window.document.height>0)	
  {$('#tavtarto').height(window.innerHeight-window.document.height-15);}	

    }
	
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 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 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 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 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 validatearticle()
{
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;
	   }

    if (emailCheck($("input[name=kfemail]").val()))
   	   {
		   $("input[name=kfemail]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=kfemail]").attr({title:_EMAIL_MEGFELEL}); 
	   }
	 else
	   {
		 $("input[name=kfemail]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=kfemail]").attr({title:_EMAIL_FORM_KOTELEZO}); 
		 valasz=false;
	   }
	   
    if ($("input[name=kfnev]").val()!='')
   	   {
		  $("input[name=kfnev]").css({backgroundImage:"url(images/reg_pipa.png)"});
		  $("input[name=kfnev]").attr({title:_NEVED_OK}); 
	   }
	 else
	   {
		 $("input[name=kfnev]").css({backgroundImage:"url(images/reg_x.png)"});
		 $("input[name=kfnev]").attr({title:_NEVED_KOTELEZ}); 
		 valasz=false;
	   }

 return valasz;
}

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 ajanljminket2(){
		
			$("#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");}});
		    $("#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:"auto"});
		    $("#dialog").dialog('open');
			
			if (validateajalnat())
						   {
							$.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) {
							 $("input[name=nev1]").val('');
							 $("input[name=email1]").val('');
							 $("input[name=nev2]").val('');
							 $("input[name=email2]").val('');
							 $("input[name=nev3]").val('');
							 $("input[name=email3]").val('');
							 $("input[name=nev4]").val('');
							 $("input[name=email4]").val('');
							 $("input[name=nev5]").val('');
							 $("input[name=email5]").val('');
								$("#dialog").html(response);});
						   }
}

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 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())
						   {$("button:contains('elküld')").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 sendArticle(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', 'Link küldése');
	    eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {}});");
	    $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
	    $("#dialog").dialog('open');
		
		$.get("index.php?content=cikk&cmd=sendarticle&aid="+id, 
        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','Link küldése');
				$("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");                         
                          }
						  
						  , 
					 "elküld": function() {
						 
						 if (validatearticle())
						   {
							$("button:contains('elküld')").remove();
							//$("#dialog").dialog().html('Küldés folyamatban, kérem várjon...');
							$.post("index.php?content=cikk&cmd=sendarticlepost&aid="+id,
							{
							 knev:$("input[name=knev]").val(),	
							 kemail:$("input[name=kemail]").val(),
							 kfnev:$("input[name=kfnev]").val(),	
							 kfemail:$("input[name=kfemail]").val(),
							 kmsg:$("textarea[name=kmsg]").val()
							}	,  
        function(response) { 
		                 $("#dialog").html(response);
                         
		});
						   }
						 }
						  
                });
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"auto"});
				 $("#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 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 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 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 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());
		  }
		}   
    );	
}

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 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','');
			   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','');
			   eval("$(\"#dialog\").dialog('option','buttons',{\""+_BEZARAS_GOMB+"\": function() {$(this).dialog(\"close\");}});");
			   $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   $("#dialog").dialog('open');
        }   
    );	
}

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 roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

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 sendform(form)
{
$('#'+form).submit();	
}

function fontG()
{fs=parseInt($('#cikk_content').css("font-size"));
 if (fs<18)
   fs++;
 $('#cikk_content').css("font-size",fs+"px");
}

function fontL()
{fs=parseInt($('#cikk_content').css("font-size"));
 if (fs>13)
   fs--;
 $('#cikk_content').css("font-size",fs+"px");
}

function simulator()
{ 
               $("#dialog3").dialog('option','modal',true);
			   $("#dialog3").dialog('option','resizable',false);
			   $("#dialog3").dialog('option','width',685);
			   $("#dialog3").dialog('option','height',600);
			   $("#dialog3").dialog('option','title','Aukciószimulátor');
			   $("#dialog3").dialog('option','buttons',{"Bezár":function(){$("#dialog3").dialog('close');}});
			   $("#dialog3").dialog().html('<table width="630"><tr><td align="center"><img src="images/loading.gif"/><img src="images/pixel.gif" width="1" height="450" align="middle"/></td></tr></table>').css({width:"auto", overflowX:"scroll"});
			   fut=true;
			   $("#dialog3").dialog('open');
			   
  $.get("index.php?content=aukcio&cmd=simulator", 
        function(response) {
			   $("#dialog3").dialog('option','modal',true);
			   $("#dialog3").dialog('option','resizable',false);
			   $("#dialog3").dialog('option','width',685);
			   $("#dialog3").dialog('option','height',600);
			   $("#dialog3").dialog('option','title','Aukciószimulátor');
			   $("#dialog3").dialog('option','buttons',{"Bezár":function(){$("#dialog3").dialog('close');}});
			   $("#dialog3").dialog().html(response).css({width:"auto", overflowX:"scroll"});
			   if (response.indexOf('<!--NOUSER-->')==-1)
			     {
			   $( "#dialog3" ).bind( "dialogclose", function(event, ui) {
				   stopsimulator();
});
				 }
			   $("#dialog3").dialog('open');
			}   
    );	
}

function newslettersubscription(){
var nev=	$("input[name=nl_nev]").val();
var email=	$("input[name=nl_email]").val();

if (nev!='' && emailCheck(email))
  {     
	   $("#dialog").dialog('option','modal',true);
	   $("#dialog").dialog('option','resizable',false);
	   $("#dialog").dialog('option','width',300);
	   $("#dialog").dialog('option','height',200);
	   $("#dialog").dialog('option','title','Hírlevél feliratkozás');
	   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
	   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
	   $("#dialog").dialog('open');
			   
		$.post("index.php?content=user&cmd=newsletterpolicy", 
        { hnev:nev,
		  hemail:email
		},
        function(response) {
			   $("input[name=nl_nev]").val("");
               $("input[name=nl_email]").val("");
			   $("input[name=nl_nev]").blur();
			   $("input[name=nl_email]").blur();
			   $("#dialog").dialog('option','modal',true);
			   $("#dialog").dialog('option','resizable',false);
			   $("#dialog").dialog('option','width',300);
			   $("#dialog").dialog('option','height',200);
			   $("#dialog").dialog('option','title',_MEGEROSITES);
			   $("#dialog").dialog('option','buttons',{                    
                     
					 "Bezár": function() { 
                         $(this).dialog("close");
                     } });
			   /*
			   "Feliratkozá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','Hírlevél feliratkozás');
					   $("#dialog").dialog('option','buttons',{"bezárás": function(){}});
					   $("#dialog").dialog().html(_REGABLAK_KEREM_VARJON);
					   $("#dialog").dialog('open');
		$.post("index.php?content=user&cmd=newsletterpolicypost", 
        { hnev:nev,
		  hemail:email
		},
        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','Hírlevél feliratkozás');
			   $("#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','Hírlevél feliratkozás');
			   $("#dialog").dialog('option','buttons',{                    
                     "bezárás": function() { 
                         $(this).dialog("close");
                        
                     } }); 
				 $("#dialog").dialog().html(response).css({width:"auto", overflowX:"scroll"});
				 $("#dialog").dialog('open');
			  }
            
        }   
    );
                     },
			   */
			   
			   
               $("#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','Hírlevél feliratkozás');
			   $("#dialog").dialog('option','buttons',{"bezárás": function(){$(this).dialog("close");}});
               $("#dialog").dialog().html('A megadott adatokkal nem tudsz feliratkozni hírlevelünkre.<br><br>A feliratkozáshoz kérlek add meg a neved és az e-mail címed!');
			   $("#dialog").dialog('open');  
  }
 
}

function poll(url,target){
	
	    $.ajax({url: url, 		    
		   success: function(response){$(target).html(response);}, 
		   dataType: "html",
		   beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");}
		   });
}
function setCustomRadio(pollul,radioinput,answerid,onkep,offkep)
{
 	$("#"+radioinput).val(answerid);
	$("#"+pollul+" li").each(function(){$(this).css("background","url("+offkep+") no-repeat left 9px");});
    $("#pollaid_"+answerid).css("background","url("+onkep+") no-repeat left 9px");
	$("#pollelkuldgomb").show();
}

function vote(radioinput,pollid,target)
{
	$.ajax({url: "index.php?content=poll&cmd=voteit&pid="+pollid+"&aid="+$("#"+radioinput).val(), 		    
		   success: function(response){$(target).html(response);}, 
		   dataType: "html",
		   beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");}
		   });
}

function directvote(button,aid,pollid)
{   var target='#pollbox';
    
	$("#c_"+button).html('<img src="images/loading3.gif" alt="loading..." />');
	$.ajax({url: "index.php?content=poll&cmd=voteit&pid="+pollid+"&aid="+aid, 		    
		   success: function(response){
			   $.scrollTo(target,1000, {'offset': {'top':-50, 'left':0} });
			   $(target).stop().css("background-color", "#FFFF9C")
.animate({ backgroundColor: "#FFFFFF"}, 2000);
			   $(target).html(response);
			   $("#c_"+button).hide();
		   }, 
		   dataType: "html",
		   beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");}
		   });
}

function polllist(target)
{
	$.ajax({url: "index.php?content=poll&cmd=polllist", 		    
		   success: function(response){$(target).html(response);}, 
		   dataType: "html",
		   beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");}
		   });
}

