if (window.Event) 
document.captureEvents(Event.MOUSEUP); 

function nocontextmenu() 
{ 
event.cancelBubble = true 
event.returnValue = false; 

return false; 
} 

function norightclick(e) 
{ 
if (window.Event) 
{ 
if (e.which == 2 || e.which == 3) 
return false; 
} 
else 
if (event.button == 2 || event.button == 3) 
{ 
event.cancelBubble = true 
event.returnValue = false; 
return false; 
} 

} 
if (document.layers) { 
document.captureEvents(Event.MOUSEDOWN); 
} 
document.oncontextmenu = nocontextmenu; 
document.onmousedown = norightclick; 
document.onmouseup = norightclick;

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function 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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showHideLayers() { //v6.0
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function show() { 
  var i,obj,args=show.arguments;
  for (i=0; i<(args.length); i++) if ((obj=findObj(args[i]))!=null) {
    if (obj.style) { obj=obj.style;}
    obj.display='block'; }
}

function hide() { 
  var i,obj,args=hide.arguments;
  for (i=0; i<(args.length); i++) if ((obj=findObj(args[i]))!=null) {
    if (obj.style) { obj=obj.style;}
    obj.display='none'; }
}

function set_style() { 
  var i,s,v,obj,args=set_style.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { 
    if (obj.style) { obj=obj.style; s=args[i+1]; v=args[i+2]; }
    obj[s]=v;}
}

function set_id() { 
  var i,s,obj,args=set_id.arguments;
  for (i=0; i<(args.length-1); i+=2) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { 
    if (obj.id) { s=args[i+1]; }
    obj.id=s;}
}

function sel_current_over() {
	set_style(
			  'sel_current','background','url(design/current_bg_o.jpg) no-repeat',
			  'sel_cur_h2','color','#a3b27b',
			  'sel_cur_h2','background','none'
			  );
}

function sel_current_out() {
	set_style(
			  'sel_current','background','url(design/current_bg.jpg) no-repeat',
			  'sel_cur_h2','color','#164a13',
			  'sel_cur_h2','background','#dadaa3',
			  'sel_cur_h2_act','background','#dadaa3'
			  );
}

function sel_current_click() {
	show('current');
	hide('planned');
	set_id(
		   'sel','sel_act',
		   'sel_cur_h2','sel_cur_h2_act',
		   'sel_current','sel_current_act',
		   'sel_planned_act','sel_planned',
		   'sel_plan_h2_act','sel_plan_h2'
		   );
	set_style(
			  'sel_mid','width','105px',
			  'sel_mid','background','url(design/mid_bg_l.jpg) no-repeat center center',
			  'sel_cur_h2_act','color','#164a13',
			  'sel_planned','background','url(design/planned_bg.jpg) no-repeat',
			  'sel_current','margin','0',
			  'sel_planned','margin','0',
			  'sel_plan_h2','background','#dadaa3',
			  'sel_plan_h2','color','#164a13'
			  );
}

function sel_planned_over() {
	set_style(
			  'sel_planned','background','url(design/planned_bg_o.jpg) no-repeat',
			  'sel_plan_h2','color','#a3b27b',
			  'sel_plan_h2','background','none'
			  );
}

function sel_planned_out() {
	set_style(
			  'sel_planned','background','url(design/planned_bg.jpg) no-repeat',
			  'sel_plan_h2','color','#164a13',
			  'sel_plan_h2','background','#dadaa3',
			  'sel_plan_h2_act','background','#dadaa3'
			  );
}

function sel_planned_click() {
	show('planned');
	hide('current');
	set_id(
		   'sel','sel_act',
		   'sel_plan_h2','sel_plan_h2_act',
		   'sel_planned','sel_planned_act',
		   'sel_current_act','sel_current',
		   'sel_cur_h2_act','sel_cur_h2'
		   );
	set_style(
			  'sel_mid','width','105px',
			  'sel_mid','background','url(design/mid_bg_r.jpg) no-repeat center center',
			  'sel_plan_h2_act','color','#164a13',
			  'sel_current','background','url(design/current_bg.jpg) no-repeat',
			  'sel_current','margin','0',
			  'sel_planned','margin','0',
			  'sel_cur_h2','background','#dadaa3',
			  'sel_cur_h2','color','#164a13'
			  );
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}