// JavaScript Document
$(document).ready(function() {


/*sfHover = function() {
	var sfEls = document.getElementById("mainmenu-list").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			sfHover();
		}
	}
}*/

	$("ul#mainmenu-list li").hover(function(){
		if($(this).children("ul").css('display') == 'none'){
			$(this).children("ul").css('display', 'block');
		}else{
			$(this).children("ul").css('display', 'none');
		}
	});

	if(document.getElementById('toggleSites'))
	{
		var sitesSlide = new Fx.Slide('siteList');
		$('toggleSites').addClass('active');
		$('toggleSites').addEvent('click', function(e){
			e.stop();
			if(!sitesSlide.open){this.addClass('active');};
			//resetSlides();
			sitesSlide.toggle();
		});

		function initSitesSlides(){
			sitesSlide.hide();
		}

		/*function resetSlides()
		{
			if (sitesSlide.open) {sitesSlide.slideOut(); $('toggleSites').removeClass('active');};
		}
		*/
		initSitesSlides();
	}

	$('.filter-resize').css({height:"100px", overflow:"hidden"});

	$('.filter-resize').mouseover(function () {
		$(this).height("100%");
	});

	$('.filter-resize').mouseout(function () {
		if ($(this).height != "100px")
		{
			$(this).height("100px");
		}
	});


    $('div.front-block:first').css('margin-left', '0px');


	if(document.getElementById('dock'))
	{
		//function()
		//{
			$('#dock').Fisheye(
				{
					maxWidth: 37,
					items: 'a',
					itemsText: 'span',
					container: '.dock-container',
					itemWidth: 65,
					proximity: 90,
					halign : 'right'
				}
			)
		//}		
	}

	//sfHover();


});

function doeIets(){
	var url = "/webshop/";
	//var type = jQuery("#type").val()+".html?";
	var type = document.getElementById("type").value+".html";
	//var model = "cycling_model="+jQuery("#model").val();
	var model = "cycling_model="+document.getElementById("model").value;
	//var merk = "cycling_brand="+jQuery("#merk").val();
	var merk = "cycling_brand="+document.getElementById("merk").value;

	
	url += type+"?";

	if (model != "cycling_model="){
		url += model+'&';
	}

	if(merk != "cycling_brand="){
		url += merk;
	}
	
	document.getElementById("vindmijnfiets").action = url;
	
	//jQuery("#vindmijnfiets").attr("action", url);
	
	if(type != ".html"){
		//jQuery(".submit-small").removeAttr('disabled');
		document.getElementById("vindmijnfietssubmit").disabled = "";
	}else{
		document.getElementById("vindmijnfietssubmit").disabled = "disabled";
		//jQuery(".submit-small").attr("disabled", "disabled");
	}
}




