/* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
          Global Javascript Methods for [ ruamonstar.com All Rights Reserved. ]
     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   @Author - Ra'Shaun "SNUGGS" Stovall (Innovative Studios, LLC. Senior Web Developer)
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */


/* -=-=-=-=-=-=-=-=-=-=-=-= Site Specific Functions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
var openPresQuestionaire = function () {
var _w = 450;
var _h = 385;
var Xpos = Math.ceil((screen.availWidth / 2) - (_w / 2));
var Ypos = Math.ceil((screen.availHeight / 2) - (_h / 2));

_strLegalUrl = "./PresidentQuestionaire.aspx";
var _win = window.open(_strLegalUrl, '_QUESTPOPUP', 'location=yes,scrollbars=no,status=no,width='+_w+',height='+_h+',left='+Xpos+',top='+Ypos)
_win.focus()

}; // openPresQuestionaire ()

var showLegal = function ( _legalType ) {
    if (!_legalType) return true;

var _strLegalUrl;
var _w = 390;
var _h = 460;
var Xpos = Math.ceil((screen.availWidth / 2) - (_w / 2));
var Ypos = Math.ceil((screen.availHeight / 2) - (_h / 2));

_strLegalUrl = "./_legal/Legal.aspx?typeID=" + _legalType;
var _win = window.open(_strLegalUrl, '_LEGALPOPUP', 'location=yes,scrollbars=no,status=no,width='+_w+',height='+_h+',left='+Xpos+',top='+Ypos)
_win.focus()

}; // showLegal ()

var openGenericPopUp = function ( _page ) {
var _strMediaUrl;
var _w = 420;
var _h = 480;
var Xpos = Math.ceil((screen.availWidth / 2) - (_w / 2));
var Ypos = Math.ceil((screen.availHeight / 2) - (_h / 2));

_strMediaUrl = "./monstarpages/PopUp.aspx?page="+_page;
var _win = window.open(_strMediaUrl, '_POPUP', 'location=yes,scrollbars=no,status=no,width='+_w+',height='+_h+',left='+Xpos+',top='+Ypos)
_win.focus()
}
var openMediaPlayer = function ( _multimediaID ) {
//alert("opening player");
//return;
var _strMediaUrl;
var _w = 600;
var _h = 450;
var Xpos = Math.ceil((screen.availWidth / 2) - (_w / 2));
var Ypos = Math.ceil((screen.availHeight / 2) - (_h / 2));

_strMediaUrl = "./MultimediaPopup.aspx?vidID=" + _multimediaID;
var _win = window.open(_strMediaUrl, '_MEDIAPOPUP', 'location=yes,scrollbars=no,status=no,width='+_w+',height='+_h+',left='+Xpos+',top='+Ypos)
_win.focus()

}; // openMediaPlayer ()

var openFrame = function (_src, _w, _h){
     var Xpos = Math.ceil((screen.availWidth / 2) - (_w / 2))
     var Ypos = Math.ceil((screen.availHeight / 2) - (_h / 2))
     var _win = window.open(_src, '_PICFRAME', 'scrollbars=yes,status=yes,width='+_w+',height='+_h+',left='+Xpos+',top='+Ypos)
         _win.focus()

}; // openFrame ()

agent = navigator.userAgent.toLowerCase(); 
mac = (agent.indexOf("mac")!=-1);
win = (!this.mac) ?true:false;
w3c = (document.getElementById) ?true:false;
iex = (document.all) ?true:false;
ns4 = (document.layers) ?true:false;

// convert all characters to lowercase to simplify testing 
var BrowserIs = function () {
    // *** BROWSER VERSION *** 
	this._isW3C = (document.getElementById)? true : false;
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5. 
    this._major = parseInt(navigator.appVersion); 
    this._minor = parseFloat(navigator.appVersion); 

    this._agt   = navigator.userAgent.toLowerCase();
    this._nav   = ((this._agt.indexOf('webtv')==-1) &&     // no Web Tv browsers
			       (this._agt.indexOf('opera')==-1)   &&   // no Opera browsers
                   (this._agt.indexOf('spoofer')==-1) &&   // no Spoofed browsers
                   (this._agt.indexOf('mozilla')!=-1));    // mozilla browser (acceptable industry standard)

   /*================ Check for Netscape Compatible Browser Clients ===============================*/
    this._navVer2 = (this._nav && (this._major == 2)); 
    this._navVer3 = (this._nav && (this._major == 3)); 
    this._navVer4 = (this._nav && (this._major == 4)); 
    this._navVer4up = (this._nav && (this._major >= 4)); 
    this._navOnly      = (this._nav && ((this._agt.indexOf(";nav") != -1) || 
                          (this._agt.indexOf("; nav") != -1)) ); 
    this._navVer5 = (this._nav && (this._major == 5)); 
    this._navVer5up = (this._nav && (this._major >= 5)); 

   /*================ Check for Internet Explorer Compatible Browser Clients ===============================*/
    this._ie   = (this._agt.indexOf("msie") != -1); 
    this._ie3  = (this._ie && (this._major < 4)); 
    this._ie4  = (this._ie && (this._major == 4) && (this._agt.indexOf("msie 5.0")==-1) ); 
    this._ie4up  = (this._ie  && (this._major >= 4)); 
    this._ie5  = (this._ie && (this._major == 4) && (this._agt.indexOf("msie 5.0")!=-1) ); 
    this._ie5up  = (this._ie  && !this._ie3 && !this._ie4); 

   /*================ Check for America On-Line Compatible Browser Clients ===============================*/
    this._aol   = (this._agt.indexOf("aol") != -1); 
    this._aol3  = (this._aol && this._ie3); 
    this._aol4  = (this._aol && this._ie4); 

   /*================ Check for Opera Compatible Browser Clients ===============================*/
    this._opera = (this._agt.indexOf("opera") != -1); 
   /*================ Check for Web TV Compatible Browser Clients ===============================*/
    this._webtv = (this._agt.indexOf("webtv") != -1); 

    if (this._navVer2 || this._ie3) this._js = 1.0;
   /*================ Detect Client Operating System Platform ===============================*/
    else if (this._navVer3 || this._opera) this._js = 1.1;
    else if ((this.navVer4 && (this._minor <= 4.05)) || this._ie4) this._js = 1.2;
    else if ((this._navVer4 && (this._minor > 4.05)) || this._ie5) this._js = 1.3;
    else if (this._navVer5) this._js = 1.4 ;
	else if (this._navVer5up) this._js = 1.5;
    else if (this._nav && (this._major > 5)) this._js = 1.4;
    else if (this._ie && (this._major > 5)) this._js = 1.3;
	//default Javascript Versioning
    else this._js = 0.0; 

    // *** PLATFORM *** 
    this._win   = ((this._agt.indexOf("win")!=-1) || 
			       (this._agt.indexOf("16bit")!=-1) ); 
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all 
    //        Win32, so you can't distinguish between Win95 and WinNT. 
    this._win95 = ((this._agt.indexOf("win95")!=-1) || 
				   (this._agt.indexOf("windows 95")!=-1)); 

    // is this a 16 bit compiled version? 
    this._win16 = ((this._agt.indexOf("win16")!=-1) || 
                  (this._agt.indexOf("16bit")!=-1) || 
				  (this._agt.indexOf("windows 3.1")!=-1) || 
                  (this._agt.indexOf("windows 16-bit")!=-1) ); 

    this._win31 = ((this._agt.indexOf("windows 3.1")!=-1) || 
				   (this._agt.indexOf("win16")!=-1) || 
                   (this._agt.indexOf("windows 16-bit")!=-1)); 

    // NOTE: Reliable detection of Win98 may not be possible. It appears that: 
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent. 
    //       - On Mercury client, the 32-bit version will return "Win98", but 
    //         the 16-bit version running on Win98 will still return "Win95". 
    this._win98 = ((this._agt.indexOf("win98")!=-1) || 
				   (this._agt.indexOf("windows 98")!=-1)); 
    this._winnt = ((this._agt.indexOf("winnt")!=-1) || 
				   (this._agt.indexOf("windows nt")!=-1)); 
    this._win32 = ( this._win95 || this._winnt || this._win98 || 
                   ((this._major >= 4) && (navigator.platform == "Win32")) || 
                   (this._agt.indexOf("win32")!=-1) || (this._agt.indexOf("32bit")!=-1) ); 

    this._os2   = ((this._agt.indexOf("os/2")!=-1) || 
                  (navigator.appVersion.indexOf("OS/2")!=-1) || 
                  (this._agt.indexOf("ibm-webexplorer")!=-1)); 

    this._mac    = (this._agt.indexOf("mac")!=-1); 
    this._mac68k = (this._mac && ((this._agt.indexOf("68k")!=-1) || 
                               (this._agt.indexOf("68000")!=-1))); 
    this._macppc = (this._mac && ((this._agt.indexOf("ppc")!=-1) || 
                               (this._agt.indexOf("powerpc")!=-1))); 

    this._sun   = (this._agt.indexOf("sunos")!=-1); 
    this._sun4  = (this._agt.indexOf("sunos 4")!=-1); 
    this._sun5  = (this._agt.indexOf("sunos 5")!=-1); 
    this._suni86= (this._sun && (this._agt.indexOf("i86")!=-1)); 
    this._irix  = (this._agt.indexOf("irix") !=-1);    // SGI 
    this._irix5 = (this._agt.indexOf("irix 5") !=-1); 
    this._irix6 = ((this._agt.indexOf("irix 6") !=-1) || (this._agt.indexOf("irix6") !=-1)); 
    this._hpux  = (this._agt.indexOf("hp-ux")!=-1); 
    this._hpux9 = (this._hpux && (this._agt.indexOf("09.")!=-1)); 
    this._hpux10= (this._hpux && (this._agt.indexOf("10.")!=-1)); 
    this._aix   = (this._agt.indexOf("aix") !=-1);      // IBM 
    this._aix1  = (this._agt.indexOf("aix 1") !=-1); 
    this._aix2  = (this._agt.indexOf("aix 2") !=-1); 
    this._aix3  = (this._agt.indexOf("aix 3") !=-1); 
    this._aix4  = (this._agt.indexOf("aix 4") !=-1); 
    this._linux = (this._agt.indexOf("inux")!=-1); 
    this._sco   = (this._agt.indexOf("sco")!=-1) || 
                  (this._agt.indexOf("unix_sv")!=-1); 
    this._unixware = (this._agt.indexOf("unix_system_v")!=-1); 
    this._mpras    = (this._agt.indexOf("ncr")!=-1); 
    this._reliant  = (this._agt.indexOf("reliantunix")!=-1); 
    this._dec   = ((this._agt.indexOf("dec")!=-1) || (this._agt.indexOf("osf1")!=-1) || 
         (this._agt.indexOf("dec_alpha")!=-1) || (this._agt.indexOf("alphaserver")!=-1) || 
         (this._agt.indexOf("ultrix")!=-1) || (this._agt.indexOf("alphastation")!=-1)); 
    this._sinix = (this._agt.indexOf("sinix")!=-1); 
    this._freebsd = (this._agt.indexOf("freebsd")!=-1); 
    this._bsd = (this._agt.indexOf("bsd")!=-1); 
    this._unix  = ((this._agt.indexOf("x11")!=-1) || this._sun || this._irix || this._hpux || 
                 this._sco ||this._unixware || this._mpras || this._reliant || 
                 this._dec || this._sinix || this._aix || this._linux || this._bsd || 
                 this._freebsd); 

    this._vms   = ((this._agt.indexOf("vax")!=-1) || (this._agt.indexOf("openvms")!=-1)); 

}; // [Object] BrowserIs ()
/* ============================= Object Method Prototype Linkage ===================================*/
BrowserIs.prototype.isInternetExplorer = IsInternetExplorer;     // used to see if browser is Internet Explorer
BrowserIs.prototype.javascriptVersion = JavascriptVersion;       // used to retrieve javascript versioning.

