// JavaScript Document
$('a.zoom').each(function(){
	$(this).fancybox({'zoomOpacity':true,'titlePosition':'inside','zoomSpeedIn':500,'zoomSpeedOut':500,'hideOnContentClick': true,'transitionIn':'elastic','transitionOut':'elastic'});
	});
$("#search").focusValue();
$("#searchSubmit").hover(function(){$(this).addClass("hover")}, function(){$(this).removeClass("hover");});
(function($){$.fn.onHover=function(cssClass){$(this).hover(function(){$(this).addClass(cssClass);},function(){$(this).removeClass(cssClass);});}})(jQuery);
(function($){
	$.fn.menuOnFly = function(options){
		var opts = $.extend({}, $.fn.menuOnFly.defaults, options);
		var mi = $(this);
		$(this).children('li').children('a.dropDown').click(function(){
						   s = $(this).hasClass('selected');						   
						   $('#menuFlyHoverCont').hide();
						   $(this).parent('li').removeClass('hover');
						   /*if(s){
								if(opts.animation=='fade'){									
									$(this).next(opts.affect).fadeOut(opts.speed);									
								}
								else if(opts.animation=='slide'){									
									$(this).next(opts.affect).slideUp(opts.speed);
								}
								else{									
									$(this).next(opts.affect).toggle();
								}								
								$(this).oneTime(opts.speed, function() {
									$(this).parent('li').removeClass('selected');								
									$(this).removeClass('selected');
								  });							
						   }
						   else{*/							   
							   mi.children('li').children('a.selected').removeClass('selected');
							   mi.children('li.selected').removeClass('selected');
							   $(this).parent('li').addClass('selected');
							   $(this).addClass('selected');
							   if(opts.animation=='fade'){
									if(opts.type=='accordion'){mi.children('li').children(opts.affect).fadeOut(opts.speed);}
								   $(this).next(opts.affect).fadeIn(opts.speed);
								}
								else if(opts.animation=='slide'){
									 if(opts.type=='accordion'){mi.children('li').children(opts.affect).slideUp(opts.speed);}
									$(this).next(opts.affect).slideDown(opts.speed);
								}
								else{
									 if(opts.type=='accordion'){mi.children('li').children(opts.affect).hide();}
									$(this).next(opts.affect).show();
								}							  
						  // }						  
						   return false;
						   });
	}
	$.fn.menuOnFly.defaults = {
		animation:'',
		speed: 300,
		type:'accordion',
		affect:'ul'
	};
})(jQuery);
$(".subMenu").menuOnFly({affect:"ul",type:"accordion",animation:"slide"});
$(".sub2Menu").menuOnFly({affect:"ul",type:"accordion",animation:"slide"});
$(".sub2Menu ul").menuOnFly({affect:"ul",type:"accordion",animation:"slide"});
var timeOut = 500;
var timer = 0;
var current = 0;
$(document).ready(function() {
var maxHeight = ($('#content_b').height() < $('#contentContainer').height())?$('#contentContainer').height():$('#content_b').height();
$('#content_b').height(maxHeight);
});
/**/
