// popup
function openW (URL,TARGET,OPT,x,y) {
  var Xcent = (screen.availWidth-x)/2;
  var Ycent = (screen.availHeight-y)/2; 
  var vals = OPT + ",screenX=" + Xcent + ",screenY=" + Ycent + ",left=" + Xcent + ",top=" + Ycent;
  window.onerror=null;
  window.open(URL,TARGET,vals);
}

function openWnd (URL,TARGET,sizeX,sizeY,resizable,scrollbars) {
	if(resizable==null) resizable="no";
	if(scrollbars==null) scrollbars="no";
  var Xcent = (screen.availWidth-sizeX)/2;
  var Ycent = (screen.availHeight-sizeY)/2; 
  var vals = "width=" + sizeX + ",height=" + sizeY + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",toolbar=no,location=no,directories=no,status=no,menubar=no,titlebar=no,left=" + Xcent + ",top=" + Ycent;
  window.onerror=null;
  return window.open(URL,TARGET,vals);
}

// Flash Version Detector
// Return either Flash Version or Plugin - true/false
var flashVersion = 0;

function getFlash() {
	var agent = navigator.userAgent.toLowerCase(); 
	
	// NS3+, Opera3+, Mozilla, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			if (flashPlugin.description.indexOf('9.') != -1) flashVersion = 9;
			else if (flashPlugin.description.indexOf('8.') != -1) flashVersion = 8;
			else if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
			else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
			else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win") != -1 && agent.indexOf("16bit") == -1) {
	  document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('dim obFlash \n');
		document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.9") \n');
		document.write('if IsObject(obFlash) then \n');
		document.write('flashVersion = 9 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.8") end if \n');
		document.write('if flashVersion < 8 and IsObject(obFlash) then \n');
		document.write('flashVersion = 8 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") end if \n');
		document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
		document.write('flashVersion = 7 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
		document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
		document.write('flashVersion = 6 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
		document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
		document.write('flashVersion = 5 \n');
		document.write('end if');
		document.write('</scr' + 'ipt\> \n');
  }
    
  // Return Version 
	return flashVersion;
}