/* ============================= Function Declaration Section ===================================*/

// function used to for Internet Explorer client browser testing
function IsInternetExplorer ( _minVersion ) { return this._ie; }; // IsInternetExplorer ()
function JavascriptVersion () { return this._js; }; // JavascriptVersion()

var _brow = new BrowserIs();

/* ============================= Global Javascript Functions ===================================*/

var swapImage = function ( id, src ) {
     if (arguments.length < 2) return
     if(document.getElementById) //uplevel browsers
          document.getElementById(id).src = src
     else
        if(document.images)       //downlevel browsers
            document.images[id].src = src

}; // swapImage ()


var initPopupCloser = function () {
	
document.onclick = closeWindow;

}; // initPopupCloser ()

var closeWindow = function () {
top.close();
}; // closeWindow ()

/** Function used to Retrieve document element
  * using the w3c DOM if applicable
  * (ie4+, ns4+, and just about every damn thing else)
  * ---------------------------------------------------
  * @param [_objName] - the name of the DOM element to retrieve 
  * @param [_nest]    - the name of the DOM element that is a container wraper 
  * 
  */
function getDOMObject ( _objName, _nest ){
      var _theElem;

     //--- Do nested container retrieval
      _nest    = (_nest) ? 'document.' + _nest + '.' : '';

     //--- Element Retrieval (with nesting in mind)
      _theElem = (_brow._isW3C) ? document.getElementById(_objName) : // is W3C DOM Compatible
                //Not w3C Compatible (Downlevel Browsers)
                 (_brow._ie4up) ? document.all[_objName] : //Downlevel IE
                 (document.layers) ? eval(_nest+'document.'+_objName) : false; //Downlevel Netscape 

     //--- Fuse CSS Element (for shits and giggles)
      _theElem._CSS = (document.layers) ? _theElem : //Return the element if its netscape downlevel browser
                                          (_theElem.style) ? _theElem.style : null;
	     _theElem.getTop        = function (){return parseInt(_theElem._CSS.top)};
	     _theElem.setTop        = function(y){_theElem._CSS.top=parseInt(y)};
	     _theElem.getHeight     = function(){return (document.layers) ? _theElem.document.height : _theElem.offsetHeight};
	     _theElem.getClipHeight = function(){return (document.layers) ? _theElem.clip.height : _theElem.offsetHeight};

     //--- Return the element
      return _theElem;
}; // getDOMObject ()

