// JavaScript Document

// Function to dynamically add stylesheet based on screen resolution
function getcss(cssfile){
loadcss = document.createElement('link')
loadcss.setAttribute("rel", "stylesheet")
loadcss.setAttribute("type", "text/css")
loadcss.setAttribute("href", cssfile)
document.getElementsByTagName("head")[0].appendChild(loadcss)}
if(screen.width <= '800'){getcss('/css/detect800.css')}
else if(screen.width > '800' && screen.width < '1920'){getcss('/css/detect1024.css')}
else if(screen.width > '1920'){getcss('/css/detect1920.css')}
else {getcss('/css/detect1024.css')}


( function($) {
    // we can now rely on $ within the safety of our "bodyguard" function

	// jQuery events
	$(document).ready(function() {
		$('.sticky').cluetip({
			sticky:			true,
			closePosition:	'title',
			arrows:			true
		});
		$('#accordion').accordion({
			collapsible:	true,
			fillSpace:		true
		});
		$('#accordionResizer').resizable({
			minHeight: 140,
			resize: function() {
				$('#accordion').accordion('resize');
			}
		});
		$("ul.sf-menu").supersubs({ 
			minWidth:    25,   // minimum width of sub-menus in em units 
			maxWidth:    27,   // maximum width of sub-menus in em units 
			extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
							   // due to slight rounding differences and font-family 
		}).superfish({
			delay:   500,
			speed:   'fast'
		});  // call supersubs first, then superfish, so that subs are 
						 // not display:none when measuring. Call before initialising 
						 // containing tabs for same reason. 
	});  
	


} ) ( jQuery );




