// last updated 9/8/2011
// detect IOS

var deviceIphone = "iphone";
var deviceIpod = "ipod";
var deviceIpad = "ipad";
var ios;
 
//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();
 
// Detects if the current device is an iPhone.
function DetectIphone() {
	return (uagent.search(deviceIphone) > -1)
}
 
// Detects if the current device is an iPad.
function DetectIpad() {
	return (uagent.search(deviceIpad) > -1)
}
 
// Detects if the current device is an iPod Touch.
function DetectIpod() {
	return (uagent.search(deviceIpod) > -1)
}
 
// Detects if the current device is an iPhone or iPod Touch.
function DetectIphoneOrIpod() {
	if (DetectIphone() || DetectIpod() || DetectIpad()) {
		// alert('got IOS');
		ios = true;
		return true;
	}
	else {
		ios = false;
		return false;
	}
}

DetectIphoneOrIpod();

$(function(){
  $('#language-selector,#menu-language-selector').supersubs({
    minWidth:    12,
    maxWidth:    27,
    extraWidth:  1
  }).superfish({
    delay: 1000
  });
  
  var utilityNavHeight = $('#nav-utility').height();
  var languageMenuTopPosition = utilityNavHeight + 10;

  $('#nav-utility').find('ul.sub-menu').css('top',languageMenuTopPosition);
  
  $('.choose-language a.sf-with-ul').live('click',function(){
    return false;
  });

});