// **************************** Container Scroller Functionality *****************************
var getMouse = function (e){
	return (_brow._ie4up) ? event.clientY : e.pageY;
}; // getMouse ()
function fixNetscape () {
	if(NS4origWidth != window.innerWidth || NS4origHeight != window.innerHeight)
		window.location.reload();
}; // fixNetscape ()

if(document.layers){  // Netscape downlevel browser
var	NS4origWidth  = window.innerWidth;
var	NS4origHeight = window.innerHeight;
	 window.onresize = fixNetscape;
} // if ()

var initDrag = function (e) {
      if((document.layers && e.which != 1) || (_brow._ie4up && event.button != 1))
          return true; // disables the right mouse button functionality on the scrollbar
	     dragStartMouse       = getMouse(e);
	     dragStartOffset      = dragObj.getTop(); 
      document.onmousemove = dragScrollBar;
      document.onmouseup   = stopDragScrollBar;
      if(document.layers) document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
      return false;
}; // initDrag ()

var dragScrollBar = function (e) {
//---for vertical scrolling only
//      dragObj._CSS.left = (_brow._ie4up) ? event.clientX : e.pagex;
  var currentMouse      = getMouse(e);
		var mouseDifference   = currentMouse - dragStartMouse;
	 var dragDistance      = dragStartOffset + mouseDifference;
 	var dragMovement      = (dragDistance < minScroll)    ? minScroll : 
		                        (dragDistance > maxScroll)    ? maxScroll : dragDistance;
	 var contentMovement   = -Math.round((dragMovement-minScroll)*(1/contentTrackRatio));
	dragObj.setTop(dragMovement);
	contentObj.setTop(contentMovement);

           if(_brow._ie4up)
                 return false; //ie on a PC will select the image if this isnt done

}; // dragScrollBar ()

