/**
 * Failsafe console.log/debug +  mapping to $.log
 * 
 */
if (!window.console) {
	window.console = { log: function(){}, debug: function(){} };
	$.log = function(){};
} else {
	if (window.console.debug) {
		if  (window.console.firebug) {
			$.log = console.debug;
		} else {
			$.log = function(obj) { console.debug(obj) };
		}
	} else if (window.console.log) {
		$.log = console.log;
	} else {
		$.log = function(){};
	}
}


function flashObject(strFlash, intWidth, intHeight, strId, strWMode, strBGColor, strQuality, strAlign, strNoFlash) {
	document.write('<object type="application/x-shockwave-flash" data="'+strFlash+'" width="'+intWidth+'" height="'+intHeight+'">');
 	document.write('<param name="movie" value="'+strFlash+'" />');
 	document.write('<param name="wmode" value="'+strWMode+'" />');
 	document.write('<param name="quality" value="'+strQuality+'" />');
 	document.write(strNoFlash);
 	document.write('</object>'); 
}


var p = {};

p.common = {
		
	pageEnhanceIE: function() {
		
		// rounded corners (http://jquery.malsup.com/corner/)
		if (typeof $.fn.corner == 'function') {
			$('.tag a').wrapInner('<span/>').corner('3px');
			$('html').addClass('corner-active');
		}
		
	}

}

p.menu = {

init: function() {
	
	$(".dropContent").not(".active").hide();
		
		$(".dropMenu span.label").addClass('clickable');
		//$(".dropMenu span.label").parent().parent().children(".dropContent").not("[.active]").hide();	
		
		// dropmenu - voor maand genre
		
		$(".dropMenu.maandgenreMenu span.label").click(function() {
			$(".dropMenu").children(".dropContent").not($(this).parent().parent().parent().children(".dropContent")).hide();
			$(this).parent().parent().parent().children(".dropContent").slideToggle();		
			
			$(this).parent().toggleClass('active');
			
		});
		
		// dropmenu - menu
		
		$(".dropMenu.menuItem span.label").click(function() {
			$(".dropMenu").children(".dropContent").hide();		
			$(this).parent().parent().children("ul.dropContent").slideToggle();
			
			$(this).parent().toggleClass('active');
			
		});
		
		$(".dropMenu span.label").mouseover(function() {
			$(this).addClass('activeLabel');		
		});
		$(".dropMenu span.label").mouseout(function() {
			$(this).removeClass('activeLabel');		
		});
	}

}; /* /menu */

p.share = {

init: function() {
	var popWin = null;
	$('#eventShare .share .facebook a').click(function(e){
		var $this = $(this);
		if (popWin && !popWin.closed) {
			popWin.focus();
		}
		else {
			popWin = window.open($this.attr('href'), 'facebookShare', 'toolbar=0, status=0, width=626, height=436');
		}
		e.preventDefault();
	});
}

};


$(function(){
	// anchors (external/popup)
	$("a[rel='external']").click(function(){
		window.open(this.href);
		return false
	});
});




/**
 * Image Overlay
 * 
 * @version 1.0.0
 * @author LzzL
 * 
 * jQuery 1.2.6
 */

$(function(){
	
// Browser indicator
	if ($.browser.mozilla && parseFloat($.browser.version))
	$("body").addClass("FireFox");	
	
	
	
	
/**
 * list items hover
 * 
 */
	// MouseOver effect op submit buttons
	$('input.txtLink').hover(function() {
  		$(this).addClass('txtLinkHover');
 	}, function() {
	  	$(this).removeClass('txtLinkHover');
 	}); 
	$('input.submit').hover(function() {
  		$(this).addClass('btnHover');
 	}, function() {
	  	$(this).removeClass('btnHover');
 	});	
	$('.forgetButton').click(function() {
	  	$('#forgetBox').toggle('slow');
	  	return false;
 	}); 
 	
	// div blokken linken
	$('div.highlight').hover(function() {
  		$(this).addClass('hover');
		$(this).find('a.leesMeer').addClass('hover');
 	}, function() {
	  	$(this).removeClass('hover');
		$(this).find('a.leesMeer').removeClass('hover');
 	});
	$('div.highlight').click(function(){
		sHref = $(this).find('a.leesMeer').attr('href');
		window.location.href = sHref;	
	});	
	$('div.highlight a').click(function(e){
		e.stopPropagation();
	});


	
	/**
	 * Voorstellingen list items
	 * 
	 */
	$('.highlight li').hover(function(){
		$(this).addClass('hover');
		$(this).find('a.leesMeer').addClass('hover');
	},function(){
		$(this).removeClass('hover');
		$(this).find('a.leesMeer').removeClass('hover');
	});

	$('.highlight li .txtLink').hover(function(){
		$(this).parents('li').find('a.leesMeer').removeClass('hover');
	},function(){
		$(this).parents('li').find('a.leesMeer').addClass('hover');
	});

	$('.highlight li').click(function(){
		sHref = $(this).find('a.leesMeer').attr('href');
		window.location.href = sHref;	
	});	
	
	/**
	 * account landenlijst insert divider
	 * 
	 */
	if($('#land').length > 0)
	{
		$('#land').html($('#land').html().replace('<option value="AFG">', '<option value="DIVIDER">&nbsp;---&nbsp;</option><option value="AFG">'));
	}
});

