//rnav.js vs 1.0 by Ryan

$(document).ready(function() {						   
//REQ REQ REQ DUPLICATE FOR EACH ITERATION
//sets element positions and counts li for each						  						   
$('#rmdrop2').css('left' , 136);

var dropdowns = document.getElementById('rmdrop2'); //Counts li in specified div
var numlidrops = dropdowns.getElementsByTagName('li');
var totaldrops = numlidrops.length;

var lispit = 0;
var aheight = -31; // USER SET adjust flyouts drop from top = #rmdrop1 a = get height and top bott padding plus borders that is def in css
while (lispit <= totaldrops) {
$('#rmdrop2_' + lispit + '_1').css('left' , 166); //  USER SET push flyouts right = #rmdrop1 a = get width and L and R padding def in css
$('#rmdrop2_' + lispit + '_1' + ' a').css('width' , 170); // USER SET width of flyouts
$('#rmdrop2_' + lispit + '_1').css('top' , aheight);
lispit++;
aheight += 31; // USER SET same as above only positive
}; 
//END END END REQ DUPLICATE

//Hide Show switch control for downdrops max100 fade for best results
$('.topswitchover').hover(function() {
var myDiv = $(this).attr('name');
var myDivActual = '#' + myDiv;
$(myDivActual).css({visibility : 'visible' , display : 'none'}).show(300);
}, function() {
var myDiv = $(this).attr('name');
var myDivActual = '#' + myDiv;
$(myDivActual).css({visibility : 'hidden' , display : 'none'}).hide(100);

});
//Hide Show Switch Control or thrid lvl flyouts plus no fade for best results
$('.switchover').hover(function() {
var myDiv = $(this).attr('id') + "_1";  //this addition requires the getElementbyId Bit
var myDivActual = document.getElementById(myDiv);
$(myDivActual).css({visibility : 'visible' , display : 'none'}).show(100);
}, function() {
var myDiv = $(this).attr('id') + "_1";  //this addition requires the getElementbyId Bit
var myDivActual = document.getElementById(myDiv);
$(myDivActual).css({visibility : 'hidden' , display : 'none'});
});

$('#promodropini').hover(function() {
$('#navbar2').css('position' , 'relative');
$('.flyoutBotnav').css('background-color' , '#233450');
$('.flyoutBotnav').css('background-repeat' , 'no-repeat');
$('#promodrop').css({visibility : 'visible', display : 'none'}).show(300);
}, function() {
$('#promodrop').css({visibility : 'hidden' , display : 'none'});
$('#navbar2').css('position' , 'static');
$('.flyoutBotnav').css('background-image' , 'url(/images/menu_bar.jpg)');
$('.flyoutBotnav').css('background-repeat' , 'repeat-x');
});

});


