function getObject( Id )
{
    if ( document.getElementById )	return document.getElementById( Id );
    else if ( document.layers )	 return document.layers( Id );
    else if ( document.all )	 return document.all[ Id ];
    return false;
}


function copyFields(fromArray,toArray){
    for ( var i in fromArray ){
        getObject(toArray[i]).value = getObject(fromArray[i]).value;
        //getObject('reg_form').toArray[i].disabled = true;
    }
}

function eraseFields(arr){
    for ( var i in arr ){
        getObject(arr[i]).value = "";
        //getObject('reg_form').arr[i].disabled = false;
    }
}

$(document).ready(function (){
	$('.keyword_to_search').click(function(){
		var keyword = $(this).attr('alt');
		$('#kereso_mezo').val(keyword);
		$('#search_form').submit();		
	});
	

});





function hirlevelFeliratkozas(emailMezoId){
	$.ajax({
		   type: "POST",
		   url: "ajax.php",
		   dataType: "json",
		   data: "hirlevelFeliratkozas=1&email="+$('#'+emailMezoId).val(),
		   beforeSend: function(){
				//$('#hirlevel_notifier').html('<img alt="Loading" src="images/loading.gif" />');
				//$('#hirlevel_notifier').fadeIn('slow',void(0));
		   	    
		   },
		   success: function(rData){
			   $('#'+emailMezoId).val('');
			   alert(rData.notify);
			   /*
			   $('#hirlevel_notifier').html(rData.notify);			   			   			   
			   setTimeout(function() {
			        $("#notifier_inner").fadeOut('slow',void(0))
			   }, 3000);*/				
		   }
		 });	
}

function hirlevelLeiratkozas(emailMezoId){
	$.ajax({
		   type: "POST",
		   url: "ajax.php",
		   dataType: "json",
		   data: "hirlevelLeiratkozas=1&email="+$('#'+emailMezoId).val(),
		   beforeSend: function(){				
				//$('#hirlevel_notifier').html('<img alt="Loading" src="images/loading.gif" />');
				//$('#hirlevel_notifier').fadeIn('slow',void(0));
		   },
		   success: function(rData){
			   $('#'+emailMezoId).val('');
			   alert(rData.notify);
			   /*
			   $('#hirlevel_notifier').html(rData.notify);			   			   
			   setTimeout(function() {
			        $("#hirlevel_notifier").fadeOut('slow',void(0))
			   }, 3000);*/
		   }
		 });	
}






function notify(html,posId){
	var windowWidth = document.documentElement.clientWidth;
	/*var windowHeight = document.documentElement.clientHeight;*/
	var _top = $('#'+posId).offset().top;
	var randomnumber=Math.floor(Math.random()*101)
	$('body').append('<div class="notifier_inner" id="notifier_'+posId+randomnumber+'">'+html+'</div>');
	
	$('#notifier_'+posId+randomnumber).css('top',_top-100);
	$('#notifier_'+posId+randomnumber).css('left',windowWidth/2-$('#notifier_'+posId+randomnumber).width()/2);
	
	$('#notifier_'+posId+randomnumber).fadeIn('slow',void(0));			   
	setTimeout(function() {
		//$('#notifier_'+posId).fadeOut('slow',void(0))
		$('#notifier_'+posId+randomnumber).remove();
	}, 3000);
	
}



function writemail(part1,part2){
	emailE=(part1 + part2); //change your email on this line
	document.write('<A href="mailto:' + emailE + '" style="color: rgb(1, 106, 158); font-weight: bold;">' + emailE + '</a>') ;
}

function writemail2(part1,part2){
	emailE=(part1 + part2); //change your email on this line
	document.write(' '+emailE) ;
}