var stopDragScrollBar = function () {
      if(document.layers) document.releaseEvents(Event.MOUSEMOVE | Event.MOUSEUP);
      document.onmousemove = null;
      document.onmouseup   = null;

}; // stopDragScrollBar ()

//-------- Arrow Functionality
var scrollUp = function () {
	    var contentMovement = contentObj.getTop()+scrollSpeed;
	    if(contentMovement > 0)
		        contentMovement = 0;

	    contentObj.setTop(contentMovement);
	    updateDrag();
	    _scrollTimerId = window.setTimeout('scrollUp()',50);
	    return false;
}; // scrollUp ()

var scrollDown = function () {
	    var contentMovement = contentObj.getTop()-scrollSpeed;
    	if(contentMovement < -(contentHeight-containerMaskHeight))
	   	        contentMovement = -(contentHeight-containerMaskHeight);
    
				 contentObj.setTop(contentMovement);
	    updateDrag();
	    _scrollTimerId = window.setTimeout('scrollDown()',50);
	    return false;
}; // scrollDown ()

var updateDrag = function () {
	    if(!dragObj) return; // no need to update if there is no scrollbar ;-)
    	var dragMovement = contentObj.getTop()*((trackHeight-scrollBarSize)/(contentHeight-containerMaskHeight));
    	dragMovement = minScroll-Math.round(dragMovement);
	    if(dragMovement < minScroll)
		           dragMovement = minScroll;
	    else if(dragMovement > maxScroll)
		             dragMovement = maxScroll;

	    dragObj.setTop(Math.round(dragMovement));
}; // updateDrag ()

