$(document).ready( function() {
  
	// Dropdown menu
	ddsmoothmenu.init({
	 mainmenuid: "menu", //menu DIV id
	 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	 classname: 'ddsmoothmenu', //class added to menu's outer DIV
	 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	})
	
	//lightbox
	if($('a.lightbox').length > 0 )	{
		$('a.lightbox').lightBox();
	}

	//external window
	$('a[class="external"]').click(function() {
		this.target = "_blank";
	});

	//popup window
	$('a[class="popup"]').click(function(){
		window.open(this.href,'Popup','height=600,width=800,scrollTo,resizable=0,scrollbars=1,location=0,left=50,top=50','false');
		return false;
	});

	//close popup window link
	$('a[class="popup_close"]').click(function() {
		window.close();
		return false;
	});

	//print link
	$('a[class="print"]').click(function() {
		window.print();
		return false;
	});

	//back link
	$('a[class="back"]').click(function() {
		history.back();
		return false;
	});

	//forward link
	$('a[class="forward"]').click(function() {
		history.forward();
		return false;
	});

	//confirm link
	$('a[class="confirm"]').click(function() {
		return confirm(this.title);
	});

	//bookmark link
	$("a.bookmark").click(function(event){
		event.preventDefault();
		var url = this.href;
		var title = this.title;
		if (window.sidebar) {
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) {
			window.external.AddFavorite( url, title);
		} else {
			alert('Uw browser ondersteunt helaas niet deze optie.');
		}
	});

	//iframe replacement
	$('a[class="iframenormal"]').each(
	function (i) {
		$(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='725' height='400'></iframe>");
	});
	$('a[class="iframebig"]').each(
	function (i) {
		$(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='745' height='1800'></iframe>");
	});
	$('a[class="iframesmall"]').each(
	function (i) {
		$(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='184' height='400'></iframe>");
	});
	$('a[class="iframehuge"]').each(
	function (i) {
		$(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='1100' height='2380'></iframe>");
	});
	$('a[class="iframelong"]').each(
	function (i) {
		$(this).replaceWith("<iframe src='" + this.getAttribute("href") + "' frameborder='0' scrolling='no' width='745' height='3350'></iframe>");
	});

	//forms - focus
	$("input[type=password], input[type=text], textarea").focus(function() {
		$(this).addClass("focus");
	});
	$("input[type=password], input[type=text], textarea").blur(function() {
		if ($(this).find(".focus")) { $(this).removeClass("focus"); }
	});

	//forms - hover
	$("input.submit").hover(function() {
		$(this).addClass("hover");
	}, function() {
		$(this).removeClass("hover");
	});

	//forms - auto submit
	$(".auto_submit").change(function() {
		//this.submit();
		//window.location = $(this).val();
	});

	//forms - no javascript button
	$('.no_javascript').hide();


});

