$(document).ready(function () {

	$(".readMore").click(function(){
		$(this).hide(500, function() {
			this.innerHTML='<br />';
			this.style.display='none';
		});
		$(this).next(".panelBody").slideToggle(500)
		return false;
	});

	$("#content .panelBody").hide();
	
	$(".showSpoiler").click(function(){
		$(this).hide(500, function() {
			this.innerHTML='<br />';
			this.style.display='none';
		});
		$(this).next(".spoiler").slideToggle(500)
		return false;
	});

	$("#content .spoiler").hide();
});

$(document).ready(function(){
	$('#newsPager2').galleryView({
	show_panels: false,
	show_filmstrip: true,
	panel_width: 350,
	panel_height: 300,
	frame_width: 420,
	frame_height: 305,
	frame_opacity: 1,
	filmstrip_size: 4,
	filmstrip_size: 1,
	nav_theme: 'light',
	easing: '',
    transition_speed: 800,
    transition_interval: 8000,
	panel_scale: 'crop',
	pause_on_hover: true
	});
});


function addSpoilerTag() {
	document.getElementById('comment').value+='[spoiler] [/spoiler]';
}

function addTag(tag) {
	document.getElementById('comment').value+=' ['+tag+'][/'+tag+'] ';
}

function username_0()
{
	if (document.getElementById('username').value == 'Konzol ID') {
		document.getElementById('username').value = '';
	}
}
function username_1()
{
    if (document.getElementById('username').value == '') {
		document.getElementById('username').value = 'Konzol ID';
	}
}

function password_0()
{
	if (document.getElementById('password').value == 'password') {
		document.getElementById('password').value = '';
	}
}
function password_1()
{
    if (document.getElementById('password').value == '') {
		document.getElementById('password').value = 'password';
	}	
}

function activateAvatarChange()
{
	document.getElementById('avatarChanger').innerHTML='<input name="pictureId" type="file" /><button type="submit">Feltöltés</button>';
}

function confirmDeleteTopic(id, name, forum_id)
{
var agree=confirm("Biztosan törölni szeretné a következõ fórumtémát: "+name+"?");
if (agree)
	window.location="/forum.php?action=delTopic&id="+id+'&fid='+forum_id;
else
	return false ;
}

function confirmDeleteForum(id, name)
{
var agree=confirm("Biztosan törölni szeretné a következõ fórumot: "+name+"?");
if (agree)
	window.location="/forum.php?action=delForum&id="+id;
else
	return false ;
}

function addUserbar()
{
	link=prompt("A userbar linkje:","");
	if(link!=null)
		document.getElementById('forumSign').value += '<img src="'+link+'" alt="userbar" />';
}

function modifyComment(id) {
	document.getElementById('ajaxIframe').src='/forumComment.php?id='+id;
	$('#ajaxIframe').load(function() {
		document.getElementById('commentText-'+id).innerHTML=document.getElementById('ajaxIframe').document.body.innerHTML;
	});
}