var stopScroll = function () {
	    if(_scrollTimerId){
		      window.clearTimeout(_scrollTimerId);
		      _scrollTimerId = null;
	    } // if ()
}; // stopScroll ()
//--- Track Object Scroll Jump functionality
var quickScroll = function (e){
	    //--- move drag
	    var currentMouse = getMouse(e);
	    var dragDistance = currentMouse-Math.round(scrollBarSize/2);
	    var dragMovement = (dragDistance<minScroll) ? minScroll : 
					                   (dragDistance>maxScroll) ? maxScroll : dragDistance;
	    dragObj.setTop(dragMovement);
	    //--- move content
	    var contentMovement = -Math.round((dragMovement-minScroll)*(1/contentTrackRatio));
	    contentObj.setTop(contentMovement);
	    return false;
}; // quickScroll ()
// **********************************************************************

var _isLooping      = false;  // flag to test if browser page is currently scrolling
var _scrollTimerId  = null;   // flag used as interval timer ID
var _scrollPause    = 30;     // the interval pause between scrolling (in milliseconds)
var _xScrollPos     = 0;      // used to hold the x scroll position 
var _yScrollPos     = 0;      // used to hold the y scroll position 
var _speedFade      = 9;
var _xScrollAmt;
var _yScrollAmt;

var scrollToTarget = function ( _scrollToName ){
     if(getDOMObject(_scrollToName).tagName != "A" &&
        getDOMObject(_scrollToName).tagName != "DIV") // test to make sure element reference is there
           return;
     var _targetObj;  // placeholder variable for the object to be scrolled to

     if (document.body&&document.body.offsetLeft)
         _xScrollPos = document.body.offsetLeft; // set the horizontal scroll position (to be used later)

     if(!_brow._isW3C){
         location.href = '#' + _scrollToName;
         return;
     } // if ()

     if(_isLooping){
        clearInterval(_scrollTimerId);
        _isLooping = false;
        _scrollTimerId = null;
     } // if ()

     _targetObj = getDOMObject(_scrollToName);

     if(_targetObj.offsetTop){
        _yScrollPos = document.body.scrollTop; 
        _xScrollPos = document.body.scrollLeft; 
        scrollToPos(_xScrollPos,(_targetObj.offsetTop));
     } // if ()

}; // scrollToTarget ()

function scrollToPos  ( _xPos, _yPos ){
if(_isLooping){

    if((_yScrollPos == _yPos)&&
       (_xScrollPos == _xPos)) {
           //---Dispose of variables and stop looping
            clearInterval(_scrollTimerId);
            _isLooping     = false;
            _scrollTimerId = null;
            return;
        } // if ()

        if((Math.round((_yPos-_yScrollPos)/_speedFade) >1 && (_yPos-_yScrollPos)>0)||
           (Math.round((_yPos-_yScrollPos)/_speedFade) <-1 && (_yPos-_yScrollPos)<0))  // dont let the scroll amount get too small
               _yScrollPos = _yScrollPos+Math.round((_yPos-_yScrollPos)/_speedFade); //_yScrollAmt;
        else
                  _yScrollPos = _yPos;

        window.scrollTo(_xScrollPos,_yScrollPos);

    }else{          
        var _strEvalFunction = "scrollToPos(" + _xPos + ", " + _yPos + ")";
            _isLooping       = true;
            _scrollTimerId   = setInterval(_strEvalFunction, _scrollPause);
     } // if ()

}; // scrollToPos ()

/* ============================= Form Validation Javascript Functions ===================================*/

