function GetMonth(intMonth){
  var MonthArray = new Array("January", "February", "March",
                             "April", "May", "June",
                             "July", "August", "September",
                             "October", "November", "December") 
  return MonthArray[intMonth] 	  	 
  }
  
  function detect(vir_img){
			 if(!FlashDetect.installed){
					document.write('<img src='+vir_img+'4d.gif border="0"\/>');	
			}else{
					document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="518" height="126">');
					document.write('<param name="movie" value='+vir_img+'4dbanner_2.swf \/>');
					document.write('<param name="quality" value="high"\/>');
					document.write('<embed src='+vir_img+'4dbanner_2.swf quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="518" height="126"><\/embed>');
					document.write('<\/object>');
			}
			  }
			  
			  
function getDateStr(){
  var today = new Date()
  var year = today.getYear()
  if(year<1000) year+=1900
  var todayStr = GetMonth(today.getMonth()) + " " + today.getDate()
  todayStr += ", " + year
  return todayStr
  }
  
function validateSearch(frm,msg) {
var re4digit=/^\d{4}$/ //regular expression defining a 4 digit number
   if (frm.number.value == '') {

		alert(msg);
		frm.number.focus();
		frm.number.select();
		return false;		

	} else if (frm.number.value != '' && frm.number.value.length < 4) {

		alert(msg);
		frm.number.focus();
		frm.number.select();
		return false;
		
	} else if (frm.number.value.search(re4digit)==-1) {
		alert(msg);
		frm.number.focus();
		frm.number.select();
		return false;	
		
	} else {

		return true;
	}

}

function NewWindow(mypage, myname, w, h, scroll)
	{
		
	var winl = (screen.width - w) / 2;
		
	var	wint = (screen.height - h) / 2;
		
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes'
		
	win = window.open(mypage, myname, winprops)
		
	if (parseFloat(navigator.appVersion) >= 4){ 
		win.window.focus(); 
	}
	
}

var FlashDetect = new function(){
	var self = this;
	self.installed = false;
	self.raw = "";
	self.major = -1;
	self.minor = -1;
	self.revision = -1;
	self.revisionStr = "";
	var activeXDetectRules = [
		{
			"name":"ShockwaveFlash.ShockwaveFlash.7",
			"version":function(obj){
				return getActiveXVersion(obj);
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash.6",
			"version":function(obj){
				var version = "6,0,21";
				try{
					obj.AllowScriptAccess = "always";
					version = getActiveXVersion(obj);
				}catch(err){}
				return version;
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash",
			"version":function(obj){
				return getActiveXVersion(obj);
			}
		}
	];
	var getActiveXVersion = function(activeXObj){
		var version = -1;
		try{
			version = activeXObj.GetVariable("$version");
		}catch(err){}
		return version;
	};
	var getActiveXObject = function(name){
		var obj = -1;
		try{
			obj = new ActiveXObject(name);
		}catch(err){}
		return obj;
	};
	var parseActiveXVersion = function(str){
		var versionArray = str.split(",");//replace with regex
		return {
			"raw":str,
			"major":parseInt(versionArray[0].split(" ")[1], 10),
			"minor":parseInt(versionArray[1], 10),
			"revision":parseInt(versionArray[2], 10),
			"revisionStr":versionArray[2]
		};
	};
	var parseStandardVersion = function(str){
		var descParts = str.split(/ +/);
		var majorMinor = descParts[2].split(/\./);
		var revisionStr = descParts[3];
		return {
			"raw":str,
			"major":parseInt(majorMinor[0], 10),
			"minor":parseInt(majorMinor[1], 10), 
			"revisionStr":revisionStr,
			"revision":parseRevisionStrToInt(revisionStr)
		};
	};
	var parseRevisionStrToInt = function(str){
		return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision;
	};
	self.majorAtLeast = function(version){
		return self.major >= version;
	};
	self.FlashDetect = function(){
		if(navigator.plugins && navigator.plugins.length>0){
			var type = 'application/x-shockwave-flash';
			var mimeTypes = navigator.mimeTypes;
			if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){
				var version = mimeTypes[type].enabledPlugin.description;
				var versionObj = parseStandardVersion(version);
				self.raw = versionObj.raw;
				self.major = versionObj.major;
				self.minor = versionObj.minor; 
				self.revisionStr = versionObj.revisionStr;
				self.revision = versionObj.revision;
				self.installed = true;
			}
		}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){
			var version = -1;
			for(var i=0; i<activeXDetectRules.length && version==-1; i++){
				var obj = getActiveXObject(activeXDetectRules[i].name);
				if(typeof obj == "object"){
					self.installed = true;
					version = activeXDetectRules[i].version(obj);
					if(version!=-1){
						var versionObj = parseActiveXVersion(version);
						self.raw = versionObj.raw;
						self.major = versionObj.major;
						self.minor = versionObj.minor; 
						self.revision = versionObj.revision;
						self.revisionStr = versionObj.revisionStr;
					}
				}
			}
		}
	}();
};
FlashDetect.release = "1.0.3";