// jQuery avusteisia funktioita

function hiletoggle(anch)
{
	$('#' + anch).toggle("slow");
}

function hileshowon(anch)
{
	$('#' + anch).show("slow");
}

function hileshowoff(anch)
{
	$('#' + anch).hide("slow");
}

function hileshowhide(anch,anch1)
{
	$('#' + anch).show("slow");
	$('#' + anch1).hide("slow");
}

function hileshowoninline(anch)
{
	$('#' + anch).css({
		display: "inline"
	});
}
					
function hileshowoffinline(anch)
{
	$('#' + anch).css({
		display: "none"
	});
}

function hiletoggleimg(anch,imgsrc)
{
	if (document.getElementById(anch).style.display == 'block')
	{
		$('#' + anch).toggle("slow");
		document.getElementById(imgsrc).src = 'components/com_comprofiler/images/tick2.png';
	} else
	{
		$('#' + anch).toggle("slow");
		document.getElementById(imgsrc).src = 'components/com_comprofiler/images/publish_x2.png';
	}
}

function confirmRemoveBuddy(conid)
{
	if (confirm("Are you sure you want to remove this Buddy connection?"))
		location.href="index.php?option=com_comprofiler&act=connections&task=removeConnection&connectionid=" + conid;
	else
		return false ;
}

function confirmHileismdelete()
{
	if (confirm("Are you sure you want to delete this broadcast permanently?"))
		return true ;
	else
		return false ;
}

function confirmImagemoderation()
{
	if (confirm("Are you sure you want to delete both images permanently?"))
		return true ;
	else
		return false ;
}

function confirmGeneral()
{
	if (confirm("Are you sure?"))
		return true ;
	else
		return false ;
}

function submithileism()
{
	if (document.getElementById("hileism").value == 'Broadcast here...')
	{
		alert("Please write your new Broadcast");
		return false ;
	}
	else if (document.getElementById("hileism").value == '')
	{
		alert("Please write your new Broadcast");
		return false ;
	}
	else
	{
		document.getElementById("newhileismsendform").submit()
	}
}

function hilehideallbutme(anch)
{
	$('#' + anch).hide("fast");
	$(this).next().show("slow");
}

function invitemore(anch,anch1)
{
	$('#' + anch).show("slow");
	$('#' + anch1).hide("slow");
}

function sysmsgfind()
{
	if (document.getElementById("system-message"))
	{
		setTimeout("sysmsghide();", 3456);
	}
}

function sysmsghide()
{
	$("#system-message").hide("slow");
	$("#system-message").after("<span id=\"showsysmsg\" style=\"text-decoration:underline;cursor:pointer\" title=\"Show message\" onclick=\"hileshowhide('system-message','showsysmsg');\">Show message</span>");

}
