/*
 * jQuery NavDropDown v1.0.0 
 *
 * Copyright (c) 2008 Taranets Aleksey
 * www: markup-javascript.com
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 */

jQuery.fn.NavDropDown=function(j){var j=jQuery.extend({duration:300,hoverElement:'li',dropHolder:'div',hoverClass:'hover',showEffect:'slide'},j);return this.each(function(){var f=jQuery(this);var g=jQuery(j.hoverElement+':has('+j.dropHolder+')',f);var h=j.duration;g.each(function(i,a){a=jQuery(a);var b=$(j.dropHolder+' :first',a);var c=$(j.dropHolder,a);a.h=b.outerHeight();var d={};var e={};if(j.showEffect=='slide'){c.css({'height':0,'overflow':'hidden'});b.css({'marginTop':-a.h,'overflow':'hidden'});d.SE={height:a.h};d.ME={marginTop:0};e.SE={height:0};e.ME={marginTop:-a.h}}if(j.showEffect=='fade'){c.css({'opacity':0});d.SE={opacity:1};e.SE={opacity:0};d.ME={};e.ME={}}if(j.showEffect=='slide&fade'){c.css({'height':0,'overflow':'hidden','opacity':0});b.css({'marginTop':-a.h,'overflow':'hidden'});d.SE={height:a.h,opacity:1};d.ME={marginTop:0};e.SE={height:0,opacity:0};e.ME={marginTop:-a.h}}a.hoverEl=false;a.hover(function(){if(this.timer)clearTimeout(this.timer);a.hoverEl=true;$(this).addClass(j.hoverClass);c.animate(d.SE,{queue:false,duration:h});b.animate(d.ME,{queue:false,duration:h})},function(){this.timer=setTimeout(function(){a.hoverEl=false;b.animate(e.ME,{queue:false,duration:h});c.animate(e.SE,{queue:false,duration:h,complete:function(){if(!a.hoverEl)$(a).removeClass(j.hoverClass)}})},100)})})})};

$(document).ready(function(){
	$('ul#mm-u').NavDropDown({duration:300,hoverElement:'li',hoverClass:'hover',dropHolder:'div',showEffect:'fade'});
	var mt;
	$('ul#bk-brd li').click(function(){
			$(this).find('div:first').css('display','block');
			$(this).find('ul:first').fadeIn();
			if($.browser.msie)
			{
				$('select:first').hide();
				clearTimeout(mt);
			}
		});
	
	$('ul#bk-brd li').hover(
		function(){
			return false;
		},
		function() {
			$(this).find('ul:first').fadeOut('fast');
			if($.browser.msie)
				mt = setTimeout("$('select:first').show()",400);
		}
	);
	var pos = $('ul#bk-brd li#photo').offset();
	$('ul#bk-brd li#photo div').css('left', pos.left+2+'px');
	$('ul#bk-brd li#free div').css('left', pos.left+273+'px');
	$('ul#bk-brd li#free div a').css('width','280px');
	$('ul#bk-brd li#free div li').css('width','289px');
	$('ul#bk-brd div').css('display', 'none');	
});
