$(function() {
	$('#nav > li:has(ul)').hover(
		function() {
			$('ul', this).fadeIn('fast');
		},
		function() {
			$('ul', this).fadeOut('slow');
		}
	);

	$('a[rel*=external]').live('click', function() {
		window.open(this.href);
		return false;
	});

	/*@cc_on
	if (parseInt($.browser.version) < 8) {
		$('.button').each(function() {
			var w = $(':not(.left,.right):visible:first', this).width() + 40;
			$(this).width(w);
		});
	}
	@*/

	function scriptloader(url) {
		$('body').append('<script type="text/javascript" src="', url, '"><\/script>');
	}
});

var adobeReaderInstalled = function () {
	if (window.ActiveXObject) {
		var control = null;
		try {
			// AcroPDF.PDF is used by version 7 and later
			control = new ActiveXObject('AcroPDF.PDF');
		} catch (e) {
			// Do nothing
		}
		if (!control) {
			try {
				// PDF.PdfCtrl is used by version 6 and earlier
				control = new ActiveXObject('PDF.PdfCtrl');
			} catch (e) {
				return false;
			}
		}
		if (control) {
			return true;
		}
	} else {
		// Check navigator.plugins
		if (navigator.plugins && navigator.plugins.length) {
			for (x = 0; x < navigator.plugins.length; x++) {
				plugin_name = navigator.plugins[x].name;
				if (plugin_name.indexOf('Adobe Acrobat') != -1) {
					return true;
				} else if (plugin_name.indexOf('Adobe PDF Plug-in') != -1) {
					return true;
				} else if (plugin_name == 'Chrome PDF Viewer') {
					return true;
				}
			}
		}
	}
	return false;
}