function isEmpty(str){
	return (str == null) || (str.length == 0);
}
// returns true if the string is a valid email
function isEmail(str){
	if(isEmpty(str)) return false;
	var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i
	return re.test(str);
}
// returns true if the string only contains characters A-Z or a-z
function isAlpha(str){
	var re = /[^a-zA-Z]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string only contains characters 0-9
function isNumeric(str){
	var re = /[\D]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string only contains characters A-Z, a-z or 0-9
function isAlphaNumeric(str){
	var re = /[^a-zA-Z0-9]/g
	if (re.test(str)) return false;
	return true;
}
// returns true if the string's length equals "len"
function isLength(str, len){
	return str.length == len;
}
// returns true if the string's length is between "min" and "max"
function isLengthBetween(str, min, max){
	return (str.length >= min)&&(str.length <= max);
}
// returns true if the string is a US phone number formatted as...
// (000)000-0000, (000) 000-0000, 000-000-0000, 000.000.0000, 000 000 0000, 0000000000
function isPhoneNumber(str){
	var re = /^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$/
	return re.test(str);
}
// returns true if the string is a valid date formatted as...
// mm dd yyyy, mm/dd/yyyy, mm.dd.yyyy, mm-dd-yyyy
function isDate(str){
	var re = /^(\d{1,2})[\s\.\/-](\d{1,2})[\s\.\/-](\d{4})$/
	if (!re.test(str)) return false;
	var result = str.match(re);
	var m = parseInt(result[1]);
	var d = parseInt(result[2]);
	var y = parseInt(result[3]);
	if(m < 1 || m > 12 || y < 1900 || y > 2100) return false;
	if(m == 2){
		var days = ((y % 4) == 0) ? 29 : 28;
	}else if(m == 4 || m == 6 || m == 9 || m == 11){
		var days = 30;
	}else{
		var days = 31;
	}
	return (d >= 1 && d <= days);
}
// returns true if "str1" is the same as the "str2"
function isMatch(str1, str2){
	return str1 == str2;
}
// returns true if the string contains only whitespace
// cannot check a password type input for whitespace
function isWhitespace(str){ // NOT USED IN FORM VALIDATION
	var re = /[\S]/g
	if (re.test(str)) return false;
	return true;
}
// removes any whitespace from the string and returns the result
// the value of "replacement" will be used to replace the whitespace (optional)
function stripWhitespace(str, replacement){// NOT USED IN FORM VALIDATION
	if (replacement == null) replacement = '';
	var result = str;
	var re = /\s/g
	if(str.search(re) != -1){
		result = str.replace(re, replacement);
	}
	return result;
}

/* ============================= Plugin Detection ===================================*/

var checkForPlugin = function ( mimeType, 
                                pluginName 
                              ) {

//---- Plugin Types to check for
var _vbAdobeAcrobat       = "PDF.PdfCtrl.5";
var _vbRealPlayer         = "rmocx.RealPlayer G2 Control.1";
var _vbFlashPlayer        = "ShockwaveFlash.ShockwaveFlash.1";
var _vbWindowsMediaPlayer = "MediaPlayer.MediaPlayer.1";
var _vbQuicktimePlayer    = "QuickTimeCheckObject.QuickTimeCheck.2";
var _vbShockwaveDirector  = "SWCtl.SWCtl.1";
var _flag = false;   // used for mimeType / plugin testing response
	var thisTest;
if(navigator.mimeTypes && navigator.mimeTypes.length){
if(navigator.mimeTypes[mimeType])
_flag = true;
}else
if(navigator.plugins && navigator.plugins.length) {
	for(var i=0;i<navigator.plugins.length;i++){
       if(navigator.plugins[i].name.toLowerCase().indexOf(pluginName.toLowerCase())!=-1)
          _flag = true;
	} // for ()
}else {   // run code for Internet Explorer bug of not finding plugin / mimeType lengths
    var _strBuffer;
_strBuffer = '<script language=VBScript\> \n' +
//'Option Explicit \n\n' +
'On Error Resume Next \n' +
'Function vbCheck_Plugin ( vbClassId ) \n' +
' \n' +
' If Not( IsObject( CreateObject( CStr(vbClassId) ) ) )  Then \n' +
' vbCheck_Plugin = false \n' +
' Else \n' +
' vbCheck_Plugin = true \n' +
' End If \n' +
' End Function\n' +
'</script\>';
//---Write VBScript out to browser
//document.writeln(_strBuffer)
//---- Plugin Types to check for
alert("VB Code: " + vbCheck_Plugin(_vbQuicktimePlayer));

}// if ()

return _flag;
}; // checkForPlugin ()

// --- Write out VBScript code for mime type / plugin checking ---
//     the vbscript must be writen before the document is loaded
/*
var _vbStringBuffer = "<script language='VBScript'\>\n" +
"\n" +
"</script\n>";
alert(_vbStringBuffer)
*/








