﻿/// <reference path="~js/jquery-1.3.2.js" />

$(document).ready(function(){

	$('li.headlink').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none');
	});

    $("li.headlink").click(function()
	{
		alert('hi');
	});

    $("li.headlink__").click(function()
    {
    	if (!$(this).next(".par").is(":visible"))
    	{
    		var strID = $(this).attr("id");

    		$(this).next(".par").slideToggle("200").siblings(".par:visible").slideUp("200");

    		$(this).toggleClass("active");

    		$("#accordion h1").each(function(i)
    		{
    			if ($(this).attr("id") == strID)
    			{
    				if (strID == "search")
    				{
    					$(this).css("backgroundImage", "url(img/menu_" + strID + "_open.png)");
    					$(this).addClass("clicked");
    					// set bottom of the accordion to 'open'
       					$("#accordionbottom").css("backgroundImage", "url(img/menu_shadow_bottom_open.png)");
    				}
    			}
    			else
    			{
    				$(this).css("backgroundImage", "url(img/menu_" + $(this).attr("id") + ".png)");
    				$(this).removeClass("clicked");
    				// reset bottom of the accordion to default
    				$("#accordionbottom").css("backgroundImage", "url(img/menu_shadow_bottom.png)");
    			}
    		});

    		$(this).siblings("h1").removeClass("active");
    	}
    });




});

function toggleDiv(strDiv)
{
	$('.' + strDiv).toggle('fast');
}

function toggleCheckbox(strID)
{
	$('#' + strID).toggleClass('checkbox_unchecked');
	$('#' + strID).toggleClass('checkbox_checked');
}

function clearField(strID)
{
  if ( document.getElementById(strID).value=='trefwoord(en)' || document.getElementById(strID).value=='keyword(s)')
  {
    document.getElementById(strID).value='';
  }
}






