// Highlight left nav link when on that page
function activateLeftNav() {
	var path = window.location.pathname;
	if (document.getElementById(path)) {
		document.getElementById(path).setAttribute("class", "leftNavOn");
	}
}

// Function to toggle display of letter navigation blocks
var activeC;
function toggleContent(c) {
	document.getElementById('linklist'+activeC).style.display='none';
	document.getElementById('linklist'+c).style.display='';
	activeC=c;
}

// Function to set initial display of letter navigation blocks (i.e. conditions and procedures)
function setContent() {
	var URL = location.href;
	var myAnchor;
	
	// If an anchor exists in URL display that, otherwise default to the A grouping
	myAnchor = URL.indexOf('alpha_');
	if (myAnchor == -1) {
		myAnchor = URL.indexOf('#');
		myAnchor == -1 || URL.substr(myAnchor+1) == '' ? activeC = 'A' : activeC = URL.substr(myAnchor+1);
	} else {
		if (myAnchor == -1 || URL.substr(myAnchor+6).replace("/","") == '') {
			activeC = 'A'
		} else if (URL.substr(myAnchor+6).replace("/","") == 'misc') {
			activeC = 'Misc.';
		} else {
			activeC = URL.substr(myAnchor+6).replace("/","");
		}
	}
	document.getElementById('linklist'+activeC).style.display='';
}

// Set initial font size based on cookie value
function setFont() {
	var fontSize = getCookie('fontsize');
	if (fontSize == '') fontSize = 1;
	adjustFont(fontSize);
	document.getElementById('a'+fontSize).src = '/images/a' + fontSize + '_o.png';
}

// Event category toggle for calendar event listing
function showEventTypeSel2(s) {
	// where s is a "select" element of type "object"
	//
	// This function accepts a select element. 
	// It then redirects the user to a page with the selected category in the query string
	//
	
	var category = s.options[s.selectedIndex].value;
	if (category == 0) {
		document.location = 'calendar.aspx';
	} else {
		document.location = 'calendar.aspx?category=' + category;
	}
}

// toggle validation on email/phone
function setValidation(id) {
	// retrieve current form values
	var emailValue,phoneValue;
	emailValue = document.getElementById('Email').value;
	emailValue2 = document.getElementById('Email2').value;
	phoneValue = document.getElementById('Phone').value;
	
	if (id == 1) {
		document.getElementById('fieldEmail').innerHTML = '<span class="green">*</span> Email';
		document.getElementById('fieldEmail2').innerHTML = '<span class="green">*</span> Confirm Email';
		document.getElementById('fieldPhone').innerHTML = 'Phone';
		
		document.getElementById('inputEmail').innerHTML = '<input class="input" style="width: 225px;" onblur="design_validate_re(/^([A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*@[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*)$/,this,\'Email address is blank or invalid.\');" ektdesignns_invalidmsg="Email address is blank or invalid." ektdesignns_schema="&lt;xs:pattern value=&quot;[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*@[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*&quot; /&gt;" ektdesignns_basetype="text" ektdesignns_datatype="string" ektdesignns_validation="email-req" ektdesignns_nodetype="element" ektdesignns_validate="re:/^([A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*@[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-\'\*\+\-\/=\?\^_`\{-~]+)*)$/" ektdesignns_name="Email" ektdesignns_caption="Email" id="Email" name="Email" type="text" />';
		document.getElementById('inputPhone').innerHTML = '<input onblur="design_validate_re(/^(((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4})$|^$/,this,\'Phone number is invalid.\');" style="MARGIN: 0; WIDTH: 225px" id="Phone" class="input" title="Phone number is invalid." type="text" name="Phone" ektdesignns_invalidmsg="Phone number is invalid." ektdesignns_schema="&lt;xs:pattern value=&quot;((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4})|(.{0})&quot; /&gt;" ektdesignns_basetype="text" ektdesignns_datatype="string" ektdesignns_validation="phoneUSCA" ektdesignns_validate="re:/^(((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4})$|^$/" ektdesignns_nodetype="element" ektdesignns_name="Phone" ektdesignns_caption="Phone" />';
	} else {
		document.getElementById('fieldEmail').innerHTML = 'Email';
		document.getElementById('fieldEmail2').innerHTML = 'Confirm Email';
		document.getElementById('fieldPhone').innerHTML = '<span class="green">*</span> Phone';
		
		document.getElementById('inputEmail').innerHTML = '<input class="input" style="width: 225px;" ektdesignns_caption="Email" ektdesignns_name="Email" ektdesignns_nodetype="element" name="Email" id="Email" ektdesignns_datatype="string" ektdesignns_basetype="text" type="text" />';
		document.getElementById('inputPhone').innerHTML = '<input onblur="design_validate_re(/^(((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4})$/,this,\'Phone number is blank or invalid.\');" style="MARGIN: 0; WIDTH: 225px" id="Phone" class="input" title="Phone number is blank or invalid." type="text" name="Phone" ektdesignns_caption="Phone" ektdesignns_name="Phone" ektdesignns_nodetype="element" ektdesignns_validate="re:/^(((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4})$/" ektdesignns_validation="phoneUSCA-req" ektdesignns_datatype="string" ektdesignns_basetype="text" ektdesignns_schema="&lt;xs:pattern value=&quot;(((\\+?1[\\. \\-]?)?\\(?[2-9][0-9]{2}\\)?[\\. \\-\\/]*)?[2-9][0-9]{2}[\\. \\-]?[0-9]{4}&quot; /&gt;" ektdesignns_invalidmsg="Phone number is blank or invalid." />';
	}
	
	// set form values after input boxes are replaced
	document.getElementById('Email').value = emailValue;
	document.getElementById('Phone').value = phoneValue;
}

