function checkfield(idarray) {
	var long=idarray.length;
	var errors=0;
	for (i=0;i<long;i++) {

		var tiny=document.getElementById(idarray[i]);
		if (tiny.value=="") {
			tiny.className="inputred";
			errors=1;
		}
		else
			tiny.className="input";
	}
	if (errors==1) {
			alert("A mezők kitöltése kötelező!");
			return false;
	}
	else {

			return true;
	}
}
function checker(val) {
	v=document.getElementById(val);
	if (v.value=="") {
		v.className="inputred";
	}
	else
		v.className="input";
}

function poll_vote(number, poll_field, lang) {
	voter=document.getElementsByName("vote");
	answer_id=0;
	for(cnt=0;cnt<voter.length;cnt++) {
		if (voter[cnt].checked) {
			answer_id=voter[cnt].value;
			break;
		}	
	}
	$.ajax({
	  url: 'phpthings/get_poll.php',
	  data: "number="+number+"&type=vote&poll_value="+answer_id+"&lang="+lang,
	  dataType: "html",

	  success: 
		function(data){
			document.getElementById(poll_field).innerHTML=data;
		}	
	});
}
function poll_result(number, poll_field, lang) {
	$.ajax({
	  url: 'phpthings/get_poll.php',
	  data: "number="+number+"&type=result&lang="+lang,
	  dataType: "html",

	  success: 
		function(data){
			document.getElementById(poll_field).innerHTML=data;
		}	
	});
}
function add_fb_block(obj_id, link) {
	document.getElementById(obj_id).innerHTML='<iframe src="http://www.facebook.com/plugins/like.php?href='+link+'&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px; margin: 3px 20px;"></iframe>';
}
function add_head_meta(data, title) {
	$("html").attr("xmlns", "http://www.w3.org/1999/xhtml");
	$("html").attr("xmlns:fb", "http://www.facebook.com/2010/fbml");
	$("html").attr("xmlns:og", "http://opengraphprotocol.org/schema/");
	
	$('head').append('<meta property="og:title" content="'+title+'">');
	$('head').append('<meta property="og:site_name" content="'+title+'">');
	$('head').append('<meta property="og:image" content="'+data+'">');
}
/*$(document).ready(function() {
	$("html").attr("xmlns", "http://www.w3.org/1999/xhtml");
	$("html").attr("xmlns:fb", "http://www.facebook.com/2010/fbml");
	$("html").attr("xmlns:og", "http://opengraphprotocol.org/schema/");
});*/
$(document).ready(function() {
	if ($('#facepile_block'))
		$('#facepile_block').html('<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FEarth-Guards-Corporation%2F154003998002212&amp;width=190&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23BBB&amp;stream=false&amp;header=false&amp;height=300" scrolling="no" frameborder="0" style="background: url(\'sitepics/bluegray.png\'); border:none; overflow:hidden; width:186px; height:300px; margin-left: 2px;" allowTransparency="true"></iframe>');
});
