
$(document).ready(function() {
	$('div#panelLoginList').hide();
	$('div#panelLoginUpdate').hide();

	$('a#lnkPanelLoginList').click(function() {
		$('div#panelLoginUpdate').hide();
		$('div#panelLoginList').slideDown();
		
		$('input[type=text]#txtListNetfang').focus();
		
		return false;
	});
	
	$('a#lnkPanelLoginUpdate').click(function() {
		$('div#panelLoginList').hide();
		$('div#panelLoginUpdate').slideDown();
		
		$('input[type=text]#txtUpdateNetfang').focus();
		
		return false;
	});
	
	$('input[type=button]#btnPanelLoginListHide').click(function() {
		$('div#panelLoginList').slideUp();
		return false;
	});
	
	$('input[type=button]#btnPanelLoginUpdateHide').click(function() {
		$('div#panelLoginUpdate').slideUp();
		return false;
	});
	
	$('#frmLoginList').bind('submit', function()
	{	
		if($('#txtListNetfang').val() == '')
		{
			alert('Þú verður að fylla út netfang!');
			$('#txtListNetfang').focus();
			return false;
		}
		
		if($('#txtListLykilord').val() == '')
		{
			alert('Þú verður að fylla út lykilorð!');
			$('#txtListLykilord').focus();
			return false;
		}
	});
	
	$('#frmLoginUpdate').bind('submit', function()
	{	
		if($('#txtUpdateNetfang').val() == '')
		{
			alert('Þú verður að fylla út netfang!');
			$('#txtUpdateNetfang').focus();
			return false;
		}
		
		if($('#txtUpdateLykilord').val() == '')
		{
			alert('Þú verður að fylla út lykilorð!');
			$('#txtUpdateLykilord').focus();
			return false;
		}
	});
	
});

$(function() {
	
	$('a.lnkBlog').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " || ",
		fade: 250
	});
	
	$('a.lnkAuthor').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " || ",
		fade: 250
	});
	
	$('a.lnkNews').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " || ",
		fade: 250
	});

});

function checkSearchData()
{
	if(document.getElementById('q').value == "")
	{
		alert("Vinsamlegast sláðinn inn leitarorð!");
		document.getElementById('q').focus();
		return false;
	}

	return true;
}

function popup(url,name,windowWidth,windowHeight)
{
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;
	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, top="+mytop+",left="+myleft;

	window.open(url,name,properties)
}
