﻿$(document).ready(function(){
    // Track External Links
    $('A[rel="external"]').click( function() {
        pageTracker._trackEvent('Link', 'External', $(this).attr('href'))
        window.open( $(this).attr('href') );
        return false;
    });
    
    // Track Download Links
    $('A[rel="download"]').click( function() {
        pageTracker._trackEvent('Link', 'Download', $(this).attr('href'))
        window.open( $(this).attr('href') );
        return false;
    });
});

startList = function() {

	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("ulNav");
		
		if(navRoot){
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" subNavActive";
					}
					node.onmouseout=function() {
						for (i=0; i<navRoot.childNodes.length; i++) {
							this.className=this.className.replace(" subNavActive", "");
						}
					}
				}
			}
		}
	}
}

function hasFlashVersion(iVersion) {
	var flashinstalled = 0;
	var flashversion = 0;
	MSDetect = "false";
	if (navigator.plugins && navigator.plugins.length){
		x = navigator.plugins["Shockwave Flash"];
		if (x) {
			flashinstalled = 2;
			if (x.description) {
			    y = x.description;
			    //Hack for version 10 and above! Will need to be fixed at version 100!
			    if (y.charAt(y.indexOf('.')-2) != " ") {
			        flashversion = y.charAt(y.indexOf('.')-2)
			    }
			    flashversion = flashversion+y.charAt(y.indexOf('.')-1);
			}
		}else flashinstalled = 1;
		if (navigator.plugins["Shockwave Flash 2.0"]) { flashinstalled = 2; flashversion = 2; }
	} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin) flashinstalled = 2;
		else flashinstalled = 1;
	} else MSDetect = "true";
	
	if(flashinstalled==0) {
		try{ var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + iVersion); flashinstalled = 2; flashversion = iVersion; }
		catch(e){}
	}
	if(flashinstalled!=2) { return false; }
	else {
		if(flashversion < iVersion) { return false; } 
		else { return true; }
	}
}

window.onload=startList;
