/**
 * Gallery
 * --------
 * 
 * author: Andrei Dinca & Alexandra Ipate
 		                    _          _   _____  _                 
		    /\             | |        (_) |  __ \(_)                
		   /  \   _ __   __| |_ __ ___ _  | |  | |_ _ __   ___ __ _ 
		  / /\ \ | '_ \ / _` | '__/ _ \ | | |  | | | '_ \ / __/ _` |
		 / ____ \| | | | (_| | | |  __/ | | |__| | | | | | (_| (_| |
		/_/    \_\_| |_|\__,_|_|  \___|_| |_____/|_|_| |_|\___\__,_|
		
 * email: andrei.webdeveloper@gmail.com
 *
 * version 1.0 release date: 2.12.2010
 *
**/
(function($){$.fn.extend({jDropDown:function(options){var defaults={'demo':true,'effect':'','notMenu':'.home','duration':{'fadeIn':300,'fadeOut':60,'slideIn':300,'slideOut':60}};options=$.extend(defaults,options);var self=this;var running=false;return this.each(function(){var opts=options;var $this=$(this);var $thisFirstLi=$this.find("> li").not(opts.notMenu);$thisFirstLi.hover(function(){var $currThis=$(this);var initHeight=0;$this.find('.on').removeClass('on');$currThis.find('a').addClass('on');if(opts.demo){opts.effect=$("#effect").val();}
effect($currThis,"open");},function(){var $currThis=$(this);$currThis.find('a').removeClass("on");effect($currThis,"close");});function effect($currThis,mode){if(mode=='open'){if(opts.effect=="fade"){$currThis.find('div:first').css('opacity',0).css('visibility','visible').animate({opacity:1,MarginTop:3},opts.duration.fadeIn);}else if(opts.effect=="slide"){initHeight=$currThis.find('div:first').height();$currThis.find('div:first').css('height',0).css('visibility','visible').stop(false,true).animate({height:initHeight},opts.duration.slideIn);}else{$currThis.find('div:first').css('visibility','visible');}
return true;}
if(mode=='close'){if(opts.effect=="fade"){$currThis.find('div:first').animate({opacity:0},opts.duration.fadeOut,function(){$(this).css('visibility','hidden');});}else if(opts.effect=="slide"){initHeight=$currThis.find('div:first').height();$currThis.find('div:first').css('overflow','hidden').stop(false,true).animate({height:0},opts.duration.slideOut,function(){$(this).css('visibility','hidden').css('height',initHeight);});}else{$currThis.find('div:first').css('visibility','hidden');unblockScript();}
return true;}
alert("Uncatch exception. Invalid effect mode!");return false;}
function unblockScript(){running=false;}});}});})(jQuery);
