/**
 * Main javascript file for YPSYLON CMS 5.3
 * @author n.vugteveen@multimove.nl
 * @version 1.0 (14-01-2011)
 * @copyright Multimove 2011
 */
 var the_event = null;
 var last_fired = null;
$(document).ready(
				   function(){
						$('nav').show();
						$('.over_container').bind("mouseenter mouseleave",function(event){		
																				   
													   if(event.type == 'mouseenter' && (last_fired == "mouseleave" || last_fired == null)){
													   		$(this).find('.over_img').effect('slide',{direction:'down', mode:'show'});
															last_fired = 'mouseenter';
															//console.log(event.type);
													   }
													   else if(event.type == 'mouseleave' && last_fired == "mouseenter"){
													   		$(this).find('.over_img').effect('slide',{direction:'down', mode:'hide'});
															last_fired = 'mouseleave';
															//console.log(event.type);
													   }
													   return false;
													});
						$('.over_container').click(function(){
										   	document.location = $(this).children('a').attr('href');
										   });
						
						$('#45').hide();
						$('#48').hide();
						$('#50').hide();
						$('#51').hide();
						$('#62').hide();
						
						$('.submit_btn').click(function(){
										   	$(this).parent('form').trigger('submit');
										   });
						
						//make the logo clickable
						$('h1#logo').click(
										   function()
										   {
												document.location = BASE_URL;
										   }
										   );
						
						
						/*Enable rel="external" as a replacement for target="_blank" attributes*/
 					 	$("a[rel*='external']").attr('target','_blank');  
						
						//enable search
						$('form[role=search]').submit(
								   function()
								   {
									   document.location = BASE_URL+'nl/search/search/search_string,'+$('input[name=searchquery]').val();
									   return false;
								   }
								   );
						
						$('#menuid45').parent().qtip({
						   position: {
							  corner: {
								 target: 'bottomMiddle',
								 tooltip: 'topMiddle'
							  },
							  adjust: {
								  y:-10
								  }
						   },
						   hide: { fixed: true, delay: 200 },
						   style: {
							   name: 'green',
							   tip: {
								   	corner: 'topMiddle',
									size : {x:25,y:14}
								   },
							   width: {
								   //min: 270
								   }
							   },
						   
						   content: $('#45')
						});
						
						$('#menuid48').parent().qtip({
						   position: {
							  corner: {
								 target: 'bottomMiddle',
								 tooltip: 'topMiddle'
							  },
							  adjust: {
								  y:-10
								  }
						   },
						   hide: { fixed: true, delay: 200 },
						   style: {
							   name: 'pink',
							   tip: {
								   	corner: 'topMiddle',
									size : {x:25,y:14}
								   },
							   width: {
								   //min: 270
								   }
							   },
						   
						   content: $('#48')
						});
						
						$('#menuid50').parent().qtip({
						   position: {
							  corner: {
								 target: 'bottomMiddle',
								 tooltip: 'topMiddle'
							  },
							  adjust: {
								  y:-10
								  }
						   },
						   hide: { fixed: true, delay: 200 },
						   style: {
							   name: 'purple',
							   tip: {
								   	corner: 'topMiddle',
									size : {x:25,y:14}
								   },
							   width: {
								   //min: 270
								   }
							   },
						   
						   content: $('#50')
						});
						
						$('#menuid51').parent().qtip({
						   position: {
							  corner: {
								 target: 'bottomMiddle',
								 tooltip: 'topMiddle'
							  },
							  adjust: {
								  y:-10
								  }
						   },
						   hide: { fixed: true, delay: 200 },
						   style: {
							   name: 'yellow',
							   tip: {
								   	corner: 'topMiddle',
									size : {x:25,y:14}
								   },
							   width: {
								   //min: 270
								   }
							   },
						   
						   content: $('#51')
						});
						
						$('#menuid62').parent().qtip({
						   position: {
							  corner: {
								 target: 'bottomMiddle',
								 tooltip: 'topMiddle'
							  },
							  adjust: {
								  y:-10
								  }
						   },
						   hide: { fixed: true, delay: 200 },
						   style: {
							   name: 'blue',
							   tip: {
								   	corner: 'topMiddle',
									size : {x:25,y:14}
								   },
							   width: {
								   //min: 270
								   }
							   },
						   
						   content: $('#62')
						});
				   }
				   );






















