// global broser variables
var myGlobals = {
	//True if device is an iPhone
	uaiphone:   (navigator.userAgent.toLowerCase().indexOf('iphone')!='-1'),
	//True if device is an iPad
	uaipad:     (navigator.userAgent.toLowerCase().indexOf('ipad')!='-1'),
    //True if device is Android-based
    uadroid:     (navigator.userAgent.toLowerCase().indexOf('android')!='-1'),
}

jQuery(document).ready(function () {
	if(myGlobals.uaiphone || myGlobals.uadroid){
		jQuery("#nav").css("bottom", "34px");
	} else {
		jQuery("#nav").css("bottom", "0px");
		var menuDown = false;
		var menuPause = 500;
		var waiting = false;
		jQuery(".menu-link").mouseover(function () {
			if (!waiting) {
				if (!menuDown) {
					menuDown = true;
					jQuery("#nav").animate({
						"bottom": "+=34px"
					}, "fast")
				}
			}
			return false
		})
		jQuery("#closemenu").mouseover(function () {
			if (!waiting) {
				if (menuDown) {
					menuDown = false;
					waiting = true;
					setTimeout(function () {
						jQuery("#nav").animate({
							"bottom": "-=34px"
						}, "slow", "swing", function () {
							waiting = false
						})
					}, menuPause)
				}
			}
			return false
		})
	}
});
