/* ================
	Navigation Main
================= */
$(document).ready(function () {
	$('#navMain ul li').hover(
		function () {
			//show its submenu
			$('ul', this).slideDown(300);
		},
		
		function () {
			//hide its submenu
			$('ul', this).fadeOut(200);			
		}
	);
});

/* ================
	Foto fades
================= */
$(document).ready(function () {

  // find the div.fade elements and hook the hover event
  $('div.fade').hover(function() {
    // on hovering over, find the element we want to fade *up*
    var fade = $('> div', this);

    // if the element is currently being animated (to a fadeOut)...
    if (fade.is(':animated')) {
      // ...take it's current opacity back up to 1
      fade.stop().fadeTo(250, 1);
    } else {
      // fade in quickly
      fade.fadeIn(250);
    }
  }, function () {
    // on hovering out, fade the element out
    var fade = $('> div', this);
    if (fade.is(':animated')) {
      fade.stop().fadeTo(3000, 0);
    } else {
      // fade away slowly
      fade.fadeOut(300);
    }
  });
});
/* ================
	Nieuwsbrief
================= */
// NIEUWSBRIEF JAVASCRIPT
// Popup-scherm voor tonen Subscribe/aanmeld-formulier.
// (c) MailingLijst, 2002-2010
// versie voor ML 3.x dd november 2009
// versie meerdere parameters dd januari 2010

function subscribe(list_ID, emailaddress, account, lastname, url) {
    var stroptions, strURL
    var lngtop, lngleft

    if (url!= null) {
	    strURL = "http://" + url + "/nieuwsbrief/subscribe/?l=" + list_ID
	}
	else {
	    strURL = "http://www.mailinglijst.eu/nieuwsbrief/subscribe/?l=" + list_ID
    };
    if (emailaddress != null) {strURL += '&e=' + emailaddress };
    if (account != null) {strURL += '&a=' + account };
    if (lastname != null) {strURL += '&n=' + lastname };

    lngtop = 50
    lngleft = 50
    stroptions = "width=400,height=500,top=" + lngtop + ",left=" + lngleft + ",scrollbars=1"
    whandle = window.open(strURL, 'MailingLijst', stroptions);
    whandle.focus();
}


/* ================
	Validate Form
	http://bassistance.de/jquery-plugins/jquery-plugin-validation/
================= */
$(document).ready(function() {
	$("#inschrijvenForm").validate();
	$("#deelnemerForm").validate();
	$("#syllabusForm").validate();
});

/* ================
	BBCode
	http://markitup.jaysalvat.com/
================= */
$(document).ready(function() {
	$("textarea.markItUp").markItUp(mySettings);
});

