jQuery.noConflict();

jQuery(function($) {
	
	//Nav IE
	if ($.browser.msie) {
		$subnav = $('#nav .subnav');
		$('li', $subnav).hoverIntent({
		     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
		     interval: 200, // number = milliseconds for onMouseOver polling interval    
		     over: function(){ $(this).addClass('hover'); }, // function = onMouseOver callback (REQUIRED)    
		     timeout: 500, // number = milliseconds delay before onMouseOut    
		     out: function(){ $(this).removeClass('hover'); } // function = onMouseOut callback (REQUIRED)    
		});
		
		if ($.browser.version == 6){
			$('.box', $subnav).each(function(){
				$(this).width($(this).prev('a').width()+16);
			});
		}
	}
	
	
	//iframe - newsletter
	// turned this off becouse gives an alert null on this page 
	// http://nhtv.nl.server85.redkiwi.nl/bachelor-opleidingen/kennismaken/brochures/brochure-aanvraag.html
	/*if($('iframe')[0]) {
		
		var iframe=$('iframe'); 
		alert( $("#Form1").html() );
   	iframe.ready(function(){
   		var form=iframe.contents().find("#Form1"); 
   		form.submit(function(){
 				alert('a');	
   		});
 		});
	}*/
	//Table
	$('table tr:odd').addClass('odd');
	
	//Tooltips
	$.fn.qtip.styles.nhtv = { // Last part is the name of the style
	   width: 200,
	   background: '#004687',
	   color: '#ffffff',
	   textAlign: 'left',
	   border: {
	      width: 10,
	      radius: 10,
	      color: '#004687'
	   },
	   tip: 'bottomRight',
	   name: 'blue' // Inherit the rest of the attributes from the preset dark style
	}
	
	$('dfn').qtip({
		position: {
      		corner: {
	        	target: 'topLeft',
	        	tooltip: 'bottomRight'
      		}
   		},
		style: { 
      		name: 'nhtv' // Inherit from preset style
   		},
   		show: 'mouseover',
   		hide: 'mouseout'
	});
	
	//Equalheights
	$categoryItemList = $('#category-list .category-item-list'); 
	for (var i=0;i<=$categoryItemList.length;i+=3){
		$categoryItemList.slice(i,i+3).find('.border-color .content').equalHeights();
	}
	
	$('#switcher #resize a').click(function() {
		setActiveStyleSheet(this.getAttribute("rel"));
		return false;
	});

	//Search Categories
	$('#searchPage').click(function(event){
		$radio = $(event.target).closest(':radio');
		if ($radio.is(':checked')){
			$('[name=tx_indexedsearch[_sections]]').val($radio.val());
			$('#tx-indexedsearch-searchbox-button-submit').click();
		}
	});
	
	
	$('#news-home-cycle').cycle({
	    fx:     'scrollUp', 
	    speed:   600, 
	    timeout: 6000
	});

	//Fancybox
	$('.galleryList a')
	.attr('rel','gallery')
	.fancybox({
		cyclic: true,
		titlePosition: 'inside',
		titleFormat: function(){
			return $(this.orig.context).next().html();
		}
	});


	
});

	

