//** Smooth Navigational Menu- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Menu created: Nov 12, 2008

//** Dec 12th, 08" (v1.01): Fixed Shadow issue when multiple LIs within the same UL (level) contain sub menus: http://www.dynamicdrive.com/forums/showthread.php?t=39177&highlight=smooth

//** Feb 11th, 09" (v1.02): The currently active main menu item (LI A) now gets a CSS class of ".selected", including sub menu items.

var ddsmoothmenu={
    //Specify full URL to down and right arrow images (23 is padding-right added to top level LIs with drop downs):
    arrowimages: {down:['downarrowclass', '/prontus_consejo/imag/auxi/down.gif', 23], right:['rightarrowclass', '/prontus_consejo/imag/auxi/right.gif']},
    transition: {overtime:100, outtime:600}, //duration of slide in/ out animation, in milliseconds
    shadow: {enabled:true, offsetx:5, offsety:5},

///////Stop configuring beyond here///////////////////////////

detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,getajaxmenu:function(a,b){var f=a('#'+b.contentsource[0]);f.html("Loading Menu...");a.ajax({url:b.contentsource[1],async:true,error:function(d){f.html('Error fetching content. Server Response: '+d.responseText)},success:function(d){f.html(d);ddsmoothmenu.buildmenu(a,b)}})},buildshadow:function(d,a){},buildmenu:function(c,k){var e=ddsmoothmenu;var i=c("#"+k.mainmenuid+">ul");var j=i.find("ul").parent();j.hover(function(d){c(this).children('a:eq(0)').addClass('selected')},function(d){c(this).children('a:eq(0)').removeClass('selected')});j.each(function(l){var g=c(this).css({zIndex:100-l});var h=c(this).find('ul:eq(0)').css({display:'block'});this._0={w:this.offsetWidth,h:this.offsetHeight,subulw:h.outerWidth(),subulh:h.outerHeight()};this.istopheader=g.parents("ul").length==1?true:false;h.css({top:this.istopheader?this._0.h+"px":0});g.children("a:eq(0)").css(this.istopheader?{paddingRight:e.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader?e.arrowimages.down[1]:e.arrowimages.right[1])+'" class="'+(this.istopheader?e.arrowimages.down[0]:e.arrowimages.right[0])+'" style="border:0;" />');if(e.shadow.enabled){this._1={x:(this.istopheader?h.offset().left+e.shadow.offsetx:this._0.w),y:(this.istopheader?h.offset().top+e.shadow.offsety:g.position().top)};if(this.istopheader)$parentshadow=c(document.body);else{var m=g.parents("li:eq(0)");$parentshadow=m.get(0).$shadow}this.$shadow=c('<div class="ddshadow'+(this.istopheader?' toplevelshadow':'')+'"></div>').prependTo($parentshadow).css({left:this._1.x+'px',top:this._1.y+'px'})}g.hover(function(d){var a=c(this).children("ul:eq(0)");this._2={left:c(this).offset().left,top:c(this).offset().top};var b=this.istopheader?0:this._0.w;b=(this._2.left+b+this._0.subulw>c(window).width())?(this.istopheader?-this._0.subulw+this._0.w:-this._0.w):b;if(a.queue().length<=1){a.css({left:b+"px",width:this._0.subulw+'px'}).animate({height:'show',opacity:'show'},ddsmoothmenu.transition.overtime);if(e.shadow.enabled){var f=this.istopheader?a.offset().left+ddsmoothmenu.shadow.offsetx:b;var n=this.istopheader?a.offset().top+e.shadow.offsety:this._1.y;if(!this.istopheader&&ddsmoothmenu.detectwebkit){this.$shadow.css({opacity:1})}this.$shadow.css({overflow:'',width:this._0.subulw+'px',left:f+'px',top:n+'px'}).animate({height:this._0.subulh+'px'},ddsmoothmenu.transition.overtime)}}},function(d){var a=c(this).children("ul:eq(0)");a.animate({height:'hide',opacity:'hide'},ddsmoothmenu.transition.outtime);if(e.shadow.enabled){if(ddsmoothmenu.detectwebkit){this.$shadow.children('div:eq(0)').css({opacity:0})}this.$shadow.css({overflow:'hidden'}).animate({height:0},ddsmoothmenu.transition.outtime)}})});i.find("ul").css({display:'none',visibility:'visible'})},init:function(a){if(typeof a.customtheme=="object"&&a.customtheme.length==2){var b='#'+a.mainmenuid;document.write('<style type="text/css">\n'+b+', '+b+' ul li a {background:'+a.customtheme[0]+';}\n'+b+' ul li a:hover {background:'+a.customtheme[1]+';}\n</style>')}jQuery(document).ready(function(d){if(typeof a.contentsource=="object"){ddsmoothmenu.getajaxmenu(d,a)}else{ddsmoothmenu.buildmenu(d,a)}})}}

//Initialize Menu instance(s):
ddsmoothmenu.init({
	mainmenuid: "smoothmenu1", //menu DIV id
	//customtheme: ["#1c5a80", "#18374a"], //override default menu CSS background values? Uncomment: ["normal_background", "hover_background"]
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})