function confirmEmails(msg) {
	if (document.getElementById('Email2').value != document.getElementById('Email').value) {
		document.getElementById('Email2').style.border = '1px solid #009999';
	} else {
		document.getElementById('Email2').style.border = '1px solid #dfdfdf';
		document.getElementById('Email2').style.borderTop = '1px solid #9f9f9f';
		document.getElementById('Email2').style.borderBottom = '1px solid #CCC';
	}
}

// Handle togglint of font-size buttons, and set cookie based on decision
function adjustFont(size) {
	setCookie('fontsize',size,365);

	var percentage;
	var padding;
	if (size == 3) {
		percentage = 82.5;
		//padding = 22;
	} else if (size == 2) {
		percentage = 75;
		//padding = 20;
	} else {
		percentage = 62.5;
		//padding = 18;
	}
	document.body.style.fontSize = percentage + '%';
	//document.getElementById('fontSizers').style.top = padding + 'px';
	
	for (s=1; s<4; s++) {
		if (s != size) {
			document.getElementById('a'+s).src = '/images/a' + s + '.png';
			document.getElementById('a'+s).onmouseout = function() { this.src = '/images/a' + this.id.substr(1) + '.png'; };
		} else {
			document.getElementById('a'+s).src = '/images/a' + s + '_o.png';
			document.getElementById('a'+s).onmouseout = function() { this.src = '/images/a' + this.id.substr(1) + '_o.png'; };
		}
	}
}

function setCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function getCookie(c_name) {
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.1
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { args[i+1]=='' ? nm=val.name : nm=args[i+1]; if ((val=val.value)!="") {
	  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
		if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
	  } else if (test!='R') { num = parseFloat(val);
		if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
		if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
		  min=test.substring(8,p); max=test.substring(p+1);
		  if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
	} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

// Flyout navigation hiders
for (i=1; i<7; i++) {
	this["nav" + i]=setTimeout("MM_showHideLayers('flyout" + i + "','','hide');",50);
}
function timedMsg(name,obj) {
	this[name] = setTimeout("MM_showHideLayers('" + obj + "','','hide');",50);
}

// Snap an element to another
function P7_Snap() { //v2.62 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;} 
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
}

// Show/hide an element
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function checkKeycode(e) {          	
	var keycode;
	if (window.event) // IE
		keycode = e.keyCode;
	else if (e.which) // Netscape/Firefox/Opera
		keycode = e.which;
	
	if (keycode==13)
		CallSearch();
}
         
//document.onkeydown = checkKeycode;
function entsub(event,ourform) {
  if (event && event.keyCode == 13) {
    CallSearch();
	return false;
  }else{
    return true;
  }
}

function CallSearch(id)
{   		
   id == undefined ? id = "" : null;
   //search.aspx?searchtext=awards&folderid=0&searchfor=html&orderby=id&orderdirection=ascending
   
   var objsearchText2 = document.getElementById('searchtext2');
   var searchText;
   
   if ((objsearchText2!=null) && (document.getElementById('searchtext').value=='Search Crouse Website') && (objsearchText2.value!='')) {
   		id=2;
   }
   
   var objsearchText = document.getElementById('searchtext'+id);
   
   //alert(objsearchText.value);
   if ((objsearchText!=null) && (objsearchText.value!='Search Crouse Website') && (objsearchText.value!=''))
   {	   
	   searchText = objsearchText.value;
	   searchText = searchText.replace(/>/gi, " >");
	   searchText = searchText.replace(/</gi, "< ");
	   objsearchText.value = searchText;
	   
		//This cookie is used for the backbutton to work in search on postback
	   //This cookie must be cleared to prevent old search results from displayed
	   document.cookie='postbackcookie=';
	   window.location.href="/search.aspx?searchtext=" + searchText.replace('alert','').replace('confirm','') + "&folderid=0&searchfor=" + document.getElementById('searchfor'+id).value +  "&orderby=id&orderdirection=ascending";

		//Load the page with the websearch server control in the bottom frame using Javascript
	   //Set websearch properties using querystring parameters
	   //Properties set here- search text,Orderby, FolderId, and SearchFor
	   //SearchFor can be a value from all/html/documents/images/multimedia/discussionForum
	   //Orderby can be one of these - editor,id,rank,title,datecreated,datemodified
	   //OrderDirection can be ascending or descending
   }
}


/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey, bypassKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.BYPASS_KEY = bypassKey ? bypassKey : 'bypass';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.skipFlash = deconcept.util.getRequestParameter(this.BYPASS_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}

		if(this.skipFlash != 'true' && (this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version')))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
