// allows you to assign multiple functions to window events
var WindowListener = {
  add : function(event,func){
    var e = this.Functions[event];
    e[func] = func;
  },
  remove : function(event,func){
    var e = this.Functions[event];
    delete e[func];
  },
  addEvent : function(event){
    window["on"+event] = function(){WindowListener.run(event)};
    this.Functions[event] = {};
  },
  removeEvent : function(event){
    window["on"+event] = null;
    delete this.Functions[event];
  },
  run : function(event){
    var e = this.Functions[event];
    for(var i in e) eval(e[i]);
  },
  Functions : {}
};

// blurs all links
function blurAnchors(){
  if(document.getElementsByTagName){
    var a = document.getElementsByTagName("a");
    for(var i = 0; i < a.length; i++){
      a[i].onfocus = function(){this.blur()};
    }
  }
}

function btPopUp(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no,status=no'
	win = window.open(mypage,myname,settings)
}

var minVersion = 4; 
var flashinstalled = 0;
var flashversion = 0;
var MSDetect = 'false';
var x, y;
var vbcode = '';
var showFlash = false;
if(navigator.plugins && navigator.plugins.length){
	var x = navigator.plugins["Shockwave Flash"];
	if(x){
		flashinstalled = 2;
  		if(x.description){
  			var y = x.description;
   			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';
 	vbcode += '<script type="text/vbscript"\> \n';
 	vbcode += '	on error resume next \n';
 	vbcode += '	If MSDetect = "true" Then \n';
 	vbcode += '		For i = 2 to 8 \n';
 	vbcode += '			If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then \n';
 	vbcode += '			Else \n';
 	vbcode += '				flashinstalled = 2 \n';
 	vbcode += '				flashversion = i \n';
 	vbcode += '			End If \n';
 	vbcode += '		Next \n';
 	vbcode += '	End If \n';
 	vbcode += '	If flashinstalled = 0 Then \n';
 	vbcode += '		flashinstalled = 1 \n';
 	vbcode += '	End If';
 	vbcode += '</script\> \n';
	document.write(vbcode);
}
if(flashinstalled == 2 && flashversion >= minVersion){
	showFlash = true;
}

WindowListener.addEvent("load");
WindowListener.add("load","blurAnchors()");

function doprint(){  
	if(window.print){
    	window.print() ;  
	}else{
    	var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    	WebBrowser1.ExecWB(6, 2);  
	}
}