$(function(){
	$('#nav>ul>li').hover(function(){
		$heading = $(this);
		if ($heading.siblings().find('ul:visible').size()>0)
			$heading.find('ul').hide();
		else
			$heading.find('ul').show();
	},
	function(){
		$(this).find('ul').hide();
	});
    $('#stuurvacaturedoorondervacature, #stuurvacaturedoorrechterkolom').hover(function(){
        //$.ga.trackEvent('stuurdoorknop',$(this).attr('id'));
        _gaq.push(['_trackEvent', 'stuurdoorknop', $(this).attr('id')]);
    })
    $("span.facebookreplace").each(function() {
	     $(this).replaceWith('<iframe src="'+$(this).data('src')+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px;" allowTransparency="true"></iframe>');
	});
	$("span.hyvesreplace").each(function() {
	     $(this).replaceWith('<iframe src="'+$(this).data('src')+'" style="border: medium none; overflow:hidden; width:120px; height:21px;" scrolling="no" frameborder="0" allowTransparency="true"></iframe>');
	});
});

jQuery.fn.clearonfocus = function() {
	jQuery(this)
	.bind('focus', function() {
		// Set the default value if it isn't set
		if ( !this.defaultValue ) this.defaultValue = this.value;
		// Check to see if the value is different
		if ( this.defaultValue && this.defaultValue != this.value ) return;
		// It isn't, so remove the text from the input
		this.value = '';
	})
	.bind('blur', function() {
	// If the value is blank, return it to the defaultValue
	if ( this.value.match(/^\s*$/) )
		this.value = this.defaultValue;
	});
};

function goThereSales(form){
    var linkList=form.selectThisSales.selectedIndex
    if(!linkList==""){window.location.href=form.selectThisSales.options[linkList].value;}
}


function goThereDistribution(form){
    var linkList=form.selectThisDistribution.selectedIndex
    if(!linkList==""){window.location.href=form.selectThisDistribution.options[linkList].value;}
}